blob: bc72f5f35ffbea86b4ded20bfa3ee8ccf05e245c [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/* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
14
15/* Generic Interrupt Controller Definitions */
16#define GICD_BASE 0xF9000000
17#define GICR_BASE 0xF9080000
18
Michal Simek4b066a12018-08-22 14:55:27 +020019#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
20
21/* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
22#if CONFIG_COUNTER_FREQUENCY
23# define COUNTER_FREQUENCY CONFIG_COUNTER_FREQUENCY
24#endif
25
26/* Serial setup */
Michal Simek4b066a12018-08-22 14:55:27 +020027#define CONFIG_SYS_BAUDRATE_TABLE \
28 { 4800, 9600, 19200, 38400, 57600, 115200 }
29
30/* BOOTP options */
31#define CONFIG_BOOTP_BOOTFILESIZE
32#define CONFIG_BOOTP_MAY_FAIL
33
Michal Simek4b066a12018-08-22 14:55:27 +020034/* Miscellaneous configurable options */
Michal Simek4b066a12018-08-22 14:55:27 +020035
36/* Monitor Command Prompt */
37/* Console I/O Buffer Size */
38#define CONFIG_SYS_CBSIZE 2048
Michal Simek4b066a12018-08-22 14:55:27 +020039#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
40#define CONFIG_SYS_MAXARGS 64
41
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053042#if defined(CONFIG_CMD_DFU)
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053043#define DFU_DEFAULT_POLL_TIMEOUT 300
44#define CONFIG_THOR_RESET_OFF
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053045#endif
46
Michal Simek4b066a12018-08-22 14:55:27 +020047/* Ethernet driver */
48#if defined(CONFIG_ZYNQ_GEM)
Michal Simek4b066a12018-08-22 14:55:27 +020049# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
50# define PHY_ANEG_TIMEOUT 20000
51#endif
52
53#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
54
55#define CONFIG_CLOCKS
56
57#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simek4b066a12018-08-22 14:55:27 +020058 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053059 "fdt_size_r=0x400000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020060 "pxefile_addr_r=0x10000000\0" \
61 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053062 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothurajua51ca692021-07-12 20:19:04 +053063 "kernel_comp_addr_r=0x30000000\0" \
64 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053065 "scriptaddr=0x20000000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053066 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053067 "script_size_f=0x80000\0"
68
69#if defined(CONFIG_MMC_SDHCI_ZYNQ)
70# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
71#else
72# define BOOT_TARGET_DEVICES_MMC(func)
73#endif
74
Michal Simek788cdae2020-09-16 10:14:01 +020075#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
76# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
77#else
78# define BOOT_TARGET_DEVICES_PXE(func)
79#endif
80
81#if defined(CONFIG_CMD_DHCP)
82# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
83#else
84# define BOOT_TARGET_DEVICES_DHCP(func)
85#endif
86
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053087#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
88# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
89#else
90# define BOOT_TARGET_DEVICES_XSPI(func)
91#endif
92
93#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
94 "bootcmd_xspi0=sf probe 0 0 0 && " \
95 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +020096 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
97 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053098
99#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
Michal Simek3464cd82020-04-16 18:04:43 +0200100 "xspi0 "
Michal Simek4b066a12018-08-22 14:55:27 +0200101
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530102#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
103
104#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simekf9647512020-04-20 09:17:53 +0200105 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
106 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530107
108#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
109 "jtag "
110
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600111#define BOOT_TARGET_DEVICES_USB_DFU(func) \
112 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
113
114#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
115 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
116 "$scriptaddr $script_size_f && " \
117 "dfu " #instance " ram " #instance " 60 && " \
118 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
119 "source ${scriptaddr}; " \
120 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
121
122#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
123 ""
124
125#define BOOT_TARGET_DEVICES_USB_THOR(func) \
126 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530127
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600128#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
129 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
130 "$scriptaddr $script_size_f && " \
131 "thordown " #instance " ram " #instance " && " \
132 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
Michal Simekf9647512020-04-20 09:17:53 +0200133 "source ${scriptaddr}; " \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600134 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530135
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600136#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
137 ""
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530138
Michal Simek4b066a12018-08-22 14:55:27 +0200139#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530140 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530141 BOOT_TARGET_DEVICES_MMC(func) \
142 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600143 BOOT_TARGET_DEVICES_USB_DFU(func) \
144 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simek788cdae2020-09-16 10:14:01 +0200145 BOOT_TARGET_DEVICES_PXE(func) \
146 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simek4b066a12018-08-22 14:55:27 +0200147
148#include <config_distro_bootcmd.h>
149
150/* Initial environment variables */
151#ifndef CONFIG_EXTRA_ENV_SETTINGS
152#define CONFIG_EXTRA_ENV_SETTINGS \
153 ENV_MEM_LAYOUT_SETTINGS \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600154 BOOTENV
Michal Simek4b066a12018-08-22 14:55:27 +0200155#endif
156
157#endif /* __XILINX_VERSAL_H */