1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * (C) Copyright 2013 - 2018 Xilinx, Inc.
6 * Common configuration options for all Zynq boards.
9 #ifndef __CONFIG_ZYNQ_COMMON_H
10 #define __CONFIG_ZYNQ_COMMON_H
13 #ifndef CONFIG_SYS_L2CACHE_OFF
14 # define CONFIG_SYS_PL310_BASE 0xf8f02000
17 #define ZYNQ_SCUTIMER_BASEADDR 0xF8F00600
18 #define CONFIG_SYS_TIMERBASE ZYNQ_SCUTIMER_BASEADDR
19 #define CONFIG_SYS_TIMER_COUNTS_DOWN
20 #define CONFIG_SYS_TIMER_COUNTER (CONFIG_SYS_TIMERBASE + 0x4)
22 /* GUIDs for capsule updatable firmware images */
23 #define XILINX_BOOT_IMAGE_GUID \
24 EFI_GUID(0x1ba29a15, 0x9969, 0x40aa, 0xb4, 0x24, \
25 0xe8, 0x61, 0x21, 0x61, 0x86, 0x64)
27 #define XILINX_UBOOT_IMAGE_GUID \
28 EFI_GUID(0x1a5178f0, 0x87d3, 0x4f36, 0xac, 0x63, \
29 0x3b, 0x31, 0xa2, 0x3b, 0xe3, 0x05)
32 /* The following table includes the supported baudrates */
33 #define CONFIG_SYS_BAUDRATE_TABLE \
34 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
39 #ifdef CONFIG_MTD_NOR_FLASH
40 # define CONFIG_FLASH_SHOW_PROGRESS 10
43 #ifdef CONFIG_USB_EHCI_ZYNQ
44 # define DFU_DEFAULT_POLL_TIMEOUT 300
45 # define CONFIG_THOR_RESET_OFF
48 /* enable preboot to be loaded before CONFIG_BOOTDELAY */
50 /* Boot configuration */
52 #ifdef CONFIG_SPL_BUILD
57 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
59 #define BOOT_TARGET_DEVICES_MMC(func)
63 #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1)
65 #define BOOT_TARGET_DEVICES_USB(func)
68 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
69 #define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
71 #define BOOT_TARGET_DEVICES_PXE(func)
74 #if defined(CONFIG_CMD_DHCP)
75 #define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
77 #define BOOT_TARGET_DEVICES_DHCP(func)
80 #if defined(CONFIG_ZYNQ_QSPI)
81 # define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
83 # define BOOT_TARGET_DEVICES_QSPI(func)
86 #if defined(CONFIG_NAND_ZYNQ)
87 # define BOOT_TARGET_DEVICES_NAND(func) func(NAND, nand, na)
89 # define BOOT_TARGET_DEVICES_NAND(func)
92 #if defined(CONFIG_MTD_NOR_FLASH)
93 # define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na)
95 # define BOOT_TARGET_DEVICES_NOR(func)
98 #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
99 "bootcmd_qspi=sf probe 0 0 0 && " \
100 "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
101 "echo QSPI: Trying to boot script at ${scriptaddr} && " \
102 "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
104 #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
107 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
108 "bootcmd_nand=nand info && " \
109 "nand read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
110 "echo NAND: Trying to boot script at ${scriptaddr} && " \
111 "source ${scriptaddr}; echo NAND: SCRIPT FAILED: continuing...;\0"
113 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
116 #define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
117 "script_offset_nor=0xE2FC0000\0" \
118 "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
119 "echo NOR: Trying to boot script at ${scriptaddr} && " \
120 "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
122 #define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
125 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
127 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
128 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
129 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
131 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
134 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
135 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
137 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
138 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
139 "$scriptaddr $script_size_f && " \
140 "dfu " #instance " ram " #instance " 60 && " \
141 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
142 "source ${scriptaddr}; " \
143 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
145 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
148 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
149 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
151 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
152 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
153 "$scriptaddr $script_size_f && " \
154 "thordown " #instance " ram " #instance " && " \
155 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
156 "source ${scriptaddr}; " \
157 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
159 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
162 #define BOOT_TARGET_DEVICES(func) \
163 BOOT_TARGET_DEVICES_JTAG(func) \
164 BOOT_TARGET_DEVICES_MMC(func) \
165 BOOT_TARGET_DEVICES_QSPI(func) \
166 BOOT_TARGET_DEVICES_NAND(func) \
167 BOOT_TARGET_DEVICES_NOR(func) \
168 BOOT_TARGET_DEVICES_USB_DFU(func) \
169 BOOT_TARGET_DEVICES_USB_THOR(func) \
170 BOOT_TARGET_DEVICES_USB(func) \
171 BOOT_TARGET_DEVICES_PXE(func) \
172 BOOT_TARGET_DEVICES_DHCP(func)
174 #include <config_distro_bootcmd.h>
175 #endif /* CONFIG_SPL_BUILD */
177 /* Default environment */
178 #ifndef CONFIG_EXTRA_ENV_SETTINGS
179 #define CONFIG_EXTRA_ENV_SETTINGS \
180 "scriptaddr=0x20000\0" \
181 "script_size_f=0x40000\0" \
182 "fdt_addr_r=0x1f00000\0" \
183 "pxefile_addr_r=0x2000000\0" \
184 "kernel_addr_r=0x2000000\0" \
185 "scriptaddr=0x3000000\0" \
186 "ramdisk_addr_r=0x3100000\0" \
190 /* Miscellaneous configurable options */
192 #define CONFIG_SYS_INIT_RAM_ADDR 0xFFFF0000
193 #define CONFIG_SYS_INIT_RAM_SIZE 0x2000
196 /* Extend size of kernel image for uncompression */
198 /* Address in RAM where the parameters must be copied by SPL. */
200 /* Not using MMC raw mode - just for compilation purpose */
202 /* qspi mode is working fine */
203 #ifdef CONFIG_ZYNQ_QSPI
204 #define CONFIG_SYS_SPI_ARGS_OFFS 0x200000
205 #define CONFIG_SYS_SPI_ARGS_SIZE 0x80000
206 #define CONFIG_SYS_SPI_KERNEL_OFFS (CONFIG_SYS_SPI_ARGS_OFFS + \
207 CONFIG_SYS_SPI_ARGS_SIZE)
210 /* SP location before relocation, must use scratch RAM */
212 /* 3 * 64kB blocks of OCM - one is on the top because of bootrom */
214 /* On the top of OCM space */
217 * SPL stack position - and stack goes down
218 * 0xfffffe00 is used for putting wfi loop.
219 * Set it up as limit for now.
222 #endif /* __CONFIG_ZYNQ_COMMON_H */