1subdirs-y += crypto
2subdirs-y += drivers
3subdirs-y += kernel
4subdirs-y += mm
5subdirs-y += pta
6subdirs-y += tee
7
8ifeq ($(CFG_WITH_USER_TA),y)
9gensrcs-y += ta_pub_key
10produce-ta_pub_key = ta_pub_key.c
11depends-ta_pub_key = $(TA_PUBLIC_KEY) scripts/pem_to_pub_c.py
12recipe-ta_pub_key = $(PYTHON3) scripts/pem_to_pub_c.py --prefix ta_pub_key \
13		--key $(TA_PUBLIC_KEY) --out $(sub-dir-out)/ta_pub_key.c
14
15gensrcs-y += ldelf
16produce-ldelf = ldelf_hex.c
17depends-ldelf = scripts/gen_ldelf_hex.py $(out-dir)/ldelf/ldelf.elf
18recipe-ldelf = $(PYTHON3) scripts/gen_ldelf_hex.py --input $(out-dir)/ldelf/ldelf.elf \
19			--output $(sub-dir-out)/ldelf_hex.c
20endif
21
22ifeq ($(CFG_WITH_USER_TA)-$(CFG_EARLY_TA),y-y)
23ifeq ($(CFG_EARLY_TA_COMPRESS),y)
24early-ta-compress = --compress
25endif
26define process_early_ta
27early-ta-$1-uuid := $(firstword $(subst ., ,$(notdir $1)))
28gensrcs-y += early-ta-$1
29produce-early-ta-$1 = early_ta_$$(early-ta-$1-uuid).c
30depends-early-ta-$1 = $1 scripts/ts_bin_to_c.py
31recipe-early-ta-$1 = $(PYTHON3) scripts/ts_bin_to_c.py $(early-ta-compress) \
32		--ta $1 --out $(sub-dir-out)/early_ta_$$(early-ta-$1-uuid).c
33endef
34$(foreach f, $(EARLY_TA_PATHS), $(eval $(call process_early_ta,$(f))))
35$(foreach f, $(CFG_IN_TREE_EARLY_TAS), $(eval $(call \
36	process_early_ta,$(out-dir)/ta/$(f).stripped.elf)))
37endif
38
39define process_secure_partition
40sp-$1-uuid := $(firstword $(subst ., ,$(notdir $1)))
41gensrcs-y += sp-$1
42produce-sp-$1 = sp_$$(sp-$1-uuid).c
43depends-sp-$1 = $1 scripts/ts_bin_to_c.py
44recipe-sp-$1 = $(PYTHON3) scripts/ts_bin_to_c.py --compress --sp $1 \
45		--out $(sub-dir-out)/sp_$$(sp-$1-uuid).c
46endef
47$(foreach f, $(SP_PATHS), $(eval $(call process_secure_partition,$(f))))
48
49ifeq ($(CFG_EMBED_DTB),y)
50core-embed-fdt-dts = $(arch-dir)/dts/$(CFG_EMBED_DTB_SOURCE_FILE)
51core-embed-fdt-dtb = $(out-dir)/$(arch-dir)/dts/$(CFG_EMBED_DTB_SOURCE_FILE:.dts=.dtb)
52core-embed-fdt-c = $(out-dir)/$(arch-dir)/dts/$(CFG_EMBED_DTB_SOURCE_FILE:.dts=.c)
53gensrcs-y += embedded_secure_dtb
54produce-embedded_secure_dtb = arch/$(ARCH)/dts/$(CFG_EMBED_DTB_SOURCE_FILE:.dts=.c)
55depends-embedded_secure_dtb = $(core-embed-fdt-dtb) scripts/bin_to_c.py
56recipe-embedded_secure_dtb = $(PYTHON3) scripts/bin_to_c.py \
57				--bin $(core-embed-fdt-dtb) \
58				--vname embedded_secure_dtb \
59				--out $(core-embed-fdt-c)
60$(eval $(call gen-dtb-file,$(core-embed-fdt-dts),$(core-embed-fdt-dtb)))
61endif
62
63ifeq ($(CFG_SHOW_CONF_ON_BOOT),y)
64conf-mk-xz-base64 := $(sub-dir-out)/conf.mk.xz.base64
65cleanfiles += $(conf-mk-xz-base64)
66
67$(conf-mk-xz-base64): $(conf-mk-file)
68	@$(cmd-echo-silent) '  GEN     $@'
69	$(q)tail +3 $< | xz | base64 -w 100 >$@
70
71gensrcs-y += conf_str
72produce-conf_str = conf.mk.xz.base64.c
73depends-conf_str = $(conf-mk-xz-base64)
74recipe-conf_str = $(PYTHON3) scripts/bin_to_c.py --text --bin $(conf-mk-xz-base64) \
75			--out $(sub-dir-out)/conf.mk.xz.base64.c \
76			--vname conf_str
77endif
78
79ifneq ($(CFG_STMM_PATH),)
80gensrcs-y += stmm
81produce-stmm = stmm_hex.c
82depends-stmm = scripts/gen_stmm_hex.py $(CFG_STMM_PATH)
83recipe-stmm = scripts/gen_stmm_hex.py --input $(CFG_STMM_PATH) \
84			--output $(sub-dir-out)/stmm_hex.c
85cleanfiles += $(sub-dir-out)/stmm_hex.c
86endif
87