HiKey: Add BOARD_VENDOR_RAMDISK_KERNEL_MODULES for HiKey

Add a number of ramdisk modules to hikey in order
to get things booting properly with modules.

This is hidden behind a HIKEY_USE_GKI for now, as we
have trouble switching between modular and non-modular
builds.

Change-Id: Ibc79f74ac9555e8e4d75c829b5da14d16cceb337
Signed-off-by: John Stultz <john.stultz@linaro.org>
diff --git a/hikey.mk b/hikey.mk
index 9e29243..1c26335 100644
--- a/hikey.mk
+++ b/hikey.mk
@@ -14,7 +14,36 @@
 PRODUCT_DEVICE := hikey
 PRODUCT_BRAND := Android
 
-HIKEY_MODS := $(wildcard device/linaro/hikey-kernel/hikey/$(TARGET_KERNEL_USE)/*.ko)
+ifneq ($(HIKEY_USES_GKI),)
+HIKEY_MOD_DIR := device/linaro/hikey-kernel/hikey/5.4/
+HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko)
 ifneq ($(HIKEY_MODS),)
   BOARD_VENDOR_KERNEL_MODULES += $(HIKEY_MODS)
+  # XXX dwc2/phy-hi6220-usb have some timing
+  # issue that prevents gadget mode from working
+  # unless they are loaded from initrd. Need to fix.
+  BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
+	$(HIKEY_MOD_DIR)/dwc2.ko \
+	$(HIKEY_MOD_DIR)/phy-hi6220-usb.ko
+
+  # make sure ion cma heap loads early
+  BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
+	$(HIKEY_MOD_DIR)/ion_cma_heap.ko
+
+  # Not sure why, but powerkey has to be initrd
+  # or else we'll see stalls or issues at bootup
+  BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
+	$(HIKEY_MOD_DIR)/hisi_powerkey.ko
+
+  BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
+	$(HIKEY_MOD_DIR)/hi655x-regulator.ko \
+	$(HIKEY_MOD_DIR)/clk-hi655x.ko \
+	$(HIKEY_MOD_DIR)/hi655x-pmic.ko \
+	$(HIKEY_MOD_DIR)/mmc_core.ko \
+	$(HIKEY_MOD_DIR)/mmc_block.ko \
+	$(HIKEY_MOD_DIR)/dw_mmc-k3.ko \
+	$(HIKEY_MOD_DIR)/dw_mmc-pltfm.ko \
+	$(HIKEY_MOD_DIR)/dw_mmc.ko \
+
+endif
 endif