Linux on a ThinkPad X31

This page documents my experience installing and running Linux (RedHat 9) on an IBM ThinkPad X31 laptop. Because I'm lazy it doesn't include many of the details, but it does give an overview of what works and what doesn't (short story: everything basically works now, but wireless didn't for nearly a year).

NOTE: almost everything here is now completely out of date, in fact any recent Linux distribution should install and work reasonably well out of the box, however I'm keeping this page around just in case its contents are still useful to someone. Please read it with a grain of salt.

Feel free to ask <andrewb AT cse DOT unsw DOT edu DOT au> if you think I might be able to help with something that isn't answered here.

Finally, Cristiano Paris has set up a mailing list for Linux on the X31, to which you might like to subscribe.

Install

Changing the installer kernel

Linux 2.4.20 doesn't know about the PCI IDs of most of the core components, including the IDE controller on the chipset. This means that it reverts to PIO mode, which isn't the end of the world, but the RedHat 9 installer refuses to install because it can't find any disks.

Rather than try to work out what the installer was doing, I built a 2.4.21-rc1 kernel and modified the installer image to use it. This isn't exactly easy, but of course I didn't bother keeping track of all the steps involved ;) They were roughly:

Alternatively, you could just grab this tarball, which contains the relevant bits of a /tftpboot tree, including the PXE loader. You'll still need to configure your DHCP server, though.

Actual install

The actual install went smoothly, apart from the fact that I couldn't get the installer program to NFS mount the images, and eventually gave up and used an FTP install.

The disk was partitioned with one single NTFS partition, which I nuked. Unlike previous ThinkPads, the disk space used for the recovery program and "predesktop area" (utilities that can be started from the BIOS at boot time) doesn't even appear in the partition table -- I'm not sure exactly where they put it, but the disk just appears slightly smaller to fdisk, so repartitioning the whole lot was fine.

If you want to use hibernation, you might need to create a small FAT32 partition, but I haven't tried to get this working yet. Some of the other ThinkPad pages linked below cover hibernation in more detail.

Post-install changes

The RedHat installer put a 2.4.20 kernel on, which meant the disk was back in PIO mode. Apart from running slowly, this uses more CPU and hence drains the battery noticably faster -- so the first thing I did was to build another 2.4.21-rc1 kernel (using this config, not the special -BOOT config).

I also used hdparm to enable power saving modes of the disk, and set a spindown timeout of a few minutes. The easiest way to do this is to grab a copy of my /etc/sysconfig/harddisks file.

For the spindown to actually happen, you need to have a kernel with the laptop mode patch applied, which significantly reduces disk activity. It was posted to linux-kernel recently, but I don't think it has been incorporated in any tree yet.

Since then, I've moved to 2.4.21-rc1-ac4, which adds support for the AGP (so accelerated GL works), as well as CPU frequency scaling. You can find the .config file I used here.

Even more recently, I've started using 2.4.21-rc2-ac2 with ACPI instead of APM. Using ACPI gives you better control over power management states than APM with the cpufreq patches, but suspend is no longer possible (apparently this works in 2.5). Decide for yourself :)

Hardware

To start with, here's the lspci output:

{{{00:00.0 Host bridge: Intel Corp.: Unknown device 3340 (rev 03) 00:01.0 PCI bridge: Intel Corp.: Unknown device 3341 (rev 03) 00:1d.0 USB Controller: Intel Corp. 82801DB USB (Hub #1) (rev 01) 00:1d.1 USB Controller: Intel Corp. 82801DB USB (Hub #2) (rev 01) 00:1d.2 USB Controller: Intel Corp. 82801DB USB (Hub #3) (rev 01) 00:1d.7 USB Controller: Intel Corp. 82801DB USB EHCI Controller (rev 01) 00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (rev 81) 00:1f.0 ISA bridge: Intel Corp.: Unknown device 24cc (rev 01) 00:1f.1 IDE interface: Intel Corp.: Unknown device 24ca (rev 01) 00:1f.3 SMBus: Intel Corp. 82801DB SMBus (rev 01) 00:1f.5 Multimedia audio controller: Intel Corp. 82801DB AC'97 Audio (rev 01) 00:1f.6 Modem: Intel Corp. 82801DB AC'97 Modem (rev 01) 01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY 02:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev aa) 02:00.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev aa) 02:00.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 02) 02:02.0 Network controller: Intel Corp.: Unknown device 1043 (rev 04) 02:08.0 Ethernet controller: Intel Corp. 82801BD PRO/100 VE (MOB) Ethernet Controller (rev 81)}}}

CPU, Chipset

These are the root cause of most of the problems -- the Centrino stuff is all very new, and Linux doesn't know about much of it yet. You need a 2.4.21 kernel to recognise the ICH4 IDE controller, but most of the other bits are similar enough to previous versions that they work.

I'm not sure if Linux is making use of all the power management features of the CPU/Chipset... although as mentioned above, 2.4.21-rc1-ac4 allows CPU frequency scaling to work, so using /proc/cpufreq I can scale the clockrate right down to 160Mhz. This is only using frequency modulation though, not the speedstep modes, which make a larger impact on power consumption but don't appear to be supported yet for the Pentium M. To access them you need to use ACPI.

Graphics

The builtin Radeon chip works with XFree86 4.3.0, but I had to use kernel 2.4.21-rc1-ac4 before AGP (and hence 3D acceleration) would work. Having done this, however, I do get occasional errors in dmesg from the kernel level radeon and drm modules, X seems a less stable, and it crashes when leaving suspend. You probably want to leave AGP disabled for now -- it might also be worth trying the radeon module available here, which appeared to improve stability for me.

Ethernet

Works fine with the e100 module, and possibly also eepro100, but I haven't tried it.

Builtin Wireless

There are several different wireless options available with the X31. The Centrino wireless is an "Intel PRO/Wireless 2100 LAN MiniPCI Adapter", which is a completely new device from all reports, and not based on the prism chip as the previous Intel PRO/Wireless products were. There are now, over a year after the Centrino stuff was released, several driver options available.

Linuxant DriverLoader

Using Linuxant's DriverLoader, it is now possible to get the Centrino wireless card working under Linux. The DriverLoader module (which is unfortunately binary-only) wraps the Windows driver. It seems to work, although is a little unstable (I get a few oopses after loading it, and there are reportedly problems when resuming from suspend).

The other major drawback is that you need to get a 30-day license to use DriverLoader (the licenses are currently free), but nevertheless this is the first way to actually use the card under Linux!

Native IPW2100 driver

There is now an open source project to develop a driver for this card by reverse engineering the hardware. Insanely enough, it seems to be all Intel people working on it (so either they've lost the programming docs, they signed an NDA with some hardware developer, or they have so much cash they can burn it paying people to reverse engineer their own hardware). Anyway, it seems that there has been a fair amount of work on this driver, and I've had several reports of success, so this is probably the best option now.

Other Wireless Options

The Cisco wireless card which is available as an option does work under Linux, and is documented by Eli Janssen. There is also a dual band (802.11a/b) card available (PCI ID 8086:101e) with an Atheros chipset. Ramon Casellas reports that a driver for this card is under development, and seems to work (although it is somewhat unstable). There is also another less complete driver being developed.

Another final word of warning: it looks like there is a whitelist of PCI device IDs which may be inserted in the miniPCI slot which is checked at boot time, so you may not even be able to replace the supplied wireless card with one that has a Linux driver. More details in the following posts to linux-kernel: 1, 2, 3. Thanks to Lincoln Durey for this info.

Builtin Bluetooth

I didn't get the version with Bluetooth, but Ramon says that the bluez module appears to support it.

Modem

I have yet to touch the modem, however Ramon Casellas reports:

slmdm: country set is 0xb5 (USA). Smart Link AMRMO modem. amrmo: probe 8086:24c6 Intel Corp. 82801DB AC'97 Modem Controller : ICH4/SmartRiser card... PCI: Found IRQ 11 for device 00:1f.6 PCI: Sharing IRQ 11 with 00:1f.3 PCI: Sharing IRQ 11 with 00:1f.5 PCI: Sharing IRQ 11 with 02:00.1 PCI: Setting latency timer of device 00:1f.6 to 64}}}

Update: Joshua pointed me to this information about getting the smlink driver working. You need to grab version 2.7.10 of the driver, not 2.7.14 which apparently dials every number twice. You also need to edit line 75 of amrmo_init.c to read:

instead of:

... which looks like a fairly dodgy hack to get it to work with the ICH4M chipset, but anyway.

Audio

Appears to work fine with the i810_audio module. If you are using CPU freqency scaling, the driver tends to misdetect the clock value for the device and hence the sound comes out wrong. To avoid this, put the line: options i810_audio clocking=48000 into your /etc/modules.conf file.

Firewire

The ieee1394 and ohci1394 modules are loaded, and it appears to be detected. I don't have any devices to test with, however.

USB

As you can see from the PCI listing, the thing has a plethora of USB controllers builtin. They work fine with the usb-uhci (USB) and ehci-hcd (USB2) drivers.

USB2 devices work on either port with USB2 speeds, however somewhat confusingly when you plug a USB1 device into the same ports it shows up on either of the UHCI controllers. Kirk Hilliard has sent me some benchmarks showing transfer rates of 20MB/s, so USB2 speeds are definitely achievable.

PCMCIA, CompactFlash

Works fine with the yenta_socket module and friends loaded. You can also mount filesystems on CompactFlash cards using the ide-cs module.

Power Management

The APM stuff works fine, and I can suspend and resume without any problems. Having fixed the disk access to use DMA and power saving modes, I can get pretty good battery life in Linux (something like 4-5 hours for low load).

ACPI also works, if you have a kernel which supports it, and gives finer control over power saving states. However, you need to install some user space utilities which RedHat doesn't package, and the 2.4 version of the ACPI patches can't enter suspend mode.

As I mentioned before, I haven't tried setting up a hibernation partition... I might just wait for Linux 2.5 which has software support for it. However, Daniel Riek apparently has it working and contacted me with the following hints:

Further resources

Configuration files, etc

Various files from my install that people have asked for:

Useful programs

Some extra programs I've installed that aren't packaged by RedHat:

Similar Pages

ThinkPad X30

There are quite a few of well-written docs about Linux on the X30. Unfortunately the X31 is very different from the X30 (CPU, chipset, wireless, graphics), but most of the peripherals are the same. The best docs cover:

Changelog

12/07/2006

imported to wiki page

23/06/2004

updated tp4utils URL

18/05/2004

updated info about wireless driver options

23/01/2004

added link to The Register article about Centrino drivers

13/11/2003

added link to Don Stewart's OpenBSD page

04/11/2003

added info about Centrino wireless with Linuxant's Driverloader

22/08/2003

added link to details about the Cisco wireless option, and other X31 Linux pages

06/08/2003

added details about how to get the modem working

earlier

many updates, none of which were tracked