aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan Chen <intervigil@gmail.com>2016-05-24 18:44:57 -0700
committerZhao Wei Liew <zhaoweiliew@gmail.com>2016-05-29 18:36:38 +0800
commita2119cee4941b0cd5d8300483274c679038c813b (patch)
tree281a820ce452ec61e27a460047e3bef090affa46
parent4920076b6beefc1de0339cf14491d9225cd56e3d (diff)
msm8916: Commonize msm8939 and msm8916
Change-Id: Iddc1a5e7793fe8110cba1f2314b53e3bb164c34d
-rw-r--r--Android.mk2
-rw-r--r--BoardConfigCommon.mk23
-rw-r--r--configs/media_codecs_msm8916.xml (renamed from configs/media_codecs.xml)0
-rw-r--r--configs/media_codecs_msm8939.xml319
-rw-r--r--configs/msm_irqbalance.conf2
-rw-r--r--msm8916.mk15
-rw-r--r--msm8916.prop5
-rw-r--r--msm8939.prop6
-rw-r--r--recovery/Android.mk8
-rw-r--r--recovery/recovery_updater.c183
-rwxr-xr-xreleasetools.py18
-rw-r--r--rootdir/Android.mk4
-rw-r--r--rootdir/etc/init.qcom.power_msm8916.rc (renamed from rootdir/etc/init.qcom.power.rc)0
-rw-r--r--rootdir/etc/init.qcom.power_msm8939.rc92
-rw-r--r--rootdir/etc/init.qcom.rc16
-rw-r--r--rootdir/etc/ueventd.qcom.rc20
-rw-r--r--sepolicy/mm-qcamerad.te1
-rw-r--r--system.prop7
18 files changed, 694 insertions, 27 deletions
diff --git a/Android.mk b/Android.mk
index c3625db..fd2842a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -15,7 +15,7 @@
LOCAL_PATH := $(call my-dir)
-ifeq ($(TARGET_CYANOGEN_COMMON),msm8916)
+ifneq ($(filter msm8916 msm8939,$(TARGET_BOARD_PLATFORM_VARIANT)),)
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index d4b4cdb..b3c824a 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -17,12 +17,6 @@ VENDOR_PATH := device/cyanogen/msm8916-common
TARGET_SPECIFIC_HEADER_PATH := $(VENDOR_PATH)/include
-TARGET_CYANOGEN_COMMON := msm8916
-
-# Platform
-TARGET_BOARD_PLATFORM := msm8916
-TARGET_BOARD_PLATFORM_GPU := qcom-adreno306
-
# Architecture
ifneq ($(FORCE_32_BIT),true)
TARGET_BOARD_SUFFIX := _64
@@ -30,7 +24,7 @@ TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
-TARGET_CPU_VARIANT := generic
+TARGET_CPU_VARIANT := cortex-a53
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
@@ -48,8 +42,11 @@ TARGET_CPU_ABI2 := armeabi
TARGET_CPU_VARIANT := cortex-a53
endif
+TARGET_BOARD_PLATFORM := msm8916
+
# Properties (reset them here, include more in device if needed)
TARGET_SYSTEM_PROP := $(VENDOR_PATH)/system.prop
+TARGET_SYSTEM_PROP += $(VENDOR_PATH)/$(TARGET_BOARD_PLATFORM_VARIANT).prop
# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := MSM8916
@@ -66,8 +63,8 @@ BOARD_RAMDISK_OFFSET := 0x02000000
TARGET_KERNEL_SOURCE := kernel/cyanogen/msm8916
ifneq ($(FORCE_32_BIT),true)
TARGET_KERNEL_ARCH := arm64
-TARGET_KERNEL_HEADER_ARCH := arm64
TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android-
+TARGET_KERNEL_HEADER_ARCH := arm64
TARGET_USES_UNCOMPRESSED_KERNEL := true
else
TARGET_KERNEL_ARCH := arm
@@ -94,15 +91,6 @@ BOARD_HARDWARE_CLASS += hardware/cyanogen/cmhw
# Crypto
TARGET_HW_DISK_ENCRYPTION := true
-# Dex
-ifeq ($(HOST_OS),linux)
- ifeq ($(TARGET_BUILD_VARIANT),user)
- ifeq ($(WITH_DEXPREOPT),)
- WITH_DEXPREOPT := true
- endif
- endif
-endif
-
# Display
MAX_EGL_CACHE_KEY_SIZE := 12*1024
MAX_EGL_CACHE_SIZE := 2048*1024
@@ -142,6 +130,7 @@ BOARD_USES_QCOM_HARDWARE := true
# Recovery
TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_RECOVERY_UPDATER_LIBS := librecovery_updater_cm
# Releasetools
TARGET_RELEASETOOLS_EXTENSIONS := $(VENDOR_PATH)
diff --git a/configs/media_codecs.xml b/configs/media_codecs_msm8916.xml
index d28ecda..d28ecda 100644
--- a/configs/media_codecs.xml
+++ b/configs/media_codecs_msm8916.xml
diff --git a/configs/media_codecs_msm8939.xml b/configs/media_codecs_msm8939.xml
new file mode 100644
index 0000000..f0826fd
--- /dev/null
+++ b/configs/media_codecs_msm8939.xml
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright (C) 2012 The Android Open Source Project
+ Copyright (C) 2014 The Linux Foundation. All rights reserved.
+ Not a contribution.
+
+ 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.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT Include EMPTY>
+<!ATTLIST Include href CDATA #REQUIRED>
+<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
+<!ELEMENT Decoders (MediaCodec|Include)*>
+<!ELEMENT Encoders (MediaCodec|Include)*>
+<!ELEMENT MediaCodec (Type|Quirk|Include)*>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+ <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+ <MediaCodec name="OMX.foo.bar" >
+ <Type name="something/interesting" />
+ <Type name="something/else" />
+ ...
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Quirk name="output-buffers-are-unreadable" />
+ </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+ must be advertised if the component does not properly support specification
+ of input buffers using the OMX_UseBuffer(...) API but instead requires
+ OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+ must be advertised if the component does not properly support specification
+ of output buffers using the OMX_UseBuffer(...) API but instead requires
+ OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+ must be advertised if the emitted output buffers of a decoder component
+ are not readable, i.e. use a custom format even though abusing one of
+ the official OMX colorspace constants.
+ Clients of such decoders will not be able to access the decoded data,
+ naturally making the component much less useful. The only use for
+ a component with this quirk is to render the output to the screen.
+ Audio decoders MUST NOT advertise this quirk.
+ Video decoders that advertise this quirk must be accompanied by a
+ corresponding color space converter for thumbnail extraction,
+ matching surfaceflinger support that can render the custom format to
+ a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+
+-->
+
+<!--
+ Decoder capabilities for 8939
+_________________________________________________________________
+ | Codec | W H fps Mbps MB/s | Encode Secure-dec |
+ |__________|_________________________________________|___________________|
+ | h264 | 1920 1088 60 50 489600 | Y Y |
+ | hevc | 1920 1088 60 50 489600 | N Y |
+ | mpeg4 | 1920 1088 60 40 489600 | Y N |
+ | vc1 | 1920 1088 30 45 244800 | N Y |
+ | vp8 | 1920 1088 30 50 244800 | Y N |
+ | divx3 | 1920 1088 30 20 244800 | N N |
+ | div4/5/6 | 1920 1088 30 50 244800 | N N |
+ | h263 | 864 480 30 2 48600 | Y N |
+ | mpeg2 | 1920 1088 30 80 244800 | N Y |
+ |__________|_________________________________________|___________________|
+
+-->
+
+<!--
+ Encoder capabilities for 8939
+ ____________________________________________________
+ | Codec | W H fps Mbps MB/s |
+ |__________|_________________________________________|
+ | h264 | 1920 1088 30 20 244800 |
+ | mpeg4 | 1920 1088 30 40 244800 |
+ | h263 | 864 480 30 2 48600 |
+ | vp8 | 1920 1088 30 20 244800 |
+ |____________________________________________________|
+-->
+
+<MediaCodecs>
+ <Include href="media_codecs_google_audio.xml" />
+ <Include href="media_codecs_google_telephony.xml" />
+ <Settings>
+ <Setting name="max-video-encoder-input-buffers" value="9" />
+ </Settings>
+ <Encoders>
+ <!-- Video Hardware -->
+ <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Quirk name="requires-loaded-to-idle-after-allocation" />
+ <Limit name="size" min="96x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-20000000" />
+ <Limit name="concurrent-instances" max="8" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Quirk name="requires-loaded-to-idle-after-allocation"/>
+ <Limit name="size" min="96x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-40000000" />
+ <Limit name="concurrent-instances" max="8" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Quirk name="requires-loaded-to-idle-after-allocation" />
+ <Limit name="size" min="96x64" max="864x480" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="48600" />
+ <Limit name="bitrate" range="1-2000000" />
+ <Limit name="concurrent-instances" max="8" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Quirk name="requires-loaded-to-idle-after-allocation" />
+ <Limit name="size" min="96x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-20000000" />
+ <Limit name="concurrent-instances" max="8" />
+ </MediaCodec>
+ </Encoders>
+ <Decoders>
+ <!-- Audio Software -->
+ <MediaCodec name="OMX.qti.audio.decoder.flac" type="audio/flac" />
+ <!-- Video Hardware -->
+ <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="489600" />
+ <Limit name="bitrate" range="1-50000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="489600" />
+ <Limit name="bitrate" range="1-50000000" />
+ <Limit name="concurrent-instances" max="4" />
+ <Feature name="adaptive-playback" />
+ <Feature name="secure-playback" required="true" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-80000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-80000000" />
+ <Limit name="concurrent-instances" max="7" />
+ <Feature name="adaptive-playback" />
+ <Feature name="secure-playback" required="true" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="489600" />
+ <Limit name="bitrate" range="1-40000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="48600" />
+ <Limit name="bitrate" range="1-2000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.vc1" type="video/x-ms-wmv" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-45000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.vc1.secure" type="video/x-ms-wmv" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-45 000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ <Feature name="secure-playback" required="true" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.divx" type="video/divx" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-50000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.divx311" type="video/divx311" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920X1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-20000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.divx4" type="video/divx4" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-50000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920x1088" />
+ <Limit name="alignment" value="2x2" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="244800" />
+ <Limit name="bitrate" range="1-50000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
+ <Quirk name="requires-allocate-on-input-ports" />
+ <Quirk name="requires-allocate-on-output-ports" />
+ <Limit name="size" min="64x64" max="1920X1080" />
+ <Limit name="alignment" value="16x16" />
+ <Limit name="block-size" value="16x16" />
+ <Limit name="blocks-per-second" min="1" max="489600" />
+ <Limit name="bitrate" range="1-50000000" />
+ <Limit name="concurrent-instances" max="8" />
+ <Feature name="adaptive-playback" />
+ </MediaCodec>
+ </Decoders>
+ <Include href="media_codecs_google_video.xml" />
+ <Include href="media_codecs_ffmpeg.xml" />
+</MediaCodecs>
diff --git a/configs/msm_irqbalance.conf b/configs/msm_irqbalance.conf
new file mode 100644
index 0000000..0692d4c
--- /dev/null
+++ b/configs/msm_irqbalance.conf
@@ -0,0 +1,2 @@
+PRIO=0,0,0,0,1,1,1,1
+IGNORED_IRQ=20,39,200,203,155,157
diff --git a/msm8916.mk b/msm8916.mk
index 4129635..74fef11 100644
--- a/msm8916.mk
+++ b/msm8916.mk
@@ -24,7 +24,6 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
- frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \
frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
frameworks/native/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml \
@@ -35,6 +34,11 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.midi.xml:system/etc/permissions/android.software.midi.xml \
frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml
+ifeq ($(TARGET_BOARD_PLATFORM_VARIANT),msm8939)
+PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.hardware.opengles.aep.xml:system/etc/permissions/android.hardware.opengles.aep.xml
+endif
+
# Audio
PRODUCT_PACKAGES += \
audiod \
@@ -87,6 +91,12 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/sec_config:system/etc/sec_config
+# IRQ balance
+ifeq ($(TARGET_BOARD_PLATFORM_VARIANT),msm8939)
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/configs/msm_irqbalance.conf:system/vendor/etc/msm_irqbalance.conf
+endif
+
# Keystore
PRODUCT_PACKAGES += \
keystore.msm8916
@@ -95,8 +105,9 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
+ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_video_le.xml:system/etc/media_codecs_google_video_le.xml \
- $(LOCAL_PATH)/configs/media_codecs.xml:system/etc/media_codecs.xml
+ $(LOCAL_PATH)/configs/media_codecs_$(TARGET_BOARD_PLATFORM_VARIANT).xml:system/etc/media_codecs.xml
PRODUCT_PACKAGES += \
libextmedia_jni \
diff --git a/msm8916.prop b/msm8916.prop
new file mode 100644
index 0000000..4ba6057
--- /dev/null
+++ b/msm8916.prop
@@ -0,0 +1,5 @@
+# Display
+ro.opengles.version=196608
+
+# Perf
+ro.min_freq_0=800000
diff --git a/msm8939.prop b/msm8939.prop
new file mode 100644
index 0000000..8d9217c
--- /dev/null
+++ b/msm8939.prop
@@ -0,0 +1,6 @@
+# Display
+ro.opengles.version=196609
+
+# Perf
+ro.min_freq_0=960000
+ro_min_freq_4=800000
diff --git a/recovery/Android.mk b/recovery/Android.mk
new file mode 100644
index 0000000..86fb070
--- /dev/null
+++ b/recovery/Android.mk
@@ -0,0 +1,8 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_SRC_FILES := recovery_updater.c
+LOCAL_MODULE := librecovery_updater_cm
+LOCAL_MODULE_TAGS := eng
+include $(BUILD_STATIC_LIBRARY)
diff --git a/recovery/recovery_updater.c b/recovery/recovery_updater.c
new file mode 100644
index 0000000..c0036f9
--- /dev/null
+++ b/recovery/recovery_updater.c
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2015, 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.
+ */
+
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "edify/expr.h"
+
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#define ALPHABET_LEN 256
+#define KB 1024
+
+#define TZ_PART_PATH "/dev/block/platform/7824900.sdhci/by-name/tz"
+#define TZ_VER_STR "QC_IMAGE_VERSION_STRING="
+#define TZ_VER_STR_LEN 24
+#define TZ_VER_BUF_LEN 255
+#define TZ_SZ 500 * KB /* MMAP 500K of TZ, TZ partition is 500K */
+
+/* Boyer-Moore string search implementation from Wikipedia */
+
+/* Return longest suffix length of suffix ending at str[p] */
+static int max_suffix_len(const char *str, size_t str_len, size_t p) {
+ uint32_t i;
+
+ for (i = 0; (str[p - i] == str[str_len - 1 - i]) && (i < p); ) {
+ i++;
+ }
+
+ return i;
+}
+
+/* Generate table of distance between last character of pat and rightmost
+ * occurrence of character c in pat
+ */
+static void bm_make_delta1(int *delta1, const char *pat, size_t pat_len) {
+ uint32_t i;
+ for (i = 0; i < ALPHABET_LEN; i++) {
+ delta1[i] = pat_len;
+ }
+ for (i = 0; i < pat_len - 1; i++) {
+ uint8_t idx = (uint8_t) pat[i];
+ delta1[idx] = pat_len - 1 - i;
+ }
+}
+
+/* Generate table of next possible full match from mismatch at pat[p] */
+static void bm_make_delta2(int *delta2, const char *pat, size_t pat_len) {
+ int p;
+ uint32_t last_prefix = pat_len - 1;
+
+ for (p = pat_len - 1; p >= 0; p--) {
+ /* Compare whether pat[p-pat_len] is suffix of pat */
+ if (strncmp(pat + p, pat, pat_len - p) == 0) {
+ last_prefix = p + 1;
+ }
+ delta2[p] = last_prefix + (pat_len - 1 - p);
+ }
+
+ for (p = 0; p < (int) pat_len - 1; p++) {
+ /* Get longest suffix of pattern ending on character pat[p] */
+ int suf_len = max_suffix_len(pat, pat_len, p);
+ if (pat[p - suf_len] != pat[pat_len - 1 - suf_len]) {
+ delta2[pat_len - 1 - suf_len] = pat_len - 1 - p + suf_len;
+ }
+ }
+}
+
+static char * bm_search(const char *str, size_t str_len, const char *pat,
+ size_t pat_len) {
+ int delta1[ALPHABET_LEN];
+ int delta2[pat_len];
+ int i;
+
+ bm_make_delta1(delta1, pat, pat_len);
+ bm_make_delta2(delta2, pat, pat_len);
+
+ if (pat_len == 0) {
+ return (char *) str;
+ }
+
+ i = pat_len - 1;
+ while (i < (int) str_len) {
+ int j = pat_len - 1;
+ while (j >= 0 && (str[i] == pat[j])) {
+ i--;
+ j--;
+ }
+ if (j < 0) {
+ return (char *) (str + i + 1);
+ }
+ i += MAX(delta1[(uint8_t) str[i]], delta2[j]);
+ }
+
+ return NULL;
+}
+
+static int get_tz_version(char *ver_str, size_t len) {
+ int ret = 0;
+ int fd;
+ char *tz_data = NULL;
+ char *offset = NULL;
+
+ fd = open(TZ_PART_PATH, O_RDONLY);
+ if (fd < 0) {
+ ret = errno;
+ goto err_ret;
+ }
+
+ tz_data = (char *) mmap(NULL, TZ_SZ, PROT_READ, MAP_PRIVATE, fd, 0);
+ if (tz_data == (char *)-1) {
+ ret = errno;
+ goto err_fd_close;
+ }
+
+ /* Do Boyer-Moore search across TZ data */
+ offset = bm_search(tz_data, TZ_SZ, TZ_VER_STR, TZ_VER_STR_LEN);
+ if (offset != NULL) {
+ strncpy(ver_str, offset + TZ_VER_STR_LEN, len);
+ } else {
+ ret = -ENOENT;
+ }
+
+ munmap(tz_data, TZ_SZ);
+err_fd_close:
+ close(fd);
+err_ret:
+ return ret;
+}
+
+/* verify_trustzone("TZ_VERSION", "TZ_VERSION", ...) */
+Value * VerifyTrustZoneFn(const char *name, State *state, int argc, Expr *argv[]) {
+ char current_tz_version[TZ_VER_BUF_LEN];
+ char *tz_version;
+ int i, ret;
+
+ ret = get_tz_version(current_tz_version, TZ_VER_BUF_LEN);
+ if (ret) {
+ return ErrorAbort(state, "%s() failed to read current TZ version: %d",
+ name, ret);
+ }
+
+ for (i = 1; i <= argc; i++) {
+ ret = ReadArgs(state, argv, i, &tz_version);
+ if (ret < 0) {
+ return ErrorAbort(state, "%s() error parsing arguments: %d",
+ name, ret);
+ }
+
+ uiPrintf(state, "Comparing TZ version %s to %s",
+ tz_version, current_tz_version);
+ if (strncmp(tz_version, current_tz_version, strlen(tz_version)) == 0) {
+ return StringValue(strdup("1"));
+ }
+ }
+
+ return StringValue(strdup("0"));
+}
+
+void Register_librecovery_updater_cm() {
+ RegisterFunction("cm.verify_trustzone", VerifyTrustZoneFn);
+}
diff --git a/releasetools.py b/releasetools.py
index cc73d5f..31bf958 100755
--- a/releasetools.py
+++ b/releasetools.py
@@ -48,11 +48,11 @@ def GetRadioFiles(z):
return out
def FullOTA_Assertions(info):
- #TODO: Implement device specific asserstions.
+ AddTrustZoneAssertion(info)
return
def IncrementalOTA_Assertions(info):
- #TODO: Implement device specific asserstions.
+ AddTrustZoneAssertion(info)
return
def InstallRawImage(image_data, api_version, input_zip, fn, info, filesmap):
@@ -107,3 +107,17 @@ def FullOTA_InstallEnd(info):
def IncrementalOTA_InstallEnd(info):
InstallRadioFiles(info)
+
+def AddTrustZoneAssertion(info):
+ # Presence of filesmap indicates packaged firmware
+ filesmap = LoadFilesMap(info.input_zip)
+ if filesmap != {}:
+ return
+ android_info = info.input_zip.read("OTA/android-info.txt")
+ m = re.search(r'require\s+version-trustzone\s*=\s*(\S+)', android_info)
+ if m:
+ versions = m.group(1).split('|')
+ if len(versions) and '*' not in versions:
+ cmd = 'assert(cm.verify_trustzone(' + ','.join(['"%s"' % tz for tz in versions]) + ') == "1");'
+ info.script.AppendExtra(cmd)
+ return
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index d88195f..abb6ae7 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -23,7 +23,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.power.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.qcom.power.rc
+LOCAL_SRC_FILES := etc/init.qcom.power_$(TARGET_BOARD_PLATFORM_VARIANT).rc
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
include $(BUILD_PREBUILT)
@@ -40,7 +40,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := init.recovery.qcom.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.qcom.power.rc
+LOCAL_SRC_FILES := etc/init.qcom.power_$(TARGET_BOARD_PLATFORM_VARIANT).rc
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
include $(BUILD_PREBUILT)
diff --git a/rootdir/etc/init.qcom.power.rc b/rootdir/etc/init.qcom.power_msm8916.rc
index 6be9da5..6be9da5 100644
--- a/rootdir/etc/init.qcom.power.rc
+++ b/rootdir/etc/init.qcom.power_msm8916.rc
diff --git a/rootdir/etc/init.qcom.power_msm8939.rc b/rootdir/etc/init.qcom.power_msm8939.rc
new file mode 100644
index 0000000..75329d0
--- /dev/null
+++ b/rootdir/etc/init.qcom.power_msm8939.rc
@@ -0,0 +1,92 @@
+on enable-low-power
+ write /proc/sys/kernel/sched_boost 1
+
+ # RPS mask
+ write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 10
+
+ # Adaptive LMK
+ write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1
+ write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 81250
+
+ # HMP scheduler load tracking settings
+ write /proc/sys/kernel/sched_window_stats_policy 3
+ write /proc/sys/kernel/sched_ravg_hist_size 5
+
+ # HMP Task packing settings for 8939, 8929
+ write /proc/sys/kernel/sched_small_task 20
+ write /proc/sys/kernel/sched_mostly_idle_load 30
+ write /proc/sys/kernel/sched_mostly_idle_nr_run 3
+
+ write /sys/class/devfreq/qcom,cpubw.64/governor "bw_hwmon"
+ write /sys/class/devfreq/qcom,cpubw.64/bw_hwmon/io_percent 20
+ write /sys/class/devfreq/qcom,gpubw.61/governor "bw_hwmon"
+ write /sys/class/devfreq/qcom,gpubw.61/bw_hwmon/io_percent 40
+ write /sys/class/devfreq/qcom,mincpubw.65/governor "cpufreq"
+
+ # Disable thermal core_control to update interactive gov settings
+ write /sys/module/msm_thermal/core_control/enabled 0
+
+ # Enable governor for perf cluster
+ write /sys/devices/system/cpu/cpu0/online 1
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
+ write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay "20000 1113600:50000"
+ write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 85
+ write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
+ write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 1113600
+ write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 0
+ write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads "1 960000:85 1113600:90 1344000:80"
+ write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 50000
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 960000
+
+ # Enable governor for power cluster
+ write /sys/devices/system/cpu/cpu4/online 1
+ write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor "interactive"
+ write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay "25000 800000:50000"
+ write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 90
+ write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 40000
+ write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 998400
+ write /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy 0
+ write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "1 800000:90"
+ write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 40000
+ write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq 800000
+
+ # Enable thermal core_control now
+ write /sys/module/msm_thermal/core_control/enabled 1
+
+ # HMP scheduler (big.Little cluster related) settings
+ write /proc/sys/kernel/sched_upmigrate 75
+ write /proc/sys/kernel/sched_downmigrate 60
+
+ # Bring all CPUs online
+ write /sys/devices/system/cpu/cpu1/online 1
+ write /sys/devices/system/cpu/cpu2/online 1
+ write /sys/devices/system/cpu/cpu3/online 1
+ write /sys/devices/system/cpu/cpu5/online 1
+ write /sys/devices/system/cpu/cpu6/online 1
+ write /sys/devices/system/cpu/cpu7/online 1
+
+ # Enable low power modes
+ write /sys/module/lpm_levels/parameters/sleep_disabled 0
+
+ # Per-process reclaim
+ write /sys/module/process_reclaim/parameters/enable_process_reclaim 1
+ write /sys/module/process_reclaim/parameters/pressure_min 10
+ write /sys/module/process_reclaim/parameters/per_swap_size 1024
+ write /sys/module/process_reclaim/parameters/pressure_max 70
+ write /sys/module/process_reclaim/parameters/swap_opt_eff 30
+
+ rm /data/system/perfd/default_values
+ start perfd
+
+on charger
+ write /sys/module/lpm_levels/parameters/sleep_disabled 0
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"
+
+on class_start:late_start
+ trigger enable-low-power
+
+on property:init.svc.recovery=running
+ trigger enable-low-power
+
+on property:dev.bootcomplete=1
+ setprop sys.io.scheduler bfq
diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc
index 520c1ab..32ed76c 100644
--- a/rootdir/etc/init.qcom.rc
+++ b/rootdir/etc/init.qcom.rc
@@ -53,6 +53,7 @@ on fs
# msm specific files that need to be created on /data
on post-fs-data
+ mkdir /data/fdAlbum 0770 camera camera
mkdir /data/misc/camera 0770 camera camera
#Create PERFD deamon related dirs
@@ -341,6 +342,11 @@ service qmuxd /system/bin/qmuxd
user root
group radio audio bluetooth gps qcom_diag
+service msm_irqbalance /system/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf
+ class core
+ user root
+ group root
+
service netmgrd /system/bin/netmgrd
class main
@@ -433,6 +439,16 @@ service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG
disabled
oneshot
+service dhcpcd_eth0 /system/bin/dhcpcd -aABDKL
+ class late_start
+ disabled
+ oneshot
+
+service iprenew_eth0 /system/bin/dhcpcd -n
+ class late_start
+ disabled
+ oneshot
+
service loc_launcher /system/bin/loc_launcher
#loc_launcher will start as root and set its uid to gps
class late_start
diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc
index f3ab6d1..5b209c1 100644
--- a/rootdir/etc/ueventd.qcom.rc
+++ b/rootdir/etc/ueventd.qcom.rc
@@ -157,6 +157,7 @@
/dev/ttyGS0 0660 system system
/dev/i2c-5 0660 media media
/dev/voice_svc 0660 system audio
+/dev/avtimer 0660 system audio
# DVB devices
/dev/dvb/adapter0/demux* 0440 media media
@@ -168,6 +169,25 @@
/dev/tsc_ci0 0660 media media
# sensors
+/dev/yl_alsprox_sensor 0660 system system
+/dev/yl_params1 0660 system system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* poll_delay 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable_wakeup 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* max_latency 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* flush 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* calibrate 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* accel_enable 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* accel_delay 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* calibration 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* debug 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* device_delay 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable_als_sensor 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable_ps_sensor 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* gyro_enable 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* gyro_delay 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* ps_calibration 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* reg 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* poll_delay 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable_wakeup 0660 input system
diff --git a/sepolicy/mm-qcamerad.te b/sepolicy/mm-qcamerad.te
new file mode 100644
index 0000000..1078951
--- /dev/null
+++ b/sepolicy/mm-qcamerad.te
@@ -0,0 +1 @@
+allow mm-qcamerad camera_data_file:dir r_dir_perms;
diff --git a/system.prop b/system.prop
index 09c3d8d..60db1c5 100644
--- a/system.prop
+++ b/system.prop
@@ -1,3 +1,6 @@
+# Art
+ro.sys.fw.dex2oat_thread_count=4
+
# ActivityManager
ro.config.max_starting_bg=8
ro.sys.fw.use_trim_settings=true
@@ -22,7 +25,6 @@ debug.sf.gpu_comp_tiling=1
debug.mdpcomp.idletime=600
persist.hwc.mdpcomp.enable=true
persist.hwc.ptor.enable=true
-ro.opengles.version=196608
debug.enable.sglscale=1
# GPS
@@ -48,8 +50,7 @@ persist.rild.nitz_short_ons_1=
persist.rild.nitz_short_ons_2=
persist.rild.nitz_short_ons_3=
-# perf
-ro.min_freq_0=800000
+# Perf
ro.vendor.extension_library=libqti-perfd-client.so
# Radio