Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # (C) Copyright 2014 - 2016 Xilinx, Inc.
  4. # Michal Simek <michal.simek@amd.com>
  5. obj-y := zynqmp.o
  6. ifneq ($(CONFIG_XILINX_PS_INIT_FILE),"")
  7. PS_INIT_FILE := $(shell cd $(srctree); readlink -f $(CONFIG_XILINX_PS_INIT_FILE))
  8. init-objs := ps_init_gpl.o
  9. spl/board/xilinx/zynqmp/ps_init_gpl.o board/xilinx/zynqmp/ps_init_gpl.o: $(PS_INIT_FILE)
  10. $(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
  11. endif
  12. DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
  13. ifeq ($(DEVICE_TREE),)
  14. DEVICE_TREE := unset
  15. endif
  16. ifeq ($(init-objs),)
  17. hw-platform-y :=$(shell echo $(DEVICE_TREE))
  18. init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\
  19. $(hw-platform-y)/psu_init_gpl.o)
  20. endif
  21. ifeq ($(init-objs),)
  22. ifneq ($(wildcard $(srctree)/$(src)/psu_init_gpl.c),)
  23. init-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/))
  26. endif
  27. endif
  28. obj-$(CONFIG_$(SPL_)ZYNQMP_PSU_INIT_ENABLED) += $(init-objs)
  29. ifdef CONFIG_SPL_BUILD
  30. ifneq ($(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE),"")
  31. obj-$(CONFIG_SPL_BUILD) += pm_cfg_obj.o
  32. $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE)) FORCE
  33. endif
  34. endif
  35. ifndef CONFIG_SPL_BUILD
  36. obj-$(CONFIG_CMD_ZYNQMP) += cmds.o
  37. endif
  38. # Suppress "warning: function declaration isn't a prototype"
  39. CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
  40. # To include xil_io.h
  41. CFLAGS_psu_init_gpl.o := -I$(srctree)/$(src)
  42. # To suppress "warning: cast to pointer from integer of different size"
  43. CFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast