diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..777e760 --- /dev/null +++ b/Android.mk @@ -0,0 +1,21 @@ +# +# Copyright (C) 2016 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := $(call my-dir) + +ifeq ($(TARGET_DEVICE),land) +include $(call all-makefiles-under,$(LOCAL_PATH)) +endif diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..b9620dd --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2016 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +DEVICE_PATH := device/xiaomi/land + +include $(DEVICE_PATH)/PlatformConfig.mk +include $(DEVICE_PATH)/board/*.mk + +# Inherit the proprietary files +-include vendor/xiaomi/land/BoardConfigVendor.mk diff --git a/PlatformConfig.mk b/PlatformConfig.mk new file mode 100644 index 0000000..86945ae --- /dev/null +++ b/PlatformConfig.mk @@ -0,0 +1,16 @@ +# Platform +TARGET_BOARD_PLATFORM := msm8937 + +# Architecture +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := arm64-v8a +TARGET_CPU_ABI2 := +TARGET_CPU_VARIANT := generic + +# Second architecture +TARGET_2ND_ARCH := arm +TARGET_2ND_ARCH_VARIANT := armv7-a-neon +TARGET_2ND_CPU_ABI := armeabi-v7a +TARGET_2ND_CPU_ABI2 := armeabi +TARGET_2ND_CPU_VARIANT := cortex-a53 diff --git a/board/ant.mk b/board/ant.mk new file mode 100644 index 0000000..e7535b8 --- /dev/null +++ b/board/ant.mk @@ -0,0 +1,2 @@ +# ANT +BOARD_ANT_WIRELESS_DEVICE := "vfs-prerelease" diff --git a/board/bluetooth.mk b/board/bluetooth.mk new file mode 100644 index 0000000..9228024 --- /dev/null +++ b/board/bluetooth.mk @@ -0,0 +1,2 @@ +# Bluetooth +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth diff --git a/board/bootloader.mk b/board/bootloader.mk new file mode 100644 index 0000000..9e01cab --- /dev/null +++ b/board/bootloader.mk @@ -0,0 +1,4 @@ +# Bootloader +TARGET_BOOTLOADER_BOARD_NAME := MSM8937 + +TARGET_NO_BOOTLOADER := true diff --git a/board/camera.mk b/board/camera.mk new file mode 100644 index 0000000..82ffff8 --- /dev/null +++ b/board/camera.mk @@ -0,0 +1,2 @@ +# Camera +USE_DEVICE_SPECIFIC_CAMERA := true diff --git a/board/charger.mk b/board/charger.mk new file mode 100644 index 0000000..a70804e --- /dev/null +++ b/board/charger.mk @@ -0,0 +1,3 @@ +# Charger +BOARD_CHARGER_DISABLE_INIT_BLANK := true +BOARD_CHARGER_ENABLE_SUSPEND := true diff --git a/board/cpusets.mk b/board/cpusets.mk new file mode 100644 index 0000000..31ffbfc --- /dev/null +++ b/board/cpusets.mk @@ -0,0 +1,2 @@ +# CPUsets +ENABLE_CPUSETS := true diff --git a/board/filesystem.mk b/board/filesystem.mk new file mode 100644 index 0000000..d25c84b --- /dev/null +++ b/board/filesystem.mk @@ -0,0 +1,10 @@ +# Partitions +BOARD_BOOTIMAGE_PARTITION_SIZE := 41943040 +BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456 +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 41943040 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 27258747904 + +BOARD_FLASH_BLOCK_SIZE := 131072 + +TARGET_USERIMAGES_USE_EXT4 := true diff --git a/board/gps.mk b/board/gps.mk new file mode 100644 index 0000000..dcb6aa1 --- /dev/null +++ b/board/gps.mk @@ -0,0 +1,2 @@ +# GPS +USE_DEVICE_SPECIFIC_GPS := true diff --git a/board/hardware.mk b/board/hardware.mk new file mode 100644 index 0000000..689f1bb --- /dev/null +++ b/board/hardware.mk @@ -0,0 +1,4 @@ +# CM Hardware +BOARD_USES_CYANOGEN_HARDWARE := true +BOARD_HARDWARE_CLASS += \ + hardware/cyanogen/cmhw diff --git a/board/kernel.mk b/board/kernel.mk new file mode 100644 index 0000000..ca8f63a --- /dev/null +++ b/board/kernel.mk @@ -0,0 +1,11 @@ +# kernel +BOARD_KERNEL_BASE := 0x80000000 +BOARD_CUSTOM_BOOTIMG_MK := $(DEVICE_PATH)/mkbootimg.mk +BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78B0000 +BOARD_KERNEL_PAGESIZE := 2048 +BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100 +TARGET_KERNEL_ARCH := arm64 +TARGET_KERNEL_CONFIG := cyanogenmod_land_defconfig +TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android- +TARGET_KERNEL_SOURCE := kernel/xiaomi/msm8937 +TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/kernel diff --git a/board/lights.mk b/board/lights.mk new file mode 100644 index 0000000..fe02d0f --- /dev/null +++ b/board/lights.mk @@ -0,0 +1,2 @@ +# Lights +TARGET_PROVIDES_LIBLIGHT := true diff --git a/board/malloc.mk b/board/malloc.mk new file mode 100644 index 0000000..fb8e527 --- /dev/null +++ b/board/malloc.mk @@ -0,0 +1,2 @@ +# Malloc +MALLOC_IMPL := dlmalloc diff --git a/board/qcom-audio.mk b/board/qcom-audio.mk new file mode 100644 index 0000000..8d12d4d --- /dev/null +++ b/board/qcom-audio.mk @@ -0,0 +1,21 @@ +# Audio +AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true +AUDIO_FEATURE_ENABLED_ANC_HEADSET := true +AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true +AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true +AUDIO_FEATURE_ENABLED_DEV_ARBI := true +AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true +AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true +AUDIO_FEATURE_ENABLED_FLUENCE := true +AUDIO_FEATURE_ENABLED_HFP := true +AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true +AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true +AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true +AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true +AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true +AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true + +AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true +BOARD_SUPPORTS_SOUND_TRIGGER := true +BOARD_USES_ALSA_AUDIO := true +USE_CUSTOM_AUDIO_POLICY := 1 diff --git a/board/qcom-bluetooth.mk b/board/qcom-bluetooth.mk new file mode 100644 index 0000000..7942087 --- /dev/null +++ b/board/qcom-bluetooth.mk @@ -0,0 +1,4 @@ +BOARD_HAVE_BLUETOOTH_QCOM := true + +BLUETOOTH_HCI_USE_MCT := true +QCOM_BT_USE_SMD_TTY := true diff --git a/board/qcom-cne.mk b/board/qcom-cne.mk new file mode 100644 index 0000000..1acb729 --- /dev/null +++ b/board/qcom-cne.mk @@ -0,0 +1,2 @@ +# CNE +BOARD_USES_QCNE := true diff --git a/board/qcom-crypto.mk b/board/qcom-crypto.mk new file mode 100644 index 0000000..92f418a --- /dev/null +++ b/board/qcom-crypto.mk @@ -0,0 +1,5 @@ +# Encryption +TARGET_HW_DISK_ENCRYPTION := true + +# Keystore +TARGET_KEYMASTER_WAIT_FOR_QSEE := true diff --git a/board/qcom-display.mk b/board/qcom-display.mk new file mode 100644 index 0000000..97a0fee --- /dev/null +++ b/board/qcom-display.mk @@ -0,0 +1,10 @@ +MAX_EGL_CACHE_KEY_SIZE := 12*1024 +MAX_EGL_CACHE_SIZE := 2048*1024 + +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 + +OVERRIDE_RS_DRIVER := libRSDriver_adreno.so + +TARGET_USES_C2D_COMPOSITION := true +TARGET_USES_ION := true +USE_OPENGL_RENDERER := true diff --git a/board/qcom-fm.mk b/board/qcom-fm.mk new file mode 100644 index 0000000..e3d90b7 --- /dev/null +++ b/board/qcom-fm.mk @@ -0,0 +1,4 @@ +# FM +AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true + +TARGET_QCOM_NO_FM_FIRMWARE := true diff --git a/board/qcom-platform.mk b/board/qcom-platform.mk new file mode 100644 index 0000000..76fc729 --- /dev/null +++ b/board/qcom-platform.mk @@ -0,0 +1,22 @@ +# Binder +TARGET_USES_64_BIT_BINDER := true + +# Init +TARGET_INIT_VENDOR_LIB := libinit_land +TARGET_PLATFORM_DEVICE_BASE := /devices/soc.0/ +TARGET_RECOVERY_DEVICE_MODULES := libinit_land + +# Peripheral manager +TARGET_PER_MGR_ENABLED := true + +# Power +TARGET_POWERHAL_VARIANT := qcom + +# QCOM support +BOARD_USES_QCOM_HARDWARE := true + +# RIL +TARGET_RIL_VARIANT := caf + +# Time +BOARD_USES_QC_TIME_SERVICES := true diff --git a/board/qcom-sepolicy.mk b/board/qcom-sepolicy.mk new file mode 100644 index 0000000..cf759b1 --- /dev/null +++ b/board/qcom-sepolicy.mk @@ -0,0 +1,2 @@ +# SELinux +include device/qcom/sepolicy/sepolicy.mk diff --git a/board/qcom-wlan.mk b/board/qcom-wlan.mk new file mode 100644 index 0000000..a7dca4c --- /dev/null +++ b/board/qcom-wlan.mk @@ -0,0 +1,21 @@ +# Wi-Fi +BOARD_HAS_QCOM_WLAN := true + +BOARD_HOSTAPD_DRIVER := NL80211 +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_qcwcn + +BOARD_WLAN_DEVICE := qcwcn + +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_qcwcn + +TARGET_USES_QCOM_WCNSS_QMI := true + +WIFI_DRIVER_FW_PATH_AP := "ap" +WIFI_DRIVER_FW_PATH_STA := "sta" + +WPA_SUPPLICANT_VERSION := VER_0_8_X + +# EAP +CONFIG_EAP_PROXY := qmi +CONFIG_EAP_PROXY_DUAL_SIM := true diff --git a/board/recovery.mk b/board/recovery.mk new file mode 100644 index 0000000..fc5968f --- /dev/null +++ b/board/recovery.mk @@ -0,0 +1 @@ +TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/fstab.qcom diff --git a/board/sepolicy.mk b/board/sepolicy.mk new file mode 100644 index 0000000..4e9f7f2 --- /dev/null +++ b/board/sepolicy.mk @@ -0,0 +1,3 @@ +# SELinux +BOARD_SEPOLICY_DIRS += \ + $(DEVICE_PATH)/sepolicy diff --git a/mkbootimg.mk b/mkbootimg.mk new file mode 100644 index 0000000..b55a19c --- /dev/null +++ b/mkbootimg.mk @@ -0,0 +1,52 @@ +LOCAL_PATH := $(call my-dir) + +# Use prebuilt kernel +INTERNAL_BOOTIMAGE_ARGS := \ + $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ + --kernel $(TARGET_PREBUILT_KERNEL) + +ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) +INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET) +endif + +INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS)) + +INTERNAL_RECOVERYIMAGE_ARGS := \ + $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ + --kernel $(TARGET_PREBUILT_KERNEL) \ + --ramdisk $(recovery_ramdisk) + +BOARD_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE)) +ifdef BOARD_KERNEL_CMDLINE + INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)" + INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)" +endif + +BOARD_KERNEL_BASE := $(strip $(BOARD_KERNEL_BASE)) +ifdef BOARD_KERNEL_BASE + INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) + INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) +endif + +BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE)) +ifdef BOARD_KERNEL_PAGESIZE + INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) + INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) +endif + +# Overload bootimg generation: Same as the original, using prebuilt kernel +$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) + $(call pretty,"Target boot image: $@") + $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ + $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw) + @echo -e ${CL_CYN}"Made boot image: $@"${CL_RST} + +# Overload recoveryimg generation: Same as the original, using prebuilt kernel +$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \ + $(recovery_ramdisk) \ + $(recovery_kernel) + $(call build-recoveryimage-target, $@) + @echo -e ${CL_CYN}"----- Making recovery image ------"${CL_RST} + $(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@ + $(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw) + @echo -e ${CL_CYN}"Made recovery image: $@"${CL_RST} diff --git a/rootdir/fstab.qcom b/rootdir/fstab.qcom new file mode 100644 index 0000000..116c210 --- /dev/null +++ b/rootdir/fstab.qcom @@ -0,0 +1,14 @@ +# Android fstab file. +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + +#TODO: Add 'check' as fs_mgr_flags with data partition. +# Currently we dont have e2fsck compiled. So fs check would failed. + +# +/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait,verify +/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,resize,check,forceencrypt=footer +/dev/block/bootdevice/by-name/cust /cust ext4 nosuid,nodev,barrier=1 wait,check +/devices/soc/7864900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=footer +/dev/block/bootdevice/by-name/config /frp emmc defaults defaults +/devices/soc/78db000.usb/msm_hsusb_host* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto