blob: 0692988507bde713ea39b093b5c0a0f65a66880a [file] [log] [blame]
Hannes Schmelzer60df8092019-08-01 07:04:46 +02001# 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
7hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE) | sed -e 's/am335x-//')
8
9payload_off :=$(shell printf "%d" $(CONFIG_SYS_SPI_U_BOOT_OFFS))
10
11quiet_cmd_prodbin = PRODBIN $@ $(payload_off)
12cmd_prodbin = \
13 dd if=/dev/zero ibs=1M count=2 2>/dev/null | tr "\000" "\377" >$@ && \
14 dd conv=notrunc bs=1 if=MLO.byteswap of=$@ seek=0 2>/dev/null && \
15 dd bs=1 if=u-boot-dtb.img of=$@ seek=$(payload_off) 2>/dev/null
16
17quiet_cmd_prodzip = SAPZIP $@
18cmd_prodzip = \
19 test -d misc && rm -r misc; \
20 mkdir misc && \
21 cp MLO.byteswap misc/ && \
22 cp spl/u-boot-spl.bin misc/ && \
23 cp u-boot-dtb.img misc/ && \
24 zip -9 -r $@ misc/* >/dev/null $<
25
26ALL-y += $(hw-platform-y)_prog.bin
27ALL-y += $(hw-platform-y)_prod.zip
28
29$(hw-platform-y)_prog.bin: u-boot-dtb.img spl/u-boot-spl.bin
30 $(call if_changed,prodbin)
31
32$(hw-platform-y)_prod.zip: $(hw-platform-y)_prog.bin
33 $(call if_changed,prodzip)