一软多硬:即一版软件支持多个型号的硬件,这里硬件指的是RF PA,即射频功率放大器,如果它不能正确配置,会造成机器无信号,信号差,驻网慢等问题。
一、原理
即在机器开机初始化时,通过uboot程序根据PA型号加载不同的NV参数。所以就需要在NV中配置两套参数,一个在deltanv中,一个在nvitem中。
修改步骤
1、修改uboot程序,在开机时判断PA型号
/uboot/drivers/misc/sprd_boardid_sp9820e.c
/* Return rf band info */ int sprd_get_bandinfo(void) { +#if 0 unsigned int adc_val = 0; adc_val = get_adc_value_board(ADC_CHANNEL_FOR_NV); debugf("rfboard.id = %d\n", adc_val); return adc_val; +#else + unsigned int gpio_val = 0; + + gpio_val = gpio_state(69); + debugf("rfboard.id = %d\n", gpio_val); + + if(gpio_val==1) + return -1; + else + return 0; +#endif }
2.修改pinmap
uboot/board/spreadtrum/sp9820e_2h10_zkzy/pinmap-sp9820e_2h10.c
--- a/board/spreadtrum/sp9820e_2h10_zkzy/pinmap-sp9820e_2h10.c +++ b/board/spreadtrum/sp9820e_2h10_zkzy/pinmap-sp9820e_2h10.c @@ -53,8 +53,8 @@ static pinmap_t pinmap[]={ {REG_MISC_PIN_CLK_AUX0, BITS_PIN_DS(1)|BIT_PIN_NULL|BIT_PIN_NUL|BIT_PIN_SLP_AP|BIT_PIN_SLP_NUL|BIT_PIN_SLP_Z},//NC {REG_PIN_T_DIG, BITS_PIN_AF(3)}, {REG_MISC_PIN_T_DIG, BITS_PIN_DS(1)|BIT_PIN_NULL|BIT_PIN_WPD|BIT_PIN_SLP_AP|BIT_PIN_SLP_WPD|BIT_PIN_SLP_Z},//NC -{REG_PIN_GNSS_LNA_EN, BITS_PIN_AF(0)}, -{REG_MISC_PIN_GNSS_LNA_EN, BITS_PIN_DS(1)|BIT_PIN_NULL|BIT_PIN_WPD|BIT_PIN_SLP_AP|BIT_PIN_SLP_WPD|BIT_PIN_SLP_OE},//GPS_LNA_EN??GPSLNA????? +{REG_PIN_GNSS_LNA_EN, BITS_PIN_AF(3)}, //GPIO69 +{REG_MISC_PIN_GNSS_LNA_EN, BITS_PIN_DS(1)|BIT_PIN_NULL|BIT_PIN_WPU|BIT_PIN_SLP_AP|BIT_PIN_SLP_WPU|BIT_PIN_SLP_IE},//GPS_LNA_EN??GPSLNA????? {REG_PIN_EXTINT0, BITS_PIN_AF(3)}, {REG_MISC_PIN_EXTINT0, BITS_PIN_DS(1)|BIT_PIN_NULL|BIT_PIN_SE|BIT_PIN_WPU|BIT_PIN_SLP_AP|BIT_PIN_SLP_WPU|BIT_PIN_SLP_IE},//KEYIN10???? {REG_PIN_EXTINT1, BITS_PIN_AF(3)},
3、修改deltanv
二、验证
1、分别使用不同型号的PA硬件验证驻网是否正常;
2、分别使用不同型号的PA硬件验证FOTA升级后驻网是否正常。