Merge "Add a 64 bit only product for hikey."
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index f10d1cf..1b16eec 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -12,4 +12,5 @@
 PRODUCT_MAKEFILES := \
 $(LOCAL_DIR)/hikey.mk \
 $(LOCAL_DIR)/hikey32.mk \
+$(LOCAL_DIR)/hikey64_only.mk \
 $(LOCAL_DIR)/hikey960.mk
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index b1487ce..eb64ac6 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -10,8 +10,6 @@
 TARGET_2ND_CPU_ABI2 := armeabi
 
 TARGET_USES_64_BIT_BINDER := true
-TARGET_SUPPORTS_32_BIT_APPS := true
-TARGET_SUPPORTS_64_BIT_APPS := true
 
 WITH_DEXPREOPT ?= true
 USE_OPENGL_RENDERER := true
diff --git a/device-common.mk b/device-common.mk
index 4aefdbf..a03a80d 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -49,10 +49,6 @@
 PRODUCT_PACKAGES += \
     android.hardware.drm@1.0-impl \
 
-# Set zygote config
-PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote64_32
-PRODUCT_COPY_FILES += system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc
-
 PRODUCT_PACKAGES += libGLES_android
 
 # Graphics HAL
diff --git a/hikey-common.mk b/hikey-common.mk
new file mode 100644
index 0000000..2212f6c
--- /dev/null
+++ b/hikey-common.mk
@@ -0,0 +1,32 @@
+
+ifndef TARGET_KERNEL_USE
+TARGET_KERNEL_USE=4.9
+endif
+
+ifndef TARGET_COMPRESSED_KERNEL
+TARGET_COMPRESSED_KERNEL=false
+endif
+
+ifeq ($(TARGET_COMPRESSED_KERNEL), false)
+TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/Image-dtb-$(TARGET_KERNEL_USE)
+else
+TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/Image.gz-dtb-$(TARGET_KERNEL_USE)
+endif
+
+TARGET_PREBUILT_DTB := device/linaro/hikey-kernel/hi6220-hikey.dtb-$(TARGET_KERNEL_USE)
+
+ifeq ($(TARGET_KERNEL_USE), 3.18)
+  TARGET_FSTAB := fstab.hikey-$(TARGET_KERNEL_USE)
+  HIKEY_USE_LEGACY_TI_BLUETOOTH := true
+else
+  ifeq ($(TARGET_KERNEL_USE), 4.4)
+    HIKEY_USE_LEGACY_TI_BLUETOOTH := true
+  else
+    HIKEY_USE_LEGACY_TI_BLUETOOTH := false
+  endif
+  TARGET_FSTAB := fstab.hikey
+endif
+
+$(call inherit-product, device/linaro/hikey/hikey/device-hikey.mk)
+$(call inherit-product, device/linaro/hikey/device-common.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
diff --git a/hikey.mk b/hikey.mk
index ca6f2d1..0b32845 100644
--- a/hikey.mk
+++ b/hikey.mk
@@ -1,39 +1,6 @@
-ifndef TARGET_KERNEL_USE
-TARGET_KERNEL_USE=4.9
-endif
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, device/linaro/hikey/hikey-common.mk)
 
-ifndef TARGET_COMPRESSED_KERNEL
-TARGET_COMPRESSED_KERNEL=false
-endif
-
-ifeq ($(TARGET_COMPRESSED_KERNEL), false)
-TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/Image-dtb-$(TARGET_KERNEL_USE)
-else
-TARGET_PREBUILT_KERNEL := device/linaro/hikey-kernel/Image.gz-dtb-$(TARGET_KERNEL_USE)
-endif
-
-TARGET_PREBUILT_DTB := device/linaro/hikey-kernel/hi6220-hikey.dtb-$(TARGET_KERNEL_USE)
-
-ifeq ($(TARGET_KERNEL_USE), 3.18)
-  TARGET_FSTAB := fstab.hikey-$(TARGET_KERNEL_USE)
-  HIKEY_USE_LEGACY_TI_BLUETOOTH := true
-else
-  ifeq ($(TARGET_KERNEL_USE), 4.4)
-    HIKEY_USE_LEGACY_TI_BLUETOOTH := true
-  else
-    HIKEY_USE_LEGACY_TI_BLUETOOTH := false
-  endif
-  TARGET_FSTAB := fstab.hikey
-endif
-
-#
-# Inherit the full_base and device configurations
-$(call inherit-product, device/linaro/hikey/hikey/device-hikey.mk)
-$(call inherit-product, device/linaro/hikey/device-common.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
-
-#
-# Overrides
 PRODUCT_NAME := hikey
 PRODUCT_DEVICE := hikey
 PRODUCT_BRAND := Android
diff --git a/hikey32.mk b/hikey32.mk
index a08ee8c..2ae48a6 100644
--- a/hikey32.mk
+++ b/hikey32.mk
@@ -1,10 +1,5 @@
-# Set zygote32 config before one in hikey.mk
-PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.zygote=zygote32
-PRODUCT_COPY_FILES += system/core/rootdir/init.zygote32.rc:root/init.zygote32.rc
+$(call inherit-product, device/linaro/hikey/hikey-common.mk)
 
-$(call inherit-product, device/linaro/hikey/hikey.mk)
-
-#
-# Overrides
 PRODUCT_NAME := hikey32
 PRODUCT_DEVICE := hikey32
+PRODUCT_BRAND := Android
diff --git a/hikey32/BoardConfig.mk b/hikey32/BoardConfig.mk
index 9d1fd4f..d7e4180 100644
--- a/hikey32/BoardConfig.mk
+++ b/hikey32/BoardConfig.mk
@@ -11,8 +11,3 @@
 TARGET_2ND_CPU_ABI :=
 TARGET_2ND_CPU_ABI2 :=
 TARGET_2ND_CPU_VARIANT :=
-
-TARGET_SUPPORTS_64_BIT_APPS := false
-
-
-
diff --git a/hikey64/BoardConfig.mk b/hikey64/BoardConfig.mk
new file mode 100644
index 0000000..c690185
--- /dev/null
+++ b/hikey64/BoardConfig.mk
@@ -0,0 +1,15 @@
+include device/linaro/hikey/hikey/BoardConfig.mk
+
+AUDIOSERVER_MULTILIB := 64
+
+TARGET_ARCH := arm64
+TARGET_ARCH_VARIANT := armv8-a
+TARGET_CPU_ABI := arm64-v8a
+TARGET_CPU_ABI2 :=
+TARGET_CPU_VARIANT := cortex-a53
+
+TARGET_2ND_ARCH :=
+TARGET_2ND_ARCH_VARIANT :=
+TARGET_2ND_CPU_ABI :=
+TARGET_2ND_CPU_ABI2 :=
+TARGET_2ND_CPU_VARIANT :=
diff --git a/hikey64/board-info.txt b/hikey64/board-info.txt
new file mode 100644
index 0000000..a167e4d
--- /dev/null
+++ b/hikey64/board-info.txt
@@ -0,0 +1,2 @@
+require board=hikey
+require version-bootloader=0.7
diff --git a/hikey64_only.mk b/hikey64_only.mk
new file mode 100644
index 0000000..c2b4320
--- /dev/null
+++ b/hikey64_only.mk
@@ -0,0 +1,6 @@
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
+$(call inherit-product, device/linaro/hikey/hikey-common.mk)
+
+PRODUCT_NAME := hikey64_only
+PRODUCT_DEVICE := hikey64
+PRODUCT_BRAND := Android
diff --git a/hikey960.mk b/hikey960.mk
index 521321b..0612447 100644
--- a/hikey960.mk
+++ b/hikey960.mk
@@ -12,6 +12,7 @@
 
 #
 # Inherit the full_base and device configurations
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
 $(call inherit-product, device/linaro/hikey/hikey960/device-hikey960.mk)
 $(call inherit-product, device/linaro/hikey/device-common.mk)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
diff --git a/vendorsetup.sh b/vendorsetup.sh
index 6797c3a..cef0a19 100755
--- a/vendorsetup.sh
+++ b/vendorsetup.sh
@@ -21,4 +21,5 @@
 # function: add_lunch_combo generic-eng
 
 add_lunch_combo hikey-userdebug
+add_lunch_combo hikey64_only-userdebug
 add_lunch_combo hikey960-userdebug