hikey/hikey960: support to specify the prebuilt kernel dir out of aosp tree

add LOCAL_KERNEL_HOME variable to support the use of out of aosp tree
prebuilt kernel dir, like the dist directory when building kernel
according to the instructions here[1].

[1]: https://source.android.com/setup/build/building-kernels

Test: export LOCAL_KERNEL_HOME=<out/hikey960/dist>
      export TARGET_KERNEL_USE=5.4
      source build/envsetup.sh; lunch hikey960-userdebug; make -j$(nproc) droidcore

      export LOCAL_KERNEL_HOME=<out/hikey/dist>
      export HIKEY_USES_GKI=true
      source build/envsetup.sh; lunch hikey-userdebug; make -j$(nproc) droidcore

Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Change-Id: Ide62267aa7b51d43280b4d3cefa0cbc82295b0d7
diff --git a/hikey-common.mk b/hikey-common.mk
index b156cc3..3df9ba7 100644
--- a/hikey-common.mk
+++ b/hikey-common.mk
@@ -4,8 +4,9 @@
 
 HIKEY_USE_DRM_HWCOMPOSER := false
 
-TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/hikey/$(TARGET_KERNEL_USE)/Image.gz-dtb
-TARGET_PREBUILT_DTB := device/linaro/hikey-kernel/hikey/$(TARGET_KERNEL_USE)/hi6220-hikey.dtb
+LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey/$(TARGET_KERNEL_USE)
+TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb
+TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi6220-hikey.dtb
 
 PRODUCT_ENFORCE_VINTF_MANIFEST_OVERRIDE := true
 
diff --git a/hikey.mk b/hikey.mk
index f8a8df9..3659579 100644
--- a/hikey.mk
+++ b/hikey.mk
@@ -15,7 +15,7 @@
 PRODUCT_BRAND := Android
 
 ifneq ($(HIKEY_USES_GKI),)
-HIKEY_MOD_DIR := device/linaro/hikey-kernel/hikey/$(TARGET_KERNEL_USE)/
+HIKEY_MOD_DIR := $(LOCAL_KERNEL_HOME)
 HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko)
 ifneq ($(HIKEY_MODS),)
   BOARD_VENDOR_KERNEL_MODULES += $(HIKEY_MODS)
diff --git a/hikey960.mk b/hikey960.mk
index 3a979f8..acd49df 100644
--- a/hikey960.mk
+++ b/hikey960.mk
@@ -1,8 +1,9 @@
 ifndef TARGET_KERNEL_USE
 TARGET_KERNEL_USE=5.4
 endif
-TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE)/Image.gz-dtb
-TARGET_PREBUILT_DTB := device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE)/hi3660-hikey960.dtb
+LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE)
+TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb
+TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi3660-hikey960.dtb
 
 ifeq ($(TARGET_KERNEL_USE), 4.4)
   HIKEY_USE_DRM_HWCOMPOSER := false
@@ -45,7 +46,7 @@
 PRODUCT_MODEL := AOSP on hikey960
 
 ifneq ($(HIKEY_USES_GKI),)
-  HIKEY_MOD_DIR := device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE)
+  HIKEY_MOD_DIR := $(LOCAL_KERNEL_HOME)
   HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko)
   SDCARDFS_KO := $(wildcard $(HIKEY_MOD_DIR)/sdcardfs*.ko)
   ifneq ($(HIKEY_MODS),)