高通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 = <&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是默认。

上一篇:SQL关键字转换大写核心算法实现


下一篇:Browser设置搜索引擎