arm/arm64: zynq/zynqmp: pass the PS init file as a kconfig variable
U-Boot needs to link ps7_init_gpl.c on Zynq or psu_init_gpl.c on
ZynqMP (PS init for short). The current logic to locate this file for
both platforms is:
1. if a board-specific file exists in
board/xilinx/zynq[mp]/$(CONFIG_DEFAULT_DEVICE_TREE)/ps?_init_gpl.c
then use it
2. otherwise use board/xilinx/zynq/ps?_init_gpl.c
In the latter case the file does not exist in the U-Boot sources and
must be copied in the source tree from the outside before starting the
build. This is typical when it is generated from Xilinx tools while
developing a custom hardware. However making sure that a
board-specific file is _not_ found (and used) requires some trickery
such as removing or overwriting all PS init files (e.g.: the current
meta-xilinx yocto layer).
This generates a few problems:
* if the source tree is shared among different out-of-tree builds,
they will pollute (and potentially corrupt) each other
* the source tree cannot be read-only
* any buildsystem must add a command to copy the PS init file binary
* overwriting or deleting files in the source tree is ugly as hell
Simplify usage by allowing to pass the path to the desired PS init
file in kconfig variable XILINX_PS_INIT_FILE. It can be an absolute
path or relative to $(srctree). If the variable is set, the
user-specified file will always be used without being copied
around. If the the variable is left empty, for backward compatibility
fall back to the old behaviour.
Since the issue is the same for Zynq and ZynqMP, add one kconfig
variable in a common place and use it for both.
Also use the new kconfig help text to document all the ways to give
U-Boot the PS init file.
Build-tested with all combinations of:
- platform: zynq or zynqmp
- PS init file: from XILINX_PS_INIT_FILE (absolute, relative path,
non-existing), in-tree board-specific, in board/xilinx/zynq[mp]/
- building in-tree, in subdir, in other directory
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-06-22 10:40:16 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
|
|
|
# Copyright (c) 2018, Luca Ceresoli <luca@lucaceresoli.net>
|
|
|
|
|
|
|
|
if ARCH_ZYNQ || ARCH_ZYNQMP
|
|
|
|
|
|
|
|
config XILINX_PS_INIT_FILE
|
|
|
|
string "Zynq/ZynqMP PS init file(s) location"
|
|
|
|
help
|
|
|
|
On Zynq and ZynqMP U-Boot SPL (or U-Boot proper if
|
|
|
|
ZYNQMP_PSU_INIT_ENABLED is set) is responsible for some
|
|
|
|
basic initializations, such as enabling peripherals and
|
|
|
|
configuring pinmuxes. The PS init file (called
|
|
|
|
psu_init_gpl.c on ZynqMP, ps7_init_gpl.c for Zynq-7000)
|
|
|
|
contains the code for such initializations.
|
|
|
|
|
|
|
|
U-Boot contains PS init files for some boards, but each of
|
|
|
|
them describes only one specific configuration. Users of a
|
|
|
|
different board, or needing a different configuration, can
|
|
|
|
generate custom files using the Xilinx development tools.
|
|
|
|
|
|
|
|
There are three ways to give a PS init file to U-Boot:
|
|
|
|
|
|
|
|
1. Set this variable to the path, either relative to the
|
|
|
|
source tree or absolute, where the psu_init_gpl.c or
|
|
|
|
ps7_init_gpl.c file is located. U-Boot will build this
|
|
|
|
file.
|
|
|
|
|
|
|
|
2. If you leave an empty string here, U-Boot will use
|
|
|
|
board/xilinx/zynq/$(CONFIG_DEFAULT_DEVICE_TREE)/ps7_init_gpl.c
|
|
|
|
for Zynq-7000, or
|
|
|
|
board/xilinx/zynqmp/$(CONFIG_DEFAULT_DEVICE_TREE)/psu_init_gpl.c
|
|
|
|
for ZynqMP.
|
|
|
|
|
|
|
|
3. If the above file does not exist, U-Boot will use
|
|
|
|
board/xilinx/zynq/ps7_init_gpl.c for Zynq-7000, or
|
|
|
|
board/xilinx/zynqmp/psu_init_gpl.c for ZynqMP. This file
|
|
|
|
is not provided by U-Boot, you have to copy it there
|
|
|
|
before the build.
|
|
|
|
|
|
|
|
endif
|
2019-10-02 14:57:36 +00:00
|
|
|
|
2019-10-02 14:57:37 +00:00
|
|
|
config XILINX_OF_BOARD_DTB_ADDR
|
2020-08-20 12:02:47 +00:00
|
|
|
hex "Default DTB pickup address"
|
2022-09-19 12:21:02 +00:00
|
|
|
default 0x1000 if ARCH_VERSAL || ARCH_VERSAL_NET
|
2021-12-02 19:56:56 +00:00
|
|
|
default 0x8000 if MICROBLAZE
|
2019-10-02 14:57:37 +00:00
|
|
|
default 0x100000 if ARCH_ZYNQ || ARCH_ZYNQMP
|
2019-12-19 16:45:15 +00:00
|
|
|
depends on OF_BOARD || OF_SEPARATE
|
2019-10-02 14:57:36 +00:00
|
|
|
help
|
|
|
|
Offset in the memory where the board configuration DTB is placed.
|
2019-12-18 10:34:41 +00:00
|
|
|
|
|
|
|
config BOOT_SCRIPT_OFFSET
|
|
|
|
hex "Boot script offset"
|
2022-09-19 12:21:02 +00:00
|
|
|
depends on ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET || MICROBLAZE
|
2020-10-22 09:08:58 +00:00
|
|
|
default 0xFC0000 if ARCH_ZYNQ || MICROBLAZE
|
2019-12-18 10:34:41 +00:00
|
|
|
default 0x3E80000 if ARCH_ZYNQMP
|
2022-09-19 12:21:02 +00:00
|
|
|
default 0x7F80000 if ARCH_VERSAL || ARCH_VERSAL_NET
|
2019-12-18 10:34:41 +00:00
|
|
|
help
|
2020-10-22 09:08:58 +00:00
|
|
|
Specifies distro boot script offset in NAND/QSPI/NOR flash.
|
2020-10-14 15:08:14 +00:00
|
|
|
|
|
|
|
config ZYNQ_MAC_IN_EEPROM
|
|
|
|
bool "Reading MAC address from EEPROM"
|
|
|
|
help
|
|
|
|
Enable this option if your MAC address is saved in eeprom and
|
|
|
|
xlnx,eeprom DT property in chosen node points to it.
|
|
|
|
|
|
|
|
if ZYNQ_MAC_IN_EEPROM
|
|
|
|
|
|
|
|
config ZYNQ_GEM_I2C_MAC_OFFSET
|
|
|
|
hex "Set the I2C MAC offset"
|
|
|
|
default 0x0
|
|
|
|
depends on DM_I2C
|
|
|
|
help
|
|
|
|
Set the MAC offset for i2C.
|
|
|
|
|
|
|
|
endif
|
2019-04-10 07:08:10 +00:00
|
|
|
|
|
|
|
config CMD_FRU
|
|
|
|
bool "FRU information for product"
|
|
|
|
help
|
|
|
|
This option enables FRU commands to capture and display FRU
|
|
|
|
information present in the device. The FRU Information is used
|
|
|
|
to primarily to provide "inventory" information about the boards
|
|
|
|
that the FRU Information Device is located on.
|