高通android开发摘要

少年辛苦终身事,莫向光阴惰寸功。这篇文章主要讲述高通android开发摘要相关的知识,希望能为你提供帮助。
一部分是开源的。能够从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 = https://www.songbingjia.com/android/< & 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
【高通android开发摘要】< MountAngle> 270< /MountAngle>


    推荐阅读