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 | a8c9436 | 2023-07-10 14:35:49 +0200 | [diff] [blame] | 4 | # Michal Simek <michal.simek@amd.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 | 461b931 | 2022-12-02 09:18:06 +0100 | [diff] [blame] | 34 | obj-$(CONFIG_$(SPL_)ZYNQMP_PSU_INIT_ENABLED) += $(init-objs) |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 35 | |
Michal Simek | 2a455e2 | 2019-07-30 17:07:27 +0200 | [diff] [blame] | 36 | ifdef CONFIG_SPL_BUILD |
Luca Ceresoli | 23e6500 | 2019-05-21 18:06:43 +0200 | [diff] [blame] | 37 | ifneq ($(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE),"") |
| 38 | obj-$(CONFIG_SPL_BUILD) += pm_cfg_obj.o |
| 39 | $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE)) FORCE |
| 40 | endif |
Michal Simek | 2a455e2 | 2019-07-30 17:07:27 +0200 | [diff] [blame] | 41 | endif |
Luca Ceresoli | 23e6500 | 2019-05-21 18:06:43 +0200 | [diff] [blame] | 42 | |
Michal Simek | 72536fd | 2015-11-20 13:17:22 +0100 | [diff] [blame] | 43 | # Suppress "warning: function declaration isn't a prototype" |
| 44 | CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes |
| 45 | |
| 46 | # To include xil_io.h |
| 47 | CFLAGS_psu_init_gpl.o := -I$(srctree)/$(src) |
Michal Simek | f5727ec | 2016-07-14 11:13:04 +0200 | [diff] [blame] | 48 | |
| 49 | # To suppress "warning: cast to pointer from integer of different size" |
| 50 | CFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast |