blob: b634bb1ab705d1587515775112e63dd9fd89b446 [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.
Michal Simek174d72842023-07-10 14:35:49 +02005 * Michal Simek <michal.simek@amd.com>
Michal Simekec48b6c2018-08-22 14:55:27 +02006 *
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 */
Tom Rini65cc0e22022-11-16 13:10:41 -050018#define CFG_SYS_BAUDRATE_TABLE \
Michal Simekec48b6c2018-08-22 14:55:27 +020019 { 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
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053026#if defined(CONFIG_CMD_DFU)
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053027#define DFU_DEFAULT_POLL_TIMEOUT 300
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053028#endif
29
Michal Simekec48b6c2018-08-22 14:55:27 +020030/* Ethernet driver */
31#if defined(CONFIG_ZYNQ_GEM)
Michal Simekec48b6c2018-08-22 14:55:27 +020032# define PHY_ANEG_TIMEOUT 20000
33#endif
34
Michal Simekec48b6c2018-08-22 14:55:27 +020035#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simekec48b6c2018-08-22 14:55:27 +020036 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053037 "fdt_size_r=0x400000\0" \
Michal Simekec48b6c2018-08-22 14:55:27 +020038 "pxefile_addr_r=0x10000000\0" \
39 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladugu37d53182019-04-22 14:45:04 +053040 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothuraju3965d132021-07-12 20:19:04 +053041 "kernel_comp_addr_r=0x30000000\0" \
42 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053043 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053044 "script_size_f=0x80000\0"
45
Michal Simek6ec17a22023-09-05 13:30:07 +020046#if defined(CONFIG_DISTRO_DEFAULTS)
47
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053048#if defined(CONFIG_MMC_SDHCI_ZYNQ)
49# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
50#else
51# define BOOT_TARGET_DEVICES_MMC(func)
52#endif
53
Michal Simeka2c87cb2020-09-16 10:14:01 +020054#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
55# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
56#else
57# define BOOT_TARGET_DEVICES_PXE(func)
58#endif
59
60#if defined(CONFIG_CMD_DHCP)
61# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
62#else
63# define BOOT_TARGET_DEVICES_DHCP(func)
64#endif
65
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053066#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
67# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
68#else
69# define BOOT_TARGET_DEVICES_XSPI(func)
70#endif
71
72#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
73 "bootcmd_xspi0=sf probe 0 0 0 && " \
74 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simek19d13042020-04-20 09:17:53 +020075 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
76 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +053077
78#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
Michal Simek0ef8cd32020-04-16 18:04:43 +020079 "xspi0 "
Michal Simekec48b6c2018-08-22 14:55:27 +020080
Siva Durga Prasad Paladugu3d865ac2019-06-25 17:13:14 +053081#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
82
83#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simek19d13042020-04-20 09:17:53 +020084 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
85 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu3d865ac2019-06-25 17:13:14 +053086
87#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
88 "jtag "
89
T Karthik Reddy82cb49d2021-03-30 23:24:57 -060090#define BOOT_TARGET_DEVICES_USB_DFU(func) \
91 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
T Karthik Reddyf0c16cd2019-07-11 16:07:57 +053092
T Karthik Reddy82cb49d2021-03-30 23:24:57 -060093#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
94 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
95 "$scriptaddr $script_size_f && " \
96 "dfu " #instance " ram " #instance " 60 && " \
97 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
Michal Simek19d13042020-04-20 09:17:53 +020098 "source ${scriptaddr}; " \
T Karthik Reddy82cb49d2021-03-30 23:24:57 -060099 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
T Karthik Reddyf0c16cd2019-07-11 16:07:57 +0530100
T Karthik Reddy82cb49d2021-03-30 23:24:57 -0600101#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
102 ""
103
104#define BOOT_TARGET_DEVICES_USB_THOR(func) \
105 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
106
107#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
108 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
109 "$scriptaddr $script_size_f && " \
110 "thordown " #instance " ram " #instance " && " \
111 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
112 "source ${scriptaddr}; " \
113 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
114
115#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
116 ""
T Karthik Reddyf0c16cd2019-07-11 16:07:57 +0530117
Michal Simekec48b6c2018-08-22 14:55:27 +0200118#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu3d865ac2019-06-25 17:13:14 +0530119 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugua318b932019-01-31 17:28:13 +0530120 BOOT_TARGET_DEVICES_MMC(func) \
121 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddy82cb49d2021-03-30 23:24:57 -0600122 BOOT_TARGET_DEVICES_USB_DFU(func) \
123 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simeka2c87cb2020-09-16 10:14:01 +0200124 BOOT_TARGET_DEVICES_PXE(func) \
125 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simekec48b6c2018-08-22 14:55:27 +0200126
127#include <config_distro_bootcmd.h>
128
Michal Simek6ec17a22023-09-05 13:30:07 +0200129#else /* CONFIG_DISTRO_DEFAULTS */
130# define BOOTENV
131#endif /* CONFIG_DISTRO_DEFAULTS */
132
Michal Simekec48b6c2018-08-22 14:55:27 +0200133/* Initial environment variables */
Tom Rini0613c362022-12-04 10:03:50 -0500134#ifndef CFG_EXTRA_ENV_SETTINGS
135#define CFG_EXTRA_ENV_SETTINGS \
Michal Simekec48b6c2018-08-22 14:55:27 +0200136 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 */