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_REMAKE_ELF
15 /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
17 /* Generic Interrupt Controller Definitions */
18 #define GICD_BASE 0xF9000000
19 #define GICR_BASE 0xF9080000
21 #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
23 /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
24 #if CONFIG_COUNTER_FREQUENCY
25 # define COUNTER_FREQUENCY CONFIG_COUNTER_FREQUENCY
29 #define CONFIG_CPU_ARMV8
31 #define CONFIG_SYS_BAUDRATE_TABLE \
32 { 4800, 9600, 19200, 38400, 57600, 115200 }
35 #define CONFIG_BOOTP_BOOTFILESIZE
36 #define CONFIG_BOOTP_MAY_FAIL
38 /* Miscellaneous configurable options */
39 #define CONFIG_SYS_LOAD_ADDR 0x8000000
41 /* Monitor Command Prompt */
42 /* Console I/O Buffer Size */
43 #define CONFIG_SYS_CBSIZE 2048
44 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
45 sizeof(CONFIG_SYS_PROMPT) + 16)
46 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
47 #define CONFIG_SYS_MAXARGS 64
49 #if defined(CONFIG_CMD_DFU)
50 #define DFU_DEFAULT_POLL_TIMEOUT 300
51 #define CONFIG_THOR_RESET_OFF
55 #if defined(CONFIG_ZYNQ_GEM)
56 # define CONFIG_NET_MULTI
57 # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
58 # define PHY_ANEG_TIMEOUT 20000
61 #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
65 #define ENV_MEM_LAYOUT_SETTINGS \
66 "fdt_addr_r=0x40000000\0" \
67 "fdt_size_r=0x400000\0" \
68 "pxefile_addr_r=0x10000000\0" \
69 "kernel_addr_r=0x18000000\0" \
70 "kernel_size_r=0x10000000\0" \
71 "scriptaddr=0x20000000\0" \
72 "ramdisk_addr_r=0x02100000\0" \
73 "script_size_f=0x80000\0"
75 #if defined(CONFIG_MMC_SDHCI_ZYNQ)
76 # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
78 # define BOOT_TARGET_DEVICES_MMC(func)
81 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
82 # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
84 # define BOOT_TARGET_DEVICES_PXE(func)
87 #if defined(CONFIG_CMD_DHCP)
88 # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
90 # define BOOT_TARGET_DEVICES_DHCP(func)
93 #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
94 # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
96 # define BOOT_TARGET_DEVICES_XSPI(func)
99 #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
100 "bootcmd_xspi0=sf probe 0 0 0 && " \
101 "sf read $scriptaddr $script_offset_f $script_size_f && " \
102 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
103 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
105 #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
108 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
110 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
111 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
112 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
114 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
117 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
118 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
120 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
121 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
122 "$scriptaddr $script_size_f && " \
123 "dfu " #instance " ram " #instance " 60 && " \
124 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
125 "source ${scriptaddr}; " \
126 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
128 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
131 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
132 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
134 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
135 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
136 "$scriptaddr $script_size_f && " \
137 "thordown " #instance " ram " #instance " && " \
138 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
139 "source ${scriptaddr}; " \
140 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
142 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
145 #define BOOT_TARGET_DEVICES(func) \
146 BOOT_TARGET_DEVICES_JTAG(func) \
147 BOOT_TARGET_DEVICES_MMC(func) \
148 BOOT_TARGET_DEVICES_XSPI(func) \
149 BOOT_TARGET_DEVICES_USB_DFU(func) \
150 BOOT_TARGET_DEVICES_USB_THOR(func) \
151 BOOT_TARGET_DEVICES_PXE(func) \
152 BOOT_TARGET_DEVICES_DHCP(func)
154 #include <config_distro_bootcmd.h>
156 /* Initial environment variables */
157 #ifndef CONFIG_EXTRA_ENV_SETTINGS
158 #define CONFIG_EXTRA_ENV_SETTINGS \
159 ENV_MEM_LAYOUT_SETTINGS \
163 #endif /* __XILINX_VERSAL_H */