xref: /openbmc/u-boot/board/xilinx/zynqmp/Makefile (revision 12308b12)
1# SPDX-License-Identifier: GPL-2.0+
2#
3# (C) Copyright 2014 - 2016 Xilinx, Inc.
4# Michal Simek <michal.simek@xilinx.com>
5
6obj-y	:= zynqmp.o
7
8ifneq ($(CONFIG_XILINX_PS_INIT_FILE),"")
9PS_INIT_FILE := $(shell cd $(srctree); readlink -f $(CONFIG_XILINX_PS_INIT_FILE))
10init-objs := ps_init_gpl.o
11spl/board/xilinx/zynqmp/ps_init_gpl.o board/xilinx/zynqmp/ps_init_gpl.o: $(PS_INIT_FILE)
12	$(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
13endif
14
15ifeq ($(init-objs),)
16hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
17init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\
18	$(hw-platform-y)/psu_init_gpl.o)
19endif
20
21ifeq ($(init-objs),)
22ifneq ($(wildcard $(srctree)/$(src)/psu_init_gpl.c),)
23init-objs := psu_init_gpl.o
24$(if $(CONFIG_SPL_BUILD),\
25$(warning Put custom psu_init_gpl.c/h to board/xilinx/zynqmp/custom_hw_platform/))
26endif
27endif
28
29ifdef_any_of = $(filter-out undefined,$(foreach v,$(1),$(origin $(v))))
30
31ifneq ($(call ifdef_any_of, CONFIG_ZYNQMP_PSU_INIT_ENABLED CONFIG_SPL_BUILD),)
32obj-y += $(init-objs)
33endif
34
35obj-$(CONFIG_MMC_SDHCI_ZYNQ) += tap_delays.o
36
37ifndef CONFIG_SPL_BUILD
38obj-$(CONFIG_CMD_ZYNQMP) += cmds.o
39endif
40
41# Suppress "warning: function declaration isn't a prototype"
42CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
43
44# To include xil_io.h
45CFLAGS_psu_init_gpl.o := -I$(srctree)/$(src)
46
47# To suppress "warning: cast to pointer from integer of different size"
48CFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast
49