Skip to content

Commit

Permalink
taoshan: Restructure the device tree into fragments
Browse files Browse the repository at this point in the history
 * Explode all configurations and makefiles
    into feature-related files automatically imported

 * Based upon the fragmented structure introduced
    in android_device_nextbit_ether by Steve Kondik,
    and the previous implementations for Huashan and Nicki

 * Additional relative paths usage and sources cleanup

Change-Id: I952bc49056108eb912bc7b0b7366ba2122632611
Signed-off-by: AdrianDC <[email protected]>
  • Loading branch information
AdrianDC authored and olivier97 committed Aug 15, 2016
1 parent ea9f846 commit 7e5dde6
Show file tree
Hide file tree
Showing 104 changed files with 565 additions and 527 deletions.
14 changes: 8 additions & 6 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
LOCAL_PATH := $(call my-dir)

ifeq ($(BOARD_VENDOR_PLATFORM),taoshan)
include $(call all-subdir-makefiles,$(LOCAL_PATH))

$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wcd9310; \
ln -sf /data/misc/audio/wcd9310_anc.bin \
$(TARGET_OUT_ETC)/firmware/wcd9310/wcd9310_anc.bin; \
ln -sf /data/misc/audio/mbhc.bin \
$(TARGET_OUT_ETC)/firmware/wcd9310/wcd9310_mbhc.bin)
include $(call all-subdir-makefiles,$(LOCAL_PATH))

$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wcd9310; \
ln -sf /data/misc/audio/wcd9310_anc.bin \
$(TARGET_OUT_ETC)/firmware/wcd9310/wcd9310_anc.bin; \
ln -sf /data/misc/audio/mbhc.bin \
$(TARGET_OUT_ETC)/firmware/wcd9310/wcd9310_mbhc.bin)

endif
115 changes: 11 additions & 104 deletions BoardConfig.mk
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2013 The Android Open Source Project
#
# Copyright (C) 2013-2016 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.
Expand All @@ -11,110 +12,16 @@
# 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.
#

# Architecture
TARGET_ARCH := arm
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_VARIANT := krait

BOARD_VENDOR := sony
BOARD_VENDOR_PLATFORM := taoshan
TARGET_BOOTLOADER_BOARD_NAME := qcom
TARGET_BOARD_PLATFORM := msm8960

TARGET_OTA_ASSERT_DEVICE := C2105,C2104,c2105,c2104,taoshan

BOARD_KERNEL_BASE := 0x80200000
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02000000
# the androidboot.hardware has impact on loading .rc files
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2
BOARD_KERNEL_PAGESIZE := 2048
BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)

TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true

BOARD_BOOTIMAGE_PARTITION_SIZE := 0x108BB9E
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1258291200
BOARD_USERDATAIMAGE_PARTITION_SIZE := 1711276032
BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456

TARGET_KERNEL_SOURCE := kernel/sony/msm8930
TARGET_KERNEL_CONFIG := cyanogenmod_taoshan_defconfig

# Board overrides
TARGET_NO_BOOTLOADER := true
TARGET_NO_RADIOIMAGE := true

# GPS
BOARD_HAVE_NEW_QC_GPS := true

TARGET_SPECIFIC_HEADER_PATH += device/sony/taoshan/include

# Audio
BOARD_USES_ALSA_AUDIO := true
BOARD_USES_LEGACY_ALSA_AUDIO := true
TARGET_USES_QCOM_COMPRESSED_AUDIO := true
QCOM_FM_ENABLED := true
BOARD_USES_SEPERATED_FM := true
QCOM_USBAUDIO_ENABLED := true

# Camera
TARGET_PROVIDES_CAMERA_HAL := true
USE_DEVICE_SPECIFIC_CAMERA := true

# Display HAL
TARGET_USES_ION := true
TARGET_USES_C2D_COMPOSITION := true
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so

# Wlan
BOARD_HAS_QCOM_WLAN := true
BOARD_WLAN_DEVICE := qcwcn
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
WIFI_DRIVER_FW_PATH_STA := "sta"
WIFI_DRIVER_FW_PATH_AP := "ap"

# Bluetooth
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_QCOM := true
BLUETOOTH_HCI_USE_MCT := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/sony/taoshan/bluetooth

# Lights HAL
TARGET_PROVIDES_LIBLIGHT := true

# Power HAL
TARGET_POWERHAL_VARIANT := qcom
CM_POWERHAL_EXTENSION := qcom

# QCOM hardware
BOARD_USES_QCOM_HARDWARE := true

# Recovery
TARGET_RECOVERY_FSTAB = device/sony/taoshan/rootdir/root/fstab.qcom
BOARD_CUSTOM_BOOTIMG := true
BOARD_CUSTOM_BOOTIMG_MK := device/sony/taoshan/custombootimg.mk

# Healthd
BOARD_CHARGER_ENABLE_SUSPEND := true
BOARD_CHARGER_SHOW_PERCENTAGE := true
RED_LED_PATH := /sys/class/leds/led:rgb_red/brightness
GREEN_LED_PATH := /sys/class/leds/led:rgb_green/brightness
BLUE_LED_PATH := /sys/class/leds/led:rgb_blue/brightness

BOARD_HARDWARE_CLASS := device/sony/taoshan/cmhw
# Board device path
DEVICE_PATH := device/sony/taoshan

# inherit qcom common sepolicies
include device/qcom/sepolicy/sepolicy.mk
# Board device headers
TARGET_SPECIFIC_HEADER_PATH := $(DEVICE_PATH)/include

BOARD_SEPOLICY_DIRS += \
device/sony/taoshan/sepolicy
# Board device elements
include $(DEVICE_PATH)/board/*.mk

include vendor/sony/taoshan/BoardConfigVendor.mk
# Board device vendor
-include vendor/sony/taoshan/BoardConfigVendor.mk
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Camera | 8MPx, LED Flash

![Sony Xperia L](http://cdn2.gsmarena.com/vv/pics/sony/sony-xperia-l-01.jpg "Sony Xperia L in black")

This branch is for building CyanogenMod 13.0 (or Android Marshmallow 6.0 AOSP based roms) ROMS.
This branch is for building CyanogenMod 13.0 (or Android Marshmallow 6.0 AOSP based roms) ROMS.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions bluetooth/bdroid_buildcfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
#define _BDROID_BUILDCFG_H

#define BTM_DEF_LOCAL_NAME "Xperia L"
#define BTA_DISABLE_DELAY 1000 /* in milliseconds */
#define BTA_DISABLE_DELAY 1000

#endif
#endif
16 changes: 16 additions & 0 deletions board/00-qcom-platform-msm8960.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Platform
TARGET_BOARD_PLATFORM := msm8960

# Architecture
TARGET_ARCH := arm
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_VARIANT := krait

# QCOM hardware
BOARD_USES_QCOM_HARDWARE := true

# Power HAL
CM_POWERHAL_EXTENSION := qcom
TARGET_POWERHAL_VARIANT := qcom
2 changes: 2 additions & 0 deletions board/bluetooth.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Bluetooth
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth
3 changes: 3 additions & 0 deletions board/camera.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Camera
TARGET_PROVIDES_CAMERA_HAL := true
USE_DEVICE_SPECIFIC_CAMERA := true
6 changes: 6 additions & 0 deletions board/charger.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Healthd
BOARD_CHARGER_ENABLE_SUSPEND := true
BOARD_CHARGER_SHOW_PERCENTAGE := true
RED_LED_PATH := /sys/class/leds/led:rgb_red/brightness
GREEN_LED_PATH := /sys/class/leds/led:rgb_green/brightness
BLUE_LED_PATH := /sys/class/leds/led:rgb_blue/brightness
2 changes: 2 additions & 0 deletions board/device.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# OTA assert
TARGET_OTA_ASSERT_DEVICE := C2105,C2104,c2105,c2104,taoshan
15 changes: 15 additions & 0 deletions board/filesystem.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Partitions informations
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x108BB9E
BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1258291200
BOARD_USERDATAIMAGE_PARTITION_SIZE := 1711276032

# Partitions types
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true

# Partitions blocks
BOARD_FLASH_BLOCK_SIZE := 131072

# Recovery
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/fstab.qcom
3 changes: 3 additions & 0 deletions board/fm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# FM radio
BOARD_USES_SEPERATED_FM := true
QCOM_FM_ENABLED := true
2 changes: 2 additions & 0 deletions board/gps.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GPS
BOARD_HAVE_NEW_QC_GPS := true
5 changes: 5 additions & 0 deletions board/hardware.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CM Hardware
BOARD_HARDWARE_CLASS := $(DEVICE_PATH)/cmhw

# Lights
TARGET_PROVIDES_LIBLIGHT := true
13 changes: 13 additions & 0 deletions board/kernel.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Kernel informations
BOARD_KERNEL_BASE := 0x80200000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=qcom androidboot.bootdevice=msm_sdcc.1 user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02000000

# Kernel properties
TARGET_KERNEL_SOURCE := kernel/sony/msm8930
TARGET_KERNEL_CONFIG := cyanogenmod_taoshan_defconfig

# Custom boot
BOARD_CUSTOM_BOOTIMG := true
BOARD_CUSTOM_BOOTIMG_MK := $(DEVICE_PATH)/boot/custombootimg.mk
10 changes: 10 additions & 0 deletions board/platform.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := qcom

# Vendor platform
BOARD_VENDOR := sony
BOARD_VENDOR_PLATFORM := taoshan

# Images
TARGET_NO_BOOTLOADER := true
TARGET_NO_RADIOIMAGE := true
5 changes: 5 additions & 0 deletions board/qcom-audio.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Audio configurations
BOARD_USES_ALSA_AUDIO := true
BOARD_USES_LEGACY_ALSA_AUDIO := true
QCOM_USBAUDIO_ENABLED := true
TARGET_USES_QCOM_COMPRESSED_AUDIO := true
4 changes: 4 additions & 0 deletions board/qcom-bluetooth.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Bluetooth
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_QCOM := true
BLUETOOTH_HCI_USE_MCT := true
6 changes: 6 additions & 0 deletions board/qcom-display.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Adreno driver
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so

# Ion
TARGET_USES_C2D_COMPOSITION := true
TARGET_USES_ION := true
2 changes: 2 additions & 0 deletions board/qcom-selinux.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Qualcomm sepolicies
include device/qcom/sepolicy/sepolicy.mk
10 changes: 10 additions & 0 deletions board/qcom-wifi.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# WiFi
BOARD_HAS_QCOM_WLAN := true
BOARD_WLAN_DEVICE := qcwcn
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
WIFI_DRIVER_FW_PATH_STA := "sta"
WIFI_DRIVER_FW_PATH_AP := "ap"
WPA_SUPPLICANT_VERSION := VER_0_8_X
3 changes: 3 additions & 0 deletions board/selinux.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Device sepolicies
BOARD_SEPOLICY_DIRS += \
$(DEVICE_PATH)/sepolicy
24 changes: 17 additions & 7 deletions custombootimg.mk → boot/custombootimg.mk
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
LOCAL_PATH := $(call my-dir)

DEVICE_BOOTDIR := device/sony/taoshan/boot
DEVICE_LOGORLE := $(DEVICE_BOOTDIR)/logo.rle
INITSONY := $(PRODUCT_OUT)/utilities/init_sony

uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk.cpio
$(uncompressed_ramdisk): $(INSTALLED_RAMDISK_TARGET)
zcat $< > $@

INITSONY := $(PRODUCT_OUT)/utilities/init_sony

INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
$(INSTALLED_BOOTIMAGE_TARGET): $(PRODUCT_OUT)/kernel $(uncompressed_ramdisk) $(recovery_uncompressed_ramdisk) $(INSTALLED_RAMDISK_TARGET) $(INITSONY) $(PRODUCT_OUT)/utilities/toybox $(PRODUCT_OUT)/utilities/keycheck $(MKBOOTIMG) $(MINIGZIP) $(INTERNAL_BOOTIMAGE_FILES)
$(call pretty,"Boot image: $@")
$(INSTALLED_BOOTIMAGE_TARGET): $(PRODUCT_OUT)/kernel \
$(uncompressed_ramdisk) \
$(recovery_uncompressed_ramdisk) \
$(INSTALLED_RAMDISK_TARGET) \
$(INITSONY) \
$(PRODUCT_OUT)/utilities/toybox \
$(PRODUCT_OUT)/utilities/keycheck \
$(MKBOOTIMG) $(MINIGZIP) \
$(INTERNAL_BOOTIMAGE_FILES)

$(call pretty,"Boot image: $@")
$(hide) rm -fr $(PRODUCT_OUT)/combinedroot
$(hide) mkdir -p $(PRODUCT_OUT)/combinedroot/sbin

$(hide) mv $(PRODUCT_OUT)/root/logo.rle $(PRODUCT_OUT)/combinedroot/logo.rle
$(hide) cp $(DEVICE_LOGORLE) $(PRODUCT_OUT)/combinedroot/logo.rle
$(hide) cp $(uncompressed_ramdisk) $(PRODUCT_OUT)/combinedroot/sbin/
$(hide) cp $(recovery_uncompressed_ramdisk) $(PRODUCT_OUT)/combinedroot/sbin/
$(hide) cp $(PRODUCT_OUT)/utilities/keycheck $(PRODUCT_OUT)/combinedroot/sbin/
Expand All @@ -31,8 +41,8 @@ $(INSTALLED_BOOTIMAGE_TARGET): $(PRODUCT_OUT)/kernel $(uncompressed_ramdisk) $(r

INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) \
$(INSTALLED_BOOTIMAGE_TARGET) \
$(recovery_kernel)
$(INSTALLED_BOOTIMAGE_TARGET) \
$(recovery_kernel)
@echo ----- Making recovery image ------
$(hide) $(MINIGZIP) < $(PRODUCT_OUT)/ramdisk-recovery.cpio > $(PRODUCT_OUT)/ramdisk-recovery.img
$(hide) $(MKBOOTIMG) --kernel $(PRODUCT_OUT)/kernel --ramdisk $(PRODUCT_OUT)/ramdisk-recovery.img --cmdline "$(BOARD_KERNEL_CMDLINE)" --base $(BOARD_KERNEL_BASE) --pagesize $(BOARD_KERNEL_PAGESIZE) $(BOARD_MKBOOTIMG_ARGS) -o $(INSTALLED_RECOVERYIMAGE_TARGET)
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions cm.dependencies
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"repository": "android_device_qcom_common",
"target_path": "device/qcom/common"
},
{
"repository": "android_device_sony_common",
"target_path": "device/sony/common"
},
{
"repository": "android_external_stlport",
"target_path": "external/stlport"
"repository": "android_device_qcom_common",
"target_path": "device/qcom/common"
},
{
"repository": "android_kernel_sony_msm8930",
"target_path": "kernel/sony/msm8930"
},
{
"repository": "android_external_stlport",
"target_path": "external/stlport"
}
]
Loading

0 comments on commit 7e5dde6

Please sign in to comment.