概述
目录
什么是SAR Sensor
术语
参考文档
SAR Sensor 移植和配置
QXDM 和reg抓日志方法
Modem/RF相关
GPIO配置
如何降DSI 值从APP 侧通过QMI 传给modem。
NV相关
什么是SAR Sensor
SAR Sensor 指的是检测机器靠近人体的一个sensor,如果人体靠近会降低设备的发射功率,从而降低SAR。
术语
术语 | 全称 |
see sensor | SENSORS EXECUTION ENVIRONMENT (SEE) SENSORS |
ssc sensor | Snapdragon Sensors Core |
参考文档
QM215平台是 ssc sensor,可以阅读如下文档:
1、80-nv610-70_g_sensors_quick_start.pdf
2、80-NM328-44 Sensors Overview
80-NH058-1 SSC Features for Linux Android
3、80-NB925-1 SSC Core Compatiable Driver Sensors Driver List
4、80-NM328-74 Sensors Deep Dive
80-N7635-1 SSC New Sensor Driver Integration Guide for Linux Android
5、80-NA811-2 Adding a Custom Sensors Algorithm on SSC Using Sensors Algorithm Manager (SAM) 2.0
6、80-N7859-1, Qualcomm Snapdragon Sensors Core (SSC) Factory Test Framework
7、80-NA811-2, The oem1 source code example provides a good starting point for developing custom sensor algorithms.
8、80-N8485-1 See QSensor Test Android Application User Guide.
9、80-P9301-35 Rev. B
80-NM328-74 G
80-NK742-2 A
80-n7635-1_f_snapdragon_sensors_core_(ssc)_new_sensor_driver_integration_guide_for_linux_android.pdf
10、kba-190307012411_1_how_to_add_sar_sensor_hal_in_see.pdf
SAR Sensor 移植和配置
以QM215项目需要支持SX9325 SAR SENSOR为例。
1、 adsp_procSensorsddqcomincsns_dd.h
extern sns_ddf_driver_if_s sns_dd_sx932x_if;
2、adsp_procSensorsddqcombuilddd_qcom.scons
DD_SOURCES = [
"${BUILDPATH}/dd_smtc_sx932x_raw.c",
"${BUILDPATH}/dd_smtc_sx932x_raw_uimg.c",
3、adsp_procSensorsddqcomsrc
增加如下代码文件
dd_smtc_sx932x_raw.c
dd_smtc_sx932x_raw.h
dd_smtc_sx932x_raw_uimg.c
dd_smtc_sx932x_reg.h
4、adsp_procSensorsbuildSensors.scons
env.Append(CPPDEFINES = ["CONFIG_SUPPORT_SX932X"])
5、adsp_procSensorscommonincsns_reg_common.h
#define SNS_REG_UUID_SX932X
{0x64,0x9d,0x2e,0x62,0x07,0x0a,0x45,0xc0,0x89,0x64,0xc4,0xca,0xd2,0xbd,0x66,0x32}
6、Androidvendorqcomproprietarysensorsdspssensordaemoncommonincsns_reg_common.h
#define SNS_REG_UUID_SX932X
{0x64,0x9d,0x2e,0x62,0x07,0x0a,0x45,0xc0,0x89,0x64,0xc4,0xca,0xd2,0xbd,0x66,0x32}
7、adsp_procSensorssmgrsrcsns_smgr_reg.c
#ifdef CONFIG_SUPPORT_SX932X
{ SNS_REG_UUID_SX932X, &sns_dd_sx932x_if},
#endif
8、adsp_procSensorsddfincsns_ddf_common.h
//Add by test@20191125 for sar sensor sx932x
SNS_DDF_VENDOR_SEMTECH,
//Add end
......
} sns_ddf_vendor_e;
9、adsp_procSensorsddqcomsrcdd_smtc_sx932x_raw.h
//Delete begin by test@20191125 for fix build error
//#include "sns_dd_daf_xm.h"
//Delete end
10、adsp_procSensorsddqcomsrcdd_smtc_sx932x_raw.h
//Delete begin by test@20191125 for fix build error
/* Enable this flag when compiling on OpenSSC HD22 builds */
//#define SX932X_COMPILE_FOR_HD22
//Delete end
QXDM 和reg抓日志方法
adb root
adb remount
cat /sys/bus/msm_subsys/devices/subsys1/name
echo 'related' > /sys/bus/msm_subsys/devices/subsys1/restart_level
adb shell rm /mnt/vendor/persist/sensors/sns.reg //用于验证第一次load sensor是否成功
adb shell sync
然后QXDM 执行 send_data 75 37 03 48 00 重启adsp,然后抓QXDM log
adb shell sns_regedit_ssi -r >sns_regedit_ssi.txt
查看soc_id 值
命令:adb shell cat /sys/devices/soc0/soc_id
C:UsersadenDesktopadb>adb shell cat /sys/devices/soc0/soc_id
386
Ret=0
Modem/RF相关
示例:
QM215 platfrom:
our project support SAR Sensor.
M_GPIO_104/RFFE3_CLK-->TRX_TUNER_CTRL2-->V2-->MXD8545Q-->SAR_SENSOR_ANT_TRX-->ANT_TRX
M_GPIO_106/RFFE3_DATA-->TRX_TUNER_CTRL1-->V1-->MXD8545Q-->SAR_SENSOR_ANT_TRX-->ANT_TRX
M_GPIO_117--->DRX_TUNER_CTRL2-->V2-->MXD8545Q-->ANT_DRX
M_GPIO_116--->DRX_TUNER_CTRL1-->V1-->MXD8545Q-->ANT_DRX
GPIO配置
GPIO 116 and 117 are GRFC 12 and 13 as grfc type.
GPIO 104 and 106 can be used as RFFE3 CLK and DATA.
refer to other grfc in rfc_msm_signal_info_ag.c and xml files in modem_proccoresystemdriverstlmmconfig%chipset name%.
{ RFC_ANT_SEL , 104 , 0 , RFC_GRFC , 1, DAL_GPIO_OUTPUT ,"grfc[0]"}, /* Signal: RFC_MSM_RF_PATH_SEL_01, MSM Pin Name: GPIO_104*/
{ RFC_ANT_SEL , 106 , 2 , RFC_GRFC , 1, DAL_GPIO_OUTPUT ,"grfc[2]"}, /* Signal: RFC_MSM_RF_PATH_SEL_02, MSM Pin Name: GPIO_106*/
{ RFC_ANT_SEL , 117 , 13 , RFC_GRFC , 1, DAL_GPIO_OUTPUT ,"grfc[13]"}, /* Signal: RFC_MSM_RF_PATH_SEL_08, MSM Pin Name: GPIO_117*/
{ RFC_ANT_SEL , 116 , 12 , RFC_GRFC , 1, DAL_GPIO_OUTPUT ,"grfc[12]"}, /* Signal: RFC_MSM_RF_PATH_SEL_16, MSM Pin Name: GPIO_116*/
针对GPIO 104 and 106 can be used as RFFE3 CLK and DATA. 是否要做改动,需要咨询射频关于这GPIO 的功能。一般情况下,RF gpio会在 rfc_msm_signal_info_ag.c 被定义作为不同的RF 功能,这与rfcard中的重复使用无关。如果你细看,你也会发现一些gpio被重新定义了。针对grfc 可以阅读 80_NE606_4。
如何降DSI 值从APP 侧通过QMI 传给modem。
QM215 is Jolokia modem based chipset. Please read 80-P5282-1 carefully to understand the DSI based SAR power backoff mechanism.
1. You will need trigger QMI message from AP to modem while SAR sensor input indicates SAR power limit backoff is needed.
2. modem RF software and related NV items are present in MPSS.JO software already.
3. check 80-P5282-1 about the diag command forcing to apply DSI value. Related log analysis is also enclosed in this doc.
4. 80-P5282-1 (DSI based SAR power backoff) and 80-NT112-100 for Jolokia modem RFNV.
AP通过QMI接口将此DSI发送到modem,这块需要OEM厂家自己写AP侧代码实现。把需要做SAR limit backoff的场景转换成QMI上的DSI设置消息。因为每家客户使用的Sensor或者感兴趣的场景都不一样,Qualcomm只提供QMI接口。实际上,这与RFSW无关。
Please check 80-P5282-1 for general introduction of DSI based SAR power backoff.
The QMI message carrying DSI value from AP to modem is included in this document.
However, how to translate the "sensor output" to the event sending QMI message, Qualcomm doesn't have any reference code (AP code) because every customer's implementation is different from others. You need to implement it by yourself.
you can check KBA-170705202734 -- how_to_set_sar_rf_state_from_ap_side
For this KBA-170705202734 RIL side just support a API QCRIL_EVT_HOOK_SET_TRANSMIT_POWER for OEM can set the SAR info.
normal oem can extend api at
vendor/qcom/proprietary / qcrilOemHook/src/com/qualcomm/qcrilhook/QcRilHook.java
such as below temp code
public boolean qcRilSetTransmitPower(int power, int phoneId) {
boolean retval = false;
int requestId = QCRIL_EVT_HOOK_SET_TRANSMIT_POWER;
byte[] request = new byte[mHeaderSize + INT_SIZE];
ByteBuffer reqBuffer = createBufferWithNativeByteOrder(request);
Log.d(LOG_TAG, "qcRilSetTransmitPower power: " + power);
addQcRilHookHeader(reqBuffer, requestId, INT_SIZE);
reqBuffer.putInt(power);
AsyncResult ar = sendRilOemHookMsg(requestId, request, phoneId);
if (ar.exception == null){
retval = true;
} else {
Log.e(LOG_TAG, "QCRIL set max transmit power returned exception: " + ar.exception);
}
return retval;
}
this is just a temp code ,we not Maintain it.
if no have framwork,oem need to create the sar qmi client ,then send the QMI_SAR_RF_SET_STATE_REQ_MSG_V01 to modem.
KBA-170905200950--新平台上使用QMUXD初始化qmi client失败
NV相关
针对QM215平台只需关注如下这几个NV
RFNV_LTE_By_DB10_SAR_BACK_OFF_LIMIT_I
RFNV_WCDMA_By_DB10_SAR_BACK_OFF_LIMIT
RFNV_BCy_TX_LIM_VS_TEMP_SAR_LVLS
RFNV_GSM_Cx_<band>_SAR_BACKOFF_I (RFNV#25028~#25035)
文档只需要看80-NT112-100。其它的文档不需要看。
最后
以上就是沉静云朵为你收集整理的SAR Sensor 调试什么是SAR Sensor术语参考文档SAR Sensor 移植和配置QXDM 和reg抓日志方法Modem/RF相关的全部内容,希望文章能够帮你解决SAR Sensor 调试什么是SAR Sensor术语参考文档SAR Sensor 移植和配置QXDM 和reg抓日志方法Modem/RF相关所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复