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