blob: 43486457a45d52b0e017149461f302389c62e024 [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_CPU_ARMV8
30
31#define CONFIG_SYS_BAUDRATE_TABLE \
32 { 4800, 9600, 19200, 38400, 57600, 115200 }
33
34/* BOOTP options */
35#define CONFIG_BOOTP_BOOTFILESIZE
36#define CONFIG_BOOTP_MAY_FAIL
37
Michal Simek4b066a12018-08-22 14:55:27 +020038/* Miscellaneous configurable options */
Michal Simek4b066a12018-08-22 14:55:27 +020039
40/* Monitor Command Prompt */
41/* Console I/O Buffer Size */
42#define CONFIG_SYS_CBSIZE 2048
Michal Simek4b066a12018-08-22 14:55:27 +020043#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
44#define CONFIG_SYS_MAXARGS 64
45
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053046#if defined(CONFIG_CMD_DFU)
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053047#define DFU_DEFAULT_POLL_TIMEOUT 300
48#define CONFIG_THOR_RESET_OFF
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053049#endif
50
Michal Simek4b066a12018-08-22 14:55:27 +020051/* Ethernet driver */
52#if defined(CONFIG_ZYNQ_GEM)
Michal Simek4b066a12018-08-22 14:55:27 +020053# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
54# define PHY_ANEG_TIMEOUT 20000
55#endif
56
57#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
58
59#define CONFIG_CLOCKS
60
61#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simek4b066a12018-08-22 14:55:27 +020062 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053063 "fdt_size_r=0x400000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020064 "pxefile_addr_r=0x10000000\0" \
65 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053066 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothurajua51ca692021-07-12 20:19:04 +053067 "kernel_comp_addr_r=0x30000000\0" \
68 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053069 "scriptaddr=0x20000000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053070 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053071 "script_size_f=0x80000\0"
72
73#if defined(CONFIG_MMC_SDHCI_ZYNQ)
74# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
75#else
76# define BOOT_TARGET_DEVICES_MMC(func)
77#endif
78
Michal Simek788cdae2020-09-16 10:14:01 +020079#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
80# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
81#else
82# define BOOT_TARGET_DEVICES_PXE(func)
83#endif
84
85#if defined(CONFIG_CMD_DHCP)
86# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
87#else
88# define BOOT_TARGET_DEVICES_DHCP(func)
89#endif
90
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053091#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
92# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
93#else
94# define BOOT_TARGET_DEVICES_XSPI(func)
95#endif
96
97#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
98 "bootcmd_xspi0=sf probe 0 0 0 && " \
99 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +0200100 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
101 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530102
103#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
Michal Simek3464cd82020-04-16 18:04:43 +0200104 "xspi0 "
Michal Simek4b066a12018-08-22 14:55:27 +0200105
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530106#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
107
108#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simekf9647512020-04-20 09:17:53 +0200109 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
110 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530111
112#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
113 "jtag "
114
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600115#define BOOT_TARGET_DEVICES_USB_DFU(func) \
116 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
117
118#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
119 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
120 "$scriptaddr $script_size_f && " \
121 "dfu " #instance " ram " #instance " 60 && " \
122 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
123 "source ${scriptaddr}; " \
124 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
125
126#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
127 ""
128
129#define BOOT_TARGET_DEVICES_USB_THOR(func) \
130 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530131
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600132#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
133 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
134 "$scriptaddr $script_size_f && " \
135 "thordown " #instance " ram " #instance " && " \
136 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
Michal Simekf9647512020-04-20 09:17:53 +0200137 "source ${scriptaddr}; " \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600138 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530139
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600140#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
141 ""
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530142
Michal Simek4b066a12018-08-22 14:55:27 +0200143#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530144 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530145 BOOT_TARGET_DEVICES_MMC(func) \
146 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600147 BOOT_TARGET_DEVICES_USB_DFU(func) \
148 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simek788cdae2020-09-16 10:14:01 +0200149 BOOT_TARGET_DEVICES_PXE(func) \
150 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simek4b066a12018-08-22 14:55:27 +0200151
152#include <config_distro_bootcmd.h>
153
154/* Initial environment variables */
155#ifndef CONFIG_EXTRA_ENV_SETTINGS
156#define CONFIG_EXTRA_ENV_SETTINGS \
157 ENV_MEM_LAYOUT_SETTINGS \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600158 BOOTENV
Michal Simek4b066a12018-08-22 14:55:27 +0200159#endif
160
161#endif /* __XILINX_VERSAL_H */