dragonboards: Copy fw files to generic ramdisk image

This will make sure that Venus, ADSP and CDSP firmware files
load successfully when we are booting AOSP from mmc-sdcard
with upstream u-boot, which only supports Android boot image
header version v2.

Change-Id: I6d0e24b502d7f28fd66f59a59db155ce43d82ab0
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
diff --git a/src/db845c/device.mk b/src/db845c/device.mk
index e978bfc..f5f94e8 100644
--- a/src/db845c/device.mk
+++ b/src/db845c/device.mk
@@ -55,8 +55,22 @@
 
 FIRMWARE_VENDOR_PATH := $(LINARO_VENDOR_PATH)/linux-firmware/$(EXPECTED_LINARO_VENDOR_VERSION)
 
-# Copy Venus and ADSP/CDSP firmware files to vendor ramdisk to drop the
+# Copy Venus and ADSP/CDSP firmware files to generic ramdisk or vendor ramdisk to drop the
 # dependency on user sysfs fw loader helper (FW_LOADER_USER_HELPER_FALLBACK)
+ifeq ($(TARGET_SDCARD_BOOT), true)
+PRODUCT_COPY_FILES += \
+    $(FIRMWARE_VENDOR_PATH)/qcom/sdm845/adsp.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/sdm845/adsp.mbn		\
+    $(FIRMWARE_VENDOR_PATH)/qcom/sdm845/adsp.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/sdm845/adsp.mdt		\
+    $(FIRMWARE_VENDOR_PATH)/qcom/sdm845/cdsp.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/sdm845/cdsp.mbn		\
+    $(FIRMWARE_VENDOR_PATH)/qcom/sdm845/cdsp.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/sdm845/cdsp.mdt		\
+    $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.b00:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.b00	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.b01:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.b01	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.b02:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.b02	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.b03:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.b03	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.b04:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.b04	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.mbn	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.mdt:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.mdt
+else
 PRODUCT_COPY_FILES += \
     $(FIRMWARE_VENDOR_PATH)/qcom/sdm845/adsp.mbn:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/sdm845/adsp.mbn		\
     $(FIRMWARE_VENDOR_PATH)/qcom/sdm845/adsp.mbn:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/sdm845/adsp.mdt		\
@@ -69,6 +83,7 @@
     $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.b04:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.b04	\
     $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.mbn:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.mbn	\
     $(FIRMWARE_VENDOR_PATH)/qcom/venus-5.2/venus.mdt:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/venus-5.2/venus.mdt
+endif
 
 # Copy notice/license files to rootfs
 # Not an AOSP requirement but other Linux distros do this
diff --git a/src/rb5/device.mk b/src/rb5/device.mk
index 8cf45bc..03ec1d5 100644
--- a/src/rb5/device.mk
+++ b/src/rb5/device.mk
@@ -48,8 +48,32 @@
 
 FIRMWARE_VENDOR_PATH := $(LINARO_VENDOR_PATH)/linux-firmware/$(EXPECTED_LINARO_VENDOR_VERSION)
 
-# Also copy a set of Venus, WiFi-BT and ADSP-CDSP firmware files to vendor ramdisk to drop the
+# Also copy a set of Venus, WiFi-BT and ADSP-CDSP firmware files to generic ramdisk or vendor ramdisk to drop the
 # dependency on user sysfs fw loader helper (FW_LOADER_USER_HELPER_FALLBACK)
+ifeq ($(TARGET_SDCARD_BOOT), true)
+PRODUCT_COPY_FILES += \
+    $(FIRMWARE_VENDOR_PATH)/ath11k/QCA6390/hw2.0/amss.bin:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/ath11k/QCA6390/hw2.0/amss.bin	\
+    $(LOCAL_PATH)/RB5_firmware_20210331-v4/38-bdwlan_split/bdwlan.e04:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/ath11k/QCA6390/hw2.0/board.bin	\
+    $(FIRMWARE_VENDOR_PATH)/ath11k/QCA6390/hw2.0/m3.bin:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/ath11k/QCA6390/hw2.0/m3.bin	\
+    $(FIRMWARE_VENDOR_PATH)/qca/htbtfw20.tlv:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qca/htbtfw20.tlv		\
+    $(FIRMWARE_VENDOR_PATH)/qca/htnv20.bin:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qca/htnv20.bin			\
+    $(FIRMWARE_VENDOR_PATH)/qcom/sm8250/adsp.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/sm8250/adsp.mbn	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/sm8250/cdsp.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/sm8250/cdsp.mbn	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b00:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b00	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b01:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b01	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b02:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b02	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b03:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b03	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b04:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b04	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b05:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b05	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b06:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b06	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b07:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b07	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b08:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b08	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b09:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b09	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b10:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b10	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b19:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b19	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.mbn:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.mbn	\
+    $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.mdt:$(TARGET_COPY_OUT_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.mdt
+else
 PRODUCT_COPY_FILES += \
     $(FIRMWARE_VENDOR_PATH)/ath11k/QCA6390/hw2.0/amss.bin:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/ath11k/QCA6390/hw2.0/amss.bin	\
     $(LOCAL_PATH)/RB5_firmware_20210331-v4/38-bdwlan_split/bdwlan.e04:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/ath11k/QCA6390/hw2.0/board.bin	\
@@ -72,6 +96,7 @@
     $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.b19:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.b19	\
     $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.mbn:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.mbn	\
     $(FIRMWARE_VENDOR_PATH)/qcom/vpu-1.0/venus.mdt:$(TARGET_COPY_OUT_VENDOR_RAMDISK)/vendor/firmware/qcom/vpu-1.0/venus.mdt
+endif
 
 # Copy notice/license files to rootfs
 # Not an AOSP requirement but other Linux distros do this