Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
sm6150-common: convert to violet tree
Browse files Browse the repository at this point in the history
* Set device bringup year 2020
* Convert to violet
* Add violet specific overlays
* Remove FOD, violet doesn't have in display fp
* Set target API level for HIDL manifest
* Update extractor scripts
* Add lunch targets for violet
* Add device assertion

Change-Id: I74267c39e230c2b541294a21223f2dd5e709837d
Co-authored-by: Shubham Das <[email protected]>
  • Loading branch information
merothh and dasshubham762 committed Sep 24, 2020
1 parent 155e901 commit aaf9032
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 517 deletions.
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

LOCAL_PATH := $(call my-dir)

ifneq ($(filter davinci phoenix violet,$(TARGET_DEVICE)),)
ifeq ($(TARGET_DEVICE),violet)
include $(call all-makefiles-under,$(LOCAL_PATH))

include $(CLEAR_VARS)
Expand Down
12 changes: 12 additions & 0 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (C) 2019 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#

PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/lineage_violet.mk

COMMON_LUNCH_CHOICES := \
lineage_violet-userdebug \
lineage_violet-eng
42 changes: 25 additions & 17 deletions BoardConfigCommon.mk → BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

BOARD_VENDOR := xiaomi

COMMON_PATH := device/xiaomi/sm6150-common
DEVICE_PATH := device/xiaomi/violet

# Architecture
TARGET_ARCH := arm64
Expand All @@ -22,6 +22,9 @@ TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a9

# Assert
TARGET_OTA_ASSERT_DEVICE := violet

# ANT+
BOARD_ANT_WIRELESS_DEVICE := "qualcomm-hidl"

Expand All @@ -37,6 +40,7 @@ BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 2
# Kernel
BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom androidboot.console=ttyMSM0 service_locator.enable=1 swiotlb=1 earlycon=msm_geni_serial,0x880000 loop.max_part=7 cgroup.memory=nokmem,nosocket
BOARD_KERNEL_CMDLINE += androidboot.vbmeta.avb_version=1.0
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_OFFSET := 0x00008000
BOARD_KERNEL_TAGS_OFFSET := 0x00000100
BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb
Expand All @@ -45,11 +49,14 @@ TARGET_KERNEL_ADDITIONAL_FLAGS := \
DTC_EXT=$(shell pwd)/prebuilts/misc/$(HOST_OS)-x86/dtc/dtc
BOARD_KERNEL_SEPARATED_DTBO := true
TARGET_KERNEL_ARCH := arm64
TARGET_KERNEL_SOURCE := kernel/xiaomi/sm6150
TARGET_KERNEL_SOURCE := kernel/xiaomi/violet
TARGET_KERNEL_CONFIG := vendor/violet-perf_defconfig
TARGET_KERNEL_CLANG_COMPILE := true
BOARD_RAMDISK_OFFSET := 0x01000000

# Platform
TARGET_BOARD_PLATFORM := sm6150
TARGET_BOARD_PLATFORM_GPU := qcom-adreno612

# APEX
DEXPREOPT_GENERATE_APEX_IMAGE := true
Expand All @@ -74,7 +81,7 @@ USE_CUSTOM_AUDIO_POLICY := 1
USE_XML_AUDIO_POLICY_CONF := 1

# Bluetooth
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(COMMON_PATH)/bluetooth/include
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth/include
BOARD_HAVE_BLUETOOTH_QCOM := true
TARGET_FWK_SUPPORTS_FULL_VALUEADDS := true
TARGET_USE_QTI_BT_STACK := true
Expand All @@ -87,6 +94,7 @@ USE_DEVICE_SPECIFIC_CAMERA := true
BOARD_CHARGER_ENABLE_SUSPEND := true

# Display
TARGET_SCREEN_DENSITY := 440
TARGET_USES_DISPLAY_RENDER_INTENTS := true

# DPM
Expand All @@ -96,7 +104,7 @@ BOARD_USES_DPM := true
TARGET_ENABLE_MEDIADRM_64 := true

# Filesystem
TARGET_FS_CONFIG_GEN := $(COMMON_PATH)/config.fs
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs

# FM
BOARD_HAS_QCA_FM_SOC := "cherokee"
Expand All @@ -121,14 +129,14 @@ TARGET_USES_QTI_MAPPER_2_0 := true
TARGET_USES_QTI_MAPPER_EXTENSIONS_1_1 := true

# HIDL
DEVICE_MANIFEST_FILE := $(COMMON_PATH)/manifest.xml
DEVICE_MATRIX_FILE := $(COMMON_PATH)/compatibility_matrix.xml
DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/manifest.xml
DEVICE_MATRIX_FILE := $(DEVICE_PATH)/compatibility_matrix.xml
ODM_MANIFEST_SKUS += \
365 \
366

ODM_MANIFEST_365_FILES := $(COMMON_PATH)/manifest_sdmmagpie.xml
ODM_MANIFEST_366_FILES := $(COMMON_PATH)/manifest_sdmmagpie.xml
ODM_MANIFEST_365_FILES := $(DEVICE_PATH)/manifest_sdmmagpie.xml
ODM_MANIFEST_366_FILES := $(DEVICE_PATH)/manifest_sdmmagpie.xml

# Media
TARGET_DISABLED_UBWC := true
Expand Down Expand Up @@ -159,22 +167,22 @@ TARGET_COPY_OUT_PRODUCT := product
TARGET_COPY_OUT_VENDOR := vendor

# Properties
TARGET_ODM_PROP += $(COMMON_PATH)/odm.prop
TARGET_PRODUCT_PROP += $(COMMON_PATH)/product.prop
TARGET_VENDOR_PROP += $(COMMON_PATH)/vendor.prop
TARGET_ODM_PROP += $(DEVICE_PATH)/odm.prop
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop

# QCOM
BOARD_USES_QCOM_HARDWARE := true

# Recovery
BOARD_INCLUDE_DTB_IN_BOOTIMG := true
BOARD_INCLUDE_RECOVERY_DTBO := true
TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/fstab.qcom
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"

# Releasetools
TARGET_RECOVERY_UPDATER_LIBS := librecovery_updater_xiaomi
TARGET_RELEASETOOLS_EXTENSIONS := $(COMMON_PATH)
TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)

# RenderScript
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
Expand All @@ -190,9 +198,9 @@ VENDOR_SECURITY_PATCH := 2020-08-01
# Sepolicy
TARGET_SEPOLICY_DIR := msmsteppe
include device/qcom/sepolicy/sepolicy.mk
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(COMMON_PATH)/sepolicy/private
BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(COMMON_PATH)/sepolicy/public
BOARD_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(DEVICE_PATH)/sepolicy/private
BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(DEVICE_PATH)/sepolicy/public
BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor

# WiFi
BOARD_HOSTAPD_DRIVER := NL80211
Expand All @@ -210,4 +218,4 @@ WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
WPA_SUPPLICANT_VERSION := VER_0_8_X

# Inherit from the proprietary version
-include vendor/xiaomi/sm6150-common/BoardConfigVendor.mk
-include vendor/xiaomi/violet/BoardConfigVendor.mk
7 changes: 5 additions & 2 deletions sm6150.mk → device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Inherit from those products. Most specific first.
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk)

# Enable updating of APEXes
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
Expand All @@ -15,7 +16,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk)

# Get non-open-source specific aspects
$(call inherit-product-if-exists, vendor/xiaomi/sm6150-common/sm6150-common-vendor.mk)
$(call inherit-product-if-exists, vendor/xiaomi/violet/violet-vendor.mk)

# Overlays
DEVICE_PACKAGE_OVERLAYS += \
Expand Down Expand Up @@ -76,7 +77,9 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml \
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml \
frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \
frameworks/native/data/etc/android.hardware.wifi.rtt.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.rtt.xml \
frameworks/native/data/etc/android.hardware.wifi.aware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.aware.xml

# AID/fs configs
PRODUCT_PACKAGES += \
Expand Down
34 changes: 10 additions & 24 deletions extract-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

set -e

DEVICE=violet
VENDOR=xiaomi

DEVICE_BRINGUP_YEAR=2020

# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
Expand All @@ -23,19 +28,11 @@ source "${HELPER}"
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true

ONLY_COMMON=
ONLY_TARGET=
SECTION=
KANG=

while [ "${#}" -gt 0 ]; do
case "${1}" in
--only-common )
ONLY_COMMON=true
;;
--only-target )
ONLY_TARGET=true
;;
-n | --no-cleanup )
CLEAN_VENDOR=false
;;
Expand Down Expand Up @@ -72,23 +69,12 @@ function blob_fixup() {
esac
}

if [ -z "${ONLY_TARGET}" ]; then
# Initialize the helper for common device
setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${LINEAGE_ROOT}" true "${CLEAN_VENDOR}"
# Initialize the helper for common device
setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" true "${CLEAN_VENDOR}"

extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"
fi

if [ -z "${ONLY_COMMON}" ] && [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then
# Reinitialize the helper for device
source "${MY_DIR}/../${DEVICE}/extract-files.sh"
setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" false "${CLEAN_VENDOR}"

extract "${MY_DIR}/../${DEVICE}/proprietary-files.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"
fi
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"

COMMON_BLOB_ROOT="${LINEAGE_ROOT}/vendor/${VENDOR}/${DEVICE_COMMON}/proprietary"
BLOB_ROOT="${LINEAGE_ROOT}/vendor/${VENDOR}/${DEVICE}/proprietary"

"${MY_DIR}/setup-makefiles.sh"
49 changes: 0 additions & 49 deletions fod/Android.bp

This file was deleted.

Loading

0 comments on commit aaf9032

Please sign in to comment.