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_COUNTER (CONFIG_SYS_TIMERBASE + 0x4)
21 /* GUIDs for capsule updatable firmware images */
22 #define XILINX_BOOT_IMAGE_GUID \
23 EFI_GUID(0x1ba29a15, 0x9969, 0x40aa, 0xb4, 0x24, \
24 0xe8, 0x61, 0x21, 0x61, 0x86, 0x64)
26 #define XILINX_UBOOT_IMAGE_GUID \
27 EFI_GUID(0x1a5178f0, 0x87d3, 0x4f36, 0xac, 0x63, \
28 0x3b, 0x31, 0xa2, 0x3b, 0xe3, 0x05)
31 /* The following table includes the supported baudrates */
32 #define CONFIG_SYS_BAUDRATE_TABLE \
33 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
38 #ifdef CONFIG_MTD_NOR_FLASH
39 # define CONFIG_FLASH_SHOW_PROGRESS 10
42 #ifdef CONFIG_USB_EHCI_ZYNQ
43 # define DFU_DEFAULT_POLL_TIMEOUT 300
44 # define CONFIG_THOR_RESET_OFF
47 /* enable preboot to be loaded before CONFIG_BOOTDELAY */
49 /* Boot configuration */
51 #ifdef CONFIG_SPL_BUILD
56 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
58 #define BOOT_TARGET_DEVICES_MMC(func)
62 #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1)
64 #define BOOT_TARGET_DEVICES_USB(func)
67 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
68 #define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
70 #define BOOT_TARGET_DEVICES_PXE(func)
73 #if defined(CONFIG_CMD_DHCP)
74 #define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
76 #define BOOT_TARGET_DEVICES_DHCP(func)
79 #if defined(CONFIG_ZYNQ_QSPI)
80 # define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
82 # define BOOT_TARGET_DEVICES_QSPI(func)
85 #if defined(CONFIG_NAND_ZYNQ)
86 # define BOOT_TARGET_DEVICES_NAND(func) func(NAND, nand, na)
88 # define BOOT_TARGET_DEVICES_NAND(func)
91 #if defined(CONFIG_MTD_NOR_FLASH)
92 # define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na)
94 # define BOOT_TARGET_DEVICES_NOR(func)
97 #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
98 "bootcmd_qspi=sf probe 0 0 0 && " \
99 "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
100 "echo QSPI: Trying to boot script at ${scriptaddr} && " \
101 "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
103 #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
106 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
107 "bootcmd_nand=nand info && " \
108 "nand read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \
109 "echo NAND: Trying to boot script at ${scriptaddr} && " \
110 "source ${scriptaddr}; echo NAND: SCRIPT FAILED: continuing...;\0"
112 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
115 #define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
116 "script_offset_nor=0xE2FC0000\0" \
117 "bootcmd_nor=cp.b ${script_offset_nor} ${scriptaddr} ${script_size_f} && " \
118 "echo NOR: Trying to boot script at ${scriptaddr} && " \
119 "source ${scriptaddr}; echo NOR: SCRIPT FAILED: continuing...;\0"
121 #define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
124 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
126 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
127 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
128 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
130 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
133 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
134 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
136 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
137 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
138 "$scriptaddr $script_size_f && " \
139 "dfu " #instance " ram " #instance " 60 && " \
140 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
141 "source ${scriptaddr}; " \
142 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
144 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
147 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
148 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
150 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
151 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
152 "$scriptaddr $script_size_f && " \
153 "thordown " #instance " ram " #instance " && " \
154 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
155 "source ${scriptaddr}; " \
156 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
158 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
161 #define BOOT_TARGET_DEVICES(func) \
162 BOOT_TARGET_DEVICES_JTAG(func) \
163 BOOT_TARGET_DEVICES_MMC(func) \
164 BOOT_TARGET_DEVICES_QSPI(func) \
165 BOOT_TARGET_DEVICES_NAND(func) \
166 BOOT_TARGET_DEVICES_NOR(func) \
167 BOOT_TARGET_DEVICES_USB_DFU(func) \
168 BOOT_TARGET_DEVICES_USB_THOR(func) \
169 BOOT_TARGET_DEVICES_USB(func) \
170 BOOT_TARGET_DEVICES_PXE(func) \
171 BOOT_TARGET_DEVICES_DHCP(func)
173 #include <config_distro_bootcmd.h>
174 #endif /* CONFIG_SPL_BUILD */
176 /* Default environment */
177 #ifndef CONFIG_EXTRA_ENV_SETTINGS
178 #define CONFIG_EXTRA_ENV_SETTINGS \
179 "scriptaddr=0x20000\0" \
180 "script_size_f=0x40000\0" \
181 "fdt_addr_r=0x1f00000\0" \
182 "pxefile_addr_r=0x2000000\0" \
183 "kernel_addr_r=0x2000000\0" \
184 "scriptaddr=0x3000000\0" \
185 "ramdisk_addr_r=0x3100000\0" \
189 /* Miscellaneous configurable options */
191 #define CONFIG_SYS_INIT_RAM_ADDR 0xFFFF0000
192 #define CONFIG_SYS_INIT_RAM_SIZE 0x2000
195 /* Extend size of kernel image for uncompression */
197 /* Address in RAM where the parameters must be copied by SPL. */
199 /* Not using MMC raw mode - just for compilation purpose */
201 /* qspi mode is working fine */
202 #ifdef CONFIG_ZYNQ_QSPI
203 #define CONFIG_SYS_SPI_ARGS_OFFS 0x200000
204 #define CONFIG_SYS_SPI_ARGS_SIZE 0x80000
205 #define CONFIG_SYS_SPI_KERNEL_OFFS (CONFIG_SYS_SPI_ARGS_OFFS + \
206 CONFIG_SYS_SPI_ARGS_SIZE)
209 /* SP location before relocation, must use scratch RAM */
211 /* 3 * 64kB blocks of OCM - one is on the top because of bootrom */
213 /* On the top of OCM space */
216 * SPL stack position - and stack goes down
217 * 0xfffffe00 is used for putting wfi loop.
218 * Set it up as limit for now.
221 #endif /* __CONFIG_ZYNQ_COMMON_H */