xref: /openbmc/u-boot/board/xilinx/zynqmp/Makefile (revision 500ad54e)
183d290c5STom Rini# SPDX-License-Identifier: GPL-2.0+
284c7204bSMichal Simek#
3e6a9ed04SMichal Simek# (C) Copyright 2014 - 2016 Xilinx, Inc.
484c7204bSMichal Simek# Michal Simek <michal.simek@xilinx.com>
584c7204bSMichal Simek
684c7204bSMichal Simekobj-y	:= zynqmp.o
7*9755e3dbSMichal Simekobj-y	+= ../common/board.o
8e6a9ed04SMichal Simek
96da4f67aSLuca Ceresoliifneq ($(CONFIG_XILINX_PS_INIT_FILE),"")
106da4f67aSLuca CeresoliPS_INIT_FILE := $(shell cd $(srctree); readlink -f $(CONFIG_XILINX_PS_INIT_FILE))
116da4f67aSLuca Ceresoliinit-objs := ps_init_gpl.o
126da4f67aSLuca Ceresolispl/board/xilinx/zynqmp/ps_init_gpl.o board/xilinx/zynqmp/ps_init_gpl.o: $(PS_INIT_FILE)
136da4f67aSLuca Ceresoli	$(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
146da4f67aSLuca Ceresoliendif
15e6a9ed04SMichal Simek
166da4f67aSLuca Ceresoliifeq ($(init-objs),)
176da4f67aSLuca Ceresolihw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
18e6a9ed04SMichal Simekinit-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\
19e6a9ed04SMichal Simek	$(hw-platform-y)/psu_init_gpl.o)
206da4f67aSLuca Ceresoliendif
21e6a9ed04SMichal Simek
22e6a9ed04SMichal Simekifeq ($(init-objs),)
23e6a9ed04SMichal Simekifneq ($(wildcard $(srctree)/$(src)/psu_init_gpl.c),)
24e6a9ed04SMichal Simekinit-objs := psu_init_gpl.o
25e6a9ed04SMichal Simek$(if $(CONFIG_SPL_BUILD),\
26e6a9ed04SMichal Simek$(warning Put custom psu_init_gpl.c/h to board/xilinx/zynqmp/custom_hw_platform/))
27e6a9ed04SMichal Simekendif
28e6a9ed04SMichal Simekendif
29e6a9ed04SMichal Simek
30fd1b635cSMichal Simekifdef_any_of = $(filter-out undefined,$(foreach v,$(1),$(origin $(v))))
31fd1b635cSMichal Simek
32fd1b635cSMichal Simekifneq ($(call ifdef_any_of, CONFIG_ZYNQMP_PSU_INIT_ENABLED CONFIG_SPL_BUILD),)
33fd1b635cSMichal Simekobj-y += $(init-objs)
34fd1b635cSMichal Simekendif
35e6a9ed04SMichal Simek
36d1f4e39dSSiva Durga Prasad Paladuguobj-$(CONFIG_MMC_SDHCI_ZYNQ) += tap_delays.o
37d1f4e39dSSiva Durga Prasad Paladugu
38c436bf92SSiva Durga Prasad Paladuguifndef CONFIG_SPL_BUILD
39c436bf92SSiva Durga Prasad Paladuguobj-$(CONFIG_CMD_ZYNQMP) += cmds.o
40c436bf92SSiva Durga Prasad Paladuguendif
41c436bf92SSiva Durga Prasad Paladugu
42e6a9ed04SMichal Simek# Suppress "warning: function declaration isn't a prototype"
43e6a9ed04SMichal SimekCFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
44e6a9ed04SMichal Simek
45e6a9ed04SMichal Simek# To include xil_io.h
46e6a9ed04SMichal SimekCFLAGS_psu_init_gpl.o := -I$(srctree)/$(src)
47b6f4048bSMichal Simek
48b6f4048bSMichal Simek# To suppress "warning: cast to pointer from integer of different size"
49b6f4048bSMichal SimekCFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast
50