blob: fa67b25a792dc72ed1b8fa2075ecfdaae4d68034 [file] [log] [blame]
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00001/*
Pavel Machek5e2d70a2014-09-08 14:08:45 +02002 * Copyright (C) 2014 Marek Vasut <marex@denx.de>
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00003 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00005 */
Pavel Machek5e2d70a2014-09-08 14:08:45 +02006#ifndef __CONFIG_SOCFPGA_CYCLONE5_H__
7#define __CONFIG_SOCFPGA_CYCLONE5_H__
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00008
9#include <asm/arch/socfpga_base_addrs.h>
10
Marek Vasutd4a4db12014-09-08 14:08:45 +020011/* U-Boot Commands */
12#define CONFIG_SYS_NO_FLASH
Marek Vasutd4a4db12014-09-08 14:08:45 +020013#define CONFIG_DOS_PARTITION
14#define CONFIG_FAT_WRITE
15#define CONFIG_HW_WATCHDOG
Marek Vasutbd279e32014-09-15 01:27:57 +020016
Marek Vasutd4a4db12014-09-08 14:08:45 +020017#define CONFIG_CMD_ASKENV
18#define CONFIG_CMD_BOOTZ
19#define CONFIG_CMD_CACHE
Marek Vasut01c09552014-12-30 20:04:20 +010020#define CONFIG_CMD_DFU
Marek Vasutd4a4db12014-09-08 14:08:45 +020021#define CONFIG_CMD_DHCP
22#define CONFIG_CMD_EXT4
23#define CONFIG_CMD_EXT4_WRITE
24#define CONFIG_CMD_FAT
Marek Vasut08c71a62014-09-19 13:28:47 +020025#define CONFIG_CMD_FS_GENERIC
Marek Vasut8c5f47f2015-06-23 16:01:28 +020026#define CONFIG_CMD_GPIO
Marek Vasutd4a4db12014-09-08 14:08:45 +020027#define CONFIG_CMD_GREPENV
28#define CONFIG_CMD_MII
29#define CONFIG_CMD_MMC
Marek Vasutd4a4db12014-09-08 14:08:45 +020030#define CONFIG_CMD_PING
Marek Vasut01c09552014-12-30 20:04:20 +010031#define CONFIG_CMD_USB
32#define CONFIG_CMD_USB_MASS_STORAGE
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000033
Pavel Machek5e2d70a2014-09-08 14:08:45 +020034/* Memory configurations */
Marek Vasutd4a4db12014-09-08 14:08:45 +020035#define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on SoCDK */
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000036
Marek Vasutd4a4db12014-09-08 14:08:45 +020037/* Booting Linux */
38#define CONFIG_BOOTDELAY 3
39#define CONFIG_BOOTFILE "zImage"
Anatolij Gustschinb02c7982014-11-07 01:12:03 +010040#define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE)
Chin Liang See4a6a2282014-09-19 05:33:19 -050041#ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
Marek Vasutd4a4db12014-09-08 14:08:45 +020042#define CONFIG_BOOTCOMMAND "run ramboot"
Chin Liang See4a6a2282014-09-19 05:33:19 -050043#else
Marek Vasutd4a4db12014-09-08 14:08:45 +020044#define CONFIG_BOOTCOMMAND "run mmcload; run mmcboot"
Chin Liang See4a6a2282014-09-19 05:33:19 -050045#endif
Marek Vasut2bff5402015-07-22 06:18:19 +020046#define CONFIG_LOADADDR 0x01000000
Marek Vasutd4a4db12014-09-08 14:08:45 +020047#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000048
Pavel Machek5e2d70a2014-09-08 14:08:45 +020049/* Ethernet on SoC (EMAC) */
50#if defined(CONFIG_CMD_NET)
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000051
Marek Vasutd4a4db12014-09-08 14:08:45 +020052/* PHY */
Marek Vasutd4a4db12014-09-08 14:08:45 +020053#define CONFIG_PHY_MICREL
54#define CONFIG_PHY_MICREL_KSZ9021
55#define CONFIG_KSZ9021_CLK_SKEW_ENV "micrel-ksz9021-clk-skew"
56#define CONFIG_KSZ9021_CLK_SKEW_VAL 0xf0f0
57#define CONFIG_KSZ9021_DATA_SKEW_ENV "micrel-ksz9021-data-skew"
58#define CONFIG_KSZ9021_DATA_SKEW_VAL 0x0
59
Chin Liang See9cd12042013-08-07 10:06:56 -050060#endif
Pavel Machekce340e92014-07-14 14:14:17 +020061
Dinh Nguyen813e7e62015-09-23 15:38:01 -050062#define CONFIG_ENV_IS_IN_MMC
63#define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */
64#define CONFIG_ENV_OFFSET 512 /* just after the MBR */
65
Marek Vasut01c09552014-12-30 20:04:20 +010066/* USB */
67#ifdef CONFIG_CMD_USB
68#define CONFIG_USB_DWC2_REG_ADDR SOCFPGA_USB1_ADDRESS
69#endif
70#define CONFIG_G_DNL_MANUFACTURER "Altera"
71
Pavel Machek5e2d70a2014-09-08 14:08:45 +020072/* Extra Environment */
73#define CONFIG_HOSTNAME socfpga_cyclone5
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000074
Marek Vasutd4a4db12014-09-08 14:08:45 +020075#define CONFIG_EXTRA_ENV_SETTINGS \
76 "verify=n\0" \
77 "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
78 "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
79 "bootm ${loadaddr} - ${fdt_addr}\0" \
80 "bootimage=zImage\0" \
81 "fdt_addr=100\0" \
82 "fdtimage=socfpga.dtb\0" \
83 "fsloadcmd=ext2load\0" \
84 "bootm ${loadaddr} - ${fdt_addr}\0" \
85 "mmcroot=/dev/mmcblk0p2\0" \
86 "mmcboot=setenv bootargs " CONFIG_BOOTARGS \
87 " root=${mmcroot} rw rootwait;" \
88 "bootz ${loadaddr} - ${fdt_addr}\0" \
89 "mmcload=mmc rescan;" \
Marek Vasut08c71a62014-09-19 13:28:47 +020090 "load mmc 0:1 ${loadaddr} ${bootimage};" \
91 "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
Marek Vasutd4a4db12014-09-08 14:08:45 +020092 "qspiroot=/dev/mtdblock0\0" \
93 "qspirootfstype=jffs2\0" \
94 "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
95 " root=${qspiroot} rw rootfstype=${qspirootfstype};"\
96 "bootm ${loadaddr} - ${fdt_addr}\0"
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000097
Pavel Machek5e2d70a2014-09-08 14:08:45 +020098/* The rest of the configuration is shared */
99#include <configs/socfpga_common.h>
Chin Liang See561c9d42014-06-10 01:11:04 -0500100
Pavel Machek5e2d70a2014-09-08 14:08:45 +0200101#endif /* __CONFIG_SOCFPGA_CYCLONE5_H__ */