blob: b78c2429489a58f12c32189bf1a855bfe989e4d0 [file] [log] [blame]
Michal Simek4b066a12018-08-22 14:55:27 +02001/* 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 Simek4b066a12018-08-22 14:55:27 +020013/* Generic Interrupt Controller Definitions */
14#define GICD_BASE 0xF9000000
15#define GICR_BASE 0xF9080000
16
Michal Simek4b066a12018-08-22 14:55:27 +020017#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
18
Michal Simek4b066a12018-08-22 14:55:27 +020019/* Serial setup */
Michal Simek4b066a12018-08-22 14:55:27 +020020#define CONFIG_SYS_BAUDRATE_TABLE \
21 { 4800, 9600, 19200, 38400, 57600, 115200 }
22
Sughosh Ganuccb36462022-04-15 11:29:34 +053023/* GUID for capsule updatable firmware image */
24#define XILINX_BOOT_IMAGE_GUID \
25 EFI_GUID(0x20c5fba5, 0x0171, 0x457f, 0xb9, 0xcd, \
26 0xf5, 0x12, 0x9c, 0xd0, 0x72, 0x28)
27
Michal Simek4b066a12018-08-22 14:55:27 +020028/* Miscellaneous configurable options */
Michal Simek4b066a12018-08-22 14:55:27 +020029
30/* Monitor Command Prompt */
31/* Console I/O Buffer Size */
32#define CONFIG_SYS_CBSIZE 2048
Michal Simek4b066a12018-08-22 14:55:27 +020033#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
34#define CONFIG_SYS_MAXARGS 64
35
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053036#if defined(CONFIG_CMD_DFU)
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053037#define DFU_DEFAULT_POLL_TIMEOUT 300
38#define CONFIG_THOR_RESET_OFF
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053039#endif
40
Michal Simek4b066a12018-08-22 14:55:27 +020041/* Ethernet driver */
42#if defined(CONFIG_ZYNQ_GEM)
Michal Simek4b066a12018-08-22 14:55:27 +020043# define PHY_ANEG_TIMEOUT 20000
44#endif
45
Michal Simekf8514e02022-03-29 12:54:41 +020046#define CONFIG_SYS_BOOTM_LEN (100 * 1024 * 1024)
Michal Simek4b066a12018-08-22 14:55:27 +020047
Michal Simek4b066a12018-08-22 14:55:27 +020048#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simek4b066a12018-08-22 14:55:27 +020049 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053050 "fdt_size_r=0x400000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020051 "pxefile_addr_r=0x10000000\0" \
52 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053053 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothurajua51ca692021-07-12 20:19:04 +053054 "kernel_comp_addr_r=0x30000000\0" \
55 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053056 "scriptaddr=0x20000000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053057 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053058 "script_size_f=0x80000\0"
59
60#if defined(CONFIG_MMC_SDHCI_ZYNQ)
61# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
62#else
63# define BOOT_TARGET_DEVICES_MMC(func)
64#endif
65
Michal Simek788cdae2020-09-16 10:14:01 +020066#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
67# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
68#else
69# define BOOT_TARGET_DEVICES_PXE(func)
70#endif
71
72#if defined(CONFIG_CMD_DHCP)
73# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
74#else
75# define BOOT_TARGET_DEVICES_DHCP(func)
76#endif
77
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053078#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
79# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
80#else
81# define BOOT_TARGET_DEVICES_XSPI(func)
82#endif
83
84#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
85 "bootcmd_xspi0=sf probe 0 0 0 && " \
86 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +020087 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
88 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053089
90#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
Michal Simek3464cd82020-04-16 18:04:43 +020091 "xspi0 "
Michal Simek4b066a12018-08-22 14:55:27 +020092
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053093#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
94
95#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simekf9647512020-04-20 09:17:53 +020096 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
97 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053098
99#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
100 "jtag "
101
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600102#define BOOT_TARGET_DEVICES_USB_DFU(func) \
103 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
104
105#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
106 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
107 "$scriptaddr $script_size_f && " \
108 "dfu " #instance " ram " #instance " 60 && " \
109 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
110 "source ${scriptaddr}; " \
111 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
112
113#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
114 ""
115
116#define BOOT_TARGET_DEVICES_USB_THOR(func) \
117 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530118
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600119#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
120 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
121 "$scriptaddr $script_size_f && " \
122 "thordown " #instance " ram " #instance " && " \
123 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
Michal Simekf9647512020-04-20 09:17:53 +0200124 "source ${scriptaddr}; " \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600125 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530126
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600127#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
128 ""
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530129
Michal Simek4b066a12018-08-22 14:55:27 +0200130#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530131 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530132 BOOT_TARGET_DEVICES_MMC(func) \
133 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600134 BOOT_TARGET_DEVICES_USB_DFU(func) \
135 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simek788cdae2020-09-16 10:14:01 +0200136 BOOT_TARGET_DEVICES_PXE(func) \
137 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simek4b066a12018-08-22 14:55:27 +0200138
139#include <config_distro_bootcmd.h>
140
141/* Initial environment variables */
142#ifndef CONFIG_EXTRA_ENV_SETTINGS
143#define CONFIG_EXTRA_ENV_SETTINGS \
144 ENV_MEM_LAYOUT_SETTINGS \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600145 BOOTENV
Michal Simek4b066a12018-08-22 14:55:27 +0200146#endif
147
148#endif /* __XILINX_VERSAL_H */