1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Configuration for Xilinx Versal
4 * (C) Copyright 2016 - 2018 Xilinx, Inc.
5 * Michal Simek <michal.simek@xilinx.com>
7 * Based on Configuration for Xilinx ZynqMP
10 #ifndef __XILINX_VERSAL_H
11 #define __XILINX_VERSAL_H
13 /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
15 /* Generic Interrupt Controller Definitions */
16 #define GICD_BASE 0xF9000000
17 #define GICR_BASE 0xF9080000
19 #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
21 /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
22 #if CONFIG_COUNTER_FREQUENCY
23 # define COUNTER_FREQUENCY CONFIG_COUNTER_FREQUENCY
27 #define CONFIG_SYS_BAUDRATE_TABLE \
28 { 4800, 9600, 19200, 38400, 57600, 115200 }
30 /* Miscellaneous configurable options */
32 /* Monitor Command Prompt */
33 /* Console I/O Buffer Size */
34 #define CONFIG_SYS_CBSIZE 2048
35 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
36 #define CONFIG_SYS_MAXARGS 64
38 #if defined(CONFIG_CMD_DFU)
39 #define DFU_DEFAULT_POLL_TIMEOUT 300
40 #define CONFIG_THOR_RESET_OFF
44 #if defined(CONFIG_ZYNQ_GEM)
45 # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
46 # define PHY_ANEG_TIMEOUT 20000
49 #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
53 #define ENV_MEM_LAYOUT_SETTINGS \
54 "fdt_addr_r=0x40000000\0" \
55 "fdt_size_r=0x400000\0" \
56 "pxefile_addr_r=0x10000000\0" \
57 "kernel_addr_r=0x18000000\0" \
58 "kernel_size_r=0x10000000\0" \
59 "kernel_comp_addr_r=0x30000000\0" \
60 "kernel_comp_size=0x3C00000\0" \
61 "scriptaddr=0x20000000\0" \
62 "ramdisk_addr_r=0x02100000\0" \
63 "script_size_f=0x80000\0"
65 #if defined(CONFIG_MMC_SDHCI_ZYNQ)
66 # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
68 # define BOOT_TARGET_DEVICES_MMC(func)
71 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
72 # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
74 # define BOOT_TARGET_DEVICES_PXE(func)
77 #if defined(CONFIG_CMD_DHCP)
78 # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
80 # define BOOT_TARGET_DEVICES_DHCP(func)
83 #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
84 # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
86 # define BOOT_TARGET_DEVICES_XSPI(func)
89 #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
90 "bootcmd_xspi0=sf probe 0 0 0 && " \
91 "sf read $scriptaddr $script_offset_f $script_size_f && " \
92 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
93 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
95 #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
98 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
100 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
101 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
102 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
104 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
107 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
108 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
110 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
111 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
112 "$scriptaddr $script_size_f && " \
113 "dfu " #instance " ram " #instance " 60 && " \
114 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
115 "source ${scriptaddr}; " \
116 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
118 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
121 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
122 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
124 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
125 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
126 "$scriptaddr $script_size_f && " \
127 "thordown " #instance " ram " #instance " && " \
128 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
129 "source ${scriptaddr}; " \
130 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
132 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
135 #define BOOT_TARGET_DEVICES(func) \
136 BOOT_TARGET_DEVICES_JTAG(func) \
137 BOOT_TARGET_DEVICES_MMC(func) \
138 BOOT_TARGET_DEVICES_XSPI(func) \
139 BOOT_TARGET_DEVICES_USB_DFU(func) \
140 BOOT_TARGET_DEVICES_USB_THOR(func) \
141 BOOT_TARGET_DEVICES_PXE(func) \
142 BOOT_TARGET_DEVICES_DHCP(func)
144 #include <config_distro_bootcmd.h>
146 /* Initial environment variables */
147 #ifndef CONFIG_EXTRA_ENV_SETTINGS
148 #define CONFIG_EXTRA_ENV_SETTINGS \
149 ENV_MEM_LAYOUT_SETTINGS \
153 #endif /* __XILINX_VERSAL_H */