1. 程式人生 > >高通android開發摘要

高通android開發摘要

lun turn line 不同 ons subscribe master less ade

一部分是開源的。能夠從codeaurora.org上下載,另一部分是高通產權的。須要從高通的站點上下載。 將高通產權的代碼放到:vendor/qcom/proprietary

1. 設置bms一些參數

@msm-pm8226.dtsi中 
pm8226_bms: qcom,bms{
qcom,low-soc-calculate-soc-threshold = <15>; //覺得是低電壓的soc(15%)
qcom,low-soc-calculate-soc-ms = <5000>; //低電壓情況下,計算soc 的時間間隔5s
qcom,calculate-soc-ms = <20000>; //正常情況下,計算soc 的時間間隔20s


qcom,v-cutoff-uv = <3400000>;//用於計算soc
qcom,low-voltage-threshold = <3420000>;//用於設置關機低電壓
}


2.pm8909_bms設備樹節點

位於msm8909-qrd-skue.dtsi文件

&pm8909_bms {
status = "okay";
qcom,resume-soc = <95>;
qcom,use-reported-soc;

qcom,report-charger-eoc;
qcom,force-bms-active-on-charger;

qcom,battery-data = <&qrd_batterydata>;
};

紅色部分是PMIC上報的充電事件,採用PMIC充電時採用,採用TI的BQ24296充電時不須要。

end-of-charge (EOC)

An apparatus and method for accurate end-of-charge (EOC) detection in a battery charger is provided. An EOC circuit determines that a battery has been fully charged when two conditions are met. The first condition for EOC detection is that the battery has reached a predetermined voltage and, as a result, the battery charger has transitioned to a constant voltage phase of the charging process. The second condition for EOC detection is that the battery current has fallen below a predetermined, set level. When both of these conditions are met, EOC is detected. This bi-condition EOC detection scheme is capable of accurate EOC detection, i.e. determining when the battery is fully charged.


3.MIPI LCD clock計算

在lk/dev/gcdb/display/gcdb_autopll.c的頻率計算方法中。是通過屏的參數。計算的mipi clk頻率

static void calculate_bitclock(struct msm_panel_info *pinfo)

4.\device\qcom\msm8909\mixer_paths_msm8909_pm8916.xml

此文件相應系統的system/etc/mixer_paths_msm8909_pm8916.xml。主要是針對收音機。聽筒,普通耳機,線控耳機和降噪,相關鏈接點擊打開鏈接


5.驗證RTC時間校準功能打開的方法:.檢測寄存器值:

adb shell
cd /sys/kernel/debug/spmi/spmi-0
echo 1 > count
echo 0x5A5B > address
cat data

80 未打開 D0 打開


6.基本的設備樹文件


7.MSM8909包括的子系統

APPS:Cortex-A7。啟動地址0xFC010000

RPM:Cortex-M3,Resource Power Manager資源功耗管理子系統。啟動地址0x00200000(subsystem vierw)。0x0(system view)

Modem:MSS_QDS,調制解調(基帶)處理子系統

Pronto:ARM9TM


8.TLMM

MSM TLMM pinmux controller,Qualcomm MSM integrates a GPIO and Pin mux/config hardware, (TOP Level Mode Multiplexer in short TLMM). It controls the input/output settings on the available pads/pins and also provides ability to multiplex and configure the output of various on-chip controllers onto these pads. The pins are also of different types, encapsulating different functions and having differing register semantics.


9.高通一些縮寫

QRD就是高通參考設計(Qualcomm Reference Design)

PBL:APPS PBL(Application Primary Boot Loader)。主引導載入程序
RPM:Resource Power Manager。資源電源管理器
RPM(Resource Power Manager)是高通MSM平臺另外加的一塊芯片,盡管與AP芯片打包在一起,但其是一個獨立的ARM Core。

之所以加這個東西,就是要控制整個電源相關的shared resources。比方ldo。clock。負責與SMP,MPM交互進入睡眠或者喚醒整個系統。
L2 TCM:Tightly-Coupled Memory,緊耦合內存
Some ARM SoC:s have a so-called TCM (Tightly-Coupled Memory). This is usually just a few (4-64) KiB of RAM inside the ARM processor.
Due to being embedded inside the CPU The TCM has a Harvard-architecture, so there is an ITCM (instruction TCM) and a DTCM (data TCM). The DTCM can not contain any instructions, but the ITCM can actually contain data.


CDT: Configuration Data Table,包括CDB0: platform info信息和CDB1: DDR配置參數。
TZ:
PIL:Peripheral image loader
MBA:Modem Boot Authenticator,調制解調器引導認證
HLOS:High-level operation system。高級操作系統
Pronto image:


SMEM : shared memory
RPC : remote procedure call
QCSBL : qualcomm second bootloader
OEMSBL : oem second bootloader
AMSS : Advanced Mobile Subscriber Software
SDI : System Debug Image
QSEE : Qualcomm Secure Execution Environment
TZBSP : TrustZone BSP
SBL1:Scondary Boot Loader Stage1
MSS:Mobile Subscriber Software移動用戶軟件


WCD: wafer codec/decodec

WCN: wireless connectivity network

WTR: Wafer Transceiver

RTR: Radio Transceiver

QCA: Qualcomm Atheros

QFE: Qualcomm Front-end

RFFE: Radio Frequency Front-end

HDET: High Power Detector

ASM: Anntena Switch Module

MTP: Modem Test Platform

CDP: Core Development Platform

FFA: Form Factor Accurate

SURF: Subscriber Unit Reference Platform

XPU: Embedded Memory Protected Unit

UniPro: Universal Protocol

FLCB: Fast Low Current Boot

MSM: Mobile Station Modem

APQ: Application Processor Qualcomm

SRLTE: Simultaneous Radio and LTE


QSD: Qualcomm Snapdragon

MDM: Mobile Data Modem

MPQ: Media Processor Qualcomm

QSC: Qualcomm Single Chip

PnP: Plug and Play

PBM: Phonebook Manager

FSG: A golden file system

modemst: modem efs partition

EDL: Emergency Download

mbn: Modem Configuration binary

CV: customer visit

FFBM: fast factory boot mode


IPO: instant power on

MPM:modem power management

SMD: Shared Memory Driver

PON:Power ON

Top Level Module Multiplex (TLMM) GPIO部分

10.kernel/drivers/power/reset/msm-poweroff.c文件下的download_mode控制死機是否重新啟動還是抓dump

節點 /sys/module/msm_poweroff/parameters/download_mode的值控制死機是否自己主動重新啟動

0為死機重新啟動

1為死機抓dump


11.抓取kmsg,logcat,event.log,dump一體的測試腳本工具


12.msm8909的僅僅有一路CCI(Camera Control Interface) master。相應設備樹qcom,cci-master = <0>。msm8974有2路。大多數情況下僅僅須要一路就可以。


13.system\core\rootdir\init.rc可改動驅動和應用的權限


14.board-id

msm8909-1gb-qrd-skue.dts文件相關內容

qcom,board-id= <0x1000b 0xc>;

b相應於

uint32_t board_hardware_id()
{
return board.platform_hw;
}


c相應於

uint32_t board_hardware_subtype(void)
{
return board.platform_subtype;
}

15.\device\qcom\msm8909\BoardConfig.mk記錄了分區信息


16.boot_images/core/storage/tools/ptool/

ptool.py //分區生成工具 partition =========> rawprogram0.xml

Python ptool.py –x partition.xm

-rawprogram0.xml是高通代碼中帶的,依據partition.xml生成,也就是分區表,高通會給論證的emmc依據經驗值提供一個partition.xml 至於生成unspare格式,是方便QPST下載,python腳本就在NON-HLOS的common以下。搜下split


16.是否採用雙mic降噪

build\buildplus\namespace\names.ini文件下ro.qc.sdk.audio.fluencetype=none-----代表不採用雙mic降噪

fluence代表採用高通的fluece進行雙mic降噪


17.高通源碼

高通的android代碼分為兩部分。一部分是開源的,能夠從站點下載,須要知道要下載的代碼的分支及build id。

另一部分是非開源的,須要從高通的另一個站點上下載,這個下載是有權限限制的,曉光的帳號能夠下載代碼。後面這部分代碼須要放到第一部分代碼的vendor指定文件夾下,可能是vendor/qcom-proprietary或vendor/qcom/proprietary,依據版本號的不同有所差別。
高通平臺相關的東西基本都在vendor/qcom/proprietary下或device/qcom下

比方我們的msm8909平臺

./device/lge/mako/self-extractors/qcom
./device/asus/deb/self-extractors/qcom
./device/qcom
./system/qcom
./vendor/qcom
./vendor/qcom/opensource/fm/qcom
./hardware/qcom
./kernel/arch/arm/boot/dts/qcom
./kernel/arch/arm64/boot/dts/qcom
./kernel/drivers/firmware/qcom
./kernel/drivers/misc/qcom
./kernel/drivers/clk/qcom
./kernel/drivers/power/qcom
./kernel/drivers/soc/qcom
./kernel/include/linux/qcom
./kernel/include/soc/qcom


高通的代碼分兩部分:一部分是開源的。能夠從codeaurora.org上下載,另一部分是高通產權的,須要從高通的站點上下載。
將高通產權的代碼放到:vendor/qcom/proprietary。
編譯相應的目標:
sourcebuild/envsetup.sh lunch msm8974-userdebug
$ make -j4
編譯出來的有以下幾個目標文件:
Boot.img emmc_appsboot.mbn system.img userdata.img

18 device\qcom\msm8909\WCNSS_qcom_wlan_nv.bin:WIFI射頻功率配置

此文件位於system/etc/firmware/wlan文件夾下。

此文件在device\qcom\msm8909\msm8909.mk中實用到


19.USB默認工作模式

\device\qcom\msm8909\system.prop,改動persist.sys.usb.config=charging就可以。



20.電池驅動,bms檢測到充電結束,通知battery驅動停止充電

POWER_SUPPLY_PROP_STATUS
This property is set by BMS whenever BMS detects end of charge
condition. Charger driver uses this to stop charging.
當BMS檢測到充電結束的情況,BMS設置此屬性來通知充電器多功能停止充電

21. BMS

Note that the Battery Management (BMS) supply is a special case as there is
a circular notification requirement of the STATUS (battery) and the CAPACITY
(bms) properties.
請註意。BMS是一個須要循環通知電池狀態和容量(bms)屬的特殊實例。

主要功能是基於周期性採樣VBAT(vattery voltage)來計算SOC(state of charge)

qcom,report-charger-eoc是BQ

qcom,use-reported-soc是默認。


22.rc文件

android通用的rc文件文件夾:\system\core\rootdir\init.rc

qcom平臺共用的rc文件文件夾:device\qcom\common\rootdir\etc

qcom特定型號處理器的rc文件文件夾:比方device\qcom\msm8909


23 sensor dtsi相應的意思,比方camera的sensor

kernel/Documentation/devicetree/bindings/media/video/msm-cci.txt有說明


24.Serial Communication log can‘t be printed

Issue the following commands in root/device/qcom/common/rootdir/etc/init.qcom.rc
write /proc/sys/kernel/printk "7 6 1 7"


25.改動攝像頭預覽角度vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/configs/msm8937_camera.xml

<MountAngle>270</MountAngle>

高通android開發摘要