高通android开发摘要
一部分是開源的,可以從codeaurora.org上下載,還有一部分是高通產(chǎn)權(quán)的,需要從高通的網(wǎng)站上下載。 將高通產(chǎn)權(quán)的代碼放到:vendor/qcom/proprietary
1. 設(shè)置bms一些參數(shù)
@msm-pm8226.dtsi中
?? ?pm8226_bms: qcom,bms{
?? ??? ?qcom,low-soc-calculate-soc-threshold = <15>; //認(rèn)為是低電壓的soc(15%)
?? ??? ?qcom,low-soc-calculate-soc-ms = <5000>; //低電壓情況下,計(jì)算soc 的時(shí)間間隔5s
?? ??? ?qcom,calculate-soc-ms = <20000>; //正常情況下,計(jì)算soc 的時(shí)間間隔20s
?? ??? ?qcom,v-cutoff-uv = <3400000>;//用于計(jì)算soc
?? ??? ?qcom,low-voltage-threshold = <3420000>;//用于設(shè)置關(guān)機(jī)低電壓
?? ?}
?
2.pm8909_bms設(shè)備樹節(jié)點(diǎn)
位于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上報(bào)的充電事件,采用PMIC充電時(shí)采用,采用TI的BQ24296充電時(shí)不需要。
?
?
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計(jì)算
在lk/dev/gcdb/display/gcdb_autopll.c的頻率計(jì)算方法中,是通過屏的參數(shù),計(jì)算的mipi ?clk頻率
?
static void calculate_bitclock(struct msm_panel_info *pinfo)?
4.\device\qcom\msm8909\mixer_paths_msm8909_pm8916.xml
?
此文件對(duì)應(yīng)系統(tǒng)的system/etc/mixer_paths_msm8909_pm8916.xml,主要是針對(duì)收音機(jī),聽筒,普通耳機(jī),線控耳機(jī)和降噪,相關(guān)鏈接點(diǎn)擊打開鏈接
?
5.驗(yàn)證RTC時(shí)間校準(zhǔn)功能打開的方法:.檢測(cè)寄存器值:
adb shell
cd /sys/kernel/debug/spmi/spmi-0
echo 1 > count
echo 0x5A5B > address
cat data
80 ?未打開?D0 打開
?
6.主要的設(shè)備樹文件
?
?
7.MSM8909包含的子系統(tǒng)
APPS:Cortex-A7,啟動(dòng)地址0xFC010000
RPM:Cortex-M3,Resource Power Manager資源功耗管理子系統(tǒng),啟動(dòng)地址0x00200000(subsystem vierw),0x0(system view)
Modem:MSS_QDS,調(diào)制解調(diào)(基帶)處理子系統(tǒng)
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就是高通參考設(shè)計(jì)(Qualcomm Reference Design)
PBL:APPS PBL(Application Primary Boot Loader),主引導(dǎo)加載程序
RPM:Resource Power Manager,資源電源管理器
RPM(Resource Power Manager)是高通MSM平臺(tái)另外加的一塊芯片,雖然與AP芯片打包在一起,但其是一個(gè)獨(dú)立的ARM Core。之所以加這個(gè)東西,就是要控制整個(gè)電源相關(guān)的shared resources,比如ldo,clock。負(fù)責(zé)與SMP,MPM交互進(jìn)入睡眠或者喚醒整個(gè)系統(tǒng)。
L2 TCM:Tightly-Coupled Memory,緊耦合內(nèi)存
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配置參數(shù)。
TZ:
PIL:Peripheral image loader
MBA:Modem Boot Authenticator,調(diào)制解調(diào)器引導(dǎo)認(rèn)證
HLOS:High-level operation system,高級(jí)操作系統(tǒng)
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移動(dòng)用戶軟件
?
?
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部分
------------------------------自己增加的
9.1 音頻部分
Low-Power Audio Subsystem (LPASS)、Application Subsystem (APSS) software、Audio Calibration Database (ACDB) and ACDB loader
?10.kernel/drivers/power/reset/msm-poweroff.c文件下的download_mode控制死機(jī)是否重啟還是抓dump
?
節(jié)點(diǎn)?/sys/module/msm_poweroff/parameters/download_mode的值控制死機(jī)是否自動(dòng)重啟
0為死機(jī)重啟
1為死機(jī)抓dump
?
11.抓取kmsg,logcat,event.log,及dump一體的測(cè)試腳本工具
?
12.msm8909的只有一路CCI(Camera Control Interface) master,對(duì)應(yīng)設(shè)備樹qcom,cci-master = <0>,msm8974有2路,大多數(shù)情況下只需要一路即可。
?
13.system\core\rootdir\init.rc可修改驅(qū)動(dòng)和應(yīng)用的權(quán)限
?
14.board-id
msm8909-1gb-qrd-skue.dts文件相關(guān)內(nèi)容
qcom,board-id= <0x1000b 0xc>;
b對(duì)應(yīng)于
uint32_t board_hardware_id()
{
return board.platform_hw;
}
?
c對(duì)應(yīng)于
uint32_t board_hardware_subtype(void)
{
return board.platform_subtype;
}
15.\device\qcom\msm8909\BoardConfig.mk記錄了分區(qū)信息
?
16.boot_images/core/storage/tools/ptool/
ptool.py ? ? ? ? //分區(qū)生成工具 partition =========> rawprogram0.xml
Python ptool.py –x partition.xm
-rawprogram0.xml是高通代碼中帶的,根據(jù)partition.xml生成,也就是分區(qū)表,高通會(huì)給論證的emmc根據(jù)經(jīng)驗(yàn)值提供一個(gè)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進(jìn)行雙mic降噪
?
17.高通源代碼
高通的android代碼分為兩部分,一部分是開源的,可以從網(wǎng)站下載,需要知道要下載的代碼的分支及build id。另一部分是非開源的,需要從高通的另一個(gè)網(wǎng)站上下載,這個(gè)下載是有權(quán)限限制的,曉光的帳號(hào)可以下載代碼。后面這部分代碼需要放到第一部分代碼的vendor指定目錄下,可能是vendor/qcom-proprietary或vendor/qcom/proprietary,根據(jù)版本的不同有所區(qū)別。
高通平臺(tái)相關(guān)的東西基本都在vendor/qcom/proprietary下或device/qcom下
比如我們的msm8909平臺(tái)
./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上下載,還有一部分是高通產(chǎn)權(quán)的,需要從高通的網(wǎng)站上下載。?
將高通產(chǎn)權(quán)的代碼放到:vendor/qcom/proprietary。?
編譯對(duì)應(yīng)的目標(biāo):?
sourcebuild/envsetup.sh?lunch msm8974-userdebug?
$ make -j4?
編譯出來的有以下幾個(gè)目標(biāo)文件:?
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默認(rèn)工作模式
\device\qcom\msm8909\system.prop,修改persist.sys.usb.config=charging即可。
?
20.電池驅(qū)動(dòng),bms檢測(cè)到充電結(jié)束,通知battery驅(qū)動(dòng)停止充電
POWER_SUPPLY_PROP_STATUS
This property is set by BMS whenever BMS detects end of charge
condition. Charger driver uses this to stop charging.
當(dāng)BMS檢測(cè)到充電結(jié)束的情況,BMS設(shè)置此屬性來通知充電器多功能停止充電
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.
請(qǐng)注意,BMS是一個(gè)需要循環(huán)通知電池狀態(tài)和容量(bms)屬的特殊實(shí)例。
?
主要功能是基于周期性采樣VBAT(vattery voltage)來計(jì)算SOC(state of charge)
qcom,report-charger-eoc是BQ
qcom,use-reported-soc是默認(rèn)。
?
22.rc文件
android通用的rc文件目錄:\system\core\rootdir\init.rc
qcom平臺(tái)共用的rc文件目錄:device\qcom\common\rootdir\etc
qcom特定型號(hào)處理器的rc文件目錄:比如device\qcom\msm8909
?
23?sensor dtsi對(duì)應(yīng)的意思,比如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.修改攝像頭預(yù)覽角度vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/configs/msm8937_camera.xml
<MountAngle>270</MountAngle>
?
26音頻增益db和數(shù)值對(duì)應(yīng)關(guān)系
比如hardware/qcom/audio/configs/msm8937/mixer_paths_qrd_sku2.xml下相關(guān)內(nèi)容
? ? <ctl name="ADC1 Volume" value="8" />
? ? <ctl name="ADC2 Volume" value="8" />
? ? <ctl name="ADC3 Volume" value="8" />
? ? <ctl name="DEC1 Volume" value="90" />
? ? <ctl name="DEC2 Volume" value="90" />
這些數(shù)值和dB對(duì)應(yīng)關(guān)系,文檔《80_NV213_1EC_Audio_Tuning_Handbook.pdf》有相關(guān)描述
?
?
26.解析前需要確保vimlinux跟ramdump的一致性
$ strings vmlinux |grep "Linux version"
Linux version 3.18.31 (android@ubuntu) (gcc version 4.9 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Wed Aug 9 23:23:27 CST 2017
$ strings DDRCS0.BIN |grep "Linux version"
Linux version 3.18.31 (android@ubuntu) (gcc version 4.9 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Wed Aug 9 23:23:27 CST 2017
如果不匹配,無法繼續(xù)分析,若確認(rèn)匹配后就可以執(zhí)行解析
?
27.攝像頭驅(qū)動(dòng),Android7.1使用的HAL3對(duì)應(yīng)Qcamera2以及ISPIF_V2
攝像頭在開機(jī)的時(shí)候會(huì)初始化一次,保證攝像頭的mediaserver是正常的,在這個(gè)過程中camera會(huì)上下電一次,每個(gè)攝像頭都會(huì)上下電一次
?
28.高通參考設(shè)計(jì)用I2C4掛載sensor,我們產(chǎn)品沒有sensor,用來掛載nfc,需要把vendor/qcom/proprietary/sensors/dsps/reg_defaults/sensor_def_qcomdev.conf文件相關(guān)內(nèi)容去掉,可以去掉,只剩下面的
另外也要采用對(duì)應(yīng)修改過devcfg.mbn,否則有問題,我遇到的問題是掛載i2c4的時(shí)候,在內(nèi)核階段反復(fù)重啟。
?
29. 今天一直一個(gè)gpio驅(qū)動(dòng),在/dev/下看不到設(shè)備名,串口信息提示:
?could not find pctldev for node,/soc/xxx_gpio/xxx_gpio_active, deferring probe
后來發(fā)現(xiàn)原來是設(shè)備樹對(duì)應(yīng)的節(jié)點(diǎn)掛載地方錯(cuò)了。
30. PM8937和PMI8937
PMI是Power Management Integrated的縮寫,PM8937主要負(fù)責(zé)系統(tǒng)供電和音頻,PMI8937主要是作為充電功能
31. android9.0下sensor_def_qcomdev.conf的替換驗(yàn)證
?
32. 攝像頭是否走高通內(nèi)置ISP
如果外置ISP輸出是YUV數(shù)據(jù)格式,高通代碼識(shí)別處理后,就不走內(nèi)置的ISP處理。
總結(jié)
以上是生活随笔為你收集整理的高通android开发摘要的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 修改C:\WINDOWS\system3
- 下一篇: linux开发缩写