Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Michal Simek | 04b7e62 | 2015-01-15 10:01:51 +0100 | [diff] [blame] | 2 | # |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 3 | # (C) Copyright 2014 - 2016 Xilinx, Inc. |
Michal Simek | 04b7e62 | 2015-01-15 10:01:51 +0100 | [diff] [blame] | 4 | # Michal Simek <michal.simek@xilinx.com> |
Michal Simek | 04b7e62 | 2015-01-15 10:01:51 +0100 | [diff] [blame] | 5 | |
| 6 | obj-y := zynqmp.o |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 7 | |
Luca Ceresoli | b0172c3 | 2018-06-22 12:40:16 +0200 | [diff] [blame] | 8 | ifneq ($(CONFIG_XILINX_PS_INIT_FILE),"") |
| 9 | PS_INIT_FILE := $(shell cd $(srctree); readlink -f $(CONFIG_XILINX_PS_INIT_FILE)) |
| 10 | init-objs := ps_init_gpl.o |
| 11 | spl/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 $@ $^ |
| 13 | endif |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 14 | |
Michal Simek | 8a8683c | 2020-02-13 14:36:34 +0100 | [diff] [blame] | 15 | DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%) |
| 16 | ifeq ($(DEVICE_TREE),) |
| 17 | DEVICE_TREE := unset |
| 18 | endif |
| 19 | |
Luca Ceresoli | b0172c3 | 2018-06-22 12:40:16 +0200 | [diff] [blame] | 20 | ifeq ($(init-objs),) |
Michal Simek | 6894d9d | 2019-12-06 12:05:34 +0100 | [diff] [blame] | 21 | hw-platform-y :=$(shell echo $(DEVICE_TREE)) |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 22 | init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\ |
| 23 | $(hw-platform-y)/psu_init_gpl.o) |
Luca Ceresoli | b0172c3 | 2018-06-22 12:40:16 +0200 | [diff] [blame] | 24 | endif |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 25 | |
| 26 | ifeq ($(init-objs),) |
| 27 | ifneq ($(wildcard $(srctree)/$(src)/psu_init_gpl.c),) |
| 28 | init-objs := psu_init_gpl.o |
| 29 | $(if $(CONFIG_SPL_BUILD),\ |
| 30 | $(warning Put custom psu_init_gpl.c/h to board/xilinx/zynqmp/custom_hw_platform/)) |
| 31 | endif |
| 32 | endif |
| 33 | |
Michal Simek | d821879 | 2017-07-12 13:21:27 +0200 | [diff] [blame] | 34 | ifdef_any_of = $(filter-out undefined,$(foreach v,$(1),$(origin $(v)))) |
| 35 | |
| 36 | ifneq ($(call ifdef_any_of, CONFIG_ZYNQMP_PSU_INIT_ENABLED CONFIG_SPL_BUILD),) |
| 37 | obj-y += $(init-objs) |
| 38 | endif |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 39 | |
Michal Simek | 2a455e2 | 2019-07-30 17:07:27 +0200 | [diff] [blame] | 40 | ifdef CONFIG_SPL_BUILD |
Luca Ceresoli | 23e6500 | 2019-05-21 18:06:43 +0200 | [diff] [blame] | 41 | ifneq ($(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE),"") |
| 42 | obj-$(CONFIG_SPL_BUILD) += pm_cfg_obj.o |
| 43 | $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE)) FORCE |
| 44 | endif |
Michal Simek | 2a455e2 | 2019-07-30 17:07:27 +0200 | [diff] [blame] | 45 | endif |
Luca Ceresoli | 23e6500 | 2019-05-21 18:06:43 +0200 | [diff] [blame] | 46 | |
Siva Durga Prasad Paladugu | b1acb65 | 2018-02-28 13:26:53 +0530 | [diff] [blame] | 47 | ifndef CONFIG_SPL_BUILD |
| 48 | obj-$(CONFIG_CMD_ZYNQMP) += cmds.o |
| 49 | endif |
| 50 | |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 51 | # Suppress "warning: function declaration isn't a prototype" |
| 52 | CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes |
| 53 | |
| 54 | # To include xil_io.h |
| 55 | CFLAGS_psu_init_gpl.o := -I$(srctree)/$(src) |
Michal Simek | f5727ec | 2016-07-14 11:13:04 +0200 | [diff] [blame] | 56 | |
| 57 | # To suppress "warning: cast to pointer from integer of different size" |
| 58 | CFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast |