xref: /rk3399_rockchip-uboot/include/configs/xilinx_zynqmp.h (revision 1a4f6af8bfd44c8ae6e87a81ff125eed47042cc5)
184c7204bSMichal Simek /*
284c7204bSMichal Simek  * Configuration for Xilinx ZynqMP
384c7204bSMichal Simek  * (C) Copyright 2014 - 2015 Xilinx, Inc.
484c7204bSMichal Simek  * Michal Simek <michal.simek@xilinx.com>
584c7204bSMichal Simek  *
684c7204bSMichal Simek  * Based on Configuration for Versatile Express
784c7204bSMichal Simek  *
884c7204bSMichal Simek  * SPDX-License-Identifier:	GPL-2.0+
984c7204bSMichal Simek  */
1084c7204bSMichal Simek 
1184c7204bSMichal Simek #ifndef __XILINX_ZYNQMP_H
1284c7204bSMichal Simek #define __XILINX_ZYNQMP_H
1384c7204bSMichal Simek 
1484c7204bSMichal Simek #define CONFIG_REMAKE_ELF
1584c7204bSMichal Simek 
1684c7204bSMichal Simek /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
1784c7204bSMichal Simek 
1884c7204bSMichal Simek /* Generic Interrupt Controller Definitions */
1984c7204bSMichal Simek #define CONFIG_GICV2
2084c7204bSMichal Simek #define GICD_BASE	0xF9010000
2184c7204bSMichal Simek #define GICC_BASE	0xF9020000
2284c7204bSMichal Simek 
23d759512fSMichal Simek #define CONFIG_SYS_ALT_MEMTEST
24d759512fSMichal Simek #define CONFIG_SYS_MEMTEST_SCRATCH	0xfffc0000
25d759512fSMichal Simek 
268d59d7f6SMichal Simek #ifndef CONFIG_NR_DRAM_BANKS
278d59d7f6SMichal Simek # define CONFIG_NR_DRAM_BANKS		2
288d59d7f6SMichal Simek #endif
298d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_START	0
308d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_END		1000
3184c7204bSMichal Simek 
328fbf678bSSoren Brinkmann #define CONFIG_SYS_INIT_SP_ADDR		CONFIG_SYS_TEXT_BASE
3384c7204bSMichal Simek 
3484c7204bSMichal Simek /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
35713b6164SMichal Simek #if !defined(COUNTER_FREQUENCY)
36713b6164SMichal Simek # define COUNTER_FREQUENCY		100000000
37713b6164SMichal Simek #endif
3884c7204bSMichal Simek 
3984c7204bSMichal Simek /* Size of malloc() pool */
4016fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x2000000)
4184c7204bSMichal Simek 
4284c7204bSMichal Simek /* Serial setup */
43b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_ARM_DCC
44b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_CPU_ARMV8
4584c7204bSMichal Simek #define CONFIG_ZYNQ_SERIAL
4684c7204bSMichal Simek 
4784c7204bSMichal Simek #define CONFIG_CONS_INDEX		0
4884c7204bSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE \
4984c7204bSMichal Simek 	{ 4800, 9600, 19200, 38400, 57600, 115200 }
5084c7204bSMichal Simek 
5184c7204bSMichal Simek /* Command line configuration */
525cb24200SMichal Simek #define CONFIG_MP
5384c7204bSMichal Simek 
54cb7ea820SMichal Simek /* BOOTP options */
55cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTFILESIZE
56cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTPATH
57cb7ea820SMichal Simek #define CONFIG_BOOTP_GATEWAY
58cb7ea820SMichal Simek #define CONFIG_BOOTP_HOSTNAME
59cb7ea820SMichal Simek #define CONFIG_BOOTP_MAY_FAIL
60a1207de0SMichal Simek #define CONFIG_BOOTP_DNS
61a1207de0SMichal Simek #define CONFIG_BOOTP_PXE
62a1207de0SMichal Simek #define CONFIG_BOOTP_SUBNETMASK
63a1207de0SMichal Simek 
64a1207de0SMichal Simek /* Diff from config_distro_defaults.h */
65a1207de0SMichal Simek #define CONFIG_SUPPORT_RAW_INITRD
66d58fc12eSMichal Simek #if !defined(CONFIG_SPL_BUILD)
67a1207de0SMichal Simek #define CONFIG_ENV_VARS_UBOOT_CONFIG
68d58fc12eSMichal Simek #endif
69a1207de0SMichal Simek #define CONFIG_AUTO_COMPLETE
70a1207de0SMichal Simek 
7108aa0334SMasahiro Yamada #if defined(CONFIG_MMC_SDHCI_ZYNQ)
72926782cdSMichal Simek # define CONFIG_SUPPORT_EMMC_BOOT
73f3bd7280SMichal Simek # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ
74f3bd7280SMichal Simek #  define CONFIG_ZYNQ_SDHCI_MAX_FREQ	200000000
75f3bd7280SMichal Simek # endif
7646f68e68SMichal Simek #endif
7746f68e68SMichal Simek 
7878cb965aSSiva Durga Prasad Paladugu #ifdef CONFIG_NAND_ARASAN
7978cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_MAX_NAND_DEVICE	1
8078cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_ONFI_DETECTION
8178cb965aSSiva Durga Prasad Paladugu #endif
8278cb965aSSiva Durga Prasad Paladugu 
8384c7204bSMichal Simek /* Miscellaneous configurable options */
8484c7204bSMichal Simek #define CONFIG_SYS_LOAD_ADDR		0x8000000
8584c7204bSMichal Simek 
8616fa00a7SSiva Durga Prasad Paladugu #if defined(CONFIG_ZYNQMP_USB)
8716fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x1800000
8816fa00a7SSiva Durga Prasad Paladugu #define DFU_DEFAULT_POLL_TIMEOUT	300
8916fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_CABLE_CHECK
9016fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_THOR
9116fa00a7SSiva Durga Prasad Paladugu #define CONFIG_THOR_RESET_OFF
9216fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO_RAM \
9316fa00a7SSiva Durga Prasad Paladugu 	"dfu_ram_info=" \
940e43140bSSiva Durga Prasad Paladugu 	"setenv dfu_alt_info " \
951b19daf4SSiva Durga Prasad Paladugu 	"Image ram $kernel_addr $kernel_size\\\\;" \
961b19daf4SSiva Durga Prasad Paladugu 	"system.dtb ram $fdt_addr $fdt_size\0" \
9716fa00a7SSiva Durga Prasad Paladugu 	"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
9816fa00a7SSiva Durga Prasad Paladugu 	"thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
9916fa00a7SSiva Durga Prasad Paladugu 
10016fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO  \
10116fa00a7SSiva Durga Prasad Paladugu 		DFU_ALT_INFO_RAM
1025ce987feSSiva Durga Prasad Paladugu 
1035ce987feSSiva Durga Prasad Paladugu #ifndef CONFIG_SPL_BUILD
1045ce987feSSiva Durga Prasad Paladugu # define PARTS_DEFAULT \
1055ce987feSSiva Durga Prasad Paladugu 	"partitions=uuid_disk=${uuid_gpt_disk};" \
1065ce987feSSiva Durga Prasad Paladugu 	"name=""boot"",size=16M,uuid=${uuid_gpt_boot};" \
1075ce987feSSiva Durga Prasad Paladugu 	"name=""Linux"",size=-M,uuid=${uuid_gpt_Linux}\0"
1085ce987feSSiva Durga Prasad Paladugu #endif
10916fa00a7SSiva Durga Prasad Paladugu #endif
11016fa00a7SSiva Durga Prasad Paladugu 
11116fa00a7SSiva Durga Prasad Paladugu #if !defined(DFU_ALT_INFO)
11216fa00a7SSiva Durga Prasad Paladugu # define DFU_ALT_INFO
11316fa00a7SSiva Durga Prasad Paladugu #endif
11416fa00a7SSiva Durga Prasad Paladugu 
1155ce987feSSiva Durga Prasad Paladugu #if !defined(PARTS_DEFAULT)
1165ce987feSSiva Durga Prasad Paladugu # define PARTS_DEFAULT
1175ce987feSSiva Durga Prasad Paladugu #endif
1185ce987feSSiva Durga Prasad Paladugu 
11984c7204bSMichal Simek /* Do not preserve environment */
120936b0384SSiva Durga Prasad Paladugu #define CONFIG_ENV_SIZE			0x8000
12184c7204bSMichal Simek 
12284c7204bSMichal Simek /* Monitor Command Prompt */
12384c7204bSMichal Simek /* Console I/O Buffer Size */
12484c7204bSMichal Simek #define CONFIG_SYS_CBSIZE		2048
12584c7204bSMichal Simek #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
12684c7204bSMichal Simek #define CONFIG_SYS_LONGHELP
12784c7204bSMichal Simek #define CONFIG_CMDLINE_EDITING
12884c7204bSMichal Simek #define CONFIG_SYS_MAXARGS		64
12984c7204bSMichal Simek 
130cb7ea820SMichal Simek /* Ethernet driver */
131596e5782SMichal Simek #if defined(CONFIG_ZYNQ_GEM)
132cb7ea820SMichal Simek # define CONFIG_NET_MULTI
133cb7ea820SMichal Simek # define CONFIG_MII
134cb7ea820SMichal Simek # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
135cb7ea820SMichal Simek # define CONFIG_PHY_MARVELL
136f96fe2c0SMichal Simek # define CONFIG_PHY_NATSEMI
137bf146325SMichal Simek # define CONFIG_PHY_TI
138a1a6af82SMichal Simek # define CONFIG_PHY_VITESSE
139a1a6af82SMichal Simek # define CONFIG_PHY_REALTEK
140e2928f32SSiva Durga Prasad Paladugu # define PHY_ANEG_TIMEOUT       20000
141cb7ea820SMichal Simek #endif
142cb7ea820SMichal Simek 
1432594e03cSSiva Durga Prasad Paladugu /* I2C */
1442594e03cSSiva Durga Prasad Paladugu #if defined(CONFIG_SYS_I2C_ZYNQ)
1452594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C
1462594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SPEED		100000
1472594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SLAVE		0
1482594e03cSSiva Durga Prasad Paladugu #endif
1492594e03cSSiva Durga Prasad Paladugu 
1502594e03cSSiva Durga Prasad Paladugu /* EEPROM */
1512594e03cSSiva Durga Prasad Paladugu #ifdef CONFIG_ZYNQMP_EEPROM
1522594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
1532594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR		0x54
1542594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	4
1552594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5
1562594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_SIZE			(64 * 1024)
1572594e03cSSiva Durga Prasad Paladugu #endif
1582594e03cSSiva Durga Prasad Paladugu 
1590d169b8cSMichal Simek #ifdef CONFIG_SATA_CEVA
1606fe6f135SMichal Simek #define CONFIG_LIBATA
1616fe6f135SMichal Simek #define CONFIG_SCSI_AHCI
162679b994aSMichal Simek #define CONFIG_SYS_SCSI_MAX_SCSI_ID	2
1636fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_LUN		1
1646fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
1656fe6f135SMichal Simek 					 CONFIG_SYS_SCSI_MAX_LUN)
1666fe6f135SMichal Simek #endif
1676fe6f135SMichal Simek 
16884c7204bSMichal Simek #define CONFIG_SYS_BOOTM_LEN	(60 * 1024 * 1024)
16984c7204bSMichal Simek 
17084c7204bSMichal Simek #define CONFIG_BOARD_EARLY_INIT_R
17184c7204bSMichal Simek #define CONFIG_CLOCKS
17284c7204bSMichal Simek 
173b72894f1SMichal Simek #define ENV_MEM_LAYOUT_SETTINGS \
174b72894f1SMichal Simek 	"fdt_high=10000000\0" \
175b72894f1SMichal Simek 	"initrd_high=10000000\0" \
176b72894f1SMichal Simek 	"fdt_addr_r=0x40000000\0" \
177b72894f1SMichal Simek 	"pxefile_addr_r=0x10000000\0" \
178b72894f1SMichal Simek 	"kernel_addr_r=0x18000000\0" \
179b72894f1SMichal Simek 	"scriptaddr=0x02000000\0" \
180b72894f1SMichal Simek 	"ramdisk_addr_r=0x02100000\0" \
181b72894f1SMichal Simek 
18208aa0334SMasahiro Yamada #if defined(CONFIG_MMC_SDHCI_ZYNQ)
183b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func)	func(MMC, mmc, 0) func(MMC, mmc, 1)
184b72894f1SMichal Simek #else
185b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func)
186b72894f1SMichal Simek #endif
187b72894f1SMichal Simek 
188b72894f1SMichal Simek #if defined(CONFIG_SATA_CEVA)
189b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func)	func(SCSI, scsi, 0)
190b72894f1SMichal Simek #else
191b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func)
192b72894f1SMichal Simek #endif
193b72894f1SMichal Simek 
194b72894f1SMichal Simek #if defined(CONFIG_ZYNQMP_USB)
195b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func)	func(USB, usb, 0) func(USB, usb, 1)
196b72894f1SMichal Simek #else
197b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func)
198b72894f1SMichal Simek #endif
199b72894f1SMichal Simek 
200b72894f1SMichal Simek #define BOOT_TARGET_DEVICES(func) \
201b72894f1SMichal Simek 	BOOT_TARGET_DEVICES_MMC(func) \
202b72894f1SMichal Simek 	BOOT_TARGET_DEVICES_USB(func) \
203b72894f1SMichal Simek 	BOOT_TARGET_DEVICES_SCSI(func) \
204b72894f1SMichal Simek 	func(PXE, pxe, na) \
205b72894f1SMichal Simek 	func(DHCP, dhcp, na)
206b72894f1SMichal Simek 
207b72894f1SMichal Simek #include <config_distro_bootcmd.h>
208b72894f1SMichal Simek 
209b72894f1SMichal Simek /* Initial environment variables */
210b72894f1SMichal Simek #ifndef CONFIG_EXTRA_ENV_SETTINGS
211b72894f1SMichal Simek #define CONFIG_EXTRA_ENV_SETTINGS \
212b72894f1SMichal Simek 	ENV_MEM_LAYOUT_SETTINGS \
213b72894f1SMichal Simek 	BOOTENV \
214b72894f1SMichal Simek 	DFU_ALT_INFO
215b72894f1SMichal Simek #endif
216b72894f1SMichal Simek 
217d58fc12eSMichal Simek /* SPL can't handle all huge variables - define just DFU */
218*09b32b41SAndrew F. Davis #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU)
219d58fc12eSMichal Simek #undef CONFIG_EXTRA_ENV_SETTINGS
220d58fc12eSMichal Simek # define CONFIG_EXTRA_ENV_SETTINGS \
221d58fc12eSMichal Simek 	"dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000;" \
222d58fc12eSMichal Simek 			  "atf-uboot.ub ram 0x10000000 0x1000000;" \
223d58fc12eSMichal Simek 			  "Image ram 0x80000 0x3f80000;" \
224d58fc12eSMichal Simek 			  "system.dtb ram 0x4000000 0x100000\0" \
225d58fc12eSMichal Simek 	"dfu_bufsiz=0x1000\0"
226d58fc12eSMichal Simek #endif
227d58fc12eSMichal Simek 
228e6a9ed04SMichal Simek #define CONFIG_SPL_TEXT_BASE		0xfffc0000
2298fbf678bSSoren Brinkmann #define CONFIG_SPL_STACK		0xfffffffc
230d58fc12eSMichal Simek #define CONFIG_SPL_MAX_SIZE		0x40000
231e6a9ed04SMichal Simek 
232e6a9ed04SMichal Simek /* Just random location in OCM */
2338ed31f36SMichal Simek #define CONFIG_SPL_BSS_START_ADDR	0x0
2348ed31f36SMichal Simek #define CONFIG_SPL_BSS_MAX_SIZE		0x80000
235e6a9ed04SMichal Simek 
236e6a9ed04SMichal Simek #define CONFIG_SPL_FRAMEWORK
237e6a9ed04SMichal Simek 
238e6a9ed04SMichal Simek /* u-boot is like dtb */
239e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_ARGS_NAME	"u-boot.bin"
240e6a9ed04SMichal Simek #define CONFIG_SYS_SPL_ARGS_ADDR	0x8000000
241e6a9ed04SMichal Simek 
242e6a9ed04SMichal Simek /* ATF is my kernel image */
2431309f671SMichal Simek #define CONFIG_SPL_FS_LOAD_KERNEL_NAME	"atf-uboot.ub"
244e6a9ed04SMichal Simek 
245e6a9ed04SMichal Simek /* FIT load address for RAM boot */
246e6a9ed04SMichal Simek #define CONFIG_SPL_LOAD_FIT_ADDRESS	0x10000000
247e6a9ed04SMichal Simek 
248e6a9ed04SMichal Simek /* MMC support */
24908aa0334SMasahiro Yamada #ifdef CONFIG_MMC_SDHCI_ZYNQ
250e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
251e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR	0 /* unused */
252e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS	0 /* unused */
253e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR	0 /* unused */
254e6a9ed04SMichal Simek # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"
255e6a9ed04SMichal Simek #endif
256e6a9ed04SMichal Simek 
257*09b32b41SAndrew F. Davis #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU)
258d58fc12eSMichal Simek # undef CONFIG_CMD_BOOTD
259d58fc12eSMichal Simek # define CONFIG_SPL_ENV_SUPPORT
260d58fc12eSMichal Simek # define CONFIG_SPL_HASH_SUPPORT
261d58fc12eSMichal Simek # define CONFIG_ENV_MAX_ENTRIES	10
262d58fc12eSMichal Simek 
263d58fc12eSMichal Simek # define CONFIG_SYS_SPL_MALLOC_START	0x20000000
2646b104feaSMichal Simek # define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000
265d58fc12eSMichal Simek 
266d58fc12eSMichal Simek #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE
267d58fc12eSMichal Simek # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used"
268d58fc12eSMichal Simek #endif
269d58fc12eSMichal Simek #endif
270d58fc12eSMichal Simek 
271fb4000e8SMichal Simek #define CONFIG_BOARD_EARLY_INIT_F
272fb4000e8SMichal Simek 
27384c7204bSMichal Simek #endif /* __XILINX_ZYNQMP_H */
274