2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2015-01-15 09:01:51 +00:00
|
|
|
#
|
2015-11-20 12:17:22 +00:00
|
|
|
# (C) Copyright 2014 - 2016 Xilinx, Inc.
|
2015-01-15 09:01:51 +00:00
|
|
|
# Michal Simek <michal.simek@xilinx.com>
|
|
|
|
|
|
|
|
obj-y := zynqmp.o
|
2019-01-21 14:25:02 +00:00
|
|
|
obj-y += ../common/board.o
|
2015-11-20 12:17:22 +00:00
|
|
|
|
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
|
|
|
ifneq ($(CONFIG_XILINX_PS_INIT_FILE),"")
|
|
|
|
PS_INIT_FILE := $(shell cd $(srctree); readlink -f $(CONFIG_XILINX_PS_INIT_FILE))
|
|
|
|
init-objs := ps_init_gpl.o
|
|
|
|
spl/board/xilinx/zynqmp/ps_init_gpl.o board/xilinx/zynqmp/ps_init_gpl.o: $(PS_INIT_FILE)
|
|
|
|
$(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
|
|
|
|
endif
|
2015-11-20 12:17:22 +00:00
|
|
|
|
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
|
|
|
ifeq ($(init-objs),)
|
|
|
|
hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
|
2015-11-20 12:17:22 +00:00
|
|
|
init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\
|
|
|
|
$(hw-platform-y)/psu_init_gpl.o)
|
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
|
|
|
endif
|
2015-11-20 12:17:22 +00:00
|
|
|
|
|
|
|
ifeq ($(init-objs),)
|
|
|
|
ifneq ($(wildcard $(srctree)/$(src)/psu_init_gpl.c),)
|
|
|
|
init-objs := psu_init_gpl.o
|
|
|
|
$(if $(CONFIG_SPL_BUILD),\
|
|
|
|
$(warning Put custom psu_init_gpl.c/h to board/xilinx/zynqmp/custom_hw_platform/))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-07-12 11:21:27 +00:00
|
|
|
ifdef_any_of = $(filter-out undefined,$(foreach v,$(1),$(origin $(v))))
|
|
|
|
|
|
|
|
ifneq ($(call ifdef_any_of, CONFIG_ZYNQMP_PSU_INIT_ENABLED CONFIG_SPL_BUILD),)
|
|
|
|
obj-y += $(init-objs)
|
|
|
|
endif
|
2015-11-20 12:17:22 +00:00
|
|
|
|
2018-04-19 07:07:09 +00:00
|
|
|
obj-$(CONFIG_MMC_SDHCI_ZYNQ) += tap_delays.o
|
|
|
|
|
2018-02-28 07:56:53 +00:00
|
|
|
ifndef CONFIG_SPL_BUILD
|
|
|
|
obj-$(CONFIG_CMD_ZYNQMP) += cmds.o
|
|
|
|
endif
|
|
|
|
|
2015-11-20 12:17:22 +00:00
|
|
|
# Suppress "warning: function declaration isn't a prototype"
|
|
|
|
CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
|
|
|
|
|
|
|
|
# To include xil_io.h
|
|
|
|
CFLAGS_psu_init_gpl.o := -I$(srctree)/$(src)
|
2016-07-14 09:13:04 +00:00
|
|
|
|
|
|
|
# To suppress "warning: cast to pointer from integer of different size"
|
|
|
|
CFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast
|