Realtek RF MP Tool Guidelines V14 20150605

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

[Realtek RF MP Tool Guidelines]

Table of Contents

1. Features.

2. Software Package.

3. Quick Start Guide.


----3.1 Build MP Driver module.
----3.2 Build Android wireless tools
--------3.2.1 rtwpriv for MP APK GUI Tool
(RtkWiFiTest_Package_For_Customer)
--------3.2.1 iwpriv tool
Notes:
3.3 1. Config PA/LNA/RFE Type Setting for 11AC chipset
(8812A/8814A).
If the use COB layout or empty of Efuse IC, you must need to refer here first.
3.3 2. 8723BS-VQ0 serial Chipset of RF Antenna configure Method
The 8723BS-VQ0 use the Antenna Path B by default.
----3.4 Manual for RF MP Use Example. (Chinese translation):
TX Parameter Setting & Test CMD Flow (1~8):
8.1 [Continuous TX testing] (無間斷調制訊號發送測試)
8.2 [Continuous Packet TX testing] (不限封包數量調制訊號發送測試)
8.3 [Count Packet TX testing] (有限封包數量調制訊號發送測試)
8.4 [Carrier suppression testing] (載波抑制發送測試)
8.5 [Single Tone TX testing] (無調制訊號單頻載波發送測試)
8.6 [Air Rx testing] (接收封包測試)
8.7 [Enable/Disable TX Power Tracking] (high and low temperature test)

----3.5 Rx Test CMD Use Example.

----3.6 Enable/Disable TX Power Tracking.

----3.7 Quickly to RF MP TX/Rx CMD Use Example.


There are depend on the driver version support features.
4. Phy Efuse Read/Write Use Example.
------4.1 efuse_get
------4.2 efuse_get
------4.3 Efuse's spec.
------4.4 BT Efuse Function
------4.5 How to use Efuse File.
5. Crystal Calibration

6. Read/Write Thermometer

7. Verify EFUSE of TX power index test.

8. Enter To BT Test Link Mode (For WLAN/BT Combo IC)


=====================================================================
[1. Features]
=====================================================================
The following steps demonstrate Realtek Wireless Adapter Mass
Production Linux Tool. This is a simple install guide,
We use Linux utility “iwpriv” to get and set the I/O control to WLAN driver.
Or use Realtek proprietary tools “rtwpriv” for Android system.

=====================================================================
[2. Software Package] - To check have the Component .tar.gz files.
=====================================================================
1. Driver source - rtXXX_linux_MP_vX.X.X.tar.gz
2. Wireless tool Source -(If want to use for Android system) -
Android_wireless_tools.tar
3. Documents
- LinuxDriver_MP_Iwpriv_UserGuide.doc

=====================================================================
[3. Quick Start Guide]
=====================================================================

===========================================================
[3.1. Build Driver module]
===========================================================
Note: Use su/sudo su for root authentication with following command.

1. Unzip Driver source folder -


# tar -xvzf rtlXXX_linux_MP_linux_vx.x.x.tar.gz

2. Change to the driver source code directory-


# cd rtlXXX_linux_MP__linux_vx.x.x

3. To choose interface for 8723A WiFi Driver.


# chmod 777 make_drv
#./make_drv
# input 1 or 2 for 8723AS/8723AU
4. Config compiles Setting-

Edit the "Makefile", and modify the line 21 "CONFIG_MP_INCLUDED = n" to


"CONFIG_MP_INCLUDED = y"

If your target platform is the platform you're compiling the driver,


Maybe you don't need to change any setting.
Otherwise, you need to do some configuration manually,
like cross compiler and kernel source tree directory.
Ex.
ARCH := arm
CROSS_COMPILE := arm-none-linux-gnueabi-
KSRC := /usr/src/linux-2.6.34.1

5. Do the Compile the driver source code -


# make

If nothing goes wrong, the driver “8xxx.ko" will be generated.

If there're still some problems or need more detail to compile driver guide,
Please check normal driver package for more reference.
===========================================================
3.2 Build Android wireless tools
===========================================================
3.2.1 rtwpriv for MP APK GUI Tool

The Realtek Android MP apk tool need to use the proprietary rtwpriv tool, please
first to execute the adb push the rtwpriv to the android system.
In the RtkWiFiTest_Package_For_Customer package more detailed information on
readme.txt.

Q. How to build rtwpriv tool?


A.
[Linux]
Just "make", and you will get an executable file "rtwpriv".

[Android - Speradtrum platform]


Step 1. To puts the rtwpriv directory to idh. code/external/.
Step 2. In root directory (idh.code/), run "./mk sp6820gb u adr external/rtwpriv/".
Step 3. The binary is installed on "out/target/product/hsdroid/system/bin/rtwpriv".

3.2.2 iwpriv tool

If you want to use “iwpriv” for Android system, we need to Build iwpriv (wireless
tools) for android.
And iwpriv use the “wireless-extensions” to ioctrl with wlan driver, If your Android
kernel disable the wireless extensions,
Please rebuild kernel and enable the kernel config “wireless-extensions”

Networking support --->


-*- Wireless --->
[*] WIRELESS_EXT
[*] WEXT_PRIV

If you are using Linux kernel 3. x, maybe you can’t to select and enable items on
make menuconfig, you can refer the following procedures:
Changed the followings in \linux-3.0.20\net\wireless\Kconfig:
Before:
Config WIRELESS_EXT
bool
...
Config WEXT_PRIV
boll
To:
config WIRELESS_EXT
bool "WIRELESS_EXT"
...
config WEXT_PRIV
bool "WEXT_PRIV"

And selected the followings in "make menuconfig":

Networking support --->


-*- Wireless --->
[*] WIRELESS_EXT
[*] WEXT_PRIV

With these steps, kernel and WLAN driver seem to be compiled successfully.

3.2.2-1 Compile the wireless tools


#tar zxvf Android_wireless_tools-iwpriv.tar.gz
#cp wireless_tools froyo-x86/external/

root@realtek-desktop:~/Desktop/froyo-x86/external/wireless_tools# . ../../build/env
setup.sh
root@realtek-desktop:~/Desktop/froyo-x86/external/wireless_tools# mm
.....
target Non-prelinked: iwpriv (out/target/product/eeepc/symbols/system/bin/iwpriv)
target Unstripped: iwpriv
(out/target/product/eeepc/obj/EXECUTABLES/iwpriv_intermediates/iwpriv)
Install: out/target/product/eeepc/system/xbin/iwpriv

#cp "out/target/product/eeepc/system/xbin/iwpriv " to target platform file system


" system/xbin/iwpriv ".
------------------------------------------------------------------------------------------
3.3 1. Config for RTL8812AU PA/LNA/RFE Type Setting.
------------------------------------------------------------------------------------------
If the RTL8812AU was empty of efuse, Please make sure your board type and PA/LNA
of HW Layout.
You must force the driver use external or internal PA/LNA before the insert driver
module.

For use 2G internal PA/LNA and 5G external PA/LNA,


Example CMD:
insmod 8812au.ko rtw_amplifier_type_2g=0 rtw_amplifier_type_5g=192
rtw_RFE_type=1

rtw_amplifier_type_2g= "BIT3:2G ext-PA, BIT4:2G ext-LNA"


rtw_amplifier_type_5g="BIT6:5G ext-PA, BIT7:5G ext-LNA"

ODM_BOARD_DEFAULT = 0, // The DEFAULT case.


ODM_BOARD_MINICARD = BIT (0), // 0 = non-mini card, 1= mini card.
ODM_BOARD_SLIM = BIT (1), // 0 = non-slim card, 1 = slim card
ODM_BOARD_BT = BIT (2), // 0 = without BT card, 1 = with BT
ODM_BOARD_EXT_PA = BIT (3), // 0 = no 2G ext-PA, 1 = existing 2G ext-PA
ODM_BOARD_EXT_LNA = BIT (4), // 0 = no 2G ext-LNA, 1 = existing 2G ext-LNA
ODM_BOARD_EXT_TRSW = BIT (5), // 0 = no ext-TRSW, 1 = existing ext-TRSW
ODM_BOARD_EXT_PA_5G = BIT (6), // 0 = no 5G ext-PA, 1 = existing 5G ext-PA
ODM_BOARD_EXT_LNA_5G= BIT (7), // 0 = no 5G ext-LNA, 1 = existing 5G ext-LNA

rtw_RFE_type =

01h:RFE is used "SW_LNA_PA, ex SKY85703" for APA_ALNA board type.


02h:RFE is used "SW_LNA, ex. SKY85601" for ALNA board type. (When efuse
0xCA[7]=1, the board type is ALNA)
03h:RFE is used "2G&5G SW+PA+LNA”, for PA_LNA board type. (When efuse
0xCA[7]=1, the board type is PA_LNA)
04h:RFE is used "SP3T" for DEFAULT board type
------------------------------------------------------------------------------------------
3.3 2. 8723BS-VQ0 serial Chipset of RF Antenna Config Method
------------------------------------------------------------------------------------------
The 8723BS-VQ0 Chipset was default the TX Antenna on PATH B,
We must to select the PATH B for TX using.
If you want to use the RtkWiFiTest. APK for MP Test TX, Please check the APK version
is “RtkWiFiTest_20140714A. apk”, This APK can select the Antenna B.
If your current version was wrong, please contact our Realtek FAE to get the right
version.

P.S. Another approach is to use the command all the way to complete
the test.
===========================================================
[3.4 Manual for MP Use Example]
===========================================================
(Execute the following commands after the WLAN interface is normally open)
If you want to change the input parameter (rate、channel、txpower、bandwidth) or
to continue the other MP test, please must first to input the command "iwpriv wlan0
mp_ctx stop". And doesn’t need to do the “mp_stop” command.
About Data Rate of input mapping range, please refer the doc
"iwpriv_mp_settings_for_different_data_rate.xls" for setting data rate.

TX Parameter Setting & Test CMD Flow (1~8):


Please take note of the red mark word, it needed to be input.
1.
#ifconfig wlan0 up // Enable Device for MP operation
2.
#iwpriv wlan0 mp_start // Enter and switch to MP mode
3.
#iwpriv wlan0 mp_channel 1
//Channel number as 2.4G: 1. 2, 3, 4~13 or 5G: 36~161 etc.
4.
#iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0
//40M=0 is set 20M mode and long GI, set 40M bandwidth is 40M=1、80M = 2.
5.
#iwpriv wlan0 mp_ant_tx a
//Selects Antenna A for the operation, if DUT have 2x2 antenna select antenna
"a" or "b" and "ab" for operation.

6.
#iwpriv wlan0 mp_rate 108
// set OFDM data rate to 54Mbps,
ex: CCK 1M = 2, CCK 5.5M = 11 ;OFDM 6M=12、54M = 108;
N Rate: MCS0 = 128, MCS1 = 129, MCS 2=130.... MCS15 = 143;
VHT Rate: MCS0 = 160, MCS 1=161, MCS 2=162 ~ MCS9 =169.

Or direct input the Data Rate of Name:


#iwpriv wlan0 mp_rate 54M // set OFDM data rate to 54Mbps
1M 2M 5.5M 11M
6M 9M 12M 18M 24M 36M 48M 54M
HTMCS0 HTMCS1 HTMCS2 HTMCS3 HTMCS4 HTMCS5 HTMCS6 HTMCS7 HTMCS8
HTMCS9 HTMCS10 HTMCS11 HTMCS12 HTMCS13 HTMCS14 HTMCS15 HTMCS16
HTMCS17 HTMCS18 HTMCS19 HTMCS20 HTMCS21 HTMCS22 HTMCS23 HTMCS24
HTMCS25 HTMCS26 HTMCS27 HTMCS28HTMCS29 HTMCS30 HTMCS31
VHT1MCS0 VHT1MCS1 VHT1MCS2 VHT1MCS3 VHT1MCS4 VHT1MCS5
VHT1MCS6VHT1MCS7 VHT1MCS8 VHT1MCS9 VHT2MCS0 VHT2MCS1 VHT2MCS2
VHT2MCS3 VHT2MCS4 VHT2MCS5 VHT2MCS6VHT2MCS7 VHT2MCS8 VHT2MCS9
VHT3MCS0 VHT3MCS1 VHT3MCS2 VHT3MCS3 VHT3MCS4 VHT3MCS5
VHT3MCS6VHT3MCS7 VHT3MCS8 VHT3MCS9 VHT4MCS0 VHT4MCS1 VHT4MCS2
VHT4MCS3 VHT4MCS4 VHT4MCS5 VHT4MCS6 VHT4MCS7 VHT4MCS8 VHT4MCS9

7.
#iwpriv wlan0 mp_txpower patha=44,pathb=44
//Set path A and path B TX power level, and the Range is 0~63.

If you want to get and use Efuse TX power index, please input advance the
command "iwpriv wlan0 mp_get_txpower ", then use the return a value and fill in
following orange field (patha=44, pathb=44).
This CMD is according to the before parameters (rate、channel、bandwidth).

8. Start TX Mode Test.

8-1 [Continuous TX testing]:


#iwpriv wlan0 mp_ctx background // start continuous TX

8-2 [Continuous Packet TX testing]:


#iwpriv wlan0 mp_ctx background,pkt // start continuous Packet TX

8-3 [Count Packet TX testing]:


#iwpriv wlan0 mp_ctx count=%d,pkt
// "%d" is Number of packets TX, you can specify a number of count packets.
8-4 [Carrier suppression testing]:
#iwpriv wlan0 mp_rate 22
// Carrier suppression only uses CCK Rate, ex: CCK 1M = 2, CCK 5.5M = 11;
#iwpriv wlan0 mp_ctx background,cs

8.5 [Single Tone TX testing]:


#iwpriv wlan0 mp_ctx background,stone

9.
#iwpriv wlan0 mp_ctx stop //stop continuous Packet TX
If you want to change the input parameter (rate、channel、txpower 、
bandwidth),
please must input advance the command "iwpriv wlan0 mp_ctx stop".
10.
#iwpriv wlan0 mp_stop // exit MP mode
If you want to continue the MP test, don’t do this command.
#ifconfig wlan0 down // close WLAN interface
3.5 Rx Test Mode:
-----------------------------------------------------------------------------------------------------------------
a. [Air Rx testing]: "iwpriv wlan0 mp_arx start"
-----------------------------------------------------------------------------------------------------------------
#ifconfig wlan0 up // Enable Device for MP operation
#iwpriv wlan0 mp_start // Enter MP mode
#iwpriv wlan0 mp_channel 1 // Set channel to 1, 2, 3, 4~13 etc.
#iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0 // set 20M mode and long GI,set 40M
is 40M=1 , set 80M= 2.
#iwpriv wlan0 mp_ant_rx a // Select antenna A for the operation, if
device has 2x2 antenna select antenna "a" or "b" and "ab" for operation.
#iwpriv wlan0 mp_arx start // start air Rx testing.
#iwpriv wlan0 mp_query // get the statistics.
#iwpriv wlan0 mp_arx stop or #iwpriv wlan0 mp_reset_stats // Stop air Rx test and show
the Statistics / Reset TX and Rx Counter.
#iwpriv wlan0 mp_stop // exit MP mode
#ifconfig wlan0 down // close WLAN interface

3.6 [Enable/Disable TX Power Tracking]:


#iwpriv wlan0 mp_pwrctldm start #Enable the power tracking for TX.
#iwpriv wlan0 mp_pwrctldm stop #Disable the power tracking for TX.
===========================================================

3.7 Quickly to RF MP TX/Rx CMD Use Example


===========================================================
This feature supporting depended on the driver version.

The Driver version must to over the v4.3.18 and revision

number : 14317.

1. TX Test:
a.iwpriv wlan0 mp_tx ch=6,bw=0,rate=108,pwr=40,ant=0,tx=1
This instruction requires an input format is correct and there is in the
order, will be able to successfully execute instructions, if you input
error format, this CMD will return below MSG.

Please input correct format as below:


ch=6,bw=0,rate=108,pwr=40,ant=0,tx=1

[ ch : BGN = <1~14> , A or AC = <36~165> ]


[ bw : Bandwidth: 0 = 20M, 1 = 40M, 2 = 80M ]
[ rate : CCK: 1 2 5.5 11M x 2 = < 2 4 11 22 >]
[OFDM: 6 9 12 18 24 36 48 54M x 2 = < 12 18 24 36 48 72 96 108>
[HT 1S2SS MCS0 ~ MCS15 : < [MCS0]=128 ~ [MCS7]=135 ~
MCS15]=143
[HT 3SS MCS16 ~ MCS32 : < [MCS16]=144 ~ [MCS23]=151
~MCS32]=159>
[VHT 1SS MCS0 ~ MCS9 : < [MCS0]=160 ~ [MCS9]=169 >
[ txpower : 1~63 power index
[ ant : <A = 1, B = 2, C = 4, D = 8> ,2T ex: AB=3 BC=6 CD=12
[ txmode : < 0 = CONTINUOUS_TX,
1 = PACKET_TX, 2 = SINGLE_TONE_TX, 3 = CARRIER_SUPPRISSION_TX,
4 = SINGLE_CARRIER_TX>

# To Stop the Tx Test.


b.iwpriv wlan0 mp_tx stop
#To get the current Setting.
c.iwpriv wlan0 mp_tx setting
#To Query the Tx counts.
d.iwpriv wlan0 mp_query

2. Rx Test:
a.iwpriv wlan0 mp_rx ch=1,bw=0,ant=0
This instruction requires an input format is correct and there is in the
order, will be able to successfully execute instructions, if you input
error format, this CMD will return below MSG.
[ ch : BGN = <1~14> , A or AC = <36~165> ]
[ bw : Bandwidth: 0 = 20M, 1 = 40M, 2 = 80M ]
[ ant : <A = 1, B = 2, C = 4, D = 8> ,2T ex: AB=3 BC=6 CD=12

#To get the Rx counts.

b.iwpriv wlan0 mp_query or iwpriv wlan0 mp_arx phy


=====================================================================
[4. Efuse Read/Write Use Example]
=====================================================================

Use example:
[4.1 WiFi efuse_get]
#iwpriv wlan0 efuse_get realmap // read from the driver for all efuse logic map.
#iwpriv wlan0 efuse_get realraw // read from the HW of Efuse all PHY map.
#iwpriv wlan0 efuse_get mac // read mac Address (Direct to use the cmd for
raed mac address from the efuse content)

#iwpriv wlan0 efuse_get rmap,16,6 // fix offset: CMD, offset, byteCounts (Specified
a start of the efuse's logic address 0x16 offset and set the number of bytes for
reading the efuse content)

#iwpriv wlan0 efuse_get wlrfkrmap,16,6 // fix offset: cmd, offset, byteCounts


(Specified a start of the Efuse's logic 0x16 address offset and set the number of
bytes for reading the fake WiFi Efuse content)

#iwpriv wlan0 efuse_get wlrfkmap // read form WiFi fake for all Efuse logic map.

------------------------------------------------------------------------------------------------------
[4.2 WiFi efuse_set]
#iwpriv wlan0 efuse_set wmap,16,00e04c871234 // CMD, offset, Data bytes [hex]
(Specified an offset address for write 6 byte data "0x00,0xe0,0x4c,0x87,0x12,0x34"
to the 0x16 start of the Efuse logic address)

#iwpriv wlan0 efuse_set mac,00e04c871234 // CMD, Data bytes [hex] (Use


set Mac CMD to write 6 byte data "0x00,0xe0,0x4c,0x87,0x12,0x34" to the Efuse
content)

#iwpriv wlan0 Efuse_set wlwfake,16,00e04c871234 // CMD, offset, Data bytes [hex]


(Specified an offset address for write 6 byte data "0x00,0xe0,0x4c,0x87,0x12,0x34"
to the 0x16 start of the Fake Efuse content address)

#iwpriv wlan0 efuse_set wldumpfake // Dump the WiFI HW of logic Efuse


MAP to Driver of Fake WiFI efuse Map.
#iwpriv wlan0 efuse_set wlfk2map // Write to WiFi Fake of Efuse MAP to
HW WiFi logic Efuse Map.

If config the Driver to use the file Map, you can use the following CMD to read the
current driver of logic map.
#iwpriv wlan0 efuse_get drvmap // Read form current driver of efuse logic map.

a. Example CMD for writing to fake efuse Map and write fake to the HW efuse
Map:
Write efuse data to fake map.
1. #iwpriv wlan0 efuse_set wlwfake,00,00112233445566778899aabbccddeeff
2. #iwpriv wlan0 efuse_set wlwfake,10,00112233445566778899aabbccddeeff
3. #iwpriv wlan0 efuse_set wlwfake,20,00112233445566778899aabbccddeeff
4. #iwpriv wlan0 efuse_set wlwfake,20,00112233445566778899aabbccddeeff
……
5. #iwpriv wlan0 efuse_set wlwfake,c0,00112233445566778899aabbccddeeff
Read the fake map for verifying.
6. #iwpriv wlan0 efuse_get wlrfkmap
Write the Fake logic efuse Map to HW efuse.
7. #iwpriv wlan0 efuse_set wlfk2map
Read from the HW logic efuse Map for verifying.
8. #iwpriv wlan0 efuse_get realmap

b. Another way to read Linux EFUSE file MAP load to driver CMD.
Attention:
This function had a limited with the driver version number, “rtl8xxx_WiFi_linux_ v4.X.X_12561”,
Must to exceed the “12561” driver serial number.

Usage:
1. #iwpriv wlan0 efuse_file /../../efuse.map

Read the fake map for verifying.


2. #iwpriv wlan0 efuse_get wlrfkmap

Write fake to hw efuse


3. #iwpriv wlan0 efuse_set wlfk2map
----------------------------------------------------------------------------------------------------------------
[ 4.4 BT Efuse Function] for COMBO IC
----------------------------------------------------------------------------------------------------------------
[--> 4.4.1 BT Get Function <--]

#iwpriv wlan0 efuse_get btfmap // read from HW BT of the front efuse logic map.
#iwpriv wlan0 efuse_get btbmap // read from HW BT of the back efuse logic map.
#iwpriv wlan0 efuse_get btrmap,16,6 // fix offset :cmd,offset,byteCounts
(Specified BT start of the efuse's address and set the number of bytes for raed from
the BT efuse content)

#iwpriv wlan0 efuse_get btffake // read from fake BT of the front efuse logic map.
#iwpriv wlan0 efuse_get btbfake // read from fake BT of the back efuse logic map.

[--> 4.4.2 BT Set Function <--]


#iwpriv wlan0 efuse_set btwmap,16,00e04c871234 // cmd,offset,Data bytes[hex]
( Specified a offset address for write 6 bytes data "0x00,0xe0,0x4c,0x87,0x12,0x34"
to the 0x16 start of the efuse content address )

#iwpriv wlan0 efuse_set btwfake,16,00e04c871234 // cmd,offset,Data bytes[hex]


( Specified a offset address for write 6 bytes data "0x00,0xe0,0x4c,0x87,0x12,0x34"
to the 0x16 start of the Fake efuse content address )

#iwpriv wlan0 efuse_set btdumpfake // Dump BT HW efuse to Fake BT efuse Map.


#iwpriv wlan0 efuse_set btfk2map // Wirte BT Fake efuse to HW BT efuse Map.
====================================================================
[Efuse's spec].
If you want a clearer definition of reference, you can refer to the Efuse's spec
"AN_RTL8XXX_EEPROM_SPEC_Vxxxxxx.pdf"
=====================================================================
----------------------------------------------------------------------------------------------------------------
[ 4.5 How to Read Efuse File
----------------------------------------------------------------------------------------------------------------
Prepare procedures:

• 1. Edit the “Makefile” :


– CONFIG_EFUSE_CONFIG_FILE=y
• Please first edit the Makfile before compiling the Driver, find
out the ”CONFIG_EFUSE_CONFIG_FILE=n” and change to y,
then compile the driver source.
• 2. Prepare for efuse MAP directory and file:
• Prepare the Driver default read “A.Directory ” Efuse map file
and “B. Directory” Mac Address file.
• Reference the FileEfuseExample folder.
– A. /system/etc/wifi/wifi_efuse.map
• Driver read from this file for initial efuse map.
– B. /data/wifimac.txt
• Driver read from this file for an initial wlan Mac address.
• 3. You can use the Efuse CMD for reading current contents
after the driver initial to read efuse file.
• #iwpriv wlan0 efuse_get drvmap.

--------------------------------------------------------------------------------------------------------------
5. Crystal Calibration: iwpriv wlan0 mp_phypara xcap=26

MP uses CMD to fine tuning the Crystal Cap value, and CMD is " iwpriv wlan0
mp_phypara xcap=%d".
We can continue to adjust for getting targeted value, then use the Efuse CMD write
to HW efuse, "iwpriv wlan0 efuse_set wmap, b9, 20"

8188EU example 0xB9 offset:


The "0xB9" is Crystal Calibration Efuse offset address, you can refer the IC Efuse spec
document.

B9h Crystal Calibration XTAL_K Value


Bit [5:0], Xi=Xo Range 0~3F h.
Bit [7:6]: reserved
FF h = 00 h
Default 20h

#insmod wlan.ko
#ifconfig wlan0 up
#iwpriv wlan0 mp_start
#iwpriv wlan0 mp_setrfpath 0
#iwpriv wlan0 mp_ant_tx a
#iwpriv wlan0 mp_channel 7
#iwpriv wlan0 mp_txpower patha=42
#iwpriv wlan0 mp_phypara xcap=32 //init a adjust Crystal
#iwpriv wlan0 mp_ctx background,stone
#iwpriv wlan0 mp_phypara xcap=26 //to adjust Crystal and measure
#iwpriv wlan0 mp_phypara xcap=24 //to adjust Crystal and measure

Crystal Calibration Success! Find Crystal Index = 24


iwpriv wlan0 efuse_set wmap,b9,18
CRYSTAL_CAL_STOP
#rtwpriv wlan0 mp_ctx stop
--------------------------------------------------------------------------------------------------------------
6. Read Thermometer : iwpriv wlan0 mp_ther
--------------------------------------------------------------------------------------------------------------
1. Read Thermometer:
#iwpriv wlan0 mp_ther
Return a value

2. Write the HW thermal value to HW efuse


#iwpriv wlan0 mp_ther write

3. Use read Efuse CMD for verifying the value from thermal offset.
#iwpriv wlan0 efuse_get rmap,(Efuse offset),1
-----------------------------------------------------------------------------------------------------------------
7. [Verify Efuse TX power index]:
----------------------------------------------------------------------------------------------------------------
IF you completed the calibration and write the power index to the EFUSE.
We provide the CMD “iwpriv wlan0 mp_get_txpower 0/1(path)” for verifying
EFUSE of power index.
You can refer the below CMD flow to verify the power index form the EFUSE.
You can reboot your system, or remove and then insert the wlan of driver module.
rmmod wlan.ko
insmod wlan.ko
#ifconfig wlan0 up // Enable Device for MP operation
#iwpriv wlan0 mp_start // enter MP mode
#iwpriv wlan0 mp_channel 1 // set the channel to 1. 2, 3, 4~13 etc.
#iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0 // set 20M mode and long GI,set 40M
is 40M=1 , set 80M= 2.
#iwpriv wlan0 mp_ant_tx a //Select Antenna A for the operation, if
the device have 2x2 antenna select antenna "a" or "b" and "ab" for operation.

#iwpriv wlan0 mp_rate 108 // set OFDM data rate to 54Mbps, ex:
CCK 1M = 2, CCK 5.5M = 11 ;OFDM 6M=12、54M = 108;
N Rate: MCS0 = 128, MCS1 = 129, MCS 2=130.... MCS15 = 143;
VHT Rate: MCS0 = 160, MCS 1=161, MCS 2=162 ~ MCS9 =169.

If you want to get and use Efuse TX power index, please input advance the command
"iwpriv wlan0 mp_get_txpower 0/1", and use the return value to fill in following
orange field.
#iwpriv wlan0 mp_txpower patha=44, pathb=44 //set path A and path B TX power
level, the Range is 0~63.

#iwpriv wlan0 mp_ctx background,pkt // start continuous Packet TX


#iwpriv wlan0 mp_ctx stop //stop continuous Packet TX

If you want to change the input parameter (rate、channel、txpower、bandwidth),


please must input advance the command "iwpriv wlan0 mp_ctx stop".
#iwpriv wlan0 mp_stop // exit MP mode
If you want to continue the MP test, don’t do this command.
#ifconfig wlan0 down // close WLAN interface
--------------------------------------------------------------------------------------------------------------
8. Enter To BT Test Link Mode: for combo IC (8723BS/BU)
--------------------------------------------------------------------------------------------------------------
#ifconfig wlan0 up //enable wlan interface
#iwpriv wlan0 mp_start //enter MP mode
#iwpriv wlan0 mp_setbt dlfw //Download BT path FW
#iwpriv wlan0 mp_setbt testmode,01 //01 => enter to BT 2.0 TestMode, 02 => BT4.0
Direct Test mode, 03 => Connect Test Mode,00 =>
RF TxRx Test mode(non-link mode)
#iwpriv wlan0 mp_setbt setgen,01 // leave BT TestMode, Reset HCI
#iwpriv wlan0 mp_setbt down //rollback to Wifi MP Test.

You might also like