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