mtk RF配置步骤一
一.系统配置
/*MT6735*/ #define MML1_CLK1_EN 1 /* CLK1 is enabled for BB *//*MT6735*/ #define MML1_CLK2_EN 1/*MT6735*/ #define MML1_CLK3_EN 1/*MT6735*/ #define MML1_CLK4_EN 1
2.修改USID
#define MIPI_USID_ASM0 0x000F //SKY77916 USID#define MIPI_USID_ASM1 0x000F //SKY77916 USID#define MIPI_USID_PA0 0x000E //SKY77643 USID#define MIPI_USID_PA1 0x000E //SKY77643 USID#define MIPI_USID_ANT0 0x0006#define MIPI_USID_ET 0x000C
{// USID change type , port_sel , current USID , PRODUCT_ID , MANUFACTORY_ID new USID- {USID_REG_W , MML1_MIPI_PORT0 , 0xF , 0x85 , 0x1A5 , 0xE },+ {USID_REG_W , MML1_MIPI_PORT0 , 0xF , 0x1B , 0x1A5 , 0xE },{USID_NULL,0,0,0,0,0},{USID_NULL,0,0,0,0,0},{USID_NULL,0,0,0,0,0},
/*MT6169*/#define LTE_Band2_TX_IO_SEL TX_IO_MB2/*MT6169*/#define LTE_Band3_TX_IO_SEL TX_IO_MB2/*MT6169*/#define LTE_Band4_TX_IO_SEL TX_IO_MB2/*MT6169*/#define LTE_Band5_TX_IO_SEL TX_IO_LB4/*MT6169*/#define LTE_Band7_TX_IO_SEL TX_IO_HB1/*MT6169*/#define LTE_Band8_TX_IO_SEL TX_IO_LB4/*MT6169*/#define LTE_Band17_TX_IO_SEL TX_IO_LB4/*MT6169*/#define LTE_Band20_TX_IO_SEL TX_IO_LB4/*MT6169*/#define LTE_Band28_TX_IO_SEL TX_IO_LB4/*MT6169*/#define LTE_Band28_2_TX_IO_SEL TX_IO_LB4///*MT6169*/#define LTE_Band34_TX_IO_SEL TX_IO_MB1/*MT6169*/#define LTE_Band38_TX_IO_SEL TX_IO_HB1/*MT6169*/#define LTE_Band39_TX_IO_SEL TX_IO_MB2/*MT6169*/#define LTE_Band40_TX_IO_SEL TX_IO_HB1/*MT6169*/#define LTE_Band41_TX_IO_SEL TX_IO_HB1/*MT6169*/#define LTE_Band41_2_TX_IO_SEL TX_IO_HB1
/*MT6169*/#define BAND_INDICATOR2 LTE_Band3/*MT6169*/#define BAND_INDICATOR3 LTE_Band5/*MT6169*/#define BAND_INDICATOR4 LTE_Band7/*MT6169*/#define BAND_INDICATOR5 LTE_Band8/*MT6169*/#define BAND_INDICATOR6 LTE_BandNone/*MT6169*/#define BAND_INDICATOR7 LTE_Band38/*MT6169*/#define BAND_INDICATOR8 LTE_Band39/*MT6169*/#define BAND_INDICATOR9 LTE_Band40/*MT6169*/#define BAND_INDICATOR10 LTE_Band41/*MT6169*/#define BAND_INDICATOR11 LTE_Band17/*MT6169*/#define BAND_INDICATOR12 LTE_Band20/*MT6169*/#define BAND_INDICATOR13 LTE_BandNone/*MT6169*/#define BAND_INDICATOR14 LTE_BandNone
// elm type , port_sel , data_seq , USID , addr , data , wait_time(us){LTE_MIPI_PA , LTE_MIPI_PORT0, LTE_REG_W, MIPI_USID_INIT0 , {0x1C, 0x38} , WAITUSCNT(0) }, // Broadcast ID, Standard MIPI, PM_TRIG = normal mode{LTE_MIPI_ASM , LTE_MIPI_PORT1, LTE_REG_W, MIPI_USID_INIT0 , {0x1C, 0x38} , WAITUSCNT(0) }, // Broadcast ID, Standard MIPI, PM_TRIG = normal mode{LTE_MIPI_END_PATTERN,0,0,0,{0,0},0},
// elm type , port_sel , data_seq , USID , addr , data , wait_time(us){LTE_MIPI_PA , LTE_MIPI_PORT0, LTE_REG_W, MIPI_USID_INIT0 , {0x1C, 0x80} , WAITUSCNT(0) }, // Broadcast ID, Standard MIPI, PM_TRIG = low power mode{LTE_MIPI_ASM , LTE_MIPI_PORT1, LTE_REG_W, MIPI_USID_INIT0 , {0x1C, 0xB8} , WAITUSCNT(0) }, // Broadcast ID, Standard MIPI, PM_TRIG = low power mode{LTE_MIPI_END_PATTERN,0,0,0,{0,0},0},
/* No. elm type , data idx , evt_type , evt_offset *//* { start, stop }, ( us ) */{ /* 0 */ LTE_MIPI_ASM , { 0 , 1 }, LTE_MIPI_TRX_ON , LTE_TDD_MIPI_ASM_RX_ON0 },{ /* 1 */ LTE_MIPI_PA , { 2 , 3 }, LTE_MIPI_TRX_ON , LTE_TDD_MIPI_PA_TX_ON0 }, //3P4T TRX Port On{ /* 2 */ LTE_MIPI_ASM , { 4 , 5 }, LTE_MIPI_TRX_OFF , LTE_TDD_MIPI_ASM_RX_OFF0},{ /* 3 */ LTE_MIPI_PA , { 6 , 7 }, LTE_MIPI_TRX_OFF , LTE_TDD_MIPI_PA_TX_OFF0},{ /* 4 */ LTE_MIPI_NULL, { 0 , 0 }, LTE_MIPI_EVENT_NULL, 0 },
/* No. elm type , data idx , evt_type , evt_offset *//* { start, stop }, ( us ) */{ /* 0 */ LTE_MIPI_PA , { 0 , 4 }, LTE_MIPI_TRX_ON , LTE_FDD_MIPI_PA_TX_ON0 },//PA On{ /* 1 */ LTE_MIPI_PA , { 5 , 5 }, LTE_MIPI_TRX_OFF , LTE_FDD_MIPI_PA_TX_OFF0},//PA Off{ /* 2 */ LTE_MIPI_ASM , { 6 , 7 }, LTE_MIPI_TRX_ON , LTE_FDD_MIPI_ASM_TX_ON0},{ /* 3 */ LTE_MIPI_NULL, { 0 , 0 }, LTE_MIPI_EVENT_NULL, 0 },
0X0F5C0038:0x0F40005C:0x0F410078:0x0F4200C0:0x0F430089 |
#define LTE_MIPI_BYPASS_BAND_INDICATOR1 LTE_Band38#define LTE_MIPI_BYPASS_BAND_INDICATOR2 LTE_Band40#define LTE_MIPI_BYPASS_BAND_INDICATOR3 LTE_Band41#define LTE_MIPI_BYPASS_BAND_INDICATOR4 LTE_BandNone#define LTE_MIPI_BYPASS_BAND_INDICATOR5 LTE_BandNone
#define PDATA_BAND1_PR2 0x00000000#define PDATA_BAND1_PR2B PDATA_BAND1_PR2#define PDATA_BAND1_PR3 0x00000000#define PDATA_BAND1_PT1 PDATA_BAND1_PR1#define PDATA_BAND1_PT2 0x00000000#define PDATA_BAND1_PT2B PDATA_BAND1_PT2#define PDATA_BAND1_PT3 0x00000000
/*MT6169*/ #define BAND2_CHANNEL_SEL LNA_MB_2/*MT6169*/ #define BAND3_CHANNEL_SEL NON_USED_BAND/*MT6169*/ #define BAND4_CHANNEL_SEL NON_USED_BAND/*MT6169*/ #define BAND5_CHANNEL_SEL LNA_LB_2/*MT6169*/ #define BAND6_CHANNEL_SEL NON_USED_BAND/*MT6169*/ #define BAND8_CHANNEL_SEL LNA_LB_1/*MT6169*/ #define BAND9_CHANNEL_SEL NON_USED_BAND/*MT6169*/ #define BAND10_CHANNEL_SEL NON_USED_BAND/*MT6169*/ #define BAND11_CHANNEL_SEL NON_USED_BAND/*MT6169*/ #define BAND19_CHANNEL_SEL NON_USED_BAND
/*MT6169*/ #define BAND2_CHANNEL2_SEL NON_USED_BAND/*MT6169*/ #define BAND3_CHANNEL2_SEL NON_USED_BAND/*MT6169*/ #define BAND4_CHANNEL2_SEL NON_USED_BAND/*MT6169*/ #define BAND5_CHANNEL2_SEL LNA_RXD_LB_3/*MT6169*/ #define BAND6_CHANNEL2_SEL NON_USED_BAND/*MT6169*/ #define BAND8_CHANNEL2_SEL LNA_RXD_LB_2/*MT6169*/ #define BAND9_CHANNEL2_SEL NON_USED_BAND/*MT6169*/ #define BAND10_CHANNEL2_SEL NON_USED_BAND/*MT6169*/ #define BAND11_CHANNEL2_SEL NON_USED_BAND/*MT6169*/ #define BAND19_CHANNEL2_SEL NON_USED_BAND
/*MT6169*/ #define BAND2_OUTPUT_SEL TX_MB_1/*MT6169*/ #define BAND3_OUTPUT_SEL TX_NULL_BAND/*MT6169*/ #define BAND4_OUTPUT_SEL TX_NULL_BAND/*MT6169*/ #define BAND5_OUTPUT_SEL TX_LB_4/*MT6169*/ #define BAND6_OUTPUT_SEL TX_NULL_BAND/*MT6169*/ #define BAND8_OUTPUT_SEL TX_LB_4/*MT6169*/ #define BAND9_OUTPUT_SEL TX_NULL_BAND/*MT6169*/ #define BAND10_OUTPUT_SEL TX_NULL_BAND/*MT6169*/ #define BAND11_OUTPUT_SEL TX_NULL_BAND/*MT6169*/ #define BAND19_OUTPUT_SEL TX_NULL_BAND
注意:3G band的Band_Output_sel的配置根据MT6169 TX连接到SKY77643的端口来设置
/*MT6169*/ #define RX_HIGHBAND2_INDICATOR UMTSBand2/*MT6169*/ #define RX_HIGHBAND3_INDICATOR UMTSBandNone/*MT6169*/ #define RX_LOWBAND1_INDICATOR UMTSBand5/*MT6169*/ #define RX_LOWBAND2_INDICATOR UMTSBand8
/*MT6169*/ /* For Single SW vs. multiple HW feature *//*MT6169*/ /* Let the NVRAN BPI setting overwrite the GPIO BPI setting,*//*MT6169*/ /* If they are not the same (wrong config. by customer) *//*MT6169*/ /************************************************************//*MT6169*/ #define RF_SETTING_BY_NVRAM KAL_TRUE
{/* No. elm type , data idx , evt_type , evt_offset */
/* { start, stop }, ( us ) */{ /* 0 */ MIPI_PA, { 0 , 2 }, MIPI_TRX_ON, US2CHIPCNT(200) }, //打开PA{ /* 1 */ MIPI_PA, { 3 , 4 }, MIPI_TRX_OFF, US2CHIPCNT(10) }, //关闭PA,也就是休眠{ /* 2 */ MIPI_ASM, { 5 , 6 }, MIPI_TRX_ON, US2CHIPCNT(200) }, //打开ASM{ /* 3 */ MIPI_NULL, { 0 , 0 }, MIPI_EVENT_NULL, 0 },
}根据上面的event填写寄存器:注意: 这里第1--2行PA只需要填入0x00和0x02寄存器,也就是切换band的部分;这里第5--6行ASM只需要0x00填入band的切换部分.不能填的原因:
/*MT6169*/ #define PDATA_GSM850_PR1 (0x00000000 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_GSM850_PR2 (0x00000000 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_GSM850_PR3 (0x00000000 )/*MIPI ENABLE*//*MT6169*/ #define PDATA_GSM_PR1 (0x00000000 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_GSM_PR2 (0x00000000 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_GSM_PR3 (0x00000000 )/*MIPI ENABLE*//*MT6169*/ #define PDATA_DCS_PR1 (0x00000400 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_DCS_PR2 (0x00000400 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_DCS_PR3 (0x00000000 )/*MIPI ENABLE*//*MT6169*/ #define PDATA_PCS_PR1 (0x00000000 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_PCS_PR2 (0x00000000 |PDATA_GSM_ERR_DET)/*MIPI ENABLE*//*MT6169*/ #define PDATA_PCS_PR3 (0x00000000 )/*MIPI ENABLE*/注意:这里 PDATA_GSM850_PR1是band5
PDATA_GSM_PR1 是band8PDATA_DCS_PR1 是band3PDATA_PCS_PR1 是band2
/*MT6169*/ #define GSM_PATH_SEL IORX_LB1/*MIPI ENABLE*//*MT6169*/ #define DCS_PATH_SEL IORX_MB2/*MIPI ENABLE*//*MT6169*/ #define PCS_PATH_SEL IORX_MB2/*MIPI ENABLE*
注意:配置各个band在mt6169的端口
/*MT6169*/ #define GSM850_PORT_SEL IOTX_LB3/*MIPI ENABLE*//*MT6169*/ #define GSM_PORT_SEL IOTX_LB3/*MIPI ENABLE*//*MT6169*/ #define DCS_PORT_SEL IOTX_MB2/*MIPI ENABLE*//*MT6169*/ #define PCS_PORT_SEL IOTX_MB2/*MIPI ENABLE*/
由于TD-SCDMA也是由MIPI所控制,使能 MIPI_SUPPORT_ENABLE .
TD-SCDMA走的是sky77916,需要将Vramp电压关闭,定义 #define INTERNAL_SW 0
2.配置PA gain
根据供应商Sky提供的“sky77916E2.0 LUT Version2.0a 010115.xlsx”得知SKY77916对应于TDS band34/39的PA有两个功率等级,因此修改“tl1d_custom_mipi.h”的gain mode定义。
因为我们有L和H,所以配置为:
3.收发BPI设置
猜测第1列数据就是BPI的位移
4.TX和RX设置
根据硬件原理图,配置好TD-SCDMA 的 TX/RX信号来源 RF_PORT_SEL
十四.TDSCDMA MIPI配置
custom/modem/tl1_rf/MT6735_MT6169_UMTS_TDD_CUSTOM/tl1d_custom_mipi.h
修改tl1d_custom_mipi.h 配置mipi参数,TDS的TX/RX都走SKY77916,故ASM/PA都为SKY77916 ,其MIPI数据格式与GSM/LET都不一样,但细心计算便没问题。
需要注意的是Tx on data的数据是在另外的PA mode setting 中定义的,PA_REG_NUM_B34即为 PA mode setting的数据长度。
注意:这里也设置发射和接收的时候需要写的寄存器。
这里就是我们需要设置的event: 分别是RX ON, RX OFF , TX ON ,TX OFF
对应EVENT的DATA
注意:这里也算比较直观了,第1,2,4也就是RX ON, RX OFF ,Tx off都是同一种形式;
修改的数据段分别是BAND34,band39的高16BIT和低16BIT;
数据的含义如下图所示:
然后解释下TX ON DATA的含义:
/*MT6169*/ #define PA_SEL_FLAG 0xf000 //PA mode selection ±í??PA MODE?¨???è?¨
/*MT6169*/ #define PA_REG_NUM_B34 3 //RegNum
/*MT6169*/ #define PA_REG_NUM_B39 3 //RegNum