Zynq SDIO WiFi

 

Introduction

The purpose of this page is to describe how to enable wireless connectivity for ZC702 running Linux.

HW/IP features

The two SDIO controllers are controlled and operate independently with the same feature set:
Host mode controller

  • Four I/O signals (MIO or EMIO)
  • Command, Clock, CD, WP, Pwr Ctrl (MIO or EMIO)
  • LED control, bus voltage (EMIO)
  • Interrupt or polling driven
  • AHB master-slave interface operating at the CPU_1x clock rate
  • Master mode for DMA transfers (with 1 KB FIFO)
  • Slave mode for register accesses

SDIO Specification 2.0

  • Low-speed, 1 KHz to 400 KHz
  • Full-speed, 1 MHz to 50 MHz (25 MB/sec)
  • High-speed and high-capacity memory cards

 

Features Supported by Driver

  • All the HW/IP features are supported by driver

 

Missing features, Known Issues, Limitations

None

Kernel Configuration

-> Networking support (CONFIG_NET [=y])
 -> Wireless (CONFIG_WIRELESS [=y])
  -> cfg80211 (CONFIG_CFG80211 [=y])
-> Device Drivers
 -> Generic Driver Options
  -> Userspace firmware loading support (CONFIG_FW_LOADER [=y])
   -> Include in-kernel firmware blobs in kernel binary (CONFIG_FIRMWARE_IN_KERNEL [=n])
 -> Network device support (CONFIG_NETDEVICES [=y])
  -> Wireless LAN (CONFIG_WLAN [=y])
   -> Atheros Wireless Cards (CONFIG_ATH_COMMON [=y])
    -> Atheros mobile chipsets support (CONFIG_ATH6KL [=y])
     -> Atheros ath6kl SDIO support (CONFIG_ATH6KL_SDIO [=m])

Devicetree

SD and eMMC

sdhci@ff160000 {
    compatible = "xlnx,zynqmp-8.9a""arasan,sdhci-8.9a";
    interrupt-parent = <&&gic>;
    interrupts = <0x0 0x30 0x4>;
    reg = <0x0 0xff160000 0x0 0x1000>;
    clock-names = "clk_xin""clk_ahb";
    xlnx,device_id = <0x0>;
};
sdhci@ff170000 {
    compatible = "xlnx,zynqmp-8.9a""arasan,sdhci-8.9a";
    interrupt-parent = <&&gic>;
    interrupts = <0x0 0x31 0x4>;
    reg = <0x0 0xff170000 0x0 0x1000>;
    clock-names = "clk_xin""clk_ahb";
    xlnx,device_id = <0x0>;
};

 

Test Procedure

Test Setup
Board: ZC702
Kernel: Linux 3.5 (uses uImage and uramdisk)
Wireless card in SDIO slot: Atheros AR6103 (see http://wireless.kernel.org/en/users/Drivers/Atheros)
Connection: Wired connection from host (192.168.1.2) to wireless access point (linksys, 192.168.1.1). Once the steps documented on this page have been followed, there will be a wireless connection between ZC702 (192.168.1.10) and the access point.

Boot Linux with Wireless Capabilities
Download and build Linux
See Getting Started for details on downloading and building Linux.

Download the latest Xilinx kernel:

bash> git clone git://github.com/Xilinx/linux-xlnx.git

Configure the kernel for Zynq:

bash> make ARCH=arm xilinx_zynq_defconfig

To compile the SDIO wireless driver as a loadable kernel module, configure the kernel:

bash> make ARCH=arm menuconfig

Build the kernel and the driver:

bash> make ARCH=arm UIMAGE_LOADADDR=08000 uImage
bash> make ARCH=arm modules

Build the device tree blob:

bash> make ARCH=arm zynq-zc702.dtb


Result:
<linux build dir>/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko
<linux build dir>/arch/arm/boot/uImage
<linux build dir>/arch/arm/boot/zynq-zc702.dtb
Create a root filesystem
See Zynq Root File System to produce a root filesystem.
Add the following files to the root filesystem (refer to the Add Files to Running Linux page for instructions).

  • Copy <linux build dir>/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko to /root/ath6kl_sdio.koon the root filesystem (does not need to be located under /root).
  • Cross-compile iwconfig (http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html) and copy it to the root filesystem (/usr/sbin).
    • If using Buildroot to create the rootfs, the configuration option to install this is BR2_PACKAGE_WIRELESS_TOOLS.


Download the latest firmware:

bash> git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

Add the following files to the root filesystem (refer to the Add Files to Running Linux page for instructions).

  • Copy <linux-firmware>/ath6k to /lib/firmware/ath6k on the root filesystem.
  • Copy /lib/firmware/ath6k/AR6003/hw2.1.1/bdata.SD31.bin to /lib/firmware/ath6k/AR6003/hw2.1.1/bdata.bin on the root filesystem. The following result might occur otherwise (as of 2012/10/09):
ath6kl: Failed to get board file ath6k/AR6003/hw2.1.1/bdata.bin (-2), trying to find default board file.
ath6kl: WARNING! No proper board file was not found, instead using a default board file.
ath6kl: Most likely your hardware won't work as specified. Install correct board file!

Result:
uramdisk.image.gz
Boot Linux on Zynq
-> ZC702 Boot From Flash for an example of how to boot from flash.
-> Boot From SD Card for an example of how to boot from an SD card.
*Note: Make sure to rename the device tree blob (*.dtb) to devicetree.dtb as this is what U-Boot expects for some of the boot modes (such as SD boot).
Enable wireless connectivity
Now that Linux is running on Zynq, it is time to enable wireless connectivity.
Load the wireless driver:

zynq> insmod /root/ath6kl_sdio.ko
ath6kl: temporary war to avoid sdio crc error
ath6kl: ar6003 hw 2.1.1 sdio fw 3.2.0.144 api 3

Setup wireless connection between the board and the host:

zynq> iwconfig wlan0 essid 'linksys'
zynq> ifconfig wlan0 192.168.1.10
zynq> iwconfig
lo        no wireless extensions.
  
wlan0     IEEE 802.11bgn  ESSID:"linksys"
          Mode:Managed  GEM: ioctl 35585 not implemented.
Frequency:2.462 GHz  Access Point: 00:16:B6:2A:AD:05
          Bit Rate=54 Mb/s   Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=62/70  Signal level=-48 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
  
eth0      no wireless extensions.
zynq> ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:01:22
          inet addr:10.10.71.1  Bcast:10.10.71.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:542 errors:0 dropped:0 overruns:0 frame:0
          TX packets:124 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:753923 (736.2 KiB)  TX bytes:14397 (14.0 KiB)
          Interrupt:54 Base address:0xb000
  
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1020 (1020.0 B)  TX bytes:1020 (1020.0 B)
  
wlan0     Link encap:Ethernet  HWaddr 00:03:7F:BE:F0:A0
          inet addr:192.168.1.10  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4900 (4.7 KiB)  TX bytes:4455 (4.3 KiB)[[#Enable wireless connectivity-Testing]]

Expected Output

Now, there is a wireless connection between ZC702 and the host. This can be tested by issuing the following commands:

host> sftp root@192.168.1.10
Connecting to 192.168.1.10...
root@192.168.1.10's password: root
sftp> ls /
/README          /ath6kl_sdio.ko  /bin             /dev             /etc             /home            /lib
/licenses        /linuxrc         /lost+found      /mnt             /opt             /proc            /root
/sbin            /sys             /tmp             /update_qspi.sh  /usr             /var
sftp>
 
 
posted @ 2020-04-09 09:02  瘋耔  阅读(755)  评论(0编辑  收藏  举报
跳至侧栏