Skip to content
Snippets Groups Projects
Commit 1a7ec620 authored by Mikhail Kshevetskiy's avatar Mikhail Kshevetskiy
Browse files

airoha: add building of an7581 specific bootloader for board recovery

parent 4b3bb0cd
Branches
No related tags found
1 merge request!1411atf-2.10 building
...@@ -24,7 +24,7 @@ define Device/Default-airoha-nand ...@@ -24,7 +24,7 @@ define Device/Default-airoha-nand
KERNEL := kernel-bin | lzma | generate-uboot-images | prepare-atf-blobs | airoha-iowrt-kernel-fit lzma external-static KERNEL := kernel-bin | lzma | generate-uboot-images | prepare-atf-blobs | airoha-iowrt-kernel-fit lzma external-static
DEVICE_UBI_LAYOUT := ubinize.cfg.in DEVICE_UBI_LAYOUT := ubinize.cfg.in
UBINIZE_OPTS := -m 2048 -p 131072 -s 2048 UBINIZE_OPTS := -m 2048 -p 131072 -s 2048
ARTIFACTS := u-boot-nand.bin u-boot-ram.itb bootext.ram ARTIFACTS := u-boot-nand.bin u-boot-recovery.bin u-boot-ram.itb bootext.ram
IMAGE/production.img := $$(call airoha-nand-production) IMAGE/production.img := $$(call airoha-nand-production)
endef endef
...@@ -33,7 +33,7 @@ define Device/Default-airoha-emmc ...@@ -33,7 +33,7 @@ define Device/Default-airoha-emmc
FIT_PARTITION := 1 FIT_PARTITION := 1
KERNEL := kernel-bin | lzma | generate-uboot-images | prepare-atf-blobs | airoha-iowrt-kernel-fit lzma external-static-with-rootfs KERNEL := kernel-bin | lzma | generate-uboot-images | prepare-atf-blobs | airoha-iowrt-kernel-fit lzma external-static-with-rootfs
ARTIFACT/u-boot-emmc.fip := append-uboot-emmc ARTIFACT/u-boot-emmc.fip := append-uboot-emmc
ARTIFACTS := u-boot-emmc.fip u-boot-nand.bin u-boot-ram.itb bootext.ram ARTIFACTS := u-boot-emmc.fip u-boot-nand.bin u-boot-recovery.bin u-boot-ram.itb bootext.ram
IMAGE/production.img := $$(call airoha-emmc-production) IMAGE/production.img := $$(call airoha-emmc-production)
endef endef
...@@ -52,6 +52,7 @@ define Device/Default-airoha-common ...@@ -52,6 +52,7 @@ define Device/Default-airoha-common
UBOOT_RAM_LOADADDR := $(UBOOT_LOADADDR) UBOOT_RAM_LOADADDR := $(UBOOT_LOADADDR)
UBOOT_RAM_COMPRESSION := lzma UBOOT_RAM_COMPRESSION := lzma
UBOOT_ENV_BLACKLIST := $(DEFAULT_UBOOT_ENV_BLACKLIST) UBOOT_ENV_BLACKLIST := $(DEFAULT_UBOOT_ENV_BLACKLIST)
ARTIFACT/u-boot-recovery.bin := append-uboot-recovery
ARTIFACT/u-boot-nand.bin := append-uboot-nand ARTIFACT/u-boot-nand.bin := append-uboot-nand
ARTIFACT/u-boot-ram.itb := append-uboot-ram | lzma | iowrt-uboot-fit lzma ARTIFACT/u-boot-ram.itb := append-uboot-ram | lzma | iowrt-uboot-fit lzma
ARTIFACT/bootext.ram := append-bootext-ram ARTIFACT/bootext.ram := append-bootext-ram
......
...@@ -149,9 +149,20 @@ define generate-uboot-nand ...@@ -149,9 +149,20 @@ define generate-uboot-nand
rm -rf $(CERT_PATH)-$(notdir $(1)) $(WORK_PATH)-$(notdir $(1)) rm -rf $(CERT_PATH)-$(notdir $(1)) $(WORK_PATH)-$(notdir $(1))
# create an7581 specific bootloader image for board recovery
# --------------------------------------------------------------
# This bootloader go directly to command line instead of loading
# BL31/OPTEE images to the memory. This may be needed if BL31/OPTEE
# are bad, but properly signed.
#
# Note: there is no difference in behavior for en7523 case
cp $@-u-boot-nand.bin $@-u-boot-recovery.bin
echo -n recovery | dd of=$@-u-boot-recovery.bin bs=$$((0x7c000)) seek=1 conv=notrunc
@echo Saving U-Boot images for $(DEVICE_NAME) @echo Saving U-Boot images for $(DEVICE_NAME)
cp $@-bootext.ram $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-bootext.ram cp $@-bootext.ram $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-bootext.ram
cp $@-u-boot-nand.bin $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-nand.bin cp $@-u-boot-nand.bin $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-nand.bin
cp $@-u-boot-recovery.bin $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-recovery.bin
endef endef
# Generate U-Boot eMMC image # Generate U-Boot eMMC image
...@@ -176,6 +187,10 @@ define Build/prepare-atf-blobs ...@@ -176,6 +187,10 @@ define Build/prepare-atf-blobs
fi fi
endef endef
define Build/append-uboot-recovery
dd if=$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-recovery.bin >> $@
endef
define Build/append-uboot-nand define Build/append-uboot-nand
dd if=$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-nand.bin >> $@ dd if=$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-nand.bin >> $@
endef endef
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment