blob: dc3f41b94a293b14e33b82af1b7556ba401194cc [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.
Michal Simeka8c94362023-07-10 14:35:49 +02005 * Michal Simek <michal.simek@amd.com>
Michal Simek4b066a12018-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 Simek4b066a12018-08-22 14:55:27 +020013/* Generic Interrupt Controller Definitions */
14#define GICD_BASE 0xF9000000
15#define GICR_BASE 0xF9080000
16
Michal Simek4b066a12018-08-22 14:55:27 +020017/* Serial setup */
Tom Rini6a5dccc2022-11-16 13:10:41 -050018#define CFG_SYS_BAUDRATE_TABLE \
Michal Simek4b066a12018-08-22 14:55:27 +020019 { 4800, 9600, 19200, 38400, 57600, 115200 }
20
Sughosh Ganuccb36462022-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 Paladuguc049dda2019-04-22 14:45:04 +053026#if defined(CONFIG_CMD_DFU)
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053027#define DFU_DEFAULT_POLL_TIMEOUT 300
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053028#endif
29
Michal Simek4b066a12018-08-22 14:55:27 +020030/* Ethernet driver */
Michal Simek4b066a12018-08-22 14:55:27 +020031
Michal Simek4b066a12018-08-22 14:55:27 +020032#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simek4b066a12018-08-22 14:55:27 +020033 "fdt_addr_r=0x40000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053034 "fdt_size_r=0x400000\0" \
Michal Simek4b066a12018-08-22 14:55:27 +020035 "pxefile_addr_r=0x10000000\0" \
36 "kernel_addr_r=0x18000000\0" \
Siva Durga Prasad Paladuguc049dda2019-04-22 14:45:04 +053037 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothurajua51ca692021-07-12 20:19:04 +053038 "kernel_comp_addr_r=0x30000000\0" \
39 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053040 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053041 "script_size_f=0x80000\0"
42
Michal Simekb1634762023-09-05 13:30:07 +020043#if defined(CONFIG_DISTRO_DEFAULTS)
44
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053045#if defined(CONFIG_MMC_SDHCI_ZYNQ)
46# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
47#else
48# define BOOT_TARGET_DEVICES_MMC(func)
49#endif
50
Michal Simek788cdae2020-09-16 10:14:01 +020051#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
52# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
53#else
54# define BOOT_TARGET_DEVICES_PXE(func)
55#endif
56
57#if defined(CONFIG_CMD_DHCP)
58# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
59#else
60# define BOOT_TARGET_DEVICES_DHCP(func)
61#endif
62
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053063#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
64# define BOOT_TARGET_DEVICES_XSPI(func) func(XSPI, xspi, 0)
65#else
66# define BOOT_TARGET_DEVICES_XSPI(func)
67#endif
68
69#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
70 "bootcmd_xspi0=sf probe 0 0 0 && " \
71 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +020072 "echo XSPI: Trying to boot script at ${scriptaddr} && " \
73 "source ${scriptaddr}; echo XSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +053074
75#define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \
Michal Simek3464cd82020-04-16 18:04:43 +020076 "xspi0 "
Michal Simek4b066a12018-08-22 14:55:27 +020077
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053078#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
79
80#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simekf9647512020-04-20 09:17:53 +020081 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
82 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +053083
84#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
85 "jtag "
86
T Karthik Reddy1104faf2021-03-30 23:24:57 -060087#define BOOT_TARGET_DEVICES_USB_DFU(func) \
88 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
89
90#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
91 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
92 "$scriptaddr $script_size_f && " \
93 "dfu " #instance " ram " #instance " 60 && " \
94 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
95 "source ${scriptaddr}; " \
96 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
97
98#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
99 ""
100
101#define BOOT_TARGET_DEVICES_USB_THOR(func) \
102 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530103
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600104#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
105 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
106 "$scriptaddr $script_size_f && " \
107 "thordown " #instance " ram " #instance " && " \
108 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
Michal Simekf9647512020-04-20 09:17:53 +0200109 "source ${scriptaddr}; " \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600110 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530111
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600112#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
113 ""
T Karthik Reddyfacca9a2019-07-11 16:07:57 +0530114
Michal Simek4b066a12018-08-22 14:55:27 +0200115#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu00784e02019-06-25 17:13:14 +0530116 BOOT_TARGET_DEVICES_JTAG(func) \
Siva Durga Prasad Paladugu6056ceb2019-01-31 17:28:13 +0530117 BOOT_TARGET_DEVICES_MMC(func) \
118 BOOT_TARGET_DEVICES_XSPI(func) \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600119 BOOT_TARGET_DEVICES_USB_DFU(func) \
120 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simek788cdae2020-09-16 10:14:01 +0200121 BOOT_TARGET_DEVICES_PXE(func) \
122 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simek4b066a12018-08-22 14:55:27 +0200123
124#include <config_distro_bootcmd.h>
125
Michal Simekb1634762023-09-05 13:30:07 +0200126#else /* CONFIG_DISTRO_DEFAULTS */
127# define BOOTENV
128#endif /* CONFIG_DISTRO_DEFAULTS */
129
Michal Simek4b066a12018-08-22 14:55:27 +0200130/* Initial environment variables */
Tom Rinic9edebe2022-12-04 10:03:50 -0500131#ifndef CFG_EXTRA_ENV_SETTINGS
132#define CFG_EXTRA_ENV_SETTINGS \
Michal Simek4b066a12018-08-22 14:55:27 +0200133 ENV_MEM_LAYOUT_SETTINGS \
T Karthik Reddy1104faf2021-03-30 23:24:57 -0600134 BOOTENV
Michal Simek4b066a12018-08-22 14:55:27 +0200135#endif
136
137#endif /* __XILINX_VERSAL_H */