blob: 37bdb214629d6068ebc4b9b767b36ebc851f845c [file] [log] [blame]
Michal Simekf6aebdf2022-09-19 14:21:02 +02001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Configuration for Xilinx Versal NET
4 * Copyright (C) 2016 - 2022, Xilinx, Inc.
5 * Copyright (C) 2022, Advanced Micro Devices, Inc.
6 *
7 * Michal Simek <michal.simek@amd.com>
8 *
9 * Based on Configuration for Xilinx ZynqMP
10 */
11
12#ifndef __XILINX_VERSAL_NET_H
13#define __XILINX_VERSAL_NET_H
14
Michal Simekf6aebdf2022-09-19 14:21:02 +020015/* FIXME this is causing issue at least on IPP */
16/* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
17
18/* Generic Interrupt Controller Definitions */
19#define GICD_BASE 0xF9000000
20#define GICR_BASE 0xF9060000
21
Michal Simekf6aebdf2022-09-19 14:21:02 +020022/* Serial setup */
Tom Rini65cc0e22022-11-16 13:10:41 -050023#define CFG_SYS_BAUDRATE_TABLE \
Michal Simekf6aebdf2022-09-19 14:21:02 +020024 { 4800, 9600, 19200, 38400, 57600, 115200 }
25
Michal Simekf6aebdf2022-09-19 14:21:02 +020026#if defined(CONFIG_CMD_DFU)
27#define DFU_DEFAULT_POLL_TIMEOUT 300
Michal Simekf6aebdf2022-09-19 14:21:02 +020028#define DFU_ALT_INFO_RAM \
29 "dfu_ram_info=" \
30 "setenv dfu_alt_info " \
31 "Image ram 80000 $kernel_size_r\\\\;" \
32 "system.dtb ram $fdt_addr_r $fdt_size_r\0" \
33 "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
34 "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
35
36#define DFU_ALT_INFO \
37 DFU_ALT_INFO_RAM
38#endif
39
40#if !defined(DFU_ALT_INFO)
41# define DFU_ALT_INFO
42#endif
43
44/* Ethernet driver */
45#if defined(CONFIG_ZYNQ_GEM)
Michal Simekce40cbd2022-09-19 14:21:09 +020046# define PHY_ANEG_TIMEOUT 20000
Michal Simekf6aebdf2022-09-19 14:21:02 +020047#endif
48
Michal Simekf6aebdf2022-09-19 14:21:02 +020049#define ENV_MEM_LAYOUT_SETTINGS \
50 "fdt_addr_r=0x40000000\0" \
51 "fdt_size_r=0x400000\0" \
52 "pxefile_addr_r=0x10000000\0" \
53 "kernel_addr_r=0x18000000\0" \
54 "kernel_size_r=0x10000000\0" \
Michal Simekce40cbd2022-09-19 14:21:09 +020055 "kernel_comp_addr_r=0x30000000\0" \
56 "kernel_comp_size=0x3C00000\0" \
Michal Simekf6aebdf2022-09-19 14:21:02 +020057 "scriptaddr=0x20000000\0" \
58 "ramdisk_addr_r=0x02100000\0" \
59 "script_size_f=0x80000\0"
60
61#if defined(CONFIG_MMC_SDHCI_ZYNQ)
62# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
63#else
64# define BOOT_TARGET_DEVICES_MMC(func)
65#endif
66
67#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
68# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
69#else
70# define BOOT_TARGET_DEVICES_PXE(func)
71#endif
72
73#if defined(CONFIG_CMD_DHCP)
74# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
75#else
76# define BOOT_TARGET_DEVICES_DHCP(func)
77#endif
78
79#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL_NET)
80# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
81#else
82# define BOOT_TARGET_DEVICES_XSPI(func)
83#endif
84
85#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
86 "bootcmd_xspi0=sf probe 0 0 0 && " \
87 "sf read $scriptaddr $script_offset_f $script_size_f && " \
88 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
89 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
90
91#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
92 "xspi0 "
93
94#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
95
96#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
97 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
98 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
99
100#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
101 "jtag "
102
103#define BOOT_TARGET_DEVICES_DFU_USB(func) func(DFU_USB, dfu_usb, 0)
104
105#define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \
106 "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \
107 "$script_size_f; dfu 0 ram 0 && " \
108 "echo DFU: Trying to boot script at ${scriptaddr} && " \
109 "source ${scriptaddr}; " \
110 "echo DFU: SCRIPT FAILED: continuing...;\0"
111
112#define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \
113 ""
114
115#define BOOT_TARGET_DEVICES(func) \
116 BOOT_TARGET_DEVICES_JTAG(func) \
117 BOOT_TARGET_DEVICES_MMC(func) \
118 BOOT_TARGET_DEVICES_XSPI(func) \
119 BOOT_TARGET_DEVICES_DFU_USB(func) \
120 BOOT_TARGET_DEVICES_PXE(func) \
121 BOOT_TARGET_DEVICES_DHCP(func)
122
123#include <config_distro_bootcmd.h>
124
125/* Initial environment variables */
126#ifndef CONFIG_EXTRA_ENV_SETTINGS
127#define CONFIG_EXTRA_ENV_SETTINGS \
128 ENV_MEM_LAYOUT_SETTINGS \
129 BOOTENV \
130 DFU_ALT_INFO
131#endif
132
133#endif /* __XILINX_VERSAL_NET_H */