1# SPDX-License-Identifier: GPL-2.0+
2#
3# Copyright (C) 2018 Synopsys, Inc. All rights reserved.
4
5ifdef CONFIG_TARGET_AXS103
6  PLATFORM_CPPFLAGS += -mcpu=archs
7else
8  PLATFORM_CPPFLAGS += -mcpu=arc700 -mlock -mswape
9endif
10
11bsp-generate: u-boot u-boot.bin
12ifdef CONFIG_ISA_ARCV2
13	$(Q)python3 $(srctree)/board/$(BOARDDIR)/headerize-axs.py \
14		--header-type v2 \
15		--arc-id 0x53 \
16		--spi-flash-offset 0x200000 \
17		--image $(srctree)/u-boot.bin \
18		--elf $(srctree)/u-boot
19else
20	$(Q)python3 $(srctree)/board/$(BOARDDIR)/headerize-axs.py \
21		--header-type v1 \
22		--arc-id 0x434 \
23		--spi-flash-offset 0x0 \
24		--image $(srctree)/u-boot.bin \
25		--elf $(srctree)/u-boot
26endif
27	$(Q)tools/mkimage -T script -C none -n 'uboot update script' \
28		-d $(srctree)/u-boot-update.txt \
29		$(srctree)/u-boot-update.img &> /dev/null
30