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