From a1ba166b8ac0f8e90a4eb8b0a40fc4d96f64c3af Mon Sep 17 00:00:00 2001 From: dhacker29 Date: Wed, 29 Jan 2014 22:14:05 -0600 Subject: [PATCH] Unified device tree for falcon (Moto G) Change-Id: I73f3358f49709527a568f157487d67d470fb60ee --- AndroidBoard.mk | 2 +- AndroidProducts.mk | 2 +- BoardConfig.mk | 8 +- README.md | 2 +- bluetooth/bdroid_buildcfg.h | 2 +- cm.mk | 10 +- device_xt1034.mk => device_falcon.mk | 17 ++- extract-files.sh | 2 +- full_xt1034.mk => full_falcon.mk | 12 +-- init/init_falcon.c | 101 ++++++++++++++++++ .../base/core/res/res/values/config.xml | 29 ----- vendorsetup.sh | 2 +- 12 files changed, 129 insertions(+), 60 deletions(-) rename device_xt1034.mk => device_falcon.mk (79%) rename full_xt1034.mk => full_falcon.mk (82%) create mode 100644 init/init_falcon.c delete mode 100644 overlay/frameworks/base/core/res/res/values/config.xml diff --git a/AndroidBoard.mk b/AndroidBoard.mk index 0c787425..9073a153 100644 --- a/AndroidBoard.mk +++ b/AndroidBoard.mk @@ -5,4 +5,4 @@ include $(CLEAR_VARS) ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET) # include the non-open-source counterpart to this file --include vendor/motorola/xt1034/AndroidBoardVendor.mk +-include vendor/motorola/falcon/AndroidBoardVendor.mk diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 89f5877e..88982f30 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -14,4 +14,4 @@ # limitations under the License. PRODUCT_MAKEFILES := \ - $(LOCAL_DIR)/full_xt1034.mk + $(LOCAL_DIR)/full_falcon.mk diff --git a/BoardConfig.mk b/BoardConfig.mk index 5448b421..5ae63dc8 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -24,9 +24,13 @@ -include device/motorola/msm8226-common/BoardConfigCommon.mk # inherit from the proprietary version --include vendor/motorola/xt1034/BoardConfigVendor.mk +-include vendor/motorola/falcon/BoardConfigVendor.mk -LOCAL_PATH := device/motorola/xt1034 +LOCAL_PATH := device/motorola/falcon + +# Vendor Init +TARGET_INIT_VENDOR_LIB := libinit_msm +TARGET_LIBINIT_DEFINES_FILE := device/motorola/falcon/init/init_falcon.c #bluetooth BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(LOCAL_PATH)/bluetooth diff --git a/README.md b/README.md index 1098ab67..36b3fffe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Device configuration for the Moto G (XT1034) (falcon_umts) (Retail US) +Universal device configuration for the Moto G (falcon) =============================== Copyright 2013 - The CyanogenMod Project diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h index 2bf6508f..124921d4 100644 --- a/bluetooth/bdroid_buildcfg.h +++ b/bluetooth/bdroid_buildcfg.h @@ -18,7 +18,7 @@ #ifndef _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H -#define BTM_DEF_LOCAL_NAME "Moto G - XT1034" +#define BTM_DEF_LOCAL_NAME "Moto G" #define BTA_DISABLE_DELAY 1000 /* in milliseconds */ #define BLUETOOTH_QCOM_SW TRUE #define BLUETOOTH_QCOM_LE_INTL_SCAN TRUE diff --git a/cm.mk b/cm.mk index f453e6b8..2efc5c93 100644 --- a/cm.mk +++ b/cm.mk @@ -7,12 +7,6 @@ TARGET_SCREEN_HEIGHT := 1280 # Release name PRODUCT_RELEASE_NAME := MOTO G -PRODUCT_NAME := cm_xt1034 +PRODUCT_NAME := cm_falcon -$(call inherit-product, device/motorola/xt1034/full_xt1034.mk) - -PRODUCT_BUILD_PROP_OVERRIDES += \ - PRODUCT_BRAND=motorola \ - PRODUCT_NAME=XT1034 \ - BUILD_PRODUCT=falcon_umts \ - BUILD_FINGERPRINT=motorola/falcon_retuaws/falcon_umts:4.4.2/KXB20.9-1.8-1.4/4:user/release-keys +$(call inherit-product, device/motorola/falcon/full_falcon.mk) diff --git a/device_xt1034.mk b/device_falcon.mk similarity index 79% rename from device_xt1034.mk rename to device_falcon.mk index 207584b7..712e4887 100644 --- a/device_xt1034.mk +++ b/device_falcon.mk @@ -20,9 +20,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) $(call inherit-product, device/motorola/msm8226-common/msm8226.mk) -LOCAL_PATH := device/motorola/xt1034 +LOCAL_PATH := device/motorola/falcon -# xt1053 specific overlay +# falcon specific overlay DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay PRODUCT_LOCALES := en_US @@ -30,14 +30,13 @@ PRODUCT_LOCALES += xhdpi PRODUCT_AAPT_CONFIG := normal hdpi xhdpi PRODUCT_AAPT_PREF_CONFIG := xhdpi -#telephony +# CDMA, GSM/WCDMA PRODUCT_PROPERTY_OVERRIDES += \ - telephony.lteOnGsmDevice=0 \ - telephony.lteOnCdmaDevice=0 \ - ro.telephony.default_network=3 \ + ro.telephony.default_network=5 \ + telephony.lteOnCdmaDevice=1 \ + persist.radio.mode_pref_nv10=1 \ persist.radio.no_wait_for_card=1 \ - persist.radio.dfr_mode_set=1 \ - ro.mot.build.customerid=retusa_aws + persist.radio.dfr_mode_set=1 $(call inherit-product, device/motorola/msm8226-common/keylayout/keylayout.mk) -$(call inherit-product, vendor/motorola/xt1034/xt1034-vendor.mk) +$(call inherit-product, vendor/motorola/falcon/falcon-vendor.mk) diff --git a/extract-files.sh b/extract-files.sh index adeb62d2..96df90d8 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,6 +1,6 @@ #!/bin/bash export VENDOR=motorola -export DEVICE=xt1034 +export DEVICE=falcon ../msm8226-common/extract-files.sh $@ diff --git a/full_xt1034.mk b/full_falcon.mk similarity index 82% rename from full_xt1034.mk rename to full_falcon.mk index 9ee15f22..86f1a2b2 100644 --- a/full_xt1034.mk +++ b/full_falcon.mk @@ -16,21 +16,21 @@ # # This file is the build configuration for a full Android -# build for xt1034 hardware. This cleanly combines a set of +# build for falcon hardware. This cleanly combines a set of # device-specific aspects (drivers) with a device-agnostic # product configuration (apps). Except for a few implementation # details, it only fundamentally contains two inherit-product -# lines, full and xt1034, hence its name. +# lines, full and falcon, hence its name. # # Inherit from those products. Most specific first. $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) # Inherit from xt1034 device -$(call inherit-product, device/motorola/xt1034/device_xt1034.mk) +$(call inherit-product, device/motorola/falcon/device_falcon.mk) ## Device identifier. This must come after all inclusions -PRODUCT_DEVICE := xt1034 -PRODUCT_NAME := full_xt1034 +PRODUCT_DEVICE := falcon +PRODUCT_NAME := full_falcon PRODUCT_BRAND := motorola -PRODUCT_MODEL := XT1034 +PRODUCT_MODEL := falcon PRODUCT_MANUFACTURER := motorola diff --git a/init/init_falcon.c b/init/init_falcon.c new file mode 100644 index 00000000..417d1f93 --- /dev/null +++ b/init/init_falcon.c @@ -0,0 +1,101 @@ +/* + Copyright (c) 2013, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include "vendor_init.h" +#include "property_service.h" +#include "log.h" +#include "util.h" + +#include "init_msm.h" + +void init_msm_properties(unsigned long msm_id, unsigned long msm_ver, char *board_type) +{ + char platform[PROP_VALUE_MAX]; + char radio[PROP_VALUE_MAX]; + int rc; + + UNUSED(msm_id); + UNUSED(msm_ver); + UNUSED(board_type); + + rc = property_get("ro.board.platform", platform); + if (!rc || !ISMATCH(platform, ANDROID_TARGET)) + return; + + property_get("ro.boot.radio", radio); + if (ISMATCH(radio, "0x1")) { + /* xt1032 */ + property_set("ro.product.device", "falcon_umts"); + property_set("ro.product.model", "Moto G"); + property_set("ro.build.description", "falcon_retgb-user 4.3 14.10.0Q3.X-76-LGG-8 54 release-keys"); + property_set("ro.build.fingerprint", "motorola/falcon_retgb/falcon_umts:4.3/14.10.0Q3.X-76-LGG-8/54:user/release-keys"); + property_set("ro.mot.build.customerid ","RTGB"); + property_set("persist.radio.multisim.config", ""); + } else if (ISMATCH(radio, "0x3")) { + /* cdma xt1028 */ + property_set("ro.product.device", "falcon_cdma"); + property_set("ro.product.model", "Moto G"); + property_set("ro.build.description", "falcon_verizon-user 4.3 14.10.0Q3.X-84-14 16 release-keys"); + property_set("ro.build.fingerprint", "motorola/falcon_verizon/falcon_cdma:4.3/14.10.0Q3.X-84-14/16:user/release-keys"); + property_set("persist.radio.multisim.config", ""); + property_set("ro.mot.build.customerid ","verizon"); + property_set("ro.telephony.gsm-routes-us-smsc", "1"); + property_set("persist.radio.vrte_logic", "2"); + property_set("persist.radio.0x9e_not_callname", "1"); + property_set("persist.radio.skip_data_check", "1"); + property_set("persist.ril.max.crit.qmi.fails", "4"); + property_set("ro.cdma.home.operator.isnan", "1"); + property_set("ro.cdma.otaspnumschema","SELC,1,80,99"); + property_set("ro.cdma.data_retry_config", "max_retries=infinite,0,0,10000,10000,100000,10000,10000,10000,10000,140000,540000,960000"); + property_set("ro.gsm.data_retry_config", "default_randomization=2000,max_retries=infinite,1000,1000,80000,125000,485000,905000"); + property_set("ro.com.google.clientidbase.ms", "android-verizon"); + property_set("ro.com.google.clientidbase.am", "android-verizon"); + property_set("ro.com.google.clientidbase.yt", "android-verizon"); + } else if (ISMATCH(radio, "0x5")) { + /* xt1033 */ + property_set("ro.product.device", "falcon_umtsds"); + property_set("ro.product.model", "Moto G"); + property_set("ro.build.description", "falcon_retbr_ds-user 4.3 14.10.0Q3.X-76-LCG-8 60 release-keys"); + property_set("ro.build.fingerprint", "motorola/falcon_retbr_ds/falcon_umtsds:4.3/14.10.0Q3.X-76-LCG-8/60:user/release-keys"); + property_set("ro.mot.build.customerid ","RETBR"); + property_set("persist.radio.multisim.config", "dsds"); + property_set("persist.radio.dont_use_dsd", "true"); + } else if (ISMATCH(radio, "0x6")) { + /* xt1034 */ + property_set("ro.product.device", "falcon_umts"); + property_set("ro.product.model", "Moto G"); + property_set("ro.build.description", "falcon_retuaws-user 4.4.2 KXB20.9-1.8-1.4 4 release-keys"); + property_set("ro.build.fingerprint", "motorola/falcon_retuaws/falcon_umts:4.4.2/KXB20.9-1.8-1.4/4:user/release-keys"); + property_set("ro.mot.build.customerid ","retusa_aws"); + property_set("persist.radio.multisim.config", ""); + } + ERROR("Found radio=%s setting build properties\n", radio); +} diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml deleted file mode 100644 index 59d52199..00000000 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - motoxt1034 - - - http://uaprof.motorola.com/phoneconfig/motoxt1034/Profile/motoxt1034.rdf - diff --git a/vendorsetup.sh b/vendorsetup.sh index ff1a7522..1a884955 100644 --- a/vendorsetup.sh +++ b/vendorsetup.sh @@ -1,2 +1,2 @@ -add_lunch_combo cm_xt1034-userdebug +add_lunch_combo cm_falcon-userdebug