Hannes Schmelzer | 6443d5d | 2019-07-17 14:29:53 +0200 | [diff] [blame] | 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 | |
| 7 | hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE) | sed -e 's/imx6dl-//') |
| 8 | |
| 9 | payload_off :=$(shell printf "%d" $(CONFIG_SYS_SPI_U_BOOT_OFFS)) |
| 10 | |
| 11 | quiet_cmd_prodbin = PRODBIN $@ $(payload_off) |
| 12 | cmd_prodbin = \ |
| 13 | dd if=/dev/zero ibs=1M count=2 2>/dev/null | tr "\000" "\377" >$@ && \ |
| 14 | dd conv=notrunc bs=1 if=SPL of=$@ seek=1024 2>/dev/null && \ |
| 15 | dd bs=1 if=u-boot-dtb.img of=$@ seek=$(payload_off) 2>/dev/null |
| 16 | |
| 17 | quiet_cmd_prodzip = SAPZIP $@ |
| 18 | cmd_prodzip = \ |
| 19 | test -d misc && rm -r misc; \ |
| 20 | mkdir misc && \ |
| 21 | cp SPL misc/ && \ |
| 22 | cp u-boot-dtb.img misc/ && \ |
| 23 | zip -9 -r $@ misc/* >/dev/null $< |
| 24 | |
| 25 | ifeq ($(hw-platform-y),brppt2) |
Simon Glass | 49c24a8 | 2024-09-29 19:49:47 -0600 | [diff] [blame] | 26 | ifneq ($(CONFIG_XPL_BUILD),y) |
Simon Glass | c46090d | 2020-07-19 13:56:01 -0600 | [diff] [blame] | 27 | INPUTS-y += $(hw-platform-y)_prog.bin |
| 28 | INPUTS-y += $(hw-platform-y)_prod.zip |
Hannes Schmelzer | 6443d5d | 2019-07-17 14:29:53 +0200 | [diff] [blame] | 29 | endif |
| 30 | endif |
| 31 | |
| 32 | $(hw-platform-y)_prog.bin: u-boot-dtb.img spl SPL |
| 33 | $(call if_changed,prodbin) |
| 34 | |
| 35 | $(hw-platform-y)_prod.zip: $(hw-platform-y)_prog.bin |
| 36 | $(call if_changed,prodzip) |