Tests:SDIO-with-UHS

From eLinux.org
Revision as of 06:19, 15 November 2016 by W sang (talk | contribs) (add final data)
Jump to: navigation, search

This document describes how to test SDIO at UHS speeds using a ZComax AC-180M card.

  • Note: This is a draft! The final version will be updated until 2016-11-15.

Setup

The following items are needed for this test:

  • the client - a Salvator-X board with a H3 SoC (firmware v2.12) and a ZComax AC-180M plugged into CN14
  • the server - a second computer running some Linux distribution with iperf3 installed
  • the network - capable of running 802.11ac

The client will be connected to the network via WIFI (802.11ac). The server is preferably connected to the network via Gigabit-LAN. Although connection with 802.11ac is also possible, the WIFI card of the server is unknown and might affect the measurement. Gigabit-LAN is more reliable in this regard.

The setup used for the below results is:

  • the client - a Salvator-X board with a H3 SoC (firmware v2.12) and a ZComax AC-180M plugged into CN14
  • the server - Fujitsu Lifebook E544 with RTL8111/8168 PCI Express Gigabit Ethernet controller running Debian Stretch
  • the network - a Fritzbox 7560 router with 802.11ac and Gigabit-LAN

Branch for testing

The test should be used with the following branch:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/sdio-uhs

Ensure the mwifiex driver is activated in the kernel config

These symbols need to be active to enable the WLAN driver:

CONFIG_WLAN=y
CONFIG_WLAN_VENDOR_MARVELL=y
CONFIG_MWIFIEX=y
CONFIG_MWIFIEX_SDIO=y

Prepare the root filesystem for your target

The root filesystem should have:

  • busybox with udhcpc (v1.24.2 used here)
  • wireless-tools (v3.0-pre9 used here)
  • wpa-supplicant (v2.5 used here)
  • iperf3 (v3.1.2 used here)
  • latest firmware for SD8887 from the linux-firmware tree.

All tools are standard linux tools and should be available through your buildsystem (buildroot, yocto...).

Boot the kernel

You should see this on successful probe:

mmc2: new ultra high speed SDR50 SDIO card at address 0001
mwifiex: rx work enabled, cpus 4
mwifiex_sdio mmc2:0001:1: info: FW download over, size 391772 bytes
mwifiex_sdio mmc2:0001:1: WLAN FW is active
mwifiex_sdio mmc2:0001:1: info: MWIFIEX VERSION: mwifiex 1.0 (15.68.7.p5)
mwifiex_sdio mmc2:0001:1: driver_version = mwifiex 1.0 (15.68.7.p5)

Please note the mmc device is mmc2 here. This is likely for connector CN14. For connector CN13, it is likely to be mmc1. However, keep in mind which one you have and replace the mmc device in the following commands, if necessary.

Verify SD card speed and bus width

We want a UHS mode. Check the timing spec line:

# cat /sys/kernel/debug/mmc2/ios
clock:		100000000 Hz
vdd:		21 (3.3 ~ 3.4 V)
bus mode:	2 (push-pull)
chip select:	0 (don't care)
power mode:	2 (on)
bus width:	2 (4 bits)
timing spec:	5 (sd uhs SDR50)
signal voltage:	1 (1.80 V)
driver type:	0 (driver type B)

Check if there is the network device

It should show some mlan<number> device:

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr <MAC-ADDRESS>
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:202904 errors:0 dropped:0 overruns:0 frame:0
          TX packets:405823 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13393299 (12.7 MiB)  TX bytes:614261381 (585.8 MiB)
          Interrupt:133 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

mlan0     Link encap:Ethernet  HWaddr <MAC-ADDRESS>
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:282 (282.0 B)  TX bytes:248 (248.0 B)

Similar to above, the wireless network device is likely to be mlan0. If it has a different name in your setup, please adapt the following command-lines accordingly.

Activate the interface

Activate the mlan interface and disable ethernet. If ethernet happens to be connected to the same network as well, you might accidently test the ethernet throughput otherwise :)

# ifconfig eth0 down
# ifconfig mlan0 up

Now scan for networks

# iwlist mlan0 scan
mlan0     Scan completed :
[listing of networks in your area]

Create /etc/wpa_supplicant.conf for your network

Here is a template:

ctrl_interface=/var/run/wpa_supplicant
network={
	ssid="<your network>"
	scan_ssid=1
	key_mgmt=WPA-PSK
	psk="<your passphrase>"
}

Start wpa_supplicant to connect to the network

# wpa_supplicant -i mlan0 -c /etc/wpa_supplicant.conf &
mlan0: Trying to associate with <AP-MAC> (SSID='<SSID-NAME>' freq=5180 MHz)
[  191.786663] mwifiex_sdio mmc2:0001:1: info: trying to associate to '<SSID-Name>' bssid <AP-MAC>
[  191.834724] mwifiex_sdio mmc2:0001:1: info: associated to bssid <AP-MAC> successfully
mlan0: Associated with <AP-MAC>
WMM AC: Missing IEs
mlan0: WPA: Key negotiation completed with <AP-MAC> [PTK=CCMP GTK=CCMP]
mlan0: CTRL-EVENT-CONNECTED - Connection to <AP-MAC> completed [id=0 id_str=]

Start iperf3 (in server mode) on the server

[SERVER] $ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

Check you are connected to an AC network

# iwconfig mlan0
eth0      no wireless extensions.

lo        no wireless extensions.

mlan0     IEEE 802.11  ESSID:"<SSID-NAME>"  
          Mode:Managed  Frequency:5.18 GHz  Access Point: <AP-MAC>
          Bit Rate=433.3 Mb/s   Tx-Power=8 dBm   
          Retry short limit:9   RTS thr=2347 B   Fragment thr=2346 B   
          Encryption key:off
          Power Management:on
          Link Quality=60/70  Signal level=-50 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Get an address and say hello to the iperf3 server

# udhcpc -i mlan0; ping <iperf3-server-ip>
udhcpc (v1.24.2) started
Sending discover...
Sending select for <our-ip>...
Lease of <our-ip> obtained, lease time 1209600
deleting routers
adding dns <DNS>
PING <iperf3-server-ip> (<iperf3-server-ip>): 56 data bytes
64 bytes from <iperf3-server-ip>: seq=0 ttl=64 time=10.912 ms
64 bytes from <iperf3-server-ip>: seq=1 ttl=64 time=5.023 ms
64 bytes from <iperf3-server-ip>: seq=2 ttl=64 time=5.015 ms
64 bytes from <iperf3-server-ip>: seq=3 ttl=64 time=7.734 ms
...

Test the connection with iperf3

On the target board, run:

# iperf3 -c <iperf3-server-ip>
Connecting to host 192.168.213.157, port 5201
[  4] local 192.168.213.160 port 32934 connected to 192.168.213.157 port 5201
[  106.338303] sh_mobile_sdhi ee100000.sd: timeout waiting for SD bus idle
[  106.363612] sh_mobile_sdhi ee100000.sd: timeout waiting for SD bus idle
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  10.4 MBytes  87.4 Mbits/sec    0    133 KBytes
[  4]   1.00-2.00   sec  11.6 MBytes  97.6 Mbits/sec    0    133 KBytes
[  108.256587] sh_mobile_sdhi ee100000.sd: timeout waiting for SD bus idle
[  4]   2.00-3.00   sec  11.3 MBytes  95.0 Mbits/sec    0    148 KBytes
[  4]   3.00-4.00   sec  11.4 MBytes  95.6 Mbits/sec    0    148 KBytes
[  4]   4.00-5.00   sec  11.4 MBytes  96.0 Mbits/sec    0    148 KBytes
[  4]   5.00-6.00   sec  11.4 MBytes  95.2 Mbits/sec    0    148 KBytes
[  4]   6.00-7.00   sec  11.3 MBytes  94.6 Mbits/sec    0    148 KBytes
[  4]   7.00-8.00   sec  11.3 MBytes  94.7 Mbits/sec    0    148 KBytes
[  4]   8.00-9.00   sec  11.4 MBytes  95.3 Mbits/sec    0    148 KBytes
[  4]   9.00-10.00  sec  11.5 MBytes  96.1 Mbits/sec    0    148 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   113 MBytes  94.8 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   113 MBytes  94.6 Mbits/sec                  receiver

Note that the "timeout" messages appeared on my H3 ES1.0, but not on my M3-W