blob: da640d6f14dcb02462853794fe9372876f442f8d [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
Michal Simek4b066a12018-08-22 14:55:27 +020022#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 */
30#define CONFIG_ARM_DCC
31#define CONFIG_CPU_ARMV8
32
33#define CONFIG_SYS_BAUDRATE_TABLE \
34 { 4800, 9600, 19200, 38400, 57600, 115200 }
35
36/* BOOTP options */
37#define CONFIG_BOOTP_BOOTFILESIZE
38#define CONFIG_BOOTP_MAY_FAIL
39
Michal Simek4b066a12018-08-22 14:55:27 +020040/* Miscellaneous configurable options */
41#define CONFIG_SYS_LOAD_ADDR 0x8000000
42
43/* Monitor Command Prompt */
44/* Console I/O Buffer Size */
45#define CONFIG_SYS_CBSIZE 2048
46#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
47 sizeof(CONFIG_SYS_PROMPT) + 16)
48#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
49#define CONFIG_SYS_MAXARGS 64
50
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053051#if defined(CONFIG_CMD_DFU)
52#define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000
53#define DFU_DEFAULT_POLL_TIMEOUT 300
54#define CONFIG_THOR_RESET_OFF
55#define DFU_ALT_INFO_RAM \
56 "dfu_ram_info=" \
57 "setenv dfu_alt_info " \
58 "Image ram $kernel_addr_r $kernel_size_r\\\\;" \
59 "system.dtb ram $fdt_addr_r $fdt_size_r\0" \
60 "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
61 "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
62
63#define DFU_ALT_INFO \
64 DFU_ALT_INFO_RAM
65#endif
66
67#if !defined(DFU_ALT_INFO)
68# define DFU_ALT_INFO
69#endif
70
Michal Simek4b066a12018-08-22 14:55:27 +020071/* Ethernet driver */
72#if defined(CONFIG_ZYNQ_GEM)
73# define CONFIG_NET_MULTI
74# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
75# define PHY_ANEG_TIMEOUT 20000
76#endif
77
78#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
79
80#define CONFIG_CLOCKS
81
82#define ENV_MEM_LAYOUT_SETTINGS \
83 "fdt_high=10000000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020084 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053085 "fdt_size_r=0x400000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020086 "pxefile_addr_r=0x10000000\0" \
87 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053088 "kernel_size_r=0x10000000\0" \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053089 "scriptaddr=0x20000000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053090 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053091 "script_size_f=0x80000\0"
92
93#if defined(CONFIG_MMC_SDHCI_ZYNQ)
94# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
95#else
96# define BOOT_TARGET_DEVICES_MMC(func)
97#endif
98
99#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
100# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
101#else
102# define BOOT_TARGET_DEVICES_XSPI(func)
103#endif
104
105#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
106 "bootcmd_xspi0=sf probe 0 0 0 && " \
107 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +0200108 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
109 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530110
111#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
112 "xspi "
Michal Simek4b066a12018-08-22 14:55:27 +0200113
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530114#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
115
116#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simekf9647512020-04-20 09:17:53 +0200117 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
118 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530119
120#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
121 "jtag "
122
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530123#define BOOT_TARGET_DEVICES_DFU_USB(func) func(DFU_USB, dfu_usb, 0)
124
125#define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \
126 "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \
Michal Simekf9647512020-04-20 09:17:53 +0200127 "$script_size_f; dfu 0 ram 0 && " \
128 "echo DFU: Trying to boot script at ${scriptaddr} && " \
129 "source ${scriptaddr}; " \
130 "echo DFU: SCRIPT FAILED: continuing...;\0"
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530131
132#define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \
133 "dfu_usb "
134
Michal Simek4b066a12018-08-22 14:55:27 +0200135#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530136 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530137 BOOT_TARGET_DEVICES_MMC(func) \
138 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530139 BOOT_TARGET_DEVICES_DFU_USB(func) \
Michal Simek4b066a12018-08-22 14:55:27 +0200140 func(PXE, pxe, na) \
141 func(DHCP, dhcp, na)
142
143#include <config_distro_bootcmd.h>
144
145/* Initial environment variables */
146#ifndef CONFIG_EXTRA_ENV_SETTINGS
147#define CONFIG_EXTRA_ENV_SETTINGS \
148 ENV_MEM_LAYOUT_SETTINGS \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +0530149 BOOTENV \
150 DFU_ALT_INFO
Michal Simek4b066a12018-08-22 14:55:27 +0200151#endif
152
153#endif /* __XILINX_VERSAL_H */