blob: 971bd69dec8d4f07c9c23197276f7c914f757516 [file] [log] [blame]
Michal Simekec48b6c2018-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 Simekec48b6c2018-08-22 14:55:27 +020013/* Generic Interrupt Controller Definitions */
14#define GICD_BASE 0xF9000000
15#define GICR_BASE 0xF9080000
16
Michal Simekec48b6c2018-08-22 14:55:27 +020017/* Serial setup */
Michal Simekec48b6c2018-08-22 14:55:27 +020018#define CONFIG_SYS_BAUDRATE_TABLE \
19 { 4800, 9600, 19200, 38400, 57600, 115200 }
20
Sughosh Ganu741ef862022-04-15 11:29:34 +053021/* GUID for capsule updatable firmware image */
22#define XILINX_BOOT_IMAGE_GUID \
23 EFI_GUID(0x20c5fba5, 0x0171, 0x457f, 0xb9, 0xcd, \
24 0xf5, 0x12, 0x9c, 0xd0, 0x72, 0x28)
25
Michal Simekec48b6c2018-08-22 14:55:27 +020026/* Miscellaneous configurable options */
Michal Simekec48b6c2018-08-22 14:55:27 +020027
Michal Simekec48b6c2018-08-22 14:55:27 +020028/* Console I/O Buffer Size */
Michal Simekec48b6c2018-08-22 14:55:27 +020029
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053030#if defined(CONFIG_CMD_DFU)
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053031#define DFU_DEFAULT_POLL_TIMEOUT 300
32#define CONFIG_THOR_RESET_OFF
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053033#endif
34
Michal Simekec48b6c2018-08-22 14:55:27 +020035/* Ethernet driver */
36#if defined(CONFIG_ZYNQ_GEM)
Michal Simekec48b6c2018-08-22 14:55:27 +020037# define PHY_ANEG_TIMEOUT 20000
38#endif
39
Michal Simekec48b6c2018-08-22 14:55:27 +020040#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simekec48b6c2018-08-22 14:55:27 +020041 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053042 "fdt_size_r=0x400000\0" \
Michal Simekec48b6c2018-08-22 14:55:27 +020043 "pxefile_addr_r=0x10000000\0" \
44 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053045 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothuraju3965d132021-07-12 20:19:04 +053046 "kernel_comp_addr_r=0x30000000\0" \
47 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugu3d865ac2019-06-25 17:13:14 +053048 "scriptaddr=0x20000000\0" \
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053049 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053050 "script_size_f=0x80000\0"
51
52#if defined(CONFIG_MMC_SDHCI_ZYNQ)
53# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
54#else
55# define BOOT_TARGET_DEVICES_MMC(func)
56#endif
57
Michal Simeka2c87cb2020-09-16 10:14:01 +020058#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
59# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
60#else
61# define BOOT_TARGET_DEVICES_PXE(func)
62#endif
63
64#if defined(CONFIG_CMD_DHCP)
65# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
66#else
67# define BOOT_TARGET_DEVICES_DHCP(func)
68#endif
69
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053070#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
71# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
72#else
73# define BOOT_TARGET_DEVICES_XSPI(func)
74#endif
75
76#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
77 "bootcmd_xspi0=sf probe 0 0 0 && " \
78 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simek19d13042020-04-20 09:17:53 +020079 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
80 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053081
82#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
Michal Simek0ef8cd32020-04-16 18:04:43 +020083 "xspi0 "
Michal Simekec48b6c2018-08-22 14:55:27 +020084
Siva Durga Prasad Paladugu3d865ac2019-06-25 17:13:14 +053085#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
86
87#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simek19d13042020-04-20 09:17:53 +020088 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
89 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu3d865ac2019-06-25 17:13:14 +053090
91#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
92 "jtag "
93
T Karthik Reddy82cb49d2021-03-30 23:24:57 -060094#define BOOT_TARGET_DEVICES_USB_DFU(func) \
95 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
T Karthik Reddyf0c16cd2019-07-11 16:07:57 +053096
T Karthik Reddy82cb49d2021-03-30 23:24:57 -060097#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
98 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
99 "$scriptaddr $script_size_f && " \
100 "dfu " #instance " ram " #instance " 60 && " \
101 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
Michal Simek19d13042020-04-20 09:17:53 +0200102 "source ${scriptaddr}; " \
T Karthik Reddy82cb49d2021-03-30 23:24:57 -0600103 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
T Karthik Reddyf0c16cd2019-07-11 16:07:57 +0530104
T Karthik Reddy82cb49d2021-03-30 23:24:57 -0600105#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
106 ""
107
108#define BOOT_TARGET_DEVICES_USB_THOR(func) \
109 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
110
111#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
112 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
113 "$scriptaddr $script_size_f && " \
114 "thordown " #instance " ram " #instance " && " \
115 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
116 "source ${scriptaddr}; " \
117 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
118
119#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
120 ""
T Karthik Reddyf0c16cd2019-07-11 16:07:57 +0530121
Michal Simekec48b6c2018-08-22 14:55:27 +0200122#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu3d865ac2019-06-25 17:13:14 +0530123 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +0530124 BOOT_TARGET_DEVICES_MMC(func) \
125 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddy82cb49d2021-03-30 23:24:57 -0600126 BOOT_TARGET_DEVICES_USB_DFU(func) \
127 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simeka2c87cb2020-09-16 10:14:01 +0200128 BOOT_TARGET_DEVICES_PXE(func) \
129 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simekec48b6c2018-08-22 14:55:27 +0200130
131#include <config_distro_bootcmd.h>
132
133/* Initial environment variables */
134#ifndef CONFIG_EXTRA_ENV_SETTINGS
135#define CONFIG_EXTRA_ENV_SETTINGS \
136 ENV_MEM_LAYOUT_SETTINGS \
T Karthik Reddy82cb49d2021-03-30 23:24:57 -0600137 BOOTENV
Michal Simekec48b6c2018-08-22 14:55:27 +0200138#endif
139
140#endif /* __XILINX_VERSAL_H */