From c8c251839e686acd50717fad5d63f8261cf7b08e Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Wed, 22 Apr 2020 16:27:46 +0200 Subject: [PATCH] exynos9610: initial common device tree Change-Id: I026a8f227fe40c3c61378dccd3285ed36858881f --- Android.mk | 23 +++++ BoardConfigCommon.mk | 99 +++++++++++++++++++ common.mk | 59 +++++++++++ extract-files.sh | 68 +++++++++++++ lineage.dependencies | 6 ++ .../base/core/res/res/xml/power_profile.xml | 64 ++++++++++++ proprietary-files.txt | 0 recovery.fstab | 19 ++++ setup-makefiles.sh | 48 +++++++++ 9 files changed, 386 insertions(+) create mode 100644 Android.mk create mode 100644 BoardConfigCommon.mk create mode 100644 common.mk create mode 100755 extract-files.sh create mode 100644 lineage.dependencies create mode 100644 overlay/frameworks/base/core/res/res/xml/power_profile.xml create mode 100644 proprietary-files.txt create mode 100644 recovery.fstab create mode 100755 setup-makefiles.sh diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..e7df7f8 --- /dev/null +++ b/Android.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2020 The LineageOS 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 := device/motorola/exynos9610-common + +ifneq ($(filter kane troika, $(TARGET_DEVICE)),) + +include $(call all-makefiles-under,$(LOCAL_PATH)) + +endif \ No newline at end of file diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk new file mode 100644 index 0000000..135bc66 --- /dev/null +++ b/BoardConfigCommon.mk @@ -0,0 +1,99 @@ +# +# Copyright (C) 2020 The LineageOS 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. +# + +COMMON_PATH := device/motorola/exynos9610-common + +# Include path +TARGET_SPECIFIC_HEADER_PATH := $(COMMON_PATH)/include + +# Platform +TARGET_BOARD_PLATFORM := exynos5 +TARGET_SOC := exynos9610 +TARGET_BOOTLOADER_BOARD_NAME := exynos9610 + +# Architecture +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := arm64-v8a +TARGET_CPU_ABI2 := +TARGET_CPU_VARIANT := generic +TARGET_CPU_VARIANT_RUNTIME := cortex-a73 + +# Secondary Architecture +TARGET_2ND_ARCH := arm +TARGET_2ND_ARCH_VARIANT := armv8-a +TARGET_2ND_CPU_ABI := armeabi-v7a +TARGET_2ND_CPU_ABI2 := armeabi +TARGET_2ND_CPU_VARIANT := generic +TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53 + +# Binder +TARGET_USES_64_BIT_BINDER := true + +# Extracted with libbootimg +BOARD_KERNEL_CMDLINE := loop.max_part=7 +BOARD_KERNEL_BASE := 0x10000000 +BOARD_KERNEL_OFFSET := 0x00008000 +BOARD_RAMDISK_OFFSET := 0x00000000 +BOARD_TAGS_OFFSET := 0x00000000 +BOARD_SECOND_OFFSET := 0x00000000 +BOARD_KERNEL_PAGESIZE := 2048 +BOARD_BOOTIMG_HEADER_VERSION := 1 + +BOARD_MKBOOTIMG_ARGS := --base $(BOARD_KERNEL_BASE) --pagesize $(BOARD_KERNEL_PAGESIZE) --kernel_offset $(BOARD_KERNEL_OFFSET) --second_offset $(BOARD_SECOND_OFFSET) --ramdisk_offset $(BOARD_RAMDISK_OFFSET) --tags_offset $(BOARD_TAGS_OFFSET) --header_version $(BOARD_BOOTIMG_HEADER_VERSION) + +# Kernel +TARGET_KERNEL_ARCH := arm64 +TARGET_KERNEL_HEADER_ARCH := arm64 +TARGET_KERNEL_CLANG_COMPILE := true +TARGET_KERNEL_SOURCE := kernel/motorola/exynos9610 +BOARD_KERNEL_IMAGE_NAME := Image + +# partitions +BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 118974455808 +BOARD_DTBOIMG_PARTITION_SIZE := 1048576 +BOARD_BUILD_SYSTEM_ROOT_IMAGE := true +BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64) +TARGET_USES_MKE2FS := true +BOARD_USES_METADATA_PARTITION := true + +# Recovery +BOARD_USES_RECOVERY_AS_BOOT := true +TARGET_NO_RECOVERY := true +TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/recovery.fstab +TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888" +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_USE_F2FS := true +TARGET_USES_MKE2FS := true + +# Verified Boot +BOARD_AVB_ENABLE := true +BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag +BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 2 + +# Properties +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true + +# Treble +BOARD_VNDK_VERSION := current + +# Audio +USE_XML_AUDIO_POLICY_CONF := 1 + +# Inherit from the proprietary version +-include vendor/motorola/exynos9610-common/BoardConfigVendor.mk diff --git a/common.mk b/common.mk new file mode 100644 index 0000000..4ece7a7 --- /dev/null +++ b/common.mk @@ -0,0 +1,59 @@ +# +# Copyright (C) 2020 The LineageOS 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. +# + +COMMON_PATH := device/motorola/exynos9610-common + +# Get non-open-source specific aspects +$(call inherit-product-if-exists, vendor/motorola/exynos9610-common/exynos9610-common-vendor.mk) + +DEVICE_PACKAGE_OVERLAYS += $(COMMON_PATH)/overlay + +# A/B +AB_OTA_UPDATER := true + +AB_OTA_PARTITIONS += \ + boot \ + dtbo \ + system \ + vbmeta + +AB_OTA_POSTINSTALL_CONFIG += \ + RUN_POSTINSTALL_system=true \ + POSTINSTALL_PATH_system=system/bin/otapreopt_script \ + FILESYSTEM_TYPE_system=ext4 \ + POSTINSTALL_OPTIONAL_system=true + +# Update engine +PRODUCT_PACKAGES += \ + update_engine \ + update_engine_sideload \ + update_verifier + +PRODUCT_PACKAGES += \ + otapreopt_script + +# Boot animation +TARGET_BOOTANIMATION_PRELOAD := true +TARGET_BOOTANIMATION_TEXTURE_CACHE := true +TARGET_SCREEN_HEIGHT := 2520 +TARGET_SCREEN_WIDTH := 1080 + +# Graphics +# Device uses high-density artwork where available +PRODUCT_AAPT_CONFIG := xlarge +PRODUCT_AAPT_PREF_CONFIG := xxxhdpi +# A list of dpis to select prebuilt apk, in precedence order. +PRODUCT_AAPT_PREBUILT_DPI := xxxhdpi xxhdpi xhdpi hdpi diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..bd2ad06 --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# +# Copyright (C) 2017-2020 The LineageOS 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. +# + +set -e + +VENDOR=motorola +DEVICE_COMMON=exynos9610-common + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}"/../../.. + +HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +SECTION= +KANG= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" +fi + +# Initialize the helper +setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${LINEAGE_ROOT}" true "${CLEAN_VENDOR}" + +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \ + "${KANG}" --section "${SECTION}" + +"${MY_DIR}/setup-makefiles.sh" diff --git a/lineage.dependencies b/lineage.dependencies new file mode 100644 index 0000000..3eb8df7 --- /dev/null +++ b/lineage.dependencies @@ -0,0 +1,6 @@ +[ + { + "repository": "android_kernel_motorola_exynos9610", + "target_path": "kernel/motorola/exynos9610-common" + } +] diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml new file mode 100644 index 0000000..22b9382 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml/power_profile.xml @@ -0,0 +1,64 @@ + + + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + + 0.2 + 0.1 + + + 1 + + + 400000 + + + 0.1 + + 0.1 + + 22.7 + + 1000 + 0 + 0 + 0 + + 0 + + .0002 + .002 + .02 + .2 + 2 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + + 0 + \ No newline at end of file diff --git a/proprietary-files.txt b/proprietary-files.txt new file mode 100644 index 0000000..e69de29 diff --git a/recovery.fstab b/recovery.fstab new file mode 100644 index 0000000..ed1063b --- /dev/null +++ b/recovery.fstab @@ -0,0 +1,19 @@ +# 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 + + +/dev/block/bootdevice/by-name/system / ext4 ro wait,slotselect +/dev/block/bootdevice/by-name/userdata /data f2fs rw,discard,nosuid,nodev,noatime,nodiratime,nobarrier,inline_xattr,inline_data,reserve_root=32768,resgid=1065 wait,check,formattable,fileencryption=aes-256-xts,quota,reservedsize=128M +/dev/block/bootdevice/by-name/efs /mnt/vendor/efs ext4 noatime,nosuid,nodev,barrier=1,rw wait +/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait,notrim +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/dev/block/bootdevice/by-name/slotinfo /slotinfo emmc defaults defaults +/dev/block/bootdevice/by-name/persist2 /mnt/product/persist ext4 noatime,nosuid,nodev,barrier=1 wait,formattable,nofail +/dev/block/zram0 none swap defaults zramsize=2147483648,max_comp_streams=8,zram_loopback_path=/data/unencrypted/zram_swap,zram_loopback_size=512M + +# VOLD +/devices/platform/13550000.dwmmc2/mmc_host* auto auto default voldmanaged=sdcard1:auto,encryptable=userdata +/devices/platform/13200000.usb* auto vfat default voldmanaged=usb1:auto +/devices/platform/13200000.usb/13200000.dwc3* auto vfat default voldmanaged=usb2:auto diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100755 index 0000000..adf83d4 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2017-2020 The LineageOS 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. +# + +set -e + +VENDOR=motorola +DEVICE_COMMON=exynos9610-common + +export INITIAL_COPYRIGHT_YEAR=2020 + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}/../../.." + +HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Initialize the helper +setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${LINEAGE_ROOT}" true + +# Copyright headers and guards +write_headers "kane troika" + +# The standard blobs +write_makefiles "${MY_DIR}/proprietary-files.txt" true + +# Finish +write_footers -- 2.20.1