dragonboards: Add boot image header v4 support and remove v2

Boot image header v3 remains the default header version for
db845c-userdebug builds because android11-5.4 kernel do not
have bootconfig support. To build v4 header images set
TARGET_USES_BOOT_HDR_V3=false at build time. Also removed
v2 header support for DB845c because of lack of users.

Boot image header v4 is the default header version for
rb5-userdebug builds.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Change-Id: Icdfef0d348a87fb10a0f56f1a98490070077aa55
diff --git a/db845c/BoardConfig.mk b/db845c/BoardConfig.mk
index 5b6bfa0..25187de 100644
--- a/db845c/BoardConfig.mk
+++ b/db845c/BoardConfig.mk
@@ -21,16 +21,16 @@
 BOARD_INCLUDE_DTB_IN_BOOTIMG := true
 ifeq ($(TARGET_USES_BOOT_HDR_V3), true)
  BOARD_BOOT_HEADER_VERSION := 3
- BOARD_KERNEL_PAGESIZE := 4096
- BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M
+ BOARD_KERNEL_CMDLINE += androidboot.hardware=db845c androidboot.boot_devices=soc@0/1d84000.ufshc
 else
- BOARD_BOOT_HEADER_VERSION := 2
- BOARD_KERNEL_PAGESIZE := 2048
+ BOARD_BOOT_HEADER_VERSION := 4
+ BOARD_BOOTCONFIG += androidboot.hardware=db845c androidboot.boot_devices=soc@0/1d84000.ufshc
 endif
 BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
 BOARD_KERNEL_BASE := 0x80000000
-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_PAGESIZE := 4096
+BOARD_KERNEL_CMDLINE += earlycon firmware_class.path=/vendor/firmware/
+BOARD_KERNEL_CMDLINE += init=/init printk.devkmsg=on
 BOARD_KERNEL_CMDLINE += deferred_probe_timeout=30
 BOARD_KERNEL_CMDLINE += pcie_pme=nomsi #For WiFi to work on rb5
 BOARD_KERNEL_CMDLINE += qcom_geni_serial.con_enabled=1
@@ -38,6 +38,7 @@
 
 # Image Configuration
 BOARD_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M
+BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 21474836480 #20G
 BOARD_FLASH_BLOCK_SIZE := 512
 # Super partition
diff --git a/rb5/BoardConfig.mk b/rb5/BoardConfig.mk
index c90b8f8..e9503ac 100644
--- a/rb5/BoardConfig.mk
+++ b/rb5/BoardConfig.mk
@@ -22,15 +22,16 @@
 BOARD_KERNEL_PAGESIZE := 4096
 
 BOARD_INCLUDE_DTB_IN_BOOTIMG := true
-BOARD_BOOT_HEADER_VERSION := 3
+BOARD_BOOT_HEADER_VERSION := 4
 BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
 
-BOARD_KERNEL_CMDLINE := earlycon firmware_class.path=/vendor/firmware/ androidboot.hardware=rb5
-BOARD_KERNEL_CMDLINE += init=/init androidboot.boot_devices=soc@0/1d84000.ufshc printk.devkmsg=on
+BOARD_KERNEL_CMDLINE := earlycon firmware_class.path=/vendor/firmware/
+BOARD_KERNEL_CMDLINE += init=/init printk.devkmsg=on
 BOARD_KERNEL_CMDLINE += pcie_pme=nomsi #For WiFi to work
 BOARD_KERNEL_CMDLINE += deferred_probe_timeout=30
 BOARD_KERNEL_CMDLINE += qcom_geni_serial.con_enabled=1
 BOARD_KERNEL_CMDLINE += console=ttyMSM0
+BOARD_BOOTCONFIG += androidboot.hardware=rb5 androidboot.boot_devices=soc@0/1d84000.ufshc
 
 # Image Configuration
 BOARD_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M