1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Configuration for Xilinx Versal
4 * (C) Copyright 2016 - 2018 Xilinx, Inc.
5 * Michal Simek <michal.simek@amd.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
18 #define CFG_SYS_BAUDRATE_TABLE \
19 { 4800, 9600, 19200, 38400, 57600, 115200 }
21 /* GUID for capsule updatable firmware image */
22 #define XILINX_BOOT_IMAGE_GUID \
23 EFI_GUID(0x20c5fba5, 0x0171, 0x457f, 0xb9, 0xcd, \
24 0xf5, 0x12, 0x9c, 0xd0, 0x72, 0x28)
26 #if defined(CONFIG_CMD_DFU)
27 #define DFU_DEFAULT_POLL_TIMEOUT 300
32 #define ENV_MEM_LAYOUT_SETTINGS \
33 "fdt_addr_r=0x40000000\0" \
34 "fdt_size_r=0x400000\0" \
35 "pxefile_addr_r=0x10000000\0" \
36 "kernel_addr_r=0x18000000\0" \
37 "kernel_size_r=0x10000000\0" \
38 "kernel_comp_addr_r=0x30000000\0" \
39 "kernel_comp_size=0x3C00000\0" \
40 "ramdisk_addr_r=0x02100000\0" \
41 "script_size_f=0x80000\0"
43 #if defined(CONFIG_DISTRO_DEFAULTS)
45 #if defined(CONFIG_MMC_SDHCI_ZYNQ)
46 # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
48 # define BOOT_TARGET_DEVICES_MMC(func)
51 #if defined(CONFIG_USB_STORAGE)
52 # define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
54 # define BOOT_TARGET_DEVICES_USB(func)
57 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
58 # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
60 # define BOOT_TARGET_DEVICES_PXE(func)
63 #if defined(CONFIG_CMD_DHCP)
64 # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
66 # define BOOT_TARGET_DEVICES_DHCP(func)
69 #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
70 # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
72 # define BOOT_TARGET_DEVICES_XSPI(func)
75 #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
76 "bootcmd_xspi0=sf probe 0 0 0 && " \
77 "sf read $scriptaddr $script_offset_f $script_size_f && " \
78 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
79 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
81 #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
84 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
86 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
87 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
88 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
90 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
93 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
94 func(USB_DFU, usb_dfu, 0)
96 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
97 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
98 "$scriptaddr $script_size_f && " \
99 "dfu " #instance " ram " #instance " 60 && " \
100 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
101 "source ${scriptaddr}; " \
102 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
104 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
107 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
108 func(USB_THOR, usb_thor, 0)
110 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
111 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
112 "$scriptaddr $script_size_f && " \
113 "thordown " #instance " ram " #instance " && " \
114 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
115 "source ${scriptaddr}; " \
116 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
118 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
121 #define BOOT_TARGET_DEVICES(func) \
122 BOOT_TARGET_DEVICES_JTAG(func) \
123 BOOT_TARGET_DEVICES_MMC(func) \
124 BOOT_TARGET_DEVICES_XSPI(func) \
125 BOOT_TARGET_DEVICES_USB_DFU(func) \
126 BOOT_TARGET_DEVICES_USB_THOR(func) \
127 BOOT_TARGET_DEVICES_USB(func) \
128 BOOT_TARGET_DEVICES_PXE(func) \
129 BOOT_TARGET_DEVICES_DHCP(func)
131 #include <config_distro_bootcmd.h>
133 #else /* CONFIG_DISTRO_DEFAULTS */
135 #endif /* CONFIG_DISTRO_DEFAULTS */
137 /* Initial environment variables */
138 #ifndef CFG_EXTRA_ENV_SETTINGS
139 #define CFG_EXTRA_ENV_SETTINGS \
140 ENV_MEM_LAYOUT_SETTINGS \
144 #endif /* __XILINX_VERSAL_H */