Showing posts with label atheros. Show all posts
Showing posts with label atheros. Show all posts

20081006

Linux-2.6.27-rc8 on the EEE 702

Although the Linux kernel version 2.6.27 has not yet been officially released, I was able to download, build and patch release-candidate-8 for my EEE PC with many notable improvements - most notably a working ath5k module. Correction: The Linux kernel version 2.6.27 was released 20081009 and you can read the changes here.

First of all, I was actually planning on using the 2.6.26-gentoo sources, which implemented the changes upstream that I had made for the 2.6.24-eee-r1 sources, because it already had the eeepc-laptop module sources included, and (limited) ath5k support.

However, when I tried to 'modprobe ath5k' with the 2.6.26-gentoo kernel, I encountered a nasty error message saying that the AR2425 chip is still under development (boo-urns!), and that support for the AR2425 chip would be included in the 2.6.27 sources. That made me revert back to my 2.6.24-eee-r1 linux kernel, but not for long!

Having never been the type to accept defeat so easily, I decided to use the vanilla-sources-2.6.27-rc8. The main difference between the vanilla and Gentoo sources are, that the Gentoo kernel sources (and subsequently the eee sources) are patched versions of the vanilla kernel, which include security fixes as well as various other features (SquashFS for example).

Now, I do need SquashFS for my squashed portage, but the security patches I could do without for the time being, until Kernel.org, and Gentoo, release their respective 2.6.27 kernel sources. Aside from that, I would need to compile external modules for the EEE pc, such as uvcvideo (webcam), eeepc-linux (Fan / CPU / FSB control).

Thanks to the inclusion of the eeepc-laptop sources, providing ACPI interfaces for all of the EEE PC Fn buttons, I could now omit the external asus-acpi module, as well as the quasi-proprietary ath_hal module provided with net-wireless/madwifi-ng.

Yes, that's right! Now the Atheros chipset on the EEE PC will work with the standard 'wext' wireless interface, allowing the unpatched version of NetworkManager to run seamlessly!!! Although I have switched to WICD since the last time I tried to use NetworkManager, but I thought I'd mention the changes anyway.

Here are a few patches that might be of interest:
eeepc-linux-2.6.27-rc8.patch
linux-2.6.27-rc8-squashfs3.4.patch
atl2-2.6.27-rc8.patch

All of these will work with sys-kernel/vanilla-sources-2.6.27_rc8.

Enjoy!

20080510

TS7260 Powered via USB

A TS7260 being powerd via USB - much more portable isn't it? Above, the board is pictured next to my fairly new Asus EEE ultra-mobile PC. Currently for work, I'm 'dogfooding' the package management system we're using for the boards, meaning that I'm using the same package management system on the 7260 as I am on the EEE.

The USB power cable was really simple to create. I first dismembered the mouse part from a Logitech optical USB mouse that I never use anymore, and then found the ground wire (bare copper in my case) and the 5 V wire (4.8V actually, and red). The rest of the wires I trimmed off. A bit of insulating electrical tape and a piece of heat-shrink tubing later, and I had the new USB power cable for the TS72xx.

I recently picked up a USB serial-converter and a DB9 F-F gender changer from The Source (the store formerly known as Radio Shack) but to my dismay, this combination was ineffective. As I suspected, the wires in the gender bender were straight through and not crossed - which is very typical of DB9 F-F converters. Crossed send / receive wires are necessary for NULL modem cables. That is, the pin input -> output mapping should resemble
  • 5 -> 5
  • 2 -> 3
  • 3 -> 2
  • 4 -> 6
  • 6 -> 4
Some sources also suggest that 7 and 8 should be crossed, but that's only ever broken things for me. As long as hardware or software flow control is not necessary, the other 4 pairs of wires can be left floating and disconnected. If this is starting to sound slightly greek to you, the best idea is to just buy a NULL modem cable from the local computer store. If it sounds interesting, you can create a tiny 2" NULL modem adapter with a bit of solder, some 24 AWG wire or IDE cable, two DB9 headers, some hot glue, and (of course) some heat-shrink tubing.

Ta-Da!

Configuration 1 shows power input for the 7260 taken from the lower-right USB port of the EEE, as well as the serial input of the 7260 taken from the top-right USB port of the EEE. Ethernet is also connected between the top of the 7260 and the left side of the EEE. Configuration 1 is very useful for having to interact with RedBoot, since RedBoot is only accessible via the serial port of the 7260. Configuration 1 allows for the developer to either log in via minicom on the serial port or telnet on the ethernet port of the 7260 during regular operations. Another option is to log in to the 7260 via telnet and use the serial connection for emulating a piece of hardware (one could write a program on the EEE to pretend to be a serially connected SNES gamepad, for example).

Configuration 2 shows both the power and ethernet for the 7260 taken from the left side of the EEE. This configuration is slightly more compact and would be used for normal development, where interaction with the bootloader is not necessary.

In both cases, the atheros 802.11 b/g wireless ethernet device can easily be configured to masquerade IP traffic for both the EEE as well as the 7260, forwarding requests between eth0 and ath0 as necessary. It might be useful to run a dhcp server on the ethernet port of the EEE so that the 7260 receives its IP address, hostname, and DNS information automatically. An example script for iptables is below:
#!/bin/sh

EXTIF=ath0
INTIF=eth0

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

My personal favorite configuration is shown to the left with my old, monochrome 4th generation iPod and headphones jacked in :) In all photos, the USB memory stick is actually my root filesystem, which contains a home-rolled Gentoo binary distribution. Contrary to popular belief, Gentoo is also suitable for binary-only and embedded applications - and it's tiny :)