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