Android RF射频



高通射频部分由Transceiver、RFFE(Radio Frequency Front-End)和RFC(Radio Frequency Control)组成,其中Transceiver基本是以高通参考设计采用的收发两用芯片为主、RFFE主要起到收发射频信号的作用,RFC则是一个软件的控制器概念。reference:Qualcomm Technologies,Inc.

一、ASM

reference:80-NE606-2_THIRD-PARTY MIPI ASM CUSTOMIZATION

1、简介

ASM(Antenna Switch Matrix),一般位于PA后边,一个单刀多置开关,用作通路的选择,有个mipi core。其实也可以把多个功能集成到一起,例如PA+ASM。

Functions that may be located either in separate devices or
integrated into a single device

2、ASM driver implementation

2.1、从datasheet或文档中获取 :

  • Manufacturer ID == is restored in 0x1D and 0x1F registers
  • Product ID == is restored in the 0x1E register
  • USID == is usually 低四位 of the 0x1F register
  • Register settings
    tips:USID can be reprogrammed,and in the USID reprogramming process, the MID/PID/default USID must be known.

2.2、修改或创建文件,都位于rfdevice_asm/src/:

  • 创建 rfdevice_asm_qm56022_data_ag.h
  1. 复制一份其他asm的文件,然后把其中的实现都修改为XYZ。
  2. 其中是一个类的定义,定义了一些获取信息的函数。
  • 创建 rfdevice_asm_XYZ_data_ag.cpp
  1. copy一份类似的,Replace all instances
  2. Set ASM_ON_REG/ASM_ON_DATA
    两个数组rfdevice_xxx_on_regs和rfdevice_xxx_on_data,一个放寄存器地址一个放数据结构体,通过RFDEVICE_ASM_REG_INVALID填充和排列组合,allows the software to control the HB/LB switch separately in the same ASM。
  3. Set ASM_OFF_REG/ASM_OFF_DATA
    其实就是把上边的参数改成0x00,对应硬件的保留位。
  4. Set ASM_TRIGGER
    仍然是两个数组rfdevice_xxx_trigger_regs和rfdevice_xxx_trigger_data,一个放寄存器地址一个放数据结构体都设置成0x01,地址0x1c由mipi规定,value也不需要修改。
  5. Set MIPI parameters for ASM
    设置mid、pid、prd_rev,最后这个参数是QTI中逻辑概念的定义0,通过不同数值区分mid、pid相同的设备。说白了就是自己定义一个id区分设备,只要与下文保持一致即可。
  • 修改 rfdevice_asm_factory.cpp
  1. Add the header file of "rfdevice_asm_XYZ_data.h"
  2. Add the if-else condition for the new ASM
    这里面判断了mid、pid、prd_rev三个参数,与上文一致即可。
  • 在RFC中使能ASM
  1. 见RFC小节

3、RFC implementation to enable ASM

见文档第7章。为了适配多个功能集成到一个chip上,新版推出了这种方式。
文件位于rf_card/rfc_wtr2965_non_ca_saw_4320/common/src/

  • phy_devices_list
    一个结构体数组,用到了的设备都要添加,没用的要删除,一个设备只能创建一个phy_device。结构体元素意义可看table7-2。

A MIPI device with a single digital MIPI communication core is considered as a single physical device even though it covers PA and ASM functions。

  • logical_devices_list
    匹配上边的phy数组。结构体元素意义可看table7-3。一个设备可以同时作为PA和ASM运行。在RFC中,应该创建两个逻辑设备,一个用于PA和ASM。

Only logical devices can be used in band_device_info
tips
DEVICE_MODULE_TYPE_INSTANCE ,每种设备类型的设备都从0开始自定义,不同设备类型的编号是独立的(设备指DEVICE_MODULE_TYPE中的6种,见table7-4);
ASSOCIATED_PHY_DEVICE_INSTANCE,要与phy_device匹配.

  • Set ASM in BAND_device_info
    文件位于/rf_card/rfc_wtr2965_non_ca_saw_4320/wcdma/src data.c。在结构体<rf_card>_tx0_tech_bx_device_info中填充基本信息: 以DEVICE_MODULE_TYPE_INSTANCE数值匹配;同时加入mfg_id、prd_id、port_num。

  • Special case–Alternative devices

  • 添加备选phy设备需要设置:

  • PHY_DEVICE_NAME is the same as GEN_ASM for a third-party ASM.

  • PHY_DEVICE_INSTANCE number is the same for alternative devices.

  • PHY_DEVICE_ALT_PART_NUM_OF_INSTANCE must be unique, starting from 0 and proceeding in sequential order for each alternative device.

  • 添加备选logical设备需要设置:

  • Only one logical device is added for each alternative device with the same functionality.

  • DEVICE_MODULE_TYPE is the same as RFDEVICE_ASM.

  • DEVICE_MODULE_NAME is the same as GEN_ASM for a third-party ASM.

  • DEVICE_MODULE_INSTANCE must be unique for each logical ASM.

  • ASSOCIATED_PHY_DEVICE_INSTANCE must match the physical device instance
    number.

Projects may have different ASM parts for the main ASM but may share the same software. The B1 ASM can be either XYZ (pid=0x98) or ABC (pid=0x97). The software provides the flexibility to allow an alternative physical device for a particular ASM.

二、PA

reference:80-NE606-3_MIPI PA CUSTOMIZATION

1、简介

PA(Power Amplifier),234G的功放,有个mipi core。

2、PA driver implementation

2.1、从datasheet获取参数

Manufacturer ID
Product ID
USID(can be reprogramed)
register setting

2.2、创建或修改文件,都位于rfdevice_pa/src/:

  • Create rfdevice_pa_XYZ_data_ag.h
  1. 复制与修改变量名
  2. 其中仍然是一个类的定义,还是一些配置获取函数
  • Create the rfdevice_pa_XYZ_data_ag.cpp
  1. Set PA_SET_BIAS_REG/DATA ,holds the PA quiescent current. It has an 8-bit value. By default, set it to 0xFC. The register it is usually 0x01.
    Modem software can support up to 16-bit PA bias with the XPT solution

  2. Set PA_set_range_REG/DATA The register it is usually 0x00.
    one port is for each band in the general case.For each band, the PA can operate at four gain states.当然如果没有四种增益状态,也可以将其中几个设置重复的值

  3. Set PA_ON_REG/DATA
    PA is automatically turned on when set_PA_RANGE is called.Consequently, there is no need to write anything for PA_ON data; all elements are set to RF_REG_INVALID.

  4. Set PA_OFF_REG/DATA
    the register 0x00 value for PA_OFF is 0b00000010 = 0x02.disable the PA enable bits in register 0x00, set the band select bits to 0, and put the PA in LPM.

  5. Set PA_TRIGGER
    A trigger is used to execute several MIPI commands on a single RFFE bus at the same time.Register is usually 0x1c,value is 0x07.

  6. Set the maximum supported bandwidth

  7. Set MIPI parameters for PA ,m_id、p_id、prd_rev 。

  • Modify the rfdevice_pa_factory.cpp
  1. Add a header file of rfdevice_pa_XYZ_data.h
  2. Add an else/if condition for the new PA,id判断

3、RFC implementation to enable PA

同ASM的RFC enable

4、change NV/XTT

  • From the above NV setting, the relationship between the PA state and PA range can be found.

三、GRFC

1、简介

本质是一组信号。

Generic RF Controls (GRFC) are dedicated signals that connect to internal or external components; they are toggled at specific times to control functions.

2、implementation

  • MSM_signal_info
  1. GRFC signal type 枚举元素
  2. GPIO number
  3. GRFC number
  • rf_card_sig_info Content:
  1. Corresponding RFC_MSM_<signal_name> 枚举元素
  2. Initial state,default state is Low
  3. Drive strength

两者通过msm_signal_name联系和匹配

<rf_card>sig_info
位于rf_card<rf_card>\common\src\rfc
<rf_card>_cmn_ag.cpp/.h
里面的结构体元素中只有前两个比较重要,第一个是枚举元素

<rf_card>_lte_bx_sig_cfg
两个元素,一个msm_signal_type的枚举,一个default state。
位于rf_card<rf_card>\tech\src<rf_card>_tech_config_data_ag.c

GFRC参考博客原文
重要文件
/modem_proc/rfc_tabasco/target/mdm8953/src/rfc_msm_signal_info_ag.c
/modem_proc/rfc_tabasco/target/mdm8953/inc/rfc_msm_signal_info_ag.h
/modem_proc/rfc_tabasco/target/mdm8953/inc/rfc_msm_typedef.h
/modem_proc/rfc_tabasco/rf_card/rfc_wtr2965_non_ca_saw4320/common/src/rfc_wtr2965_non_ca_saw4320_cmn_ag.cpp
/modem_proc/rfc_tabasco/rf_card/rfc_wtr2965_non_ca_saw4320/common/inc/rfc_wtr2965_non_ca_saw4320_cmn_ag.h

/rfc_tabasco/target/platform/src
vim rfc_msm_signal_info_ag.c
GRFC的填空

四、RFC

1、简介

感觉是一个软件概念,因为介绍中说会在初始化时由驱动检测RFC,而实际执行过程中,却是在检测ASM、PA、LNA(Low-Noise Amplifier)等组件。下边的物理、逻辑列表相当于一个索引,用来初始化设备,无关顺序。

The RF card contains hardware information that the RF driver needs to configure/set for operation. The RF driver queries the RFC during initialization and building scripts for RF execution.
文件结构:

  • api==>The rfc_hwid.h file contains the HW_ID value definition; this value is stored in NV 1878.
  • rf_card==>GRFC signals table is stored in rfc_msm_signal_info_ag.c.
  • target==>The rf_card folder contains the RFC settings for each RF card, and stored in wtr2965_non_saw_4200
  • rfc_<rf_card>_ _config_ag.cpp – Contains the function to query RFC data for each band/path
  • rfc_<rf_card>_ _config_data_ag.c – Contains the required settings for each band

2、implementation

physic_device list

logical_device list

msm signals(GRFC)

Logical device properties

Restriction table


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM