sm8x50: Enable booting from mmc-sdcard
Set TARGET_SDCARD_BOOT=true at build time to build and boot
AOSP from mmc sdcard. This device configuration need atleast
16GB sdcard to boot from.
Booting from external sdcards will help prevent the internal
emmc/ufs wear off in the long run and extend the lab-life of
SM8550-HDKs.
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Change-Id: I59530d39915c051565e9d02087164c1cbd1fbae2
diff --git a/sm8x50/BoardConfig.mk b/sm8x50/BoardConfig.mk
index 4995b75..43f437f 100644
--- a/sm8x50/BoardConfig.mk
+++ b/sm8x50/BoardConfig.mk
@@ -23,17 +23,34 @@
BOARD_KERNEL_CMDLINE += qcom_geni_serial.con_enabled=1
BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200n8
BOARD_KERNEL_CMDLINE += allow_mismatched_32bit_el0 clk_ignore_unused pd_ignore_unused
+
+ifeq ($(TARGET_SDCARD_BOOT), true)
+BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc@0/8804000.mmc
+else
BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc@0/1d84000.ufs
+endif
+
BOARD_KERNEL_CMDLINE += androidboot.hardware=sm8x50
BOARD_KERNEL_CMDLINE += androidboot.verifiedbootstate=orange
# Image Configuration
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 #64M
+
+ifeq ($(TARGET_SDCARD_BOOT), true)
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 8589934592 #8G
+BOARD_FLASH_BLOCK_SIZE := 4096
+# Super partition
+BOARD_SUPER_PARTITION_SIZE := 4294967296 #4G
+BOARD_DB_DYNAMIC_PARTITIONS_SIZE := 4290772992 # Reserve 4M for DAP metadata
+BOARD_SEPOLICY_DIRS += device/linaro/dragonboard/shared/utils/sdcard-boot/sepolicy/
+else
BOARD_USERDATAIMAGE_PARTITION_SIZE := 223226966016 #200+G
BOARD_FLASH_BLOCK_SIZE := 131072
# Super partition
BOARD_SUPER_PARTITION_SIZE := 6442450944 #6GB
BOARD_DB_DYNAMIC_PARTITIONS_SIZE := 6438256640 # Reserve 4M for DAP metadata
+endif
+
BOARD_SUPER_PARTITION_METADATA_DEVICE := super
BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE := true
BOARD_DB_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor system_ext product