-
Notifications
You must be signed in to change notification settings - Fork 43
/
prebuilts.mak
executable file
·154 lines (134 loc) · 6.55 KB
/
prebuilts.mak
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.PHONY: prebuilts_compose
ifeq ($(CFG_HI_DONGLE_SUPPORT),y)
BOOTARGS_DONGLE := _dongle
endif
ifeq ($(CFG_HI_ADVCA_TYPE),VERIMATRIX)
BOOTARGS_ADVCA := _vmx_advanced
else ifeq ($(CFG_HI_ADVCA_TYPE),VERIMATRIX_ULTRA)
BOOTARGS_ADVCA := _vmx_ultra
else ifeq ($(CFG_HI_ADVCA_TYPE),NAGRA)
BOOTARGS_ADVCA := _nagra
else ifeq ($(CFG_HI_ADVCA_TYPE),DCAS)
BOOTARGS_ADVCA :=
ifeq ($(CFG_HI_TEE_SUPPORT),y)
ifeq ($(CFG_HI_CHIP_TYPE), hi3796mv200)
BOOTARGS_TEE := _tee
else
BOOTARGS_TEE := _tee_DDR_$(CFG_HI_TVP_MEM_LAYOUT)B
endif
endif
else ifeq ($(CFG_HI_ADVCA_TYPE),SUMA)
BOOTARGS_ADVCA :=
ifeq ($(CFG_HI_TEE_SUPPORT),y)
ifeq ($(CFG_HI_CHIP_TYPE), hi3796mv200)
BOOTARGS_TEE := _tee
else
BOOTARGS_TEE := _tee_DDR_$(CFG_HI_TVP_MEM_LAYOUT)B
endif
endif
else ifneq ($(CFG_HI_ADVCA_TYPE),)
ifeq ($(CFG_HI_ADVCA_FUNCTION),)
BOOTARGS_ADVCA :=
else
BOOTARGS_ADVCA := _ca_$(shell echo $(CFG_HI_ADVCA_FUNCTION) | tr '[A-Z]' '[a-z]')
endif
ifeq ($(CFG_HI_TEE_SUPPORT),y)
ifeq ($(CFG_HI_CHIP_TYPE), hi3796mv200)
BOOTARGS_TEE := _tee
else
BOOTARGS_TEE := _tee_DDR_$(CFG_HI_TVP_MEM_LAYOUT)B
endif
endif
else
ifeq ($(CFG_HI_TEE_SUPPORT),y)
ifeq ($(CFG_HI_CHIP_TYPE), hi3796mv200)
BOOTARGS_TEE := _tee
else
BOOTARGS_TEE := _tee_DDR_$(CFG_HI_TVP_MEM_LAYOUT)B
endif
endif
endif
ifeq ($(CFG_HI_TWOSTAGEBOOT_SUPPORT),y)
BOOTARGS_SBL := _sbl
endif
NAND_PARTITIONS := $(HI_PREBUILTS_DIR)/nand_partitions$(BOOTARGS_SBL)$(BOOTARGS_ADVCA).xml
EMMC_PARTITIONS := $(HI_PREBUILTS_DIR)/emmc_partitions$(BOOTARGS_ADVCA).xml
SPI_EMMC_PARTITIONS := $(HI_PREBUILTS_DIR)/spi_emmc_partitions$(BOOTARGS_ADVCA).xml
SPI_PARTITIONS := $(HI_PREBUILTS_DIR)/spi_partitions.xml
NAND_BOOTARGS := $(HI_PREBUILTS_DIR)/nand_bootargs$(BOOTARGS_SBL)$(BOOTARGS_DONGLE)$(BOOTARGS_TEE)$(BOOTARGS_ADVCA).txt
EMMC_BOOTARGS := $(HI_PREBUILTS_DIR)/emmc_bootargs$(BOOTARGS_DONGLE)$(BOOTARGS_TEE)$(BOOTARGS_ADVCA).txt
SPI_EMMC_BOOTARGS := $(HI_PREBUILTS_DIR)/spi_emmc_bootargs$(BOOTARGS_DONGLE)$(BOOTARGS_TEE)$(BOOTARGS_ADVCA).txt
SPI_BOOTARGS := $(HI_PREBUILTS_DIR)/spi_bootargs.txt
ifeq ($(CFG_ADVCA_VERIMATRIX_ULTRA),y)
ifeq ($(CFG_HI_TVP_MEM_LAYOUT),512M)
SOS_IMG_DIR := $(HI_TEE_OS_DIR)/images/$(CFG_HI_CHIP_TYPE)/vmx_ultra/512M
else ifeq ($(CFG_HI_TVP_MEM_LAYOUT),1G)
SOS_IMG_DIR := $(HI_TEE_OS_DIR)/images/$(CFG_HI_CHIP_TYPE)/vmx_ultra/1G
else ifeq ($(CFG_HI_TVP_MEM_LAYOUT),1_5G)
SOS_IMG_DIR := $(HI_TEE_OS_DIR)/images/$(CFG_HI_CHIP_TYPE)/vmx_ultra/1_5G
else ifeq ($(CFG_HI_TVP_MEM_LAYOUT),2G)
SOS_IMG_DIR := $(HI_TEE_OS_DIR)/images/$(CFG_HI_CHIP_TYPE)/vmx_ultra/2G
endif
FBL_IMG_DIR := $(BOOT_DIR)/fbl/$(CFG_HI_CHIP_TYPE)
endif
prebuilts_compose:
ifneq ($(CFG_HI_LOADER_APPLOADER),y)
ifeq ($(CFG_HI_NAND_FLASH_SUPPORT),y)
$(AT)test -d $(HI_NAND_IMAGE_DIR) || mkdir -p $(HI_NAND_IMAGE_DIR)
$(AT)test ! -f $(NAND_PARTITIONS) || cp -f $(NAND_PARTITIONS) $(HI_NAND_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/logo.img $(HI_NAND_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/baseparam.img $(HI_NAND_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/pq_param.bin $(HI_NAND_IMAGE_DIR)/
$(AT)(test ! -f $(NAND_BOOTARGS) || (cd $(HI_NAND_IMAGE_DIR) && $(MKBOOTARGS) \
-s 64 -r $(NAND_BOOTARGS) -o bootargs.bin > /dev/null))
ifeq ($(CFG_ADVCA_VERIMATRIX_ULTRA),y)
$(AT)test ! -f $(FBL_IMG_DIR)/fbl.bin || cp -f $(FBL_IMG_DIR)/fbl.bin $(HI_NAND_IMAGE_DIR)/
$(AT)test ! -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc || cp -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc $(HI_NAND_IMAGE_DIR)/
endif
endif
ifeq ($(CFG_HI_EMMC_SUPPORT),y)
$(AT)test -d $(HI_EMMC_IMAGE_DIR) || mkdir -p $(HI_EMMC_IMAGE_DIR)
$(AT)test ! -f $(EMMC_PARTITIONS) || cp -f $(EMMC_PARTITIONS) $(HI_EMMC_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/logo.img $(HI_EMMC_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/baseparam.img $(HI_EMMC_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/pq_param.bin $(HI_EMMC_IMAGE_DIR)/
$(AT)(test ! -f $(EMMC_BOOTARGS) || (cd $(HI_EMMC_IMAGE_DIR) && $(MKBOOTARGS) \
-s 64 -r $(EMMC_BOOTARGS) -o bootargs.bin > /dev/null))
ifeq ($(CFG_ADVCA_VERIMATRIX_ULTRA),y)
$(AT)test ! -f $(FBL_IMG_DIR)/fbl.bin || cp -f $(FBL_IMG_DIR)/fbl.bin $(HI_EMMC_IMAGE_DIR)/
$(AT)test ! -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc || cp -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc $(HI_EMMC_IMAGE_DIR)/
endif
endif
ifeq ($(CFG_HI_SPI_SUPPORT)_$(CFG_HI_EMMC_SUPPORT),y_y)
$(AT)test -d $(HI_SPI_EMMC_IMAGE_DIR) || mkdir -p $(HI_SPI_EMMC_IMAGE_DIR)
$(AT)test ! -f $(SPI_EMMC_PARTITIONS) || cp -f $(SPI_EMMC_PARTITIONS) $(HI_SPI_EMMC_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/logo.img $(HI_SPI_EMMC_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/baseparam.img $(HI_SPI_EMMC_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/pq_param.bin $(HI_SPI_EMMC_IMAGE_DIR)/
$(AT)(test ! -f $(SPI_EMMC_BOOTARGS) || (cd $(HI_SPI_EMMC_IMAGE_DIR) && $(MKBOOTARGS) \
-s 64 -r $(SPI_EMMC_BOOTARGS) -o bootargs.bin > /dev/null))
ifeq ($(CFG_ADVCA_VERIMATRIX_ULTRA),y)
$(AT)test ! -f $(FBL_IMG_DIR)/fbl.bin || cp -f $(FBL_IMG_DIR)/fbl.bin $(HI_SPI_EMMC_IMAGE_DIR)/
$(AT)test ! -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc || cp -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc $(HI_SPI_EMMC_IMAGE_DIR)/
endif
ifeq ($(CFG_HI_CHIP_TYPE),hi3796mv200)
$(AT)test ! -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc || cp -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc $(HI_SPI_EMMC_IMAGE_DIR)/
endif
endif
ifeq ($(CFG_HI_SPI_SUPPORT),y)
$(AT)test -d $(HI_SPI_IMAGE_DIR) || mkdir -p $(HI_SPI_IMAGE_DIR)
$(AT)test ! -f $(SPI_PARTITIONS) || cp -f $(SPI_PARTITIONS) $(HI_SPI_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/logo.img $(HI_SPI_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/baseparam.img $(HI_SPI_IMAGE_DIR)/
$(AT)cp -f $(HI_PREBUILTS_DIR)/pq_param.bin $(HI_SPI_IMAGE_DIR)/
$(AT)(test ! -f $(SPI_BOOTARGS) || (cd $(HI_SPI_IMAGE_DIR) && $(MKBOOTARGS) \
-s 64 -r $(SPI_BOOTARGS) -o bootargs.bin > /dev/null))
ifeq ($(CFG_ADVCA_VERIMATRIX_ULTRA),y)
$(AT)test ! -f $(FBL_IMG_DIR)/fbl.bin || cp -f $(FBL_IMG_DIR)/fbl.bin $(HI_SPI_IMAGE_DIR)/
$(AT)test ! -f $(SOS_SRC_DIR)/trustedcore.img.sig.enc || cp -f $(SOS_SRC_DIR)/trustedcore.img.sig.enc $(HI_SPI_IMAGE_DIR)/
ifeq ($(CFG_HI_CHIP_TYPE),hi3796mv200)
$(AT)test ! -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc || cp -f $(SOS_IMG_DIR)/trustedcore.img.sig.enc $(HI_SPI_IMAGE_DIR)/
endif
endif
endif
endif