From 49b859887727f9d4119159033d5cc1247071f3d4 Mon Sep 17 00:00:00 2001 From: Max Weffers Date: Thu, 27 Sep 2018 11:52:08 +0200 Subject: [PATCH] clover: Intial Device-Tree for Mi PAD 4 --- Android.bp | 19 +++ Android.mk | 22 ++++ BoardConfig.mk | 27 ++++ README.md | 25 ++++ device.mk | 45 +++++++ .../base/core/res/res/values/config.xml | 115 ++++++++++++++++++ .../base/core/res/res/xml/power_profile.xml | 58 +++++++++ vendorsetup.sh | 19 +++ 8 files changed, 330 insertions(+) create mode 100644 Android.bp create mode 100644 Android.mk create mode 100644 BoardConfig.mk create mode 100644 README.md create mode 100644 device.mk create mode 100755 overlay/frameworks/base/core/res/res/values/config.xml create mode 100755 overlay/frameworks/base/core/res/res/xml/power_profile.xml create mode 100644 vendorsetup.sh diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..3b86b81 --- /dev/null +++ b/Android.bp @@ -0,0 +1,19 @@ +//# +//# Copyright 2018 The Android Open Source 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. +//# + +subdirs = [ + "*" +] diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..729e6e4 --- /dev/null +++ b/Android.mk @@ -0,0 +1,22 @@ +# +# Copyright 2018 The Android Open Source 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),clover) +include $(call all-makefiles-under,$(LOCAL_PATH)) + +include $(CLEAR_VARS) diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..9a6cd65 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,27 @@ +# +# Copyright 2018 The Android Open Source 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. +# + +include device/xiaomi/sdm660-common/PlatformConfig.mk + +DEVICE_PATH := device/xiaomi/clover + +# Platform +BOARD_VENDOR_PLATFORM := xiaomi-sdm660 + +# Kernel +TARGET_KERNEL_SOURCE := kernel/xiaomi/clover +TARGET_KERNEL_CONFIG := clover-perf_defconfig +TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz-dtb diff --git a/README.md b/README.md new file mode 100644 index 0000000..a432342 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +Copyright 2018 The Android Open Source Project + +The MI PAD 4 (codenamed _"clover"_) are high-end mid-range tablet from Xiaomi. + +Xiaomi MI PAD 4 was announced and released in June 2018. + +## Device specifications + +| Device | Xiaomi MI PAD 4 / Xiaomi MI PAD 4 PLUS | +| -----------: | :---------------------------------------------- | +| SoC | Qualcomm SDM660 Snapdragon 660 | +| CPU | 8x Qualcomm® Kryo™ 260 up to 2.2GHz | +| GPU | Adreno 512 | +| Memory | 3GB / 4GM RAM (LPDDR4X) | +| Shipped Android version | 8.1.0 | +| Storage | 64GB eMMC 5.1 flash storage | +| Battery | Non-removable Li-Po 6000 mAh | +| Dimensions | 200.2 x 120.3 x 7.9 mm | +| Display | 1920 x 1200 (16:10), 8.0 inch or 10.1 inch | +| Rear camera | 13MP, f/2.0 1080p 30 fps video| +| Front camera | 5MP, f/2.0| + +## Device picture + +![Xiaomi MI PAD 4](http://i8.mifile.cn/a1/pms_1529843020.73617168!560x560.jpg) diff --git a/device.mk b/device.mk new file mode 100644 index 0000000..638e99a --- /dev/null +++ b/device.mk @@ -0,0 +1,45 @@ +# +# Copyright 2018 The Android Open Source 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. +# + +# Inherit the fusion-common definitions +$(call inherit-product, device/xiaomi/sdm660-common/platform.mk) + +# setup dalvik vm configs +$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) + +# setup HWUI configs +$(call inherit-product, frameworks/native/build/phone-xxhdpi-3072-hwui-memory.mk) + +DEVICE_PATH := device/xiaomi/clover + +# These are the hardware-specific features +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet_core_hardware.xml + +# Device is a Tablet +PRODUCT_AAPT_CONFIG := normal large +PRODUCT_AAPT_PREF_CONFIG := hdpi + +# Boot animation +TARGET_SCREEN_HEIGHT := 1920 +TARGET_SCREEN_WIDTH := 1200 + +# Set those variables here to overwrite the inherited values. +PRODUCT_NAME := aosp_clover +PRODUCT_DEVICE := clover +PRODUCT_MODEL := Mi PAD 4 (AOSP) +PRODUCT_BRAND := Xiaomi +PRODUCT_MANUFACTURER := Xiaomi diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100755 index 0000000..bbf3abb --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,115 @@ + + + + + + + true + + + + 10 + 30 + 60 + 100 + 150 + 210 + 255 + + + + + 10 + 20 + 40 + 70 + 110 + 160 + 200 + 255 + + + + 2000 + 6000 + + + 200% + + + 16000 + + + 1 + + + 1 + + + 17 + + + + "lte:2097152,4194304,8388608,262144,524288,1048576" + "lte_ca:2097152,4194304,8388608,4096,1048576,2097152" + "umts:4094,87380,1220608,4096,16384,1220608" + "hspa:4094,87380,1220608,4096,16384,1220608" + "hsupa:4094,87380,1220608,4096,16384,1220608" + "hsdpa:4094,87380,1220608,4096,16384,1220608" + "hspap:4094,87380,1220608,4096,16384,1220608" + "edge:4093,26280,35040,4096,16384,35040" + "gprs:4092,8760,11680,4096,8760,11680" + "evdo:4094,87380,524288,4096,16384,262144" + + 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 100755 index 0000000..db1a98d --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml/power_profile.xml @@ -0,0 +1,58 @@ + + + 0 + 88 + 300 + + 4 + 4 + + + 633600 + 902400 + 1113600 + 1401600 + 1536000 + 1612800 + + + 11 + 18 + 34 + 45 + 52 + 56 + + + 1113600 + 1401600 + 1747200 + 1804800 + + + 75 + 108 + 170 + 193 + + 4 + 3 + 4000 + 80 + 2 + 2 + 2 + 175 + 180 + 45 + 60 + 200 + 550 + 100 + 140 + 45 + + 8 + 6 + + \ No newline at end of file diff --git a/vendorsetup.sh b/vendorsetup.sh new file mode 100644 index 0000000..57d5e8d --- /dev/null +++ b/vendorsetup.sh @@ -0,0 +1,19 @@ +# +# Copyright 2018 The Android Open Source 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. +# + +add_lunch_combo aosp_clover-eng +add_lunch_combo aosp_clover-userdebug +add_lunch_combo aosp_clover-user