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