blob: f426127edcff4485a0340e57f90982a270d1ce40 [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
21#define CONFIG_SYS_MEMTEST_SCRATCH 0xfffc0000
22
23#define CONFIG_SYS_MEMTEST_START 0
24#define CONFIG_SYS_MEMTEST_END 1000
25
26#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
27
28/* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
29#if CONFIG_COUNTER_FREQUENCY
30# define COUNTER_FREQUENCY CONFIG_COUNTER_FREQUENCY
31#endif
32
33/* Serial setup */
34#define CONFIG_ARM_DCC
35#define CONFIG_CPU_ARMV8
36
37#define CONFIG_SYS_BAUDRATE_TABLE \
38 { 4800, 9600, 19200, 38400, 57600, 115200 }
39
40/* BOOTP options */
41#define CONFIG_BOOTP_BOOTFILESIZE
42#define CONFIG_BOOTP_MAY_FAIL
43
Michal Simek4b066a12018-08-22 14:55:27 +020044/* Miscellaneous configurable options */
45#define CONFIG_SYS_LOAD_ADDR 0x8000000
46
47/* Monitor Command Prompt */
48/* Console I/O Buffer Size */
49#define CONFIG_SYS_CBSIZE 2048
50#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
51 sizeof(CONFIG_SYS_PROMPT) + 16)
52#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
53#define CONFIG_SYS_MAXARGS 64
54
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053055#if defined(CONFIG_CMD_DFU)
56#define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000
57#define DFU_DEFAULT_POLL_TIMEOUT 300
58#define CONFIG_THOR_RESET_OFF
59#define DFU_ALT_INFO_RAM \
60 "dfu_ram_info=" \
61 "setenv dfu_alt_info " \
62 "Image ram $kernel_addr_r $kernel_size_r\\\\;" \
63 "system.dtb ram $fdt_addr_r $fdt_size_r\0" \
64 "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
65 "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
66
67#define DFU_ALT_INFO \
68 DFU_ALT_INFO_RAM
69#endif
70
71#if !defined(DFU_ALT_INFO)
72# define DFU_ALT_INFO
73#endif
74
Michal Simek4b066a12018-08-22 14:55:27 +020075/* Ethernet driver */
76#if defined(CONFIG_ZYNQ_GEM)
77# define CONFIG_NET_MULTI
78# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
79# define PHY_ANEG_TIMEOUT 20000
80#endif
81
82#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
83
84#define CONFIG_CLOCKS
85
86#define ENV_MEM_LAYOUT_SETTINGS \
87 "fdt_high=10000000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020088 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053089 "fdt_size_r=0x400000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020090 "pxefile_addr_r=0x10000000\0" \
91 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053092 "kernel_size_r=0x10000000\0" \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053093 "scriptaddr=0x20000000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053094 "ramdisk_addr_r=0x02100000\0" \
T Karthik Reddy6217d282019-08-05 16:18:56 +053095 "script_offset_f=0x7F80000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053096 "script_size_f=0x80000\0"
97
98#if defined(CONFIG_MMC_SDHCI_ZYNQ)
99# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
100#else
101# define BOOT_TARGET_DEVICES_MMC(func)
102#endif
103
104#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
105# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
106#else
107# define BOOT_TARGET_DEVICES_XSPI(func)
108#endif
109
110#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
111 "bootcmd_xspi0=sf probe 0 0 0 && " \
112 "sf read $scriptaddr $script_offset_f $script_size_f && " \
113 "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
114
115#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
116 "xspi "
Michal Simek4b066a12018-08-22 14:55:27 +0200117
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530118#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
119
120#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
121 "bootcmd_jtag=source $scriptaddr; echo SCRIPT FAILED: continuing...;\0"
122
123#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
124 "jtag "
125
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530126#define BOOT_TARGET_DEVICES_DFU_USB(func) func(DFU_USB, dfu_usb, 0)
127
128#define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \
129 "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \
130 "$script_size_f; dfu 0 ram 0 && source $scriptaddr; " \
131 "echo SCRIPT FAILED: continuing...;\0"
132
133#define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \
134 "dfu_usb "
135
Michal Simek4b066a12018-08-22 14:55:27 +0200136#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530137 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530138 BOOT_TARGET_DEVICES_MMC(func) \
139 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530140 BOOT_TARGET_DEVICES_DFU_USB(func) \
Michal Simek4b066a12018-08-22 14:55:27 +0200141 func(PXE, pxe, na) \
142 func(DHCP, dhcp, na)
143
144#include <config_distro_bootcmd.h>
145
146/* Initial environment variables */
147#ifndef CONFIG_EXTRA_ENV_SETTINGS
148#define CONFIG_EXTRA_ENV_SETTINGS \
149 ENV_MEM_LAYOUT_SETTINGS \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +0530150 BOOTENV \
151 DFU_ALT_INFO
Michal Simek4b066a12018-08-22 14:55:27 +0200152#endif
153
154#endif /* __XILINX_VERSAL_H */