1*83d290c5STom 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 7e6a9ed04SMichal Simek 8fde6cacdSMichal Simekhw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)) 9e6a9ed04SMichal Simek 10e6a9ed04SMichal Simekinit-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\ 11e6a9ed04SMichal Simek $(hw-platform-y)/psu_init_gpl.o) 12e6a9ed04SMichal Simek 13e6a9ed04SMichal Simekifeq ($(init-objs),) 14e6a9ed04SMichal Simekifneq ($(wildcard $(srctree)/$(src)/psu_init_gpl.c),) 15e6a9ed04SMichal Simekinit-objs := psu_init_gpl.o 16e6a9ed04SMichal Simek$(if $(CONFIG_SPL_BUILD),\ 17e6a9ed04SMichal Simek$(warning Put custom psu_init_gpl.c/h to board/xilinx/zynqmp/custom_hw_platform/)) 18e6a9ed04SMichal Simekendif 19e6a9ed04SMichal Simekendif 20e6a9ed04SMichal Simek 21fd1b635cSMichal Simekifdef_any_of = $(filter-out undefined,$(foreach v,$(1),$(origin $(v)))) 22fd1b635cSMichal Simek 23fd1b635cSMichal Simekifneq ($(call ifdef_any_of, CONFIG_ZYNQMP_PSU_INIT_ENABLED CONFIG_SPL_BUILD),) 24fd1b635cSMichal Simekobj-y += $(init-objs) 25fd1b635cSMichal Simekendif 26e6a9ed04SMichal Simek 27c436bf92SSiva Durga Prasad Paladuguifndef CONFIG_SPL_BUILD 28c436bf92SSiva Durga Prasad Paladuguobj-$(CONFIG_CMD_ZYNQMP) += cmds.o 29c436bf92SSiva Durga Prasad Paladuguendif 30c436bf92SSiva Durga Prasad Paladugu 31e6a9ed04SMichal Simek# Suppress "warning: function declaration isn't a prototype" 32e6a9ed04SMichal SimekCFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes 33e6a9ed04SMichal Simek 34e6a9ed04SMichal Simek# To include xil_io.h 35e6a9ed04SMichal SimekCFLAGS_psu_init_gpl.o := -I$(srctree)/$(src) 36b6f4048bSMichal Simek 37b6f4048bSMichal Simek# To suppress "warning: cast to pointer from integer of different size" 38b6f4048bSMichal SimekCFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast 39