Friday, December 4, 2009

Configuring linux kernel for use on ALIX 2

I'm a happy owner of two ALIX boards (2c3 and newer 2d3).

Searching the net for info about how to configure the kernel for this sweet device doesn't bring much good, so I thought I'd add my take on it.

The CPU used is an AMD Geode LX800, so it's x86-compatible. And the board itself is almost PC-compatible. This means you can run stock x86 Debian on it.

To give you some idea on the insides, here's the output of lspci:
00:01.0 Host bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] Host Bridge (rev 33)
00:01.2 Entertainment encryption device: Advanced Micro Devices [AMD] Geode LX AES Security Block
00:09.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
00:0a.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
00:0b.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
00:0f.0 ISA bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] ISA (rev 03)
00:0f.2 IDE interface: Advanced Micro Devices [AMD] CS5536 [Geode companion] IDE (rev 01)
00:0f.4 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] OHC (rev 02)
00:0f.5 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] EHC (rev 02)

If you want to customize the kernel yourself (instead of sticking to whatever your distro provides) here are some tips based on my experience:
  • Turn on General setup/Configure standard kernel features (for small systems). This lets you kill off some features that are useless on the ALIX anyway, like PC-speaker and Virtual Terminal support.
  • You probably want to disable any sort of namespaces/virtualization support.
  • In Processor type and features:
    • Select Geode GX/LX as the Processor family.
    • There is neither HPET nor MTRR, so turn that off.
  • There's no ACPI/APM, so you can turn that off in Power management and ACPI options. But if you intend to use selective USB suspend, you need to keep Power Management support on. (All other options in this submenu can be off.)
  • In Bus options: There is PCI, so that needs to be enabled. Also turn on NatSemi SCx200 support. But don't turn on NatSemi SCx200 27MHz High-Resolution Timer Support. Enable Geode Multi-Function General Purpose Timer (MFGPT) events. (As the help says this can be use as high-precision timer, turning on Processor type and features/High Resolution Timer Support might be a good idea(?))
  • In Device drivers:
    • Decide if you wish to use the legacy ATA way or the newer libata way. I've been using the libata approach for a long time without any problem, so I suggest you use that. But beware -- switching between those two results in the CF card being visible as either /dev/hda or /dev/sda and this can break you boot.
    • For the old ATA way choose: ATA/ATAPI/MFM/RLL support/CS5536 chipset support (or AMD CS5535 chipset support in older kernels)
    • For the libata way choose: Serial ATA (prod) and Parallel ATA (experimental) drivers/ATA SFF support/CS5536 PATA support
    • Enable Network device support/Ethernet (10 or 100Mbit)/EISA, VLB, PCI and on board controllers/VIA Rhine support. You can also enable Use MMIO instead of PIO for VIA Rhine. (Works fine for me.)
    • Input device support: Enable if you plan to connect any such thing to your ALIX. If it's just gonna sit on your shelf chewing some network traffic you don't need that.
    • Character devices: Feel free to disable Virtual terminal as it's of no use on an ALIX 2 anyway. To use the HW random number generator that the Geode contains enable Hardware Random Number Generator Core support/AMD Geode HW Random Number Generator support. Don't forget to enable the serial console: Serial drivers/8250/16550 and compatible serial support and Console on 8250/16550 and compatible serial port.
    • Enable Hardware Monitoring support/National Semiconductor LM90 and compatibles to be able to see what's going on inside your ALIX. (You also need to enable I2C Support for this.)
    • There's hadware watchdog too. To use it, enable Watchdog Timer Support/AMD Geode CS5535/CS5536 Watchdog. In debian, look into the package "watchdog" for an app to use it.
    • Graphics support: Feel free to uncheck everything there. :-)
    • Sound card support: The same, unless you buy some USB sound thingy. :-)
    • USB support: To get USB functionality enable EHCI HCD (USB 2.0) support and OHCI HCD support.
    • To get access to the ALIX leds, enable LED Support/LED Support for ALIX.2 and ALIX.3 series and also select some LED Triggers.
    • You can freely uncheck Real Time Clock. While there's an option to add a battery to the board so that it keeps the time, even if I enable RTC, I don't get /dev/rtc. Either way, without the battery you'll always boot into Jan 1st 2000, so I think RTC support is useless here.
    • You can enable GPOI Support/AMD CS5535/CS5536 GPIO (Geode Companion Device) -- This can probably used to read the status of the front ALIX button (?) Also I2C Support/I2C Hardware Bus support/Geode ACCESS.bus support seems relevant. But I don't know more and so far was too lazy to look for it. Any info is welcome. :-)
  • To use the hardware AES crypto engine enable Cryptographic API/Hardware crypto devices/Support for the Geode LX AES engine.
  • I suggest you enable Magic SysRq key (Kernel hacking/Magic SysRq key), as it works also over serial (instead of SysRq, you send a break, see Documentation/sysrq.txt).

(The menu items are as per the 2.6.31.6 kernel, but they should be reasonably similar for any kernel version that is not too distant.)

The other options pretty much depend on your specific requirements and there's not anything board-specific that influences them.

Here is a working kernel configuration file for ALIX 2 that can be used as a base for further customization.

7 comments:

  1. Hey, thanks for the great article. I just bought one of these in January and your config was invaluable. Do you have an updated version for 2.6.32?

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Maybe you will like my dev2uuid.sh script, that will do the needed changes automatically:
    http://a.ctdo.de/wiki/doku.php?id=debian-alix-2c3#umstellen_von_dev_da_nach_dev_disk_by-uuid_xxxxxxxxxx

    I have also some hints about installing and configuring Debian Lenny on the Alix 2 (be aware - it's written in german...), and a link collection.

    Daniel

    ReplyDelete
  4. Thanks to this, I was able to run Linux kernel 2.6.37 in Alix 3d3 and then later on, busybox with xwindows.

    ReplyDelete
  5. Hi David,

    Thanks for the detailed info. I am pretty new to this. I wonder if you a guide to install onto CF card? How would the kernel configuration file be used?

    Thanks,
    Sam

    ReplyDelete
    Replies
    1. Hi Sam,

      if you want to install Debian, I can recommend debootstrap (https://wiki.debian.org/Debootstrap). Debian might (it did long time ago when I tried) work on the Alix with the default distro kernel, so you could be ok with that for testing.

      The most painful for me has always been getting grub working. (It's a pain when you install grub on a device - CF in this case - in one computer and want it to run in a different computer.)

      After you get basic system working, you can fine-tune the kernel. For that you need to get linux kernel sources, configure the kernel and build it (ideally on a PC, compiling the kernel on the Alix itself would take ages). You could use the kernel config I linked above in the process. Also note there is a bunch of newer ones available - see http://linux.fjfi.cvut.cz/~zub/alix/ If you need more info on how to build the kernel... I did a brief googling, but I didn't really like any guide I could find. :( Google yourself and see if you find something that makes sense.

      Delete
  6. If you're looking for a great distribution for the Alix, check out http://linux.voyage.hk/
    Ready to go debian for the alix.

    ReplyDelete