Michal Simek | ec48b6c | 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 | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 21 | |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 22 | #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE |
| 23 | |
| 24 | /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */ |
| 25 | #if CONFIG_COUNTER_FREQUENCY |
| 26 | # define COUNTER_FREQUENCY CONFIG_COUNTER_FREQUENCY |
| 27 | #endif |
| 28 | |
| 29 | /* Serial setup */ |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 30 | #define CONFIG_CPU_ARMV8 |
| 31 | |
| 32 | #define CONFIG_SYS_BAUDRATE_TABLE \ |
| 33 | { 4800, 9600, 19200, 38400, 57600, 115200 } |
| 34 | |
| 35 | /* BOOTP options */ |
| 36 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 37 | #define CONFIG_BOOTP_MAY_FAIL |
| 38 | |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 39 | /* Miscellaneous configurable options */ |
| 40 | #define CONFIG_SYS_LOAD_ADDR 0x8000000 |
| 41 | |
| 42 | /* Monitor Command Prompt */ |
| 43 | /* Console I/O Buffer Size */ |
| 44 | #define CONFIG_SYS_CBSIZE 2048 |
| 45 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 46 | sizeof(CONFIG_SYS_PROMPT) + 16) |
| 47 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 48 | #define CONFIG_SYS_MAXARGS 64 |
| 49 | |
Siva Durga Prasad Paladugu | 37d5318 | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 50 | #if defined(CONFIG_CMD_DFU) |
| 51 | #define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000 |
| 52 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
| 53 | #define CONFIG_THOR_RESET_OFF |
| 54 | #define DFU_ALT_INFO_RAM \ |
| 55 | "dfu_ram_info=" \ |
| 56 | "setenv dfu_alt_info " \ |
| 57 | "Image ram $kernel_addr_r $kernel_size_r\\\\;" \ |
| 58 | "system.dtb ram $fdt_addr_r $fdt_size_r\0" \ |
| 59 | "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ |
| 60 | "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" |
| 61 | |
| 62 | #define DFU_ALT_INFO \ |
| 63 | DFU_ALT_INFO_RAM |
| 64 | #endif |
| 65 | |
| 66 | #if !defined(DFU_ALT_INFO) |
| 67 | # define DFU_ALT_INFO |
| 68 | #endif |
| 69 | |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 70 | /* Ethernet driver */ |
| 71 | #if defined(CONFIG_ZYNQ_GEM) |
| 72 | # define CONFIG_NET_MULTI |
| 73 | # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN |
| 74 | # define PHY_ANEG_TIMEOUT 20000 |
| 75 | #endif |
| 76 | |
| 77 | #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024) |
| 78 | |
| 79 | #define CONFIG_CLOCKS |
| 80 | |
| 81 | #define ENV_MEM_LAYOUT_SETTINGS \ |
| 82 | "fdt_high=10000000\0" \ |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 83 | "fdt_addr_r=0x40000000\0" \ |
Siva Durga Prasad Paladugu | 37d5318 | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 84 | "fdt_size_r=0x400000\0" \ |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 85 | "pxefile_addr_r=0x10000000\0" \ |
| 86 | "kernel_addr_r=0x18000000\0" \ |
Siva Durga Prasad Paladugu | 37d5318 | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 87 | "kernel_size_r=0x10000000\0" \ |
Siva Durga Prasad Paladugu | 3d865ac | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 88 | "scriptaddr=0x20000000\0" \ |
Siva Durga Prasad Paladugu | a318b93 | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 89 | "ramdisk_addr_r=0x02100000\0" \ |
Siva Durga Prasad Paladugu | a318b93 | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 90 | "script_size_f=0x80000\0" |
| 91 | |
| 92 | #if defined(CONFIG_MMC_SDHCI_ZYNQ) |
| 93 | # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) |
| 94 | #else |
| 95 | # define BOOT_TARGET_DEVICES_MMC(func) |
| 96 | #endif |
| 97 | |
| 98 | #if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL) |
| 99 | # define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0) |
| 100 | #else |
| 101 | # define BOOT_TARGET_DEVICES_XSPI(func) |
| 102 | #endif |
| 103 | |
| 104 | #define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \ |
| 105 | "bootcmd_xspi0=sf probe 0 0 0 && " \ |
| 106 | "sf read $scriptaddr $script_offset_f $script_size_f && " \ |
Michal Simek | 19d1304 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 107 | "echo XSPI: Trying to boot script at ${scriptaddr} && " \ |
| 108 | "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0" |
Siva Durga Prasad Paladugu | a318b93 | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 109 | |
| 110 | #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \ |
Michal Simek | 0ef8cd3 | 2020-04-16 18:04:43 +0200 | [diff] [blame] | 111 | "xspi0 " |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 112 | |
Siva Durga Prasad Paladugu | 3d865ac | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 113 | #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) |
| 114 | |
| 115 | #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ |
Michal Simek | 19d1304 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 116 | "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \ |
| 117 | "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0" |
Siva Durga Prasad Paladugu | 3d865ac | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 118 | |
| 119 | #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ |
| 120 | "jtag " |
| 121 | |
T Karthik Reddy | f0c16cd | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 122 | #define BOOT_TARGET_DEVICES_DFU_USB(func) func(DFU_USB, dfu_usb, 0) |
| 123 | |
| 124 | #define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \ |
| 125 | "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \ |
Michal Simek | 19d1304 | 2020-04-20 09:17:53 +0200 | [diff] [blame] | 126 | "$script_size_f; dfu 0 ram 0 && " \ |
| 127 | "echo DFU: Trying to boot script at ${scriptaddr} && " \ |
| 128 | "source ${scriptaddr}; " \ |
| 129 | "echo DFU: SCRIPT FAILED: continuing...;\0" |
T Karthik Reddy | f0c16cd | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 130 | |
| 131 | #define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \ |
| 132 | "dfu_usb " |
| 133 | |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 134 | #define BOOT_TARGET_DEVICES(func) \ |
Siva Durga Prasad Paladugu | 3d865ac | 2019-06-25 17:13:14 +0530 | [diff] [blame] | 135 | BOOT_TARGET_DEVICES_JTAG(func) \ |
Siva Durga Prasad Paladugu | a318b93 | 2019-01-31 17:28:13 +0530 | [diff] [blame] | 136 | BOOT_TARGET_DEVICES_MMC(func) \ |
| 137 | BOOT_TARGET_DEVICES_XSPI(func) \ |
T Karthik Reddy | f0c16cd | 2019-07-11 16:07:57 +0530 | [diff] [blame] | 138 | BOOT_TARGET_DEVICES_DFU_USB(func) \ |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 139 | func(PXE, pxe, na) \ |
| 140 | func(DHCP, dhcp, na) |
| 141 | |
| 142 | #include <config_distro_bootcmd.h> |
| 143 | |
| 144 | /* Initial environment variables */ |
| 145 | #ifndef CONFIG_EXTRA_ENV_SETTINGS |
| 146 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 147 | ENV_MEM_LAYOUT_SETTINGS \ |
Siva Durga Prasad Paladugu | 37d5318 | 2019-04-22 14:45:04 +0530 | [diff] [blame] | 148 | BOOTENV \ |
| 149 | DFU_ALT_INFO |
Michal Simek | ec48b6c | 2018-08-22 14:55:27 +0200 | [diff] [blame] | 150 | #endif |
| 151 | |
| 152 | #endif /* __XILINX_VERSAL_H */ |