Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Configuration for Xilinx Versal |
| 4 | * (C) Copyright 2016 - 2018 Xilinx, Inc. |
| 5 | * Michal Simek <michal.simek@xilinx.com> |
| 6 | * |
| 7 | * Based on Configuration for Xilinx ZynqMP |
| 8 | */ |
| 9 | |
| 10 | #ifndef __XILINX_VERSAL_H |
| 11 | #define __XILINX_VERSAL_H |
| 12 | |
| 13 | #define CONFIG_REMAKE_ELF |
| 14 | |
| 15 | /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */ |
| 16 | |
| 17 | /* Generic Interrupt Controller Definitions */ |
| 18 | #define GICD_BASE 0xF9000000 |
| 19 | #define GICR_BASE 0xF9080000 |
| 20 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 21 | #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE |
| 22 | |
| 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 |
| 26 | #endif |
| 27 | |
| 28 | /* Serial setup */ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 29 | #define CONFIG_SYS_BAUDRATE_TABLE \ |
| 30 | { 4800, 9600, 19200, 38400, 57600, 115200 } |
| 31 | |
| 32 | /* BOOTP options */ |
| 33 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 34 | #define CONFIG_BOOTP_MAY_FAIL |
| 35 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 36 | /* Miscellaneous configurable options */ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 37 | |
| 38 | /* Monitor Command Prompt */ |
| 39 | /* Console I/O Buffer Size */ |
| 40 | #define CONFIG_SYS_CBSIZE 2048 |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 41 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 42 | #define CONFIG_SYS_MAXARGS 64 |
| 43 | |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 44 | #if defined(CONFIG_CMD_DFU) |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 45 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
| 46 | #define CONFIG_THOR_RESET_OFF |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 47 | #endif |
| 48 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 49 | /* Ethernet driver */ |
| 50 | #if defined(CONFIG_ZYNQ_GEM) |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 51 | # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN |
| 52 | # define PHY_ANEG_TIMEOUT 20000 |
| 53 | #endif |
| 54 | |
| 55 | #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024) |
| 56 | |
| 57 | #define CONFIG_CLOCKS |
| 58 | |
| 59 | #define ENV_MEM_LAYOUT_SETTINGS \ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 60 | "fdt_addr_r=0x40000000\0" \ |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 61 | "fdt_size_r=0x400000\0" \ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 62 | "pxefile_addr_r=0x10000000\0" \ |
| 63 | "kernel_addr_r=0x18000000\0" \ |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 64 | "kernel_size_r=0x10000000\0" \ |
Raju Kumar Pothuraju | a51ca69 | 2021-07-12 20:19:04 +0530 | [diff] [blame] | 65 | "kernel_comp_addr_r=0x30000000\0" \ |
| 66 | "kernel_comp_size=0x3C00000\0" \ |
Siva Durga Prasad Paladugu | 00784e0 | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 67 | "scriptaddr=0x20000000\0" \ |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 68 | "ramdisk_addr_r=0x02100000\0" \ |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 69 | "script_size_f=0x80000\0" |
| 70 | |
| 71 | #if defined(CONFIG_MMC_SDHCI_ZYNQ) |
| 72 | # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) |
| 73 | #else |
| 74 | # define BOOT_TARGET_DEVICES_MMC(func) |
| 75 | #endif |
| 76 | |
Michal Simek | 788cdae | 2020-09-16 10:14:01 +0200 | [diff] [blame] | 77 | #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) |
| 78 | # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) |
| 79 | #else |
| 80 | # define BOOT_TARGET_DEVICES_PXE(func) |
| 81 | #endif |
| 82 | |
| 83 | #if defined(CONFIG_CMD_DHCP) |
| 84 | # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na) |
| 85 | #else |
| 86 | # define BOOT_TARGET_DEVICES_DHCP(func) |
| 87 | #endif |
| 88 | |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 89 | #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL) |
| 90 | # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0) |
| 91 | #else |
| 92 | # define BOOT_TARGET_DEVICES_XSPI(func) |
| 93 | #endif |
| 94 | |
| 95 | #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \ |
| 96 | "bootcmd_xspi0=sf probe 0 0 0 && " \ |
| 97 | "sf read $scriptaddr $script_offset_f $script_size_f && " \ |
Michal Simek | f964751 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 98 | "echo XSPI: Trying to boot script at ${scriptaddr} && " \ |
| 99 | "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0" |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 100 | |
| 101 | #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \ |
Michal Simek | 3464cd8 | 2020-04-16 18:04:43 +0200 | [diff] [blame] | 102 | "xspi0 " |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 103 | |
Siva Durga Prasad Paladugu | 00784e0 | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 104 | #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) |
| 105 | |
| 106 | #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ |
Michal Simek | f964751 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 107 | "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \ |
| 108 | "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0" |
Siva Durga Prasad Paladugu | 00784e0 | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 109 | |
| 110 | #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ |
| 111 | "jtag " |
| 112 | |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 113 | #define BOOT_TARGET_DEVICES_USB_DFU(func) \ |
| 114 | func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) |
| 115 | |
| 116 | #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ |
| 117 | "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ |
| 118 | "$scriptaddr $script_size_f && " \ |
| 119 | "dfu " #instance " ram " #instance " 60 && " \ |
| 120 | "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ |
| 121 | "source ${scriptaddr}; " \ |
| 122 | "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" |
| 123 | |
| 124 | #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ |
| 125 | "" |
| 126 | |
| 127 | #define BOOT_TARGET_DEVICES_USB_THOR(func) \ |
| 128 | func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) |
T Karthik Reddy | facca9a | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 129 | |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 130 | #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ |
| 131 | "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ |
| 132 | "$scriptaddr $script_size_f && " \ |
| 133 | "thordown " #instance " ram " #instance " && " \ |
| 134 | "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ |
Michal Simek | f964751 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 135 | "source ${scriptaddr}; " \ |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 136 | "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" |
T Karthik Reddy | facca9a | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 137 | |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 138 | #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ |
| 139 | "" |
T Karthik Reddy | facca9a | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 140 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 141 | #define BOOT_TARGET_DEVICES(func) \ |
Siva Durga Prasad Paladugu | 00784e0 | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 142 | BOOT_TARGET_DEVICES_JTAG(func) \ |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 143 | BOOT_TARGET_DEVICES_MMC(func) \ |
| 144 | BOOT_TARGET_DEVICES_XSPI(func) \ |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 145 | BOOT_TARGET_DEVICES_USB_DFU(func) \ |
| 146 | BOOT_TARGET_DEVICES_USB_THOR(func) \ |
Michal Simek | 788cdae | 2020-09-16 10:14:01 +0200 | [diff] [blame] | 147 | BOOT_TARGET_DEVICES_PXE(func) \ |
| 148 | BOOT_TARGET_DEVICES_DHCP(func) |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 149 | |
| 150 | #include <config_distro_bootcmd.h> |
| 151 | |
| 152 | /* Initial environment variables */ |
| 153 | #ifndef CONFIG_EXTRA_ENV_SETTINGS |
| 154 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 155 | ENV_MEM_LAYOUT_SETTINGS \ |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 156 | BOOTENV |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 157 | #endif |
| 158 | |
| 159 | #endif /* __XILINX_VERSAL_H */ |