This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (65 loc) · 2.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright(C) 2018 Hex Five Security, Inc. - All Rights Reserved
#############################################################
# Platform definitions
#############################################################
BOARD ?= IMX8QM
ifeq ($(BOARD),IMX8QM)
ARM_ARCH := armv7e-m
ARM_CPU := cortex-m4
ARM_FLOAT := soft
ARM_FPU := fpv5-sp-d16
else
$(error Unsupported board $(BOARD))
endif
#############################################################
# Arguments/variables available to all submakes
#############################################################
export BOARD
export ARM_ARCH
export ARM_CPU
export ARM_FLOAT
export ARM_FPU
#############################################################
# Toolchain definitions
#############################################################
ifndef GNU_ARM
$(error GNU_ARM (GNU Arm Embedded Toolchain) not set)
endif
export CROSS_COMPILE := $(abspath $(GNU_ARM))/arm-none-eabi-
export CC := $(CROSS_COMPILE)gcc
export OBJDUMP := $(CROSS_COMPILE)objdump
export OBJCOPY := $(CROSS_COMPILE)objcopy
export GDB := $(CROSS_COMPILE)gdb
export AR := $(CROSS_COMPILE)ar
export LD := $(CROSS_COMPILE)gcc
#############################################################
# Rules for building multizone
#############################################################
.PHONY: all
all: clean
$(MAKE) -C zone1
$(MAKE) -C zone2
$(MAKE) -C zone3
$(MAKE) -C zone4
java -jar multizone.jar \
--arch $(BOARD) \
--config bsp/$(BOARD)/multizone.cfg \
zone1/zone1.elf \
zone2/zone2.elf \
zone3/zone3.elf \
zone4/zone4.elf
@$(OBJCOPY) -S -Iihex -Obinary multizone.hex multizone.bin > /dev/null
@./ext/mkimage/imx-mkimage/mkimage_imx8 -soc QM -rev B0 -append \
./ext/secofw/firmware-imx-8.1/firmware/seco/mx8qm-ahab-container.img \
-c -flags 0x01210000 \
-scfw ./ext/scfw/packages/imx-scfw-porting-kit-1.2.7.1/src/scfw_export_mx8qm_b0/build_mx8qm_b0/scfw_tcm.bin \
-ap ./ext/qnx/ipl-imx8qm-cpu-mek.bin a53 0x80000000 \
-p3 -m4 ./multizone.bin 0 0x34FE0000 \
-out multizone.imx > /dev/null 2>&1
.PHONY: clean
clean:
$(MAKE) -C zone1 clean
$(MAKE) -C zone2 clean
$(MAKE) -C zone3 clean
$(MAKE) -C zone4 clean
rm -f multizone.hex multizone.bin *.imx