Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Configuration for Xilinx Versal NET |
| 4 | * Copyright (C) 2016 - 2022, Xilinx, Inc. |
| 5 | * Copyright (C) 2022, Advanced Micro Devices, Inc. |
| 6 | * |
| 7 | * Michal Simek <michal.simek@amd.com> |
| 8 | * |
| 9 | * Based on Configuration for Xilinx ZynqMP |
| 10 | */ |
| 11 | |
| 12 | #ifndef __XILINX_VERSAL_NET_H |
| 13 | #define __XILINX_VERSAL_NET_H |
| 14 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 15 | /* FIXME this is causing issue at least on IPP */ |
| 16 | /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */ |
| 17 | |
| 18 | /* Generic Interrupt Controller Definitions */ |
Michal Simek | 96b7449 | 2024-02-06 12:51:39 +0100 | [diff] [blame] | 19 | #define GICD_BASE 0xe2000000 |
| 20 | #define GICR_BASE 0xe2060000 |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 21 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 22 | /* Serial setup */ |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 23 | #define CFG_SYS_BAUDRATE_TABLE \ |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 24 | { 4800, 9600, 19200, 38400, 57600, 115200 } |
| 25 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 26 | #if defined(CONFIG_CMD_DFU) |
| 27 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 28 | #define DFU_ALT_INFO_RAM \ |
| 29 | "dfu_ram_info=" \ |
| 30 | "setenv dfu_alt_info " \ |
| 31 | "Image ram 80000 $kernel_size_r\\\\;" \ |
| 32 | "system.dtb ram $fdt_addr_r $fdt_size_r\0" \ |
| 33 | "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ |
| 34 | "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" |
| 35 | |
| 36 | #define DFU_ALT_INFO \ |
| 37 | DFU_ALT_INFO_RAM |
| 38 | #endif |
| 39 | |
| 40 | #if !defined(DFU_ALT_INFO) |
| 41 | # define DFU_ALT_INFO |
| 42 | #endif |
| 43 | |
| 44 | /* Ethernet driver */ |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 45 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 46 | #define ENV_MEM_LAYOUT_SETTINGS \ |
| 47 | "fdt_addr_r=0x40000000\0" \ |
| 48 | "fdt_size_r=0x400000\0" \ |
| 49 | "pxefile_addr_r=0x10000000\0" \ |
| 50 | "kernel_addr_r=0x18000000\0" \ |
| 51 | "kernel_size_r=0x10000000\0" \ |
Michal Simek | 59e49c3 | 2022-09-19 14:21:09 +0200 | [diff] [blame] | 52 | "kernel_comp_addr_r=0x30000000\0" \ |
| 53 | "kernel_comp_size=0x3C00000\0" \ |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 54 | "ramdisk_addr_r=0x02100000\0" \ |
| 55 | "script_size_f=0x80000\0" |
| 56 | |
Michal Simek | b163476 | 2023-09-05 13:30:07 +0200 | [diff] [blame] | 57 | #if defined(CONFIG_DISTRO_DEFAULTS) |
| 58 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 59 | #if defined(CONFIG_MMC_SDHCI_ZYNQ) |
| 60 | # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) |
| 61 | #else |
| 62 | # define BOOT_TARGET_DEVICES_MMC(func) |
| 63 | #endif |
| 64 | |
| 65 | #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) |
| 66 | # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) |
| 67 | #else |
| 68 | # define BOOT_TARGET_DEVICES_PXE(func) |
| 69 | #endif |
| 70 | |
| 71 | #if defined(CONFIG_CMD_DHCP) |
| 72 | # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na) |
| 73 | #else |
| 74 | # define BOOT_TARGET_DEVICES_DHCP(func) |
| 75 | #endif |
| 76 | |
Ashok Reddy Soma | 4c16d32 | 2023-06-14 03:30:58 -0600 | [diff] [blame] | 77 | #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL) |
| 78 | # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0) func(XSPI, xspi, 1) |
| 79 | # define BOOTENV_DEV_SHARED_XSPI \ |
| 80 | "xspi_boot=sf probe $devnum_xspi:0 0 0 && " \ |
| 81 | "sf read $scriptaddr $script_offset_f $script_size_f && " \ |
| 82 | "echo XSPI: Trying to boot script at ${scriptaddr} && " \ |
| 83 | "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0" |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 84 | #else |
| 85 | # define BOOT_TARGET_DEVICES_XSPI(func) |
Ashok Reddy Soma | 4c16d32 | 2023-06-14 03:30:58 -0600 | [diff] [blame] | 86 | # define BOOTENV_DEV_SHARED_XSPI |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 87 | #endif |
| 88 | |
| 89 | #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \ |
Ashok Reddy Soma | 4c16d32 | 2023-06-14 03:30:58 -0600 | [diff] [blame] | 90 | "bootcmd_" #devtypel #instance "=" \ |
| 91 | "devnum_xspi=" #instance "; run " #devtypel "_boot\0" \ |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 92 | |
| 93 | #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \ |
Ashok Reddy Soma | 4c16d32 | 2023-06-14 03:30:58 -0600 | [diff] [blame] | 94 | "" |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 95 | |
| 96 | #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) |
| 97 | |
| 98 | #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ |
| 99 | "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \ |
| 100 | "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0" |
| 101 | |
| 102 | #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ |
| 103 | "jtag " |
| 104 | |
| 105 | #define BOOT_TARGET_DEVICES_DFU_USB(func) func(DFU_USB, dfu_usb, 0) |
| 106 | |
| 107 | #define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \ |
| 108 | "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \ |
| 109 | "$script_size_f; dfu 0 ram 0 && " \ |
| 110 | "echo DFU: Trying to boot script at ${scriptaddr} && " \ |
| 111 | "source ${scriptaddr}; " \ |
| 112 | "echo DFU: SCRIPT FAILED: continuing...;\0" |
| 113 | |
| 114 | #define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \ |
| 115 | "" |
| 116 | |
| 117 | #define BOOT_TARGET_DEVICES(func) \ |
| 118 | BOOT_TARGET_DEVICES_JTAG(func) \ |
| 119 | BOOT_TARGET_DEVICES_MMC(func) \ |
| 120 | BOOT_TARGET_DEVICES_XSPI(func) \ |
| 121 | BOOT_TARGET_DEVICES_DFU_USB(func) \ |
| 122 | BOOT_TARGET_DEVICES_PXE(func) \ |
| 123 | BOOT_TARGET_DEVICES_DHCP(func) |
| 124 | |
| 125 | #include <config_distro_bootcmd.h> |
| 126 | |
Michal Simek | b163476 | 2023-09-05 13:30:07 +0200 | [diff] [blame] | 127 | #else /* CONFIG_DISTRO_DEFAULTS */ |
| 128 | # define BOOTENV |
| 129 | #endif /* CONFIG_DISTRO_DEFAULTS */ |
| 130 | |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 131 | /* Initial environment variables */ |
Tom Rini | c9edebe | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 132 | #ifndef CFG_EXTRA_ENV_SETTINGS |
| 133 | #define CFG_EXTRA_ENV_SETTINGS \ |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 134 | ENV_MEM_LAYOUT_SETTINGS \ |
| 135 | BOOTENV \ |
Ashok Reddy Soma | 4c16d32 | 2023-06-14 03:30:58 -0600 | [diff] [blame] | 136 | BOOTENV_DEV_SHARED_XSPI \ |
Michal Simek | 2e53eb2 | 2022-09-19 14:21:02 +0200 | [diff] [blame] | 137 | DFU_ALT_INFO |
| 138 | #endif |
| 139 | |
| 140 | #endif /* __XILINX_VERSAL_NET_H */ |