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. |
Michal Simek | a8c9436 | 2023-07-10 14:35:49 +0200 | [diff] [blame] | 5 | * Michal Simek <michal.simek@amd.com> |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 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 | /* Serial setup */ |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 18 | #define CFG_SYS_BAUDRATE_TABLE \ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 19 | { 4800, 9600, 19200, 38400, 57600, 115200 } |
| 20 | |
Sughosh Ganu | ccb3646 | 2022-04-15 11:29:34 +0530 | [diff] [blame] | 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) |
| 25 | |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 26 | #if defined(CONFIG_CMD_DFU) |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 27 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 28 | #endif |
| 29 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 30 | /* Ethernet driver */ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 31 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 32 | #define ENV_MEM_LAYOUT_SETTINGS \ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 33 | "fdt_addr_r=0x40000000\0" \ |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 34 | "fdt_size_r=0x400000\0" \ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 35 | "pxefile_addr_r=0x10000000\0" \ |
| 36 | "kernel_addr_r=0x18000000\0" \ |
Siva Durga Prasad Paladugu | c049dda | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 37 | "kernel_size_r=0x10000000\0" \ |
Raju Kumar Pothuraju | a51ca69 | 2021-07-12 20:19:04 +0530 | [diff] [blame] | 38 | "kernel_comp_addr_r=0x30000000\0" \ |
| 39 | "kernel_comp_size=0x3C00000\0" \ |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 40 | "ramdisk_addr_r=0x02100000\0" \ |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 41 | "script_size_f=0x80000\0" |
| 42 | |
Michal Simek | b163476 | 2023-09-05 13:30:07 +0200 | [diff] [blame] | 43 | #if defined(CONFIG_DISTRO_DEFAULTS) |
| 44 | |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 45 | #if defined(CONFIG_MMC_SDHCI_ZYNQ) |
| 46 | # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) |
| 47 | #else |
| 48 | # define BOOT_TARGET_DEVICES_MMC(func) |
| 49 | #endif |
| 50 | |
Michal Simek | a2098d2 | 2024-09-30 13:03:53 +0200 | [diff] [blame] | 51 | #if defined(CONFIG_USB_STORAGE) |
| 52 | # define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) |
| 53 | #else |
| 54 | # define BOOT_TARGET_DEVICES_USB(func) |
| 55 | #endif |
| 56 | |
Michal Simek | 788cdae | 2020-09-16 10:14:01 +0200 | [diff] [blame] | 57 | #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) |
| 58 | # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) |
| 59 | #else |
| 60 | # define BOOT_TARGET_DEVICES_PXE(func) |
| 61 | #endif |
| 62 | |
| 63 | #if defined(CONFIG_CMD_DHCP) |
| 64 | # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na) |
| 65 | #else |
| 66 | # define BOOT_TARGET_DEVICES_DHCP(func) |
| 67 | #endif |
| 68 | |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 69 | #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL) |
| 70 | # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0) |
| 71 | #else |
| 72 | # define BOOT_TARGET_DEVICES_XSPI(func) |
| 73 | #endif |
| 74 | |
| 75 | #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \ |
| 76 | "bootcmd_xspi0=sf probe 0 0 0 && " \ |
| 77 | "sf read $scriptaddr $script_offset_f $script_size_f && " \ |
Michal Simek | f964751 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 78 | "echo XSPI: Trying to boot script at ${scriptaddr} && " \ |
| 79 | "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0" |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 80 | |
| 81 | #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \ |
Michal Simek | 3464cd8 | 2020-04-16 18:04:43 +0200 | [diff] [blame] | 82 | "xspi0 " |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 83 | |
Siva Durga Prasad Paladugu | 00784e0 | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 84 | #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) |
| 85 | |
| 86 | #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ |
Michal Simek | f964751 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 87 | "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \ |
| 88 | "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0" |
Siva Durga Prasad Paladugu | 00784e0 | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 89 | |
| 90 | #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ |
| 91 | "jtag " |
| 92 | |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 93 | #define BOOT_TARGET_DEVICES_USB_DFU(func) \ |
Michal Simek | f0e07fd | 2024-09-30 13:03:52 +0200 | [diff] [blame] | 94 | func(USB_DFU, usb_dfu, 0) |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 95 | |
| 96 | #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ |
| 97 | "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ |
| 98 | "$scriptaddr $script_size_f && " \ |
| 99 | "dfu " #instance " ram " #instance " 60 && " \ |
| 100 | "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ |
| 101 | "source ${scriptaddr}; " \ |
| 102 | "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" |
| 103 | |
| 104 | #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ |
| 105 | "" |
| 106 | |
| 107 | #define BOOT_TARGET_DEVICES_USB_THOR(func) \ |
Michal Simek | f0e07fd | 2024-09-30 13:03:52 +0200 | [diff] [blame] | 108 | func(USB_THOR, usb_thor, 0) |
T Karthik Reddy | facca9a | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 109 | |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 110 | #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ |
| 111 | "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ |
| 112 | "$scriptaddr $script_size_f && " \ |
| 113 | "thordown " #instance " ram " #instance " && " \ |
| 114 | "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ |
Michal Simek | f964751 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 115 | "source ${scriptaddr}; " \ |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 116 | "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" |
T Karthik Reddy | facca9a | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 117 | |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 118 | #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ |
| 119 | "" |
T Karthik Reddy | facca9a | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 120 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 121 | #define BOOT_TARGET_DEVICES(func) \ |
Siva Durga Prasad Paladugu | 00784e0 | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 122 | BOOT_TARGET_DEVICES_JTAG(func) \ |
Siva Durga Prasad Paladugu | 6056ceb | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 123 | BOOT_TARGET_DEVICES_MMC(func) \ |
| 124 | BOOT_TARGET_DEVICES_XSPI(func) \ |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 125 | BOOT_TARGET_DEVICES_USB_DFU(func) \ |
| 126 | BOOT_TARGET_DEVICES_USB_THOR(func) \ |
Michal Simek | a2098d2 | 2024-09-30 13:03:53 +0200 | [diff] [blame] | 127 | BOOT_TARGET_DEVICES_USB(func) \ |
Michal Simek | 788cdae | 2020-09-16 10:14:01 +0200 | [diff] [blame] | 128 | BOOT_TARGET_DEVICES_PXE(func) \ |
| 129 | BOOT_TARGET_DEVICES_DHCP(func) |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 130 | |
| 131 | #include <config_distro_bootcmd.h> |
| 132 | |
Michal Simek | b163476 | 2023-09-05 13:30:07 +0200 | [diff] [blame] | 133 | #else /* CONFIG_DISTRO_DEFAULTS */ |
| 134 | # define BOOTENV |
| 135 | #endif /* CONFIG_DISTRO_DEFAULTS */ |
| 136 | |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 137 | /* Initial environment variables */ |
Tom Rini | c9edebe | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 138 | #ifndef CFG_EXTRA_ENV_SETTINGS |
| 139 | #define CFG_EXTRA_ENV_SETTINGS \ |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 140 | ENV_MEM_LAYOUT_SETTINGS \ |
T Karthik Reddy | 1104faf | 2021-03-30 23:24:57 -0600 | [diff] [blame] | 141 | BOOTENV |
Michal Simek | 4b066a1 | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 142 | #endif |
| 143 | |
| 144 | #endif /* __XILINX_VERSAL_H */ |