I recently got a Atheros AR5B22 chip for my Jetson TK1 board, in order to make it support WiFi and Bluetooth. The system provided by NVIDIA (Linux4Tegra 21.4) doesn’t have Atheros driver built-in, so I have to compile it to make use of the device.
This is what the chip looks like when installed on TK1. AR5B22 is the Mini PCIe reference design for AR9462, which features both 2.4GHz and 5GHz WiFi and Bluetooth 4.0, according to WikiDevi.
Since it belongs to 9xxx series, Linux kernel has the well-supported driver ath9k for it. Unlike other WiFi-Bluetooth-combo chips from Atheros, this one doesn’t specify which Bluetooth chip it uses (judging by BT 4.0 support, it should be AR3012), but nevertheless you still need ath3k driver and firmware for Bluetooth support. This has bugged me for quite a while, but I figured it out anyway (with hints from this Ubuntu bug report).
If you are familiar with how to compile Linux kernel modules for Jetson TK1, above is all you need to continue. The rest of this article are detailed steps for those who don’t know about this.
Note: The following steps are to compile directly on TK1, and features some hack-y steps for installing them. Also, I am NOT responsible for bricking your device.
- First make sure you have the latest Linux4Tegra (L4T) 21.4 installed on your Jetson TK1, which features basic bluetooth support. You can use Jetpack to flash it.
- The following steps are all carried out with a shell on TK1. It could be either over SSH (
ssh ubuntu@IP
), or GNOME Terminal (Ctrl-Alt-T
) from GUI if you have a monitor plugged in. - Install the firmware (for ath3k) and dependency (for kernel config menu) packages on your TK1.
sudo apt-get install linux-firmware libncurses5-dev
- Download and extract L4T kernel sources into your home directory.
mkdir ~/kernel && cd ~/kernel wget -O kernel_src.tbz2 https://s.du9l.com/Iz4HK # For L4T 21.4 tar xf kernel_src.tbz2 && cd kernel
- Copy existent kernel config as a start.
zcat /proc/config.gz > .config
- Enter kernel config menu, and change the following settings.
make menuconfig
- From “General setup” set “Local version” to “-gdacac96” (check with
uname -a
), otherwise your compiled module will report “Unknown symbol in module” and “ath9k: version magic … should be …” errors when you insert them. - Use “Exit” to go back to the top, then from “Device Drivers – Network device support – Wireless LAN”, press
M
on “Atheros Wireless Cards” to compile it as a module; then enter it, pressM
on “Atheros 802.11n wireless cards support”, and pressY
on “Atheros bluetooth coexistence support” and “Atheros ath9k PCI/PCIe bus support”. - Again, “Exit” to the top, then from “Networking support – Bluetooth subsystem support (should already be
M
in 21.4 kernel) – Bluetooth device drivers”, pressM
on “Atheros firmware download driver”. - Use “Save” to save your work (default “.config” name is fine), and “Exit” until you are back to the shell.
- From “General setup” set “Local version” to “-gdacac96” (check with
- Use the following command to start the compilation. It usually needs ~5 minutes to finish.
make -j4 modules
- Here comes the hack-y part: Officially you need
sudo make modules_install
to install the modules, but I just want to install the newly compiled ones into a separate folder, so I will use the following commands instead:sudo mkdir /lib/modules/`uname -r`/kernel/custom # `uname -r` becomes "3.10.40-gdacac96" in this case find . -name 'ath*.ko' | xargs -I{} sudo cp {} /lib/modules/`uname -r`/kernel/custom/ sudo depmod -a
- In order to use WiFi and Bluetooth together, you need to enable “Bluetooth coexistence” in ath9k module.
echo "options ath9k btcoex_enable=1" | sudo tee /etc/modprobe.d/ath9k_btcoex.conf
- Finally, insert both modules into the kernel.
sudo modprobe ath9k ath3k
You should now have both WiFi and Bluetooth working. You can check with the following commands:
iwconfig
hciconfig
Just to be clear, I used the above steps with the following hardware, but I suppose you can use the same drivers for any Atheros WiFi AR9xxx series and BT AR3xxx series chip (combo or separate), as long as the 3.10 kernel and ath9k & ath3k modules support them.
$ lspci |grep Atheros
# 01:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01)
$ lsusb |grep Atheros
# Bus 001 Device 003: ID 0cf3:3004 Atheros Communications, Inc.