高通android开发摘要
发布日期:2021-06-30 21:52:03 浏览次数:3 分类:技术文章

本文共 9405 字,大约阅读时间需要 31 分钟。

一部分是开源的,可以从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部分

------------------------------自己增加的

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控制死机是否重启还是抓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>

 

26音频增益db和数值对应关系

比如hardware/qcom/audio/configs/msm8937/mixer_paths_qrd_sku2.xml下相关内容

    <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" />

这些数值和dB对应关系,文档《80_NV213_1EC_Audio_Tuning_Handbook.pdf》有相关描述

 

 

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

如果不匹配,无法继续分析,若确认匹配后就可以执行解析

 

27.摄像头驱动,Android7.1使用的HAL3对应Qcamera2以及ISPIF_V2

摄像头在开机的时候会初始化一次,保证摄像头的mediaserver是正常的,在这个过程中camera会上下电一次,每个摄像头都会上下电一次

 

28.高通参考设计用I2C4挂载sensor,我们产品没有sensor,用来挂载nfc,需要把vendor/qcom/proprietary/sensors/dsps/reg_defaults/sensor_def_qcomdev.conf文件相关内容去掉,可以去掉,只剩下面的

另外也要采用对应修改过devcfg.mbn,否则有问题,我遇到的问题是挂载i2c4的时候,在内核阶段反复重启。

 

29. 今天一直一个gpio驱动,在/dev/下看不到设备名,串口信息提示:

 could not find pctldev for node,/soc/xxx_gpio/xxx_gpio_active, deferring probe

后来发现原来是设备树对应的节点挂载地方错了。

30. PM8937和PMI8937

PMI是Power Management Integrated的缩写,PM8937主要负责系统供电和音频,PMI8937主要是作为充电功能

31. android9.0下sensor_def_qcomdev.conf的替换验证

 

32. 摄像头是否走高通内置ISP

如果外置ISP输出是YUV数据格式,高通代码识别处理后,就不走内置的ISP处理。

转载地址:https://loongembedded.blog.csdn.net/article/details/50570982 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Qual F&Q
下一篇:修改C:\WINDOWS\system32\drivers\etc\hosts 文件有什么作用

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2024年04月22日 06时39分45秒