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
18 #define CONFIG_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 /* Miscellaneous configurable options */
28 /* Console I/O Buffer Size */
30 #if defined(CONFIG_CMD_DFU)
31 #define DFU_DEFAULT_POLL_TIMEOUT 300
32 #define CONFIG_THOR_RESET_OFF
36 #if defined(CONFIG_ZYNQ_GEM)
37 # define PHY_ANEG_TIMEOUT 20000
40 #define CONFIG_SYS_BOOTM_LEN (100 * 1024 * 1024)
42 #define ENV_MEM_LAYOUT_SETTINGS \
43 "fdt_addr_r=0x40000000\0" \
44 "fdt_size_r=0x400000\0" \
45 "pxefile_addr_r=0x10000000\0" \
46 "kernel_addr_r=0x18000000\0" \
47 "kernel_size_r=0x10000000\0" \
48 "kernel_comp_addr_r=0x30000000\0" \
49 "kernel_comp_size=0x3C00000\0" \
50 "scriptaddr=0x20000000\0" \
51 "ramdisk_addr_r=0x02100000\0" \
52 "script_size_f=0x80000\0"
54 #if defined(CONFIG_MMC_SDHCI_ZYNQ)
55 # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
57 # define BOOT_TARGET_DEVICES_MMC(func)
60 #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
61 # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
63 # define BOOT_TARGET_DEVICES_PXE(func)
66 #if defined(CONFIG_CMD_DHCP)
67 # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
69 # define BOOT_TARGET_DEVICES_DHCP(func)
72 #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
73 # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
75 # define BOOT_TARGET_DEVICES_XSPI(func)
78 #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
79 "bootcmd_xspi0=sf probe 0 0 0 && " \
80 "sf read $scriptaddr $script_offset_f $script_size_f && " \
81 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
82 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
84 #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
87 #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
89 #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
90 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
91 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
93 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
96 #define BOOT_TARGET_DEVICES_USB_DFU(func) \
97 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
99 #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
100 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
101 "$scriptaddr $script_size_f && " \
102 "dfu " #instance " ram " #instance " 60 && " \
103 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
104 "source ${scriptaddr}; " \
105 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
107 #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
110 #define BOOT_TARGET_DEVICES_USB_THOR(func) \
111 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
113 #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
114 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
115 "$scriptaddr $script_size_f && " \
116 "thordown " #instance " ram " #instance " && " \
117 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
118 "source ${scriptaddr}; " \
119 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
121 #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
124 #define BOOT_TARGET_DEVICES(func) \
125 BOOT_TARGET_DEVICES_JTAG(func) \
126 BOOT_TARGET_DEVICES_MMC(func) \
127 BOOT_TARGET_DEVICES_XSPI(func) \
128 BOOT_TARGET_DEVICES_USB_DFU(func) \
129 BOOT_TARGET_DEVICES_USB_THOR(func) \
130 BOOT_TARGET_DEVICES_PXE(func) \
131 BOOT_TARGET_DEVICES_DHCP(func)
133 #include <config_distro_bootcmd.h>
135 /* Initial environment variables */
136 #ifndef CONFIG_EXTRA_ENV_SETTINGS
137 #define CONFIG_EXTRA_ENV_SETTINGS \
138 ENV_MEM_LAYOUT_SETTINGS \
142 #endif /* __XILINX_VERSAL_H */