blob: 03539a41b49f36f53543f203c562f85a71346008 [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
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 Simek4b066a12018-08-22 14:55:27 +020021#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
22
23/* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
24#if CONFIG_COUNTER_FREQUENCY
25# define COUNTER_FREQUENCY CONFIG_COUNTER_FREQUENCY
26#endif
27
28/* Serial setup */
Michal Simek4b066a12018-08-22 14:55:27 +020029#define CONFIG_SYS_BAUDRATE_TABLE \
30 { 4800, 9600, 19200, 38400, 57600, 115200 }
31
32/* BOOTP options */
33#define CONFIG_BOOTP_BOOTFILESIZE
34#define CONFIG_BOOTP_MAY_FAIL
35
Michal Simek4b066a12018-08-22 14:55:27 +020036/* Miscellaneous configurable options */
Michal Simek4b066a12018-08-22 14:55:27 +020037
38/* Monitor Command Prompt */
39/* Console I/O Buffer Size */
40#define CONFIG_SYS_CBSIZE 2048
Michal Simek4b066a12018-08-22 14:55:27 +020041#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
42#define CONFIG_SYS_MAXARGS 64
43
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053044#if defined(CONFIG_CMD_DFU)
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053045#define DFU_DEFAULT_POLL_TIMEOUT 300
46#define CONFIG_THOR_RESET_OFF
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053047#endif
48
Michal Simek4b066a12018-08-22 14:55:27 +020049/* Ethernet driver */
50#if defined(CONFIG_ZYNQ_GEM)
Michal Simek4b066a12018-08-22 14:55:27 +020051# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
52# define PHY_ANEG_TIMEOUT 20000
53#endif
54
55#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
56
57#define CONFIG_CLOCKS
58
59#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simek4b066a12018-08-22 14:55:27 +020060 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053061 "fdt_size_r=0x400000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020062 "pxefile_addr_r=0x10000000\0" \
63 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053064 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothurajua51ca692021-07-12 20:19:04 +053065 "kernel_comp_addr_r=0x30000000\0" \
66 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053067 "scriptaddr=0x20000000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053068 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053069 "script_size_f=0x80000\0"
70
71#if defined(CONFIG_MMC_SDHCI_ZYNQ)
72# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
73#else
74# define BOOT_TARGET_DEVICES_MMC(func)
75#endif
76
Michal Simek788cdae2020-09-16 10:14:01 +020077#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
78# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
79#else
80# define BOOT_TARGET_DEVICES_PXE(func)
81#endif
82
83#if defined(CONFIG_CMD_DHCP)
84# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
85#else
86# define BOOT_TARGET_DEVICES_DHCP(func)
87#endif
88
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053089#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
90# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
91#else
92# define BOOT_TARGET_DEVICES_XSPI(func)
93#endif
94
95#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
96 "bootcmd_xspi0=sf probe 0 0 0 && " \
97 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +020098 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
99 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530100
101#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
Michal Simek3464cd82020-04-16 18:04:43 +0200102 "xspi0 "
Michal Simek4b066a12018-08-22 14:55:27 +0200103
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530104#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
105
106#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simekf9647512020-04-20 09:17:53 +0200107 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
108 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530109
110#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
111 "jtag "
112
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600113#define BOOT_TARGET_DEVICES_USB_DFU(func) \
114 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
115
116#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
117 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
118 "$scriptaddr $script_size_f && " \
119 "dfu " #instance " ram " #instance " 60 && " \
120 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
121 "source ${scriptaddr}; " \
122 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
123
124#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
125 ""
126
127#define BOOT_TARGET_DEVICES_USB_THOR(func) \
128 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530129
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600130#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
131 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
132 "$scriptaddr $script_size_f && " \
133 "thordown " #instance " ram " #instance " && " \
134 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
Michal Simekf9647512020-04-20 09:17:53 +0200135 "source ${scriptaddr}; " \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600136 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530137
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600138#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
139 ""
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530140
Michal Simek4b066a12018-08-22 14:55:27 +0200141#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530142 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530143 BOOT_TARGET_DEVICES_MMC(func) \
144 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600145 BOOT_TARGET_DEVICES_USB_DFU(func) \
146 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simek788cdae2020-09-16 10:14:01 +0200147 BOOT_TARGET_DEVICES_PXE(func) \
148 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simek4b066a12018-08-22 14:55:27 +0200149
150#include <config_distro_bootcmd.h>
151
152/* Initial environment variables */
153#ifndef CONFIG_EXTRA_ENV_SETTINGS
154#define CONFIG_EXTRA_ENV_SETTINGS \
155 ENV_MEM_LAYOUT_SETTINGS \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600156 BOOTENV
Michal Simek4b066a12018-08-22 14:55:27 +0200157#endif
158
159#endif /* __XILINX_VERSAL_H */