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 /* Generic Interrupt Controller Definitions */
14 #define GICD_BASE 0xF9000000
15 #define GICR_BASE 0xF9080000
17 #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
19 /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
20 #if CONFIG_COUNTER_FREQUENCY
21 # define COUNTER_FREQUENCY CONFIG_COUNTER_FREQUENCY
25 #define CONFIG_SYS_BAUDRATE_TABLE \
26 { 4800, 9600, 19200, 38400, 57600, 115200 }
28 /* Miscellaneous configurable options */
30 /* Monitor Command Prompt */
31 /* Console I/O Buffer Size */
32 #define CONFIG_SYS_CBSIZE 2048
33 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
34 #define CONFIG_SYS_MAXARGS 64
36 #if defined(CONFIG_CMD_DFU)
37 #define DFU_DEFAULT_POLL_TIMEOUT 300
38 #define CONFIG_THOR_RESET_OFF
42 #if defined(CONFIG_ZYNQ_GEM)
43 # define PHY_ANEG_TIMEOUT 20000
46 #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
50 #define ENV_MEM_LAYOUT_SETTINGS \
51 "fdt_addr_r=0x40000000\0" \
52 "fdt_size_r=0x400000\0" \
53 "pxefile_addr_r=0x10000000\0" \
54 "kernel_addr_r=0x18000000\0" \
55 "kernel_size_r=0x10000000\0" \
56 "kernel_comp_addr_r=0x30000000\0" \
57 "kernel_comp_size=0x3C00000\0" \
58 "scriptaddr=0x20000000\0" \
59 "ramdisk_addr_r=0x02100000\0" \
60 "script_size_f=0x80000\0"
62 #if defined(CONFIG_MMC_SDHCI_ZYNQ)
63 # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
65 # define BOOT_TARGET_DEVICES_MMC(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_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
81 # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
83 # define BOOT_TARGET_DEVICES_XSPI(func)
86 #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
87 "bootcmd_xspi0=sf probe 0 0 0 && " \
88 "sf read $scriptaddr $script_offset_f $script_size_f && " \
89 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
90 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
92 #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
95 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
97 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
98 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
99 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
101 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
104 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
105 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
107 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
108 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
109 "$scriptaddr $script_size_f && " \
110 "dfu " #instance " ram " #instance " 60 && " \
111 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
112 "source ${scriptaddr}; " \
113 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
115 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
118 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
119 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
121 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
122 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
123 "$scriptaddr $script_size_f && " \
124 "thordown " #instance " ram " #instance " && " \
125 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
126 "source ${scriptaddr}; " \
127 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
129 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
132 #define BOOT_TARGET_DEVICES(func) \
133 BOOT_TARGET_DEVICES_JTAG(func) \
134 BOOT_TARGET_DEVICES_MMC(func) \
135 BOOT_TARGET_DEVICES_XSPI(func) \
136 BOOT_TARGET_DEVICES_USB_DFU(func) \
137 BOOT_TARGET_DEVICES_USB_THOR(func) \
138 BOOT_TARGET_DEVICES_PXE(func) \
139 BOOT_TARGET_DEVICES_DHCP(func)
141 #include <config_distro_bootcmd.h>
143 /* Initial environment variables */
144 #ifndef CONFIG_EXTRA_ENV_SETTINGS
145 #define CONFIG_EXTRA_ENV_SETTINGS \
146 ENV_MEM_LAYOUT_SETTINGS \
150 #endif /* __XILINX_VERSAL_H */