config.mk 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # Copyright (C) 2019 Hannes Schmelzer <oe5hpm@oevsv.at> -
  4. # B&R Industrial Automation GmbH - http://www.br-automation.com
  5. #
  6. hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE) | sed -e 's/imx6dl-//')
  7. payload_off :=$(shell printf "%d" $(CONFIG_SYS_SPI_U_BOOT_OFFS))
  8. quiet_cmd_prodbin = PRODBIN $@ $(payload_off)
  9. cmd_prodbin = \
  10. dd if=/dev/zero ibs=1M count=2 2>/dev/null | tr "\000" "\377" >$@ && \
  11. dd conv=notrunc bs=1 if=SPL of=$@ seek=1024 2>/dev/null && \
  12. dd bs=1 if=u-boot-dtb.img of=$@ seek=$(payload_off) 2>/dev/null
  13. quiet_cmd_prodzip = SAPZIP $@
  14. cmd_prodzip = \
  15. test -d misc && rm -r misc; \
  16. mkdir misc && \
  17. cp SPL misc/ && \
  18. cp u-boot-dtb.img misc/ && \
  19. zip -9 -r $@ misc/* >/dev/null $<
  20. ifeq ($(hw-platform-y),brppt2)
  21. ifneq ($(CONFIG_SPL_BUILD),y)
  22. INPUTS-y += $(hw-platform-y)_prog.bin
  23. INPUTS-y += $(hw-platform-y)_prod.zip
  24. endif
  25. endif
  26. $(hw-platform-y)_prog.bin: u-boot-dtb.img spl SPL
  27. $(call if_changed,prodbin)
  28. $(hw-platform-y)_prod.zip: $(hw-platform-y)_prog.bin
  29. $(call if_changed,prodzip)