xref: /rk3399_rockchip-uboot/include/configs/xilinx_zynqmp.h (revision e6a9ed04e78cf87ec97e306fa4e7a1669ef98df6)
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 #define CONFIG_SYS_NO_FLASH
1984c7204bSMichal Simek 
2084c7204bSMichal Simek /* Generic Interrupt Controller Definitions */
2184c7204bSMichal Simek #define CONFIG_GICV2
2284c7204bSMichal Simek #define GICD_BASE	0xF9010000
2384c7204bSMichal Simek #define GICC_BASE	0xF9020000
2484c7204bSMichal Simek 
25d759512fSMichal Simek #define CONFIG_SYS_ALT_MEMTEST
26d759512fSMichal Simek #define CONFIG_SYS_MEMTEST_SCRATCH	0xfffc0000
27d759512fSMichal Simek 
288d59d7f6SMichal Simek #ifndef CONFIG_NR_DRAM_BANKS
298d59d7f6SMichal Simek # define CONFIG_NR_DRAM_BANKS		2
308d59d7f6SMichal Simek #endif
318d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_START	0
328d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_END		1000
3384c7204bSMichal Simek 
3484c7204bSMichal Simek /* Have release address at the end of 256MB for now */
3584c7204bSMichal Simek #define CPU_RELEASE_ADDR	0xFFFFFF0
3684c7204bSMichal Simek 
3784c7204bSMichal Simek /* Cache Definitions */
38222b2129SSiva Durga Prasad Paladugu #define CONFIG_SYS_CACHELINE_SIZE	64
3984c7204bSMichal Simek 
4015c3eb53SMichal Simek #if !defined(CONFIG_IDENT_STRING)
4184c7204bSMichal Simek # define CONFIG_IDENT_STRING		" Xilinx ZynqMP"
4215c3eb53SMichal Simek #endif
4384c7204bSMichal Simek 
44*e6a9ed04SMichal Simek #define CONFIG_SYS_INIT_SP_ADDR		0xfffffffc
4584c7204bSMichal Simek 
4684c7204bSMichal Simek /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
47713b6164SMichal Simek #if !defined(COUNTER_FREQUENCY)
48713b6164SMichal Simek # define COUNTER_FREQUENCY		100000000
49713b6164SMichal Simek #endif
5084c7204bSMichal Simek 
5184c7204bSMichal Simek /* Size of malloc() pool */
5216fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x2000000)
5384c7204bSMichal Simek 
5484c7204bSMichal Simek /* Serial setup */
55b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_ARM_DCC
56b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_CPU_ARMV8
5784c7204bSMichal Simek #define CONFIG_ZYNQ_SERIAL
5884c7204bSMichal Simek 
5984c7204bSMichal Simek #define CONFIG_CONS_INDEX		0
6084c7204bSMichal Simek #define CONFIG_BAUDRATE			115200
6184c7204bSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE \
6284c7204bSMichal Simek 	{ 4800, 9600, 19200, 38400, 57600, 115200 }
6384c7204bSMichal Simek 
6484c7204bSMichal Simek /* Command line configuration */
6584c7204bSMichal Simek #define CONFIG_CMD_ENV
6684c7204bSMichal Simek #define CONFIG_DOS_PARTITION
6707654ba1SMichal Simek #define CONFIG_EFI_PARTITION
68*e6a9ed04SMichal Simek #ifndef CONFIG_SPL_BUILD
69a1207de0SMichal Simek # define CONFIG_ISO_PARTITION
70*e6a9ed04SMichal Simek #endif
715cb24200SMichal Simek #define CONFIG_MP
7284c7204bSMichal Simek 
73cb7ea820SMichal Simek /* BOOTP options */
74cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTFILESIZE
75cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTPATH
76cb7ea820SMichal Simek #define CONFIG_BOOTP_GATEWAY
77cb7ea820SMichal Simek #define CONFIG_BOOTP_HOSTNAME
78cb7ea820SMichal Simek #define CONFIG_BOOTP_MAY_FAIL
79cb7ea820SMichal Simek #define CONFIG_BOOTP_SERVERIP
80a1207de0SMichal Simek #define CONFIG_BOOTP_DNS
81a1207de0SMichal Simek #define CONFIG_BOOTP_PXE
82a1207de0SMichal Simek #define CONFIG_BOOTP_SUBNETMASK
83a1207de0SMichal Simek #define CONFIG_BOOTP_PXE_CLIENTARCH     0x100
84a1207de0SMichal Simek 
85a1207de0SMichal Simek /* Diff from config_distro_defaults.h */
86a1207de0SMichal Simek #define CONFIG_SUPPORT_RAW_INITRD
87a1207de0SMichal Simek #define CONFIG_ENV_VARS_UBOOT_CONFIG
88a1207de0SMichal Simek #define CONFIG_AUTO_COMPLETE
89a1207de0SMichal Simek 
90a1207de0SMichal Simek /* PXE */
91a1207de0SMichal Simek #define CONFIG_CMD_PXE
92a1207de0SMichal Simek #define CONFIG_MENU
93cb7ea820SMichal Simek 
94ce0335f2SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI)
9584c7204bSMichal Simek # define CONFIG_MMC
9684c7204bSMichal Simek # define CONFIG_GENERIC_MMC
97926782cdSMichal Simek # define CONFIG_SUPPORT_EMMC_BOOT
9884c7204bSMichal Simek # define CONFIG_SDHCI
99f3bd7280SMichal Simek # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ
100f3bd7280SMichal Simek #  define CONFIG_ZYNQ_SDHCI_MAX_FREQ	200000000
101f3bd7280SMichal Simek # endif
10246f68e68SMichal Simek #endif
10346f68e68SMichal Simek 
10446f68e68SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) || defined(CONFIG_ZYNQMP_USB)
10584c7204bSMichal Simek # define CONFIG_FAT_WRITE
10684c7204bSMichal Simek #endif
10784c7204bSMichal Simek 
10878cb965aSSiva Durga Prasad Paladugu #ifdef CONFIG_NAND_ARASAN
10978cb965aSSiva Durga Prasad Paladugu # define CONFIG_CMD_NAND
11078cb965aSSiva Durga Prasad Paladugu # define CONFIG_CMD_NAND_LOCK_UNLOCK
11178cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_MAX_NAND_DEVICE	1
11278cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_SELF_INIT
11378cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_ONFI_DETECTION
11478cb965aSSiva Durga Prasad Paladugu # define CONFIG_MTD_DEVICE
11578cb965aSSiva Durga Prasad Paladugu #endif
11678cb965aSSiva Durga Prasad Paladugu 
11784c7204bSMichal Simek /* Miscellaneous configurable options */
11884c7204bSMichal Simek #define CONFIG_SYS_LOAD_ADDR		0x8000000
11984c7204bSMichal Simek 
12016fa00a7SSiva Durga Prasad Paladugu #if defined(CONFIG_ZYNQMP_USB)
1210f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI_DWC3
1220f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI
1230f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_MAX_CONTROLLER_COUNT         1
1240f676767SSiva Durga Prasad Paladugu #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS      2
1250f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_STORAGE
1260f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI_ZYNQMP
1270f676767SSiva Durga Prasad Paladugu 
12816fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x1800000
12916fa00a7SSiva Durga Prasad Paladugu #define DFU_DEFAULT_POLL_TIMEOUT	300
13016fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_DFU
13116fa00a7SSiva Durga Prasad Paladugu #define CONFIG_DFU_RAM
13216fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_CABLE_CHECK
13316fa00a7SSiva Durga Prasad Paladugu #define CONFIG_CMD_THOR_DOWNLOAD
13416fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_THOR
13516fa00a7SSiva Durga Prasad Paladugu #define CONFIG_THOR_RESET_OFF
13616fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO_RAM \
13716fa00a7SSiva Durga Prasad Paladugu 	"dfu_ram_info=" \
1380e43140bSSiva Durga Prasad Paladugu 	"setenv dfu_alt_info " \
1391b19daf4SSiva Durga Prasad Paladugu 	"Image ram $kernel_addr $kernel_size\\\\;" \
1401b19daf4SSiva Durga Prasad Paladugu 	"system.dtb ram $fdt_addr $fdt_size\0" \
14116fa00a7SSiva Durga Prasad Paladugu 	"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
14216fa00a7SSiva Durga Prasad Paladugu 	"thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
14316fa00a7SSiva Durga Prasad Paladugu 
14416fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO  \
14516fa00a7SSiva Durga Prasad Paladugu 		DFU_ALT_INFO_RAM
14616fa00a7SSiva Durga Prasad Paladugu #endif
14716fa00a7SSiva Durga Prasad Paladugu 
14816fa00a7SSiva Durga Prasad Paladugu #if !defined(DFU_ALT_INFO)
14916fa00a7SSiva Durga Prasad Paladugu # define DFU_ALT_INFO
15016fa00a7SSiva Durga Prasad Paladugu #endif
15116fa00a7SSiva Durga Prasad Paladugu 
15284c7204bSMichal Simek /* Initial environment variables */
15327640fdaSMichal Simek #ifndef CONFIG_EXTRA_ENV_SETTINGS
15484c7204bSMichal Simek #define CONFIG_EXTRA_ENV_SETTINGS \
15584c7204bSMichal Simek 	"kernel_addr=0x80000\0" \
15684c7204bSMichal Simek 	"fdt_addr=0x7000000\0" \
15784c7204bSMichal Simek 	"fdt_high=0x10000000\0" \
158407b76f9SSiva Durga Prasad Paladugu 	CONFIG_KERNEL_FDT_OFST_SIZE \
1592d9925bcSMichal Simek 	"sdbootdev=0\0"\
1602d9925bcSMichal Simek 	"sdboot=mmc dev $sdbootdev && mmcinfo && load mmc $sdbootdev:$partid $fdt_addr system.dtb && " \
1612d9925bcSMichal Simek 		"load mmc $sdbootdev:$partid $kernel_addr Image && " \
1622d9925bcSMichal Simek 		"booti $kernel_addr - $fdt_addr\0" \
16316fa00a7SSiva Durga Prasad Paladugu 	DFU_ALT_INFO
16427640fdaSMichal Simek #endif
16584c7204bSMichal Simek 
16684c7204bSMichal Simek #define CONFIG_BOOTCOMMAND	"run $modeboot"
1675cfd9182SSoren Brinkmann #define CONFIG_BOOTDELAY	3
16884c7204bSMichal Simek 
16984c7204bSMichal Simek #define CONFIG_BOARD_LATE_INIT
17084c7204bSMichal Simek 
17184c7204bSMichal Simek /* Do not preserve environment */
17284c7204bSMichal Simek #define CONFIG_ENV_IS_NOWHERE		1
17384c7204bSMichal Simek #define CONFIG_ENV_SIZE			0x1000
17484c7204bSMichal Simek 
17584c7204bSMichal Simek /* Monitor Command Prompt */
17684c7204bSMichal Simek /* Console I/O Buffer Size */
17784c7204bSMichal Simek #define CONFIG_SYS_CBSIZE		2048
17884c7204bSMichal Simek #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
17984c7204bSMichal Simek 					sizeof(CONFIG_SYS_PROMPT) + 16)
18084c7204bSMichal Simek #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
18184c7204bSMichal Simek #define CONFIG_SYS_LONGHELP
18284c7204bSMichal Simek #define CONFIG_CMDLINE_EDITING
18384c7204bSMichal Simek #define CONFIG_SYS_MAXARGS		64
18484c7204bSMichal Simek 
185cb7ea820SMichal Simek /* Ethernet driver */
186596e5782SMichal Simek #if defined(CONFIG_ZYNQ_GEM)
187cb7ea820SMichal Simek # define CONFIG_NET_MULTI
188cb7ea820SMichal Simek # define CONFIG_MII
189cb7ea820SMichal Simek # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
190cb7ea820SMichal Simek # define CONFIG_PHY_MARVELL
191f96fe2c0SMichal Simek # define CONFIG_PHY_NATSEMI
192bf146325SMichal Simek # define CONFIG_PHY_TI
193c4c96f2bSMichal Simek # define CONFIG_PHY_GIGE
194e2928f32SSiva Durga Prasad Paladugu # define PHY_ANEG_TIMEOUT       20000
195cb7ea820SMichal Simek #endif
196cb7ea820SMichal Simek 
1972594e03cSSiva Durga Prasad Paladugu /* I2C */
1982594e03cSSiva Durga Prasad Paladugu #if defined(CONFIG_SYS_I2C_ZYNQ)
1992594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C
2002594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SPEED		100000
2012594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SLAVE		0
2022594e03cSSiva Durga Prasad Paladugu #endif
2032594e03cSSiva Durga Prasad Paladugu 
2042594e03cSSiva Durga Prasad Paladugu /* EEPROM */
2052594e03cSSiva Durga Prasad Paladugu #ifdef CONFIG_ZYNQMP_EEPROM
2062594e03cSSiva Durga Prasad Paladugu # define CONFIG_CMD_EEPROM
2072594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
2082594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR		0x54
2092594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	4
2102594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5
2112594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_SIZE			(64 * 1024)
2122594e03cSSiva Durga Prasad Paladugu #endif
2132594e03cSSiva Durga Prasad Paladugu 
2146fe6f135SMichal Simek #ifdef CONFIG_AHCI
2156fe6f135SMichal Simek #define CONFIG_LIBATA
2166fe6f135SMichal Simek #define CONFIG_SCSI_AHCI
2176fe6f135SMichal Simek #define CONFIG_SCSI_AHCI_PLAT
218679b994aSMichal Simek #define CONFIG_SYS_SCSI_MAX_SCSI_ID	2
2196fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_LUN		1
2206fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
2216fe6f135SMichal Simek 					 CONFIG_SYS_SCSI_MAX_LUN)
222c649e3c9SSimon Glass #define CONFIG_SCSI
2236fe6f135SMichal Simek #endif
2246fe6f135SMichal Simek 
22584c7204bSMichal Simek #define CONFIG_SYS_BOOTM_LEN	(60 * 1024 * 1024)
22684c7204bSMichal Simek 
22784c7204bSMichal Simek #define CONFIG_CMD_BOOTI
22884c7204bSMichal Simek #define CONFIG_CMD_UNZIP
22984c7204bSMichal Simek 
23084c7204bSMichal Simek #define CONFIG_BOARD_EARLY_INIT_R
23184c7204bSMichal Simek #define CONFIG_CLOCKS
23284c7204bSMichal Simek 
233*e6a9ed04SMichal Simek #define CONFIG_SPL_TEXT_BASE		0xfffc0000
234*e6a9ed04SMichal Simek #define CONFIG_SPL_MAX_SIZE		0x20000
235*e6a9ed04SMichal Simek 
236*e6a9ed04SMichal Simek /* Just random location in OCM */
237*e6a9ed04SMichal Simek #define CONFIG_SPL_BSS_START_ADDR	0x1000000
238*e6a9ed04SMichal Simek #define CONFIG_SPL_BSS_MAX_SIZE		0x2000000
239*e6a9ed04SMichal Simek 
240*e6a9ed04SMichal Simek #define CONFIG_SPL_FRAMEWORK
241*e6a9ed04SMichal Simek #define CONFIG_SPL_LIBCOMMON_SUPPORT
242*e6a9ed04SMichal Simek #define CONFIG_SPL_LIBGENERIC_SUPPORT
243*e6a9ed04SMichal Simek #define CONFIG_SPL_SERIAL_SUPPORT
244*e6a9ed04SMichal Simek #define CONFIG_SPL_BOARD_INIT
245*e6a9ed04SMichal Simek #define CONFIG_SPL_RAM_DEVICE
246*e6a9ed04SMichal Simek 
247*e6a9ed04SMichal Simek #define CONFIG_SPL_OS_BOOT
248*e6a9ed04SMichal Simek /* u-boot is like dtb */
249*e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_ARGS_NAME	"u-boot.bin"
250*e6a9ed04SMichal Simek #define CONFIG_SYS_SPL_ARGS_ADDR	0x8000000
251*e6a9ed04SMichal Simek 
252*e6a9ed04SMichal Simek /* ATF is my kernel image */
253*e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_KERNEL_NAME	"atf.ub"
254*e6a9ed04SMichal Simek 
255*e6a9ed04SMichal Simek /* FIT load address for RAM boot */
256*e6a9ed04SMichal Simek #define CONFIG_SPL_LOAD_FIT_ADDRESS	0x10000000
257*e6a9ed04SMichal Simek 
258*e6a9ed04SMichal Simek /* MMC support */
259*e6a9ed04SMichal Simek #ifdef CONFIG_ZYNQ_SDHCI
260*e6a9ed04SMichal Simek # define CONFIG_SPL_MMC_SUPPORT
261*e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
262*e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR	0 /* unused */
263*e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS	0 /* unused */
264*e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR	0 /* unused */
265*e6a9ed04SMichal Simek # define CONFIG_SPL_LIBDISK_SUPPORT
266*e6a9ed04SMichal Simek # define CONFIG_SPL_FAT_SUPPORT
267*e6a9ed04SMichal Simek # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"
268*e6a9ed04SMichal Simek #endif
269*e6a9ed04SMichal Simek 
27084c7204bSMichal Simek #endif /* __XILINX_ZYNQMP_H */
271