db845c: Enable boot image header v3 support am: dd5bd1b45d

Original change: https://android-review.googlesource.com/c/device/linaro/dragonboard/+/1533191

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I191703df3a88a30cb44e0eac2d9dc8876158ef3b
diff --git a/db845c/BoardConfig.mk b/db845c/BoardConfig.mk
index 9d31f97..67120aa 100644
--- a/db845c/BoardConfig.mk
+++ b/db845c/BoardConfig.mk
@@ -6,10 +6,16 @@
 
 TARGET_NO_KERNEL := false
 BOARD_INCLUDE_DTB_IN_BOOTIMG := true
-BOARD_BOOT_HEADER_VERSION := 2
+ifeq ($(TARGET_USES_BOOT_HDR_V3), true)
+ BOARD_BOOT_HEADER_VERSION := 3
+ BOARD_KERNEL_PAGESIZE := 4096
+ BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 67108864 #64M
+else
+ BOARD_BOOT_HEADER_VERSION := 2
+ BOARD_KERNEL_PAGESIZE := 2048
+endif
 BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
 BOARD_KERNEL_BASE := 0x80000000
-BOARD_KERNEL_PAGESIZE := 2048
 BOARD_KERNEL_CMDLINE := earlycon firmware_class.path=/vendor/firmware/ androidboot.hardware=db845c
 BOARD_KERNEL_CMDLINE += init=/init androidboot.boot_devices=soc@0/1d84000.ufshc printk.devkmsg=on
 BOARD_KERNEL_CMDLINE += deferred_probe_timeout=30
diff --git a/db845c/device.mk b/db845c/device.mk
index 0c2cbf9..b6480a5 100644
--- a/db845c/device.mk
+++ b/db845c/device.mk
@@ -28,7 +28,11 @@
     system_ext \
     vendor
 
+ifeq ($(TARGET_USES_BOOT_HDR_V3), true)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
+else
 $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota.mk)
+endif
 
 PRODUCT_COPY_FILES := \
     $(DB845C_KERNEL_DIR)/Image.gz:kernel \
diff --git a/installer/db845c/README b/installer/db845c/README
index 61c3a3b..3b86aa9 100644
--- a/installer/db845c/README
+++ b/installer/db845c/README
@@ -38,16 +38,11 @@
 
 Flash the board:
 ----------------
-Once the board is in fastboot mode, you can then flash it by
-running the following from the
+Once the board is in fastboot mode, you can then flash bootloader
+binaries and AOSP images by running the following script from
 device/linaro/dragonboard/installer/db845c/ directory:
 
-  $ ./flash-all-aosp.sh <optional_kernel_binary>
-
-
-This will flash the bootloader binaries, AOSP images (userdata.img
-and super.img), and will also generate and flash boot.img if kernel
-binary (in Image.gz-dtb format) is passed to the script.
+  $ ./flash-all-aosp.sh
 
 
 Troubleshooting:
diff --git a/installer/db845c/flash-all-aosp.sh b/installer/db845c/flash-all-aosp.sh
index e6b1995..3451998 100755
--- a/installer/db845c/flash-all-aosp.sh
+++ b/installer/db845c/flash-all-aosp.sh
@@ -42,5 +42,7 @@
 fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img
 echo "FLASH-ALL-AOSP: Flash userdata image"
 fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img
+echo "FLASH-ALL-AOSP: Flash vendor_boot image"
+fastboot flash vendor_boot "${ANDROID_PRODUCT_OUT}"/vendor_boot.img
 
 fastboot reboot