xref: /rk3399_rockchip-uboot/include/configs/xilinx_zynqmp.h (revision b72894f14da79cdcdab8007b079d922bd28e5ce7)
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 
44e6a9ed04SMichal 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
68e6a9ed04SMichal Simek #ifndef CONFIG_SPL_BUILD
69a1207de0SMichal Simek # define CONFIG_ISO_PARTITION
70e6a9ed04SMichal 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
79a1207de0SMichal Simek #define CONFIG_BOOTP_DNS
80a1207de0SMichal Simek #define CONFIG_BOOTP_PXE
81a1207de0SMichal Simek #define CONFIG_BOOTP_SUBNETMASK
82a1207de0SMichal Simek 
83a1207de0SMichal Simek /* Diff from config_distro_defaults.h */
84a1207de0SMichal Simek #define CONFIG_SUPPORT_RAW_INITRD
85a1207de0SMichal Simek #define CONFIG_ENV_VARS_UBOOT_CONFIG
86a1207de0SMichal Simek #define CONFIG_AUTO_COMPLETE
87a1207de0SMichal Simek 
88a1207de0SMichal Simek /* PXE */
89a1207de0SMichal Simek #define CONFIG_CMD_PXE
90a1207de0SMichal Simek #define CONFIG_MENU
91cb7ea820SMichal Simek 
92ce0335f2SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI)
9384c7204bSMichal Simek # define CONFIG_MMC
9484c7204bSMichal Simek # define CONFIG_GENERIC_MMC
95926782cdSMichal Simek # define CONFIG_SUPPORT_EMMC_BOOT
9684c7204bSMichal Simek # define CONFIG_SDHCI
97f3bd7280SMichal Simek # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ
98f3bd7280SMichal Simek #  define CONFIG_ZYNQ_SDHCI_MAX_FREQ	200000000
99f3bd7280SMichal Simek # endif
10046f68e68SMichal Simek #endif
10146f68e68SMichal Simek 
10246f68e68SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) || defined(CONFIG_ZYNQMP_USB)
10384c7204bSMichal Simek # define CONFIG_FAT_WRITE
10484c7204bSMichal Simek #endif
10584c7204bSMichal Simek 
10678cb965aSSiva Durga Prasad Paladugu #ifdef CONFIG_NAND_ARASAN
10778cb965aSSiva Durga Prasad Paladugu # define CONFIG_CMD_NAND_LOCK_UNLOCK
10878cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_MAX_NAND_DEVICE	1
10978cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_SELF_INIT
11078cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_ONFI_DETECTION
11178cb965aSSiva Durga Prasad Paladugu # define CONFIG_MTD_DEVICE
11278cb965aSSiva Durga Prasad Paladugu #endif
11378cb965aSSiva Durga Prasad Paladugu 
11484c7204bSMichal Simek /* Miscellaneous configurable options */
11584c7204bSMichal Simek #define CONFIG_SYS_LOAD_ADDR		0x8000000
11684c7204bSMichal Simek 
11716fa00a7SSiva Durga Prasad Paladugu #if defined(CONFIG_ZYNQMP_USB)
1180f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI_DWC3
1190f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI
1200f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_MAX_CONTROLLER_COUNT         1
1210f676767SSiva Durga Prasad Paladugu #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS      2
1220f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_STORAGE
1230f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI_ZYNQMP
1240f676767SSiva Durga Prasad Paladugu 
12516fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x1800000
12616fa00a7SSiva Durga Prasad Paladugu #define DFU_DEFAULT_POLL_TIMEOUT	300
12716fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_DFU
12816fa00a7SSiva Durga Prasad Paladugu #define CONFIG_DFU_RAM
12916fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_CABLE_CHECK
13016fa00a7SSiva Durga Prasad Paladugu #define CONFIG_CMD_THOR_DOWNLOAD
13116fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_THOR
13216fa00a7SSiva Durga Prasad Paladugu #define CONFIG_THOR_RESET_OFF
13316fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO_RAM \
13416fa00a7SSiva Durga Prasad Paladugu 	"dfu_ram_info=" \
1350e43140bSSiva Durga Prasad Paladugu 	"setenv dfu_alt_info " \
1361b19daf4SSiva Durga Prasad Paladugu 	"Image ram $kernel_addr $kernel_size\\\\;" \
1371b19daf4SSiva Durga Prasad Paladugu 	"system.dtb ram $fdt_addr $fdt_size\0" \
13816fa00a7SSiva Durga Prasad Paladugu 	"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
13916fa00a7SSiva Durga Prasad Paladugu 	"thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
14016fa00a7SSiva Durga Prasad Paladugu 
14116fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO  \
14216fa00a7SSiva Durga Prasad Paladugu 		DFU_ALT_INFO_RAM
14316fa00a7SSiva Durga Prasad Paladugu #endif
14416fa00a7SSiva Durga Prasad Paladugu 
14516fa00a7SSiva Durga Prasad Paladugu #if !defined(DFU_ALT_INFO)
14616fa00a7SSiva Durga Prasad Paladugu # define DFU_ALT_INFO
14716fa00a7SSiva Durga Prasad Paladugu #endif
14816fa00a7SSiva Durga Prasad Paladugu 
1495cfd9182SSoren Brinkmann #define CONFIG_BOOTDELAY	3
15084c7204bSMichal Simek 
15184c7204bSMichal Simek #define CONFIG_BOARD_LATE_INIT
15284c7204bSMichal Simek 
15384c7204bSMichal Simek /* Do not preserve environment */
15484c7204bSMichal Simek #define CONFIG_ENV_IS_NOWHERE		1
15584c7204bSMichal Simek #define CONFIG_ENV_SIZE			0x1000
15684c7204bSMichal Simek 
15784c7204bSMichal Simek /* Monitor Command Prompt */
15884c7204bSMichal Simek /* Console I/O Buffer Size */
15984c7204bSMichal Simek #define CONFIG_SYS_CBSIZE		2048
16084c7204bSMichal Simek #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
16184c7204bSMichal Simek 					sizeof(CONFIG_SYS_PROMPT) + 16)
16284c7204bSMichal Simek #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
16384c7204bSMichal Simek #define CONFIG_SYS_LONGHELP
16484c7204bSMichal Simek #define CONFIG_CMDLINE_EDITING
16584c7204bSMichal Simek #define CONFIG_SYS_MAXARGS		64
16684c7204bSMichal Simek 
167cb7ea820SMichal Simek /* Ethernet driver */
168596e5782SMichal Simek #if defined(CONFIG_ZYNQ_GEM)
169cb7ea820SMichal Simek # define CONFIG_NET_MULTI
170cb7ea820SMichal Simek # define CONFIG_MII
171cb7ea820SMichal Simek # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
172cb7ea820SMichal Simek # define CONFIG_PHY_MARVELL
173f96fe2c0SMichal Simek # define CONFIG_PHY_NATSEMI
174bf146325SMichal Simek # define CONFIG_PHY_TI
175c4c96f2bSMichal Simek # define CONFIG_PHY_GIGE
176a1a6af82SMichal Simek # define CONFIG_PHY_VITESSE
177a1a6af82SMichal Simek # define CONFIG_PHY_REALTEK
178e2928f32SSiva Durga Prasad Paladugu # define PHY_ANEG_TIMEOUT       20000
179cb7ea820SMichal Simek #endif
180cb7ea820SMichal Simek 
1812594e03cSSiva Durga Prasad Paladugu /* I2C */
1822594e03cSSiva Durga Prasad Paladugu #if defined(CONFIG_SYS_I2C_ZYNQ)
1832594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C
1842594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SPEED		100000
1852594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SLAVE		0
1862594e03cSSiva Durga Prasad Paladugu #endif
1872594e03cSSiva Durga Prasad Paladugu 
1882594e03cSSiva Durga Prasad Paladugu /* EEPROM */
1892594e03cSSiva Durga Prasad Paladugu #ifdef CONFIG_ZYNQMP_EEPROM
1902594e03cSSiva Durga Prasad Paladugu # define CONFIG_CMD_EEPROM
1912594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
1922594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR		0x54
1932594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	4
1942594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5
1952594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_SIZE			(64 * 1024)
1962594e03cSSiva Durga Prasad Paladugu #endif
1972594e03cSSiva Durga Prasad Paladugu 
1980d169b8cSMichal Simek #ifdef CONFIG_SATA_CEVA
1990d169b8cSMichal Simek #define CONFIG_AHCI
2006fe6f135SMichal Simek #define CONFIG_LIBATA
2016fe6f135SMichal Simek #define CONFIG_SCSI_AHCI
2026fe6f135SMichal Simek #define CONFIG_SCSI_AHCI_PLAT
203679b994aSMichal Simek #define CONFIG_SYS_SCSI_MAX_SCSI_ID	2
2046fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_LUN		1
2056fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
2066fe6f135SMichal Simek 					 CONFIG_SYS_SCSI_MAX_LUN)
207c649e3c9SSimon Glass #define CONFIG_SCSI
2086fe6f135SMichal Simek #endif
2096fe6f135SMichal Simek 
21084c7204bSMichal Simek #define CONFIG_SYS_BOOTM_LEN	(60 * 1024 * 1024)
21184c7204bSMichal Simek 
21284c7204bSMichal Simek #define CONFIG_CMD_BOOTI
21384c7204bSMichal Simek #define CONFIG_CMD_UNZIP
21484c7204bSMichal Simek 
21584c7204bSMichal Simek #define CONFIG_BOARD_EARLY_INIT_R
21684c7204bSMichal Simek #define CONFIG_CLOCKS
21784c7204bSMichal Simek 
218*b72894f1SMichal Simek #define ENV_MEM_LAYOUT_SETTINGS \
219*b72894f1SMichal Simek 	"fdt_high=10000000\0" \
220*b72894f1SMichal Simek 	"initrd_high=10000000\0" \
221*b72894f1SMichal Simek 	"fdt_addr_r=0x40000000\0" \
222*b72894f1SMichal Simek 	"pxefile_addr_r=0x10000000\0" \
223*b72894f1SMichal Simek 	"kernel_addr_r=0x18000000\0" \
224*b72894f1SMichal Simek 	"scriptaddr=0x02000000\0" \
225*b72894f1SMichal Simek 	"ramdisk_addr_r=0x02100000\0" \
226*b72894f1SMichal Simek 
227*b72894f1SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI)
228*b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func)	func(MMC, mmc, 0) func(MMC, mmc, 1)
229*b72894f1SMichal Simek #else
230*b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func)
231*b72894f1SMichal Simek #endif
232*b72894f1SMichal Simek 
233*b72894f1SMichal Simek #if defined(CONFIG_SATA_CEVA)
234*b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func)	func(SCSI, scsi, 0)
235*b72894f1SMichal Simek #else
236*b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func)
237*b72894f1SMichal Simek #endif
238*b72894f1SMichal Simek 
239*b72894f1SMichal Simek #if defined(CONFIG_ZYNQMP_USB)
240*b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func)	func(USB, usb, 0) func(USB, usb, 1)
241*b72894f1SMichal Simek #else
242*b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func)
243*b72894f1SMichal Simek #endif
244*b72894f1SMichal Simek 
245*b72894f1SMichal Simek #define BOOT_TARGET_DEVICES(func) \
246*b72894f1SMichal Simek 	BOOT_TARGET_DEVICES_MMC(func) \
247*b72894f1SMichal Simek 	BOOT_TARGET_DEVICES_USB(func) \
248*b72894f1SMichal Simek 	BOOT_TARGET_DEVICES_SCSI(func) \
249*b72894f1SMichal Simek 	func(PXE, pxe, na) \
250*b72894f1SMichal Simek 	func(DHCP, dhcp, na)
251*b72894f1SMichal Simek 
252*b72894f1SMichal Simek #include <config_distro_bootcmd.h>
253*b72894f1SMichal Simek 
254*b72894f1SMichal Simek /* Initial environment variables */
255*b72894f1SMichal Simek #ifndef CONFIG_EXTRA_ENV_SETTINGS
256*b72894f1SMichal Simek #define CONFIG_EXTRA_ENV_SETTINGS \
257*b72894f1SMichal Simek 	ENV_MEM_LAYOUT_SETTINGS \
258*b72894f1SMichal Simek 	BOOTENV \
259*b72894f1SMichal Simek 	DFU_ALT_INFO
260*b72894f1SMichal Simek #endif
261*b72894f1SMichal Simek 
262e6a9ed04SMichal Simek #define CONFIG_SPL_TEXT_BASE		0xfffc0000
263e6a9ed04SMichal Simek #define CONFIG_SPL_MAX_SIZE		0x20000
264e6a9ed04SMichal Simek 
265e6a9ed04SMichal Simek /* Just random location in OCM */
266e6a9ed04SMichal Simek #define CONFIG_SPL_BSS_START_ADDR	0x1000000
267e6a9ed04SMichal Simek #define CONFIG_SPL_BSS_MAX_SIZE		0x2000000
268e6a9ed04SMichal Simek 
269e6a9ed04SMichal Simek #define CONFIG_SPL_FRAMEWORK
270e6a9ed04SMichal Simek #define CONFIG_SPL_LIBCOMMON_SUPPORT
271e6a9ed04SMichal Simek #define CONFIG_SPL_LIBGENERIC_SUPPORT
272e6a9ed04SMichal Simek #define CONFIG_SPL_SERIAL_SUPPORT
273e6a9ed04SMichal Simek #define CONFIG_SPL_BOARD_INIT
274e6a9ed04SMichal Simek #define CONFIG_SPL_RAM_DEVICE
275e6a9ed04SMichal Simek 
276e6a9ed04SMichal Simek #define CONFIG_SPL_OS_BOOT
277e6a9ed04SMichal Simek /* u-boot is like dtb */
278e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_ARGS_NAME	"u-boot.bin"
279e6a9ed04SMichal Simek #define CONFIG_SYS_SPL_ARGS_ADDR	0x8000000
280e6a9ed04SMichal Simek 
281e6a9ed04SMichal Simek /* ATF is my kernel image */
282e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_KERNEL_NAME	"atf.ub"
283e6a9ed04SMichal Simek 
284e6a9ed04SMichal Simek /* FIT load address for RAM boot */
285e6a9ed04SMichal Simek #define CONFIG_SPL_LOAD_FIT_ADDRESS	0x10000000
286e6a9ed04SMichal Simek 
287e6a9ed04SMichal Simek /* MMC support */
288e6a9ed04SMichal Simek #ifdef CONFIG_ZYNQ_SDHCI
289e6a9ed04SMichal Simek # define CONFIG_SPL_MMC_SUPPORT
290e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
291e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR	0 /* unused */
292e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS	0 /* unused */
293e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR	0 /* unused */
294e6a9ed04SMichal Simek # define CONFIG_SPL_LIBDISK_SUPPORT
295e6a9ed04SMichal Simek # define CONFIG_SPL_FAT_SUPPORT
296e6a9ed04SMichal Simek # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"
297e6a9ed04SMichal Simek #endif
298e6a9ed04SMichal Simek 
29984c7204bSMichal Simek #endif /* __XILINX_ZYNQMP_H */
300