blob: 8c4f54f7118e69f128675591a145a2e73d80d140 [file] [log] [blame]
LOCAL_PATH := $(call my-dir)
include $(LOCAL_PATH)/android_env.mk
ifeq ($(wildcard $(TARGET_PREBUILT_LK)),)
.KATI_RESTAT: $(BUILT_LK_TARGET)
$(BUILT_LK_TARGET):
$(hide) rm -rf $(BL2_BUILDROOT)
$(hide) rm -rf $(PRODUCT_OUT)/bl2.bin
$(hide) rm -rf $(PRODUCT_OUT)/bl2.img
$(hide) mkdir -p ${BL2_BUILDROOT}
$(hide) mkdir -p ${BL2_BUILDROOT}/include
ifeq ($(strip $(SECURE_BOOT_ENABLE)), true)
cp ${DUMMY_IMG_DIR}/fitImage $(BL2_BUILDROOT)
dtc -p 0x3ff ${LK_DTS_DIR}/lk.dts -O dtb -o ${BL2_BUILDROOT}/lk.dtb
cp $(LK_ROOT_DIR)/${MTK_KEY_DIR}/${VERIFIED_KEY}.crt ${BL2_BUILDROOT}/dev.crt
cp $(LK_ROOT_DIR)/${MTK_KEY_DIR}/${VERIFIED_KEY}.pem ${BL2_BUILDROOT}/dev.key
${HSM_ENV} HSM_KEY_NAME=${VERIFIED_KEY} $(UBOOT_MKIMG_TOOL) -D "-I dts -O dtb -p 1024" -F -k ${BL2_BUILDROOT} -K ${BL2_BUILDROOT}/lk.dtb -r ${BL2_BUILDROOT}/fitImage
python ${DEV_INFO_DIR}/dtb-transfer-array.py ${BL2_BUILDROOT}/lk.dtb ${BL2_BUILDROOT}/include/blob.h $(BL2_OFF_DT_STRINGS) $(BL2_SIZE_DT_STRINGS)
else
cp -f ${LK_DTS_DIR}/tmp_blob.txt ${BL2_BUILDROOT}/include/blob.h
endif
$(hide) echo $(LK_DIR)
$(hide) echo $(DTS_DIR)
$(hide) mkdir -p $(dir $@)
$(hide) mkdir -p $(PRODUCT_OUT)/$(LK_PROJECT)
$(hide) cp -rf $(LK_DIR) $(PRODUCT_OUT)/$(LK_PROJECT)
$(hide) cp -rf $(DRAMK_DIR) $(PRODUCT_OUT)/$(LK_PROJECT)
$(hide) cp -rf $(LK_EXT_DIR) $(PRODUCT_OUT)/$(LK_PROJECT)
LKINC=$(LK_BLOB_INC) $(MAKE) -C $(PRODUCT_OUT)/$(LK_PROJECT)/lk $(LOCAL_COMMON_MAKE_OPTION) $(LK_MAKE_OPTION) $(LK_PROJECT)
$(hide) cp -f $(PRODUCT_OUT)/$(LK_PROJECT)/lk/build-$(LK_PROJECT)/lk.bin $(PRODUCT_OUT)/bl2.bin
$(hide) $(LK_FIT_PACK_SCRIPT) $(PRODUCT_OUT) $(SBC_RSA_ALGO) $(SBC_HASH_ALGO) $(LK_LOADADDRESS) $(LK_ENTRYPOINT) $(LK_LOAD_OFFSET) $(LK_ROOT_DIR)/$(MTK_KEY_DIR)
else
BUILT_LK_TARGET := $(TARGET_PREBUILT_LK)
$(TARGET_PREBUILT_LK): $(BUILT_LK_TARGET)
$(hide) mkdir -p $(dir $@)
$(hide) cp -f $(BUILT_LK_TARGET) $@
endif#TARGET_PREBUILT_LK
ifeq ($(wildcard $(TARGET_PREBUILT_BL33)),)
.KATI_RESTAT: $(BUILT_BL33_TARGET)
$(BUILT_BL33_TARGET):
$(hide) rm -rf $(BL33_BUILDROOT)
$(hide) rm -rf $(PRODUCT_OUT)/bl33.bin
$(hide) rm -rf $(PRODUCT_OUT)/bl33.img
$(hide) mkdir -p ${BL33_BUILDROOT}
$(hide) mkdir -p ${BL33_BUILDROOT}/include
ifeq ($(strip $(SECURE_BOOT_ENABLE)), true)
cp ${DUMMY_IMG_DIR}/fitImage ${BL33_BUILDROOT}/
dtc -p 0x3ff ${LK_DTS_DIR}/lk.dts -O dtb -o ${BL33_BUILDROOT}/lk.dtb
cp $(LK_ROOT_DIR)/${MTK_KEY_DIR}/${VERIFIED_KEY}.crt ${BL33_BUILDROOT}/dev.crt
cp $(LK_ROOT_DIR)/${MTK_KEY_DIR}/${VERIFIED_KEY}.pem ${BL33_BUILDROOT}/dev.key
${HSM_ENV} HSM_KEY_NAME=${VERIFIED_KEY} $(UBOOT_MKIMG_TOOL) -D "-I dts -O dtb -p 1024" -F -k ${BL33_BUILDROOT} -K ${BL33_BUILDROOT}/lk.dtb -r ${BL33_BUILDROOT}/fitImage
python ${DEV_INFO_DIR}/dtb-transfer-array.py ${BL33_BUILDROOT}/lk.dtb ${BL33_BUILDROOT}/include/blob.h $(BL33_OFF_DT_STRINGS) $(BL33_SIZE_DT_STRINGS)
else
cp -f ${LK_DTS_DIR}/tmp_blob.txt ${BL33_BUILDROOT}/include/blob.h
endif
$(hide) mkdir -p $(dir $@)
$(hide) mkdir -p $(PRODUCT_OUT)/$(BL33_PROJECT)
$(hide) cp -rf $(LK_DIR) $(PRODUCT_OUT)/$(BL33_PROJECT)
$(hide) cp -rf $(DRAMK_DIR) $(PRODUCT_OUT)/$(BL33_PROJECT)
$(hide) cp -rf $(LK_EXT_DIR) $(PRODUCT_OUT)/$(BL33_PROJECT)
LKINC=$(BL33_BLOB_INC) $(MAKE) -C $(PRODUCT_OUT)/$(BL33_PROJECT)/lk $(LOCAL_COMMON_MAKE_OPTION) $(BL33_MAKE_OPTION) $(BL33_PROJECT)
$(hide) cp -f $(PRODUCT_OUT)/$(BL33_PROJECT)/lk/build-$(BL33_PROJECT)/lk.bin $(PRODUCT_OUT)/bl33.bin
$(hide) $(BL33_FIT_PACK_SCRIPT) $(PRODUCT_OUT) $(SBC_RSA_ALGO) $(SBC_HASH_ALGO) $(BL33_LOADADDRESS) $(BL33_ENTRYPOINT) $(BL33_LOAD_OFFSET) $(LK_ROOT_DIR)/$(MTK_KEY_DIR) $(SECURE_BOOT_ENABLE)
else
BUILT_BL33_TARGET := $(TARGET_PREBUILT_BL33)
$(TARGET_PREBUILT_BL33): $(BUILT_BL33_TARGET)
$(hide) mkdir -p $(dir $@)
$(hide) cp -f $(BUILT_BL33_TARGET) $@
endif#TARGET_PREBUILT_BL33
.PHONY: lk save-lk clean-lk bl33 save-bl33 clean-bl33
droidcore: $(BUILT_LK_TARGET) $(BUILT_BL33_TARGET)
lk: $(BUILT_LK_TARGET)
bl33: $(BUILT_BL33_TARGET)