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
20 #define CONFIG_SYS_BAUDRATE_TABLE \
21 { 4800, 9600, 19200, 38400, 57600, 115200 }
23 /* GUID for capsule updatable firmware image */
24 #define XILINX_BOOT_IMAGE_GUID \
25 EFI_GUID(0x20c5fba5, 0x0171, 0x457f, 0xb9, 0xcd, \
26 0xf5, 0x12, 0x9c, 0xd0, 0x72, 0x28)
28 /* Miscellaneous configurable options */
30 /* Console I/O Buffer Size */
31 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
33 #if defined(CONFIG_CMD_DFU)
34 #define DFU_DEFAULT_POLL_TIMEOUT 300
35 #define CONFIG_THOR_RESET_OFF
39 #if defined(CONFIG_ZYNQ_GEM)
40 # define PHY_ANEG_TIMEOUT 20000
43 #define CONFIG_SYS_BOOTM_LEN (100 * 1024 * 1024)
45 #define ENV_MEM_LAYOUT_SETTINGS \
46 "fdt_addr_r=0x40000000\0" \
47 "fdt_size_r=0x400000\0" \
48 "pxefile_addr_r=0x10000000\0" \
49 "kernel_addr_r=0x18000000\0" \
50 "kernel_size_r=0x10000000\0" \
51 "kernel_comp_addr_r=0x30000000\0" \
52 "kernel_comp_size=0x3C00000\0" \
53 "scriptaddr=0x20000000\0" \
54 "ramdisk_addr_r=0x02100000\0" \
55 "script_size_f=0x80000\0"
57 #if defined(CONFIG_MMC_SDHCI_ZYNQ)
58 # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
60 # define BOOT_TARGET_DEVICES_MMC(func)
63 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
64 # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
66 # define BOOT_TARGET_DEVICES_PXE(func)
69 #if defined(CONFIG_CMD_DHCP)
70 # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
72 # define BOOT_TARGET_DEVICES_DHCP(func)
75 #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
76 # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
78 # define BOOT_TARGET_DEVICES_XSPI(func)
81 #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
82 "bootcmd_xspi0=sf probe 0 0 0 && " \
83 "sf read $scriptaddr $script_offset_f $script_size_f && " \
84 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
85 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
87 #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
90 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
92 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
93 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
94 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
96 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
99 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
100 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
102 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
103 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
104 "$scriptaddr $script_size_f && " \
105 "dfu " #instance " ram " #instance " 60 && " \
106 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
107 "source ${scriptaddr}; " \
108 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
110 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
113 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
114 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
116 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
117 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
118 "$scriptaddr $script_size_f && " \
119 "thordown " #instance " ram " #instance " && " \
120 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
121 "source ${scriptaddr}; " \
122 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
124 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
127 #define BOOT_TARGET_DEVICES(func) \
128 BOOT_TARGET_DEVICES_JTAG(func) \
129 BOOT_TARGET_DEVICES_MMC(func) \
130 BOOT_TARGET_DEVICES_XSPI(func) \
131 BOOT_TARGET_DEVICES_USB_DFU(func) \
132 BOOT_TARGET_DEVICES_USB_THOR(func) \
133 BOOT_TARGET_DEVICES_PXE(func) \
134 BOOT_TARGET_DEVICES_DHCP(func)
136 #include <config_distro_bootcmd.h>
138 /* Initial environment variables */
139 #ifndef CONFIG_EXTRA_ENV_SETTINGS
140 #define CONFIG_EXTRA_ENV_SETTINGS \
141 ENV_MEM_LAYOUT_SETTINGS \
145 #endif /* __XILINX_VERSAL_H */