void dump_chip_info(HAL_VERSION ChipVersion) { if(IS_81XXC(ChipVersion)){ DBG_871X("Chip Version Info: %s_",IS_92C_SERIAL(ChipVersion)?"CHIP_8192C":"CHIP_8188C"); } else if(IS_92D(ChipVersion)){ DBG_871X("Chip Version Info: CHIP_8192D_"); } else if(IS_8723_SERIES(ChipVersion)){ DBG_871X("Chip Version Info: CHIP_8723A_"); } else if(IS_8188E(ChipVersion)){ DBG_871X("Chip Version Info: CHIP_8188E_"); } DBG_871X("%s_",IS_NORMAL_CHIP(ChipVersion)?"Normal_Chip":"Test_Chip"); DBG_871X("%s_",IS_CHIP_VENDOR_TSMC(ChipVersion)?"TSMC":"UMC"); if(IS_A_CUT(ChipVersion)) DBG_871X("A_CUT_"); else if(IS_B_CUT(ChipVersion)) DBG_871X("B_CUT_"); else if(IS_C_CUT(ChipVersion)) DBG_871X("C_CUT_"); else if(IS_D_CUT(ChipVersion)) DBG_871X("D_CUT_"); else if(IS_E_CUT(ChipVersion)) DBG_871X("E_CUT_"); else DBG_871X("UNKNOWN_CUT(%d)_",ChipVersion.CUTVersion); if(IS_1T1R(ChipVersion)) DBG_871X("1T1R_"); else if(IS_1T2R(ChipVersion)) DBG_871X("1T2R_"); else if(IS_2T2R(ChipVersion)) DBG_871X("2T2R_"); else DBG_871X("UNKNOWN_RFTYPE(%d)_",ChipVersion.RFType); DBG_871X("RomVer(%d)\n",ChipVersion.ROMVer); }
s32 rtw_hal_c2h_evt_read(_adapter *adapter, u8 *buf) { HAL_DATA_TYPE *HalData = GET_HAL_DATA(adapter); HAL_VERSION *hal_ver = &HalData->VersionID; s32 ret = _FAIL; if (IS_81XXC(*hal_ver) || IS_8723_SERIES(*hal_ver) ||IS_92D(*hal_ver) ||IS_8188E(*hal_ver)) { ret = c2h_evt_read(adapter, buf); } else if(IS_8192E(*hal_ver) || IS_8812_SERIES(*hal_ver) || IS_8821_SERIES(*hal_ver) || IS_8723B_SERIES(*hal_ver)) { ret = c2h_evt_read_88xx(adapter, buf); } else { rtw_warn_on(1); } return ret; }
bool rtw_hal_c2h_valid(_adapter *adapter, u8 *buf) { HAL_DATA_TYPE *HalData = GET_HAL_DATA(adapter); HAL_VERSION *hal_ver = &HalData->VersionID; bool ret = _FAIL; if (IS_81XXC(*hal_ver) || IS_8723_SERIES(*hal_ver) ||IS_92D(*hal_ver) ||IS_8188E(*hal_ver)) { ret = c2h_evt_valid((struct c2h_evt_hdr *)buf); } else if(IS_8192E(*hal_ver) || IS_8812_SERIES(*hal_ver) || IS_8821_SERIES(*hal_ver) || IS_8723B_SERIES(*hal_ver)) { ret = c2h_evt_valid((struct c2h_evt_hdr_88xx*)buf); } else { rtw_warn_on(1); } return ret; }
void rtl92c_read_chip_version(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_hal *rtlhal = rtl_hal(rtlpriv); enum version_8192c chip_version = VERSION_UNKNOWN; const char *versionid; u32 value32; value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG); if (value32 & TRP_VAUX_EN) { chip_version = (value32 & TYPE_ID) ? VERSION_TEST_CHIP_92C : VERSION_TEST_CHIP_88C; } else { /* Normal mass production chip. */ chip_version = NORMAL_CHIP; chip_version |= ((value32 & TYPE_ID) ? CHIP_92C : 0); chip_version |= ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : 0); /* RTL8723 with BT function. */ chip_version |= ((value32 & BT_FUNC) ? CHIP_8723 : 0); if (IS_VENDOR_UMC(chip_version)) chip_version |= ((value32 & CHIP_VER_RTL_MASK) ? CHIP_VENDOR_UMC_B_CUT : 0); if (IS_92C_SERIAL(chip_version)) { value32 = rtl_read_dword(rtlpriv, REG_HPON_FSM); chip_version |= ((CHIP_BONDING_IDENTIFIER(value32) == CHIP_BONDING_92C_1T2R) ? CHIP_92C_1T2R : 0); } else if (IS_8723_SERIES(chip_version)) { value32 = rtl_read_dword(rtlpriv, REG_GPIO_OUTSTS); chip_version |= ((value32 & RF_RL_ID) ? CHIP_8723_DRV_REV : 0); } } rtlhal->version = (enum version_8192c)chip_version; pr_info("Chip version 0x%x\n", chip_version); switch (rtlhal->version) { case VERSION_NORMAL_TSMC_CHIP_92C_1T2R: versionid = "NORMAL_B_CHIP_92C"; break; case VERSION_NORMAL_TSMC_CHIP_92C: versionid = "NORMAL_TSMC_CHIP_92C"; break; case VERSION_NORMAL_TSMC_CHIP_88C: versionid = "NORMAL_TSMC_CHIP_88C"; break; case VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT: versionid = "NORMAL_UMC_CHIP_i92C_1T2R_A_CUT"; break; case VERSION_NORMAL_UMC_CHIP_92C_A_CUT: versionid = "NORMAL_UMC_CHIP_92C_A_CUT"; break; case VERSION_NORMAL_UMC_CHIP_88C_A_CUT: versionid = "NORMAL_UMC_CHIP_88C_A_CUT"; break; case VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT: versionid = "NORMAL_UMC_CHIP_92C_1T2R_B_CUT"; break; case VERSION_NORMAL_UMC_CHIP_92C_B_CUT: versionid = "NORMAL_UMC_CHIP_92C_B_CUT"; break; case VERSION_NORMAL_UMC_CHIP_88C_B_CUT: versionid = "NORMAL_UMC_CHIP_88C_B_CUT"; break; case VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT: versionid = "NORMAL_UMC_CHIP_8723_1T1R_A_CUT"; break; case VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT: versionid = "NORMAL_UMC_CHIP_8723_1T1R_B_CUT"; break; case VERSION_TEST_CHIP_92C: versionid = "TEST_CHIP_92C"; break; case VERSION_TEST_CHIP_88C: versionid = "TEST_CHIP_88C"; break; default: versionid = "UNKNOWN"; break; } RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Chip Version ID: %s\n", versionid); if (IS_92C_SERIAL(rtlhal->version)) rtlphy->rf_type = (IS_92C_1T2R(rtlhal->version)) ? RF_1T2R : RF_2T2R; else rtlphy->rf_type = RF_1T1R; RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "Chip RF Type: %s\n", rtlphy->rf_type == RF_2T2R ? "RF_2T2R" : "RF_1T1R"); if (get_rf_type(rtlphy) == RF_1T1R) rtlpriv->dm.rfpath_rxenable[0] = true; else rtlpriv->dm.rfpath_rxenable[0] = rtlpriv->dm.rfpath_rxenable[1] = true; RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "VersionID = 0x%4x\n", rtlhal->version); }
//------------------------------------------------------------------- // // EEPROM/EFUSE Content Parsing // //------------------------------------------------------------------- static VERSION_8192C ReadChipVersion( IN PADAPTER Adapter ) { u32 value32; VERSION_8192C version; u8 ChipVersion=0; value32 = rtw_read32(Adapter, REG_SYS_CFG); if (value32 & TRP_VAUX_EN){ version = (value32 & TYPE_ID) ?VERSION_TEST_CHIP_92C :VERSION_TEST_CHIP_88C; } else{ ChipVersion = NORMAL_CHIP; ChipVersion |= ((value32 & TYPE_ID) ? CHIP_92C : 0); ChipVersion |= ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : 0); ChipVersion |= ((value32 & BT_FUNC) ? CHIP_8723: 0); // RTL8723 with BT function. #if 0 if(IS_VENDOR_UMC(ChipVersion)) ChipVersion |= ((value32 & CHIP_VER_RTL_MASK) ? CHIP_VENDOR_UMC_B_CUT : 0); #else // 88/92C UMC B-cut IC will not set the SYS_CFG[19] to UMC // because we do not want the custmor to know. by tynli. 2011.01.17. if((!IS_VENDOR_UMC(ChipVersion) )&& (value32 & CHIP_VER_RTL_MASK)) { ChipVersion |= CHIP_VENDOR_UMC; ChipVersion |= CHIP_VENDOR_UMC_B_CUT; } #endif if(IS_92C_SERIAL(ChipVersion)) { value32 = rtw_read32(Adapter, REG_HPON_FSM); ChipVersion |= ((CHIP_BONDING_IDENTIFIER(value32) == CHIP_BONDING_92C_1T2R) ? CHIP_92C_1T2R : 0); } else if(IS_8723_SERIES(ChipVersion)) { value32 = rtw_read32(Adapter, REG_GPIO_OUTSTS); ChipVersion |= ((value32 & RF_RL_ID) ? CHIP_8723_DRV_REV : 0); } version = (VERSION_8192C)ChipVersion; } switch(version) { case VERSION_NORMAL_TSMC_CHIP_92C_1T2R: MSG_8192C("Chip Version ID: VERSION_NORMAL_TSMC_CHIP_92C_1T2R.\n"); break; case VERSION_NORMAL_TSMC_CHIP_92C: MSG_8192C("Chip Version ID: VERSION_NORMAL_TSMC_CHIP_92C.\n"); break; case VERSION_NORMAL_TSMC_CHIP_88C: MSG_8192C("Chip Version ID: VERSION_NORMAL_TSMC_CHIP_88C.\n"); break; case VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT: MSG_8192C("Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT.\n"); break; case VERSION_NORMAL_UMC_CHIP_92C_A_CUT: MSG_8192C("Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_A_CUT.\n"); break; case VERSION_NORMAL_UMC_CHIP_88C_A_CUT: MSG_8192C("Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_A_CUT.\n"); break; case VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT: MSG_8192C("Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT.\n"); break; case VERSION_NORMAL_UMC_CHIP_92C_B_CUT: MSG_8192C("Chip Version ID: VERSION_NORMAL_UMC_CHIP_92C_B_CUT.\n"); break; case VERSION_NORMAL_UMC_CHIP_88C_B_CUT: MSG_8192C("Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT.\n"); break; case VERSION_TEST_CHIP_92C: MSG_8192C("Chip Version ID: VERSION_TEST_CHIP_92C.\n"); break; case VERSION_TEST_CHIP_88C: MSG_8192C("Chip Version ID: VERSION_TEST_CHIP_88C.\n"); break; case VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT: MSG_8192C("Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT.\n"); break; case VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT: MSG_8192C("Chip Version ID: VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT.\n"); break; default: MSG_8192C("Chip Version ID: ???????????????.\n"); break; } return version; }