<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
          "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article lang="en">

  <articleinfo>
    <title>GNU/Linux on an IBM ThinkPad X31</title>

    <author>
      <firstname>Henrik Brix</firstname>
      <surname>Andersen</surname>
      <affiliation>
        <address><email>brix@gentoo.org</email></address>
      </affiliation>
    </author>

    <copyright>
      <year>2004</year>
      <holder>
        Henrik Brix Andersen
      </holder>
    </copyright>

    <revhistory>
      <revision>
        <revnumber>0.4.0</revnumber>
        <date>2004-11-01</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Updated for kernel 2.6.9 and X11R6.8</revremark>
      </revision>
      <revision>
        <revnumber>0.3.1</revnumber>
        <date>2004-09-10</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Updated email address and homepage</revremark>
      </revision>
      <revision>
        <revnumber>0.3.0</revnumber>
        <date>2004-08-29</date>
        <authorinitials>HBA</authorinitials>
        <revdescription>
          <itemizedlist>
            <listitem>
              <para>
                Changed from XFree86-4.3.0 to X.Org Foundation's
                X11R6.7.0
              </para>
            </listitem>
            <listitem>
              <para>
                Added a Related Links section
              </para>
            </listitem>
            <listitem>
              <para>
                Updated ipw2100 driver requirements
              </para>
            </listitem>
            <listitem>
              <para>
                Added a note about the experimental ibm-acpi module
              </para>
            </listitem>
            <listitem>
              <para>
                Added X31 type number
              </para>
            </listitem>
            <listitem>
              <para>
                Added conclusion
              </para>
            </listitem>
          </itemizedlist>
        </revdescription>
      </revision>
      <revision>
        <revnumber>0.2.0</revnumber>
        <date>2004-06-28</date>
        <authorinitials>HBA</authorinitials>
        <revremark>First beta version</revremark>
      </revision>
      <revision>
        <revnumber>0.1.0</revnumber>
        <date>2004-06-17</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Initial revision</revremark>
      </revision>
    </revhistory>

    <abstract>
      <para>
        This document describes the process of configuring GNU/Linux
        for an IBM ThinkPad X31.  It covers configuring the Linux
        kernel for the hardware of the X31 and setting up X11 for the
        Radeon graphics chipset.
      </para>
      <para>
        The document is also available as <ulink url="X31.txt">plain
        text</ulink>.  The <ulink url="X31.xml">Docbook XML</ulink>
        source from which it was created is available as well.  The
        latest version of this document can be obtained from <ulink
        url="http://dev.gentoo.org/~brix">dev.gentoo.org/~brix</ulink>.
      </para>
    </abstract>
  </articleinfo>

  <section id="sect-intro">
    <title>Introduction</title>
    <para>
      I recently bought an IBM ThinkPad X31.  This document describes
      my experiences with configuring GNU/Linux to run on the X31.
      The document covers how to set up the kernel for the specific
      hardware found in the X31 and how to set up the graphical user
      interface, X11.  A certain amount of experience with kernel
      configuration and X11 is required.
    </para>
    <para>
      Although the instructions in this document are based on my
      experiences with <ulink url="http://www.gentoo.org">Gentoo
      Linux</ulink> it should be fairly trivial to use them with any
      other Linux distribution.  I've tried to be as general as
      possible and left out distribution specific instructions.
    </para>

    <section id="sect-copyright">
      <title>Copyright and License</title>
      <para>
        This document is copyrighted &copy; 2004 by <emphasis>Henrik
        Brix Andersen</emphasis>.  Permission is granted to copy,
        distribute and/or modify this document under the terms of the
        GNU Free Documentation License, Version 1.2 or any later
        version published by the Free Software Foundation; with no
        Invariant Sections, with no Front-Cover Texts, and with no
        Back-Cover Texts.  A copy of the license is available at
        <ulink url="http://www.gnu.org/copyleft/fdl.html">
        http://www.gnu.org/copyleft/fdl.html</ulink>.
      </para>
      <para>
        <ulink url="http://www.kernel.org">Linux</ulink> is a
        registered trademark of Linus Torvalds.  ThinkPad is a
        registered trademark of the <ulink
        url="http://www.ibm.com">IBM Corporation</ulink>.
      </para>
    </section>

    <section id="sect-disclaimer">
      <title>Disclaimer</title>
      <para>
        No liability for the contents of this document can be
        accepted.  Use the concepts, examples and information at your
        own risk.  There may be errors and inaccuracies, that could be
        damaging to your system.  Proceed with caution, and although
        this is highly unlikely, the author(s) do not take any
        responsibility.
      </para>
      <para>
        All copyrights are held by their by their respective owners,
        unless specifically noted otherwise.  Use of a term in this
        document should not be regarded as affecting the validity of
        any trademark or service mark.  Naming of particular products
        or brands should not be seen as endorsements.
      </para>
    </section>

    <section id="sect-feedback">
      <title>Feedback</title>
      <para>
        Feedback is most certainly welcome for this document.  Send
        your additions, comments and criticisms to the following email
        address: <email>brix@gentoo.org</email>.
      </para>
    </section>
  </section>

  <section id="sect-ibm-x31">
    <title>The IBM ThinkPad X31</title>
    <para>
      My IBM ThinkPad X31 is a type <ulink
      url="http://www-307.ibm.com/pc/support/site.wss/quickPath.do?quickPathEntry=2672xxh">2672-XXH</ulink>
      without built-in bluetooth transceiver.  It has the
      configuration shown in the output of the
      <command>lspci</command> command in <xref
      linkend="fig-ibm-x31-lspci" />.

      <figure id="fig-ibm-x31-lspci">
        <title>Output of the lspci command</title>
<programlisting>
<prompt># </prompt><command>lspci</command>
0000:00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corp. 82801DB (ICH4) USB UHCI #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corp. 82801DB (ICH4) USB2 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corp. 82801DBM LPC Interface Controller (rev 01)
0000:00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4) Ultra ATA Storage Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corp. 82801DB/DBM (ICH4) SMBus Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB (ICH4) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corp. 82801DB (ICH4) AC'97 Modem Controller (rev 01)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY
0000:02:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev aa)
0000:02:00.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev aa)
0000:02:00.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 02)
0000:02:02.0 Network controller: Intel Corp. PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04)
0000:02:08.0 Ethernet controller: Intel Corp. 82801BD PRO/100 VE (MOB) Ethernet Controller (rev 81)
</programlisting>
      </figure>
    </para>
  </section>

  <section id="sect-kernel">
    <title>Kernel Configuration</title>
    <para>
      This section describes how to configure a <ulink
      url="http://www.kernel.org">Linux</ulink> kernel version 2.6.x
      for the hardware found in the X31.  The instructions found in
      this revision of the document has been tested with kernel
      version 2.6.9.  Only options closely related to the X31 specific
      hardware are mentioned; which options to enable apart from
      those are beyond the scope of this document.
    </para>
    <para>
      The kernel options which I have chosen to build as modules are
      marked with <emphasis role="module">[module]</emphasis>.  My
      main reasons to compile certain functionality as modules is to
      enable run-time configuration through module parameters and to
      be able to only load a module when that particular functionality
      is needed.
    </para>

    <section id="sect-kernel-cpu-chipset">
      <title>CPU and Chipset</title>
      <para>
        Kernel support for the Pentium M CPU and the Centrino chipset
        of the X31 is enabled through the kernel options listed below.

        <itemizedlist>
          <listitem>
            <para>
              Subarchitecture Type (PC-compatible) (CONFIG_X86_PC)
            </para>
          </listitem>
          <listitem>
            <para>
               Processor family (Pentium M) (CONFIG_MPENTIUMM)
            </para>
          </listitem>
          <listitem>
            <para>
              Machine Check Exception (CONFIG_X86_MCE)
            </para>
          </listitem>
          <listitem>
            <para>
              MTRR (Memory Type Range Register) support (CONFIG_MTRR)
            </para>
          </listitem>
          <listitem>
            <para>
              PCI support (CONFIG_PCI)
            </para>
          </listitem>
          <listitem>
            <para>
              PCI device name database (CONFIG_PCI_NAMES)
            </para>
          </listitem>
          <listitem>
            <para>
              ISA support (CONFIG_ISA)
            </para>
          </listitem>
          <listitem>
            <para>
              ATA/ATAPI/MFM/RLL support (CONFIG_IDE)
            </para>
          </listitem>
          <listitem>
            <para>
              Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
              (CONFIG_BLK_DEV_IDE)
            </para>
          </listitem>
          <listitem>
            <para>
              Include IDE/ATA-2 DISK support (CONFIG_BLK_DEV_IDEDISK)
            </para>
          </listitem>
          <listitem>
            <para>
              PCI IDE chipset support (CONFIG_BLK_DEV_IDEPCI)
            </para>
          </listitem>
          <listitem>
            <para>
              Generic PCI bus-master DMA support
              (CONFIG_BLK_DEV_IDEDMA_PCI)
            </para>
          </listitem>
          <listitem>
            <para>
              Use PCI DMA by default when available
              (CONFIG_IDEDMA_PCI_AUTO)
            </para>
          </listitem>
          <listitem>
            <para>
              Intel PIIXn chipsets support (CONFIG_BLK_DEV_PIIX)
            </para>
          </listitem>
        </itemizedlist>
      </para>

      <section>
        <title>SMBus</title>
        <para>
          The SMBus of the X31 should be supported by the kernel
          options listed below, but due to some rather <ulink
          url="http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/README.ThinkPad">nasty
          accidents</ulink> with SMBus access on IBM ThinkPads in the
          past all SMBus access has been disabled on IBM ThinkPads in
          the kernel.

          <itemizedlist>
            <listitem>
               <para>
                 I2C device interface (CONFIG_I2C_CHARDEV)
              </para>
            </listitem>
            <listitem>
               <para>
                 Intel 801 (CONFIG_I2C_I801)
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </section>
    </section>

    <section id="sect-kernel-gfx">
      <title>Graphics Chipset</title>
      <para>
        The X31 is equipped with an <ulink
        url="http://www.ati.com">ATI Technologies Inc.</ulink> Radeon
        Mobility M6 LY graphics chipset.  The kernel has support for a
        high resolution framebuffer console on the Radeon chipset and
        a direct rendering manager which greatly improves the
        performance of OpenGL 3D applications under X11.
      </para>

      <section id="sect-kernel-gfx-fbcon">
        <title>Framebuffer Console</title>
        <para>
          To enable the high resolution framebuffer console you need
          the kernel options mentioned below.  The CONFIG_LOGO*
          options gives you a <ulink
          url="http://www.isc.tamu.edu/~lewing/linux/">Tux</ulink>
          logo in the upper left corner of the screen while booting.

          <itemizedlist>
            <listitem>
              <para>
                Support for frame buffer devices (CONFIG_FB)
              </para>
            </listitem>
            <listitem>
              <para>
                ATI Radeon display support (CONFIG_FB_RADEON)
              </para>
            </listitem>
            <listitem>
              <para>
                DDC/I2C for ATI Radeon support (CONFIG_FB_RADEON_I2C)
              </para>
            </listitem>
            <listitem>
              <para>
                Bootup logo (CONFIG_LOGO)
              </para>
            </listitem>
            <listitem>
              <para>
                Standard 224-color Linux logo
                (CONFIG_LOGO_LINUX_CLUT224)
              </para>
            </listitem>
            <listitem>
              <para>
                Video mode selection support (CONFIG_VIDEO_SELECT)
              </para>
            </listitem>
            <listitem>
              <para>
                Framebuffer Console support
                (CONFIG_FRAMEBUFFER_CONSOLE)
              </para>
            </listitem>
          </itemizedlist>
        </para>
        <para>
          To actually use the high resolution framebuffer you need to
          pass a <option>vga=</option> option to the kernel at boot
          time like the one shown in <xref
          linkend="fig-kernel-gfx-fbcon-boot" />.  For more information
          see the documentation for the kernel and your boot loader.

          <figure id="fig-kernel-gfx-fbcon-boot">
            <title>1024x768 24bpp Framebuffer Configuration</title>
<programlisting>
vga=792
</programlisting>
          </figure>
        </para>
      </section>

      <section id="sect-kernel-drm">
        <title>Direct Rendering</title>
        <para>
          To enable the direct rendering manager you need the kernel
          options listed below.  The X11 specific configuration is
          covered in <xref linkend="sect-x11" />.

          <itemizedlist>
            <listitem>
               <para>
                 /dev/agpgart (AGP Support) (CONFIG_AGP)
              </para>
            </listitem>
            <listitem>
               <para>
                 Intel 440LX/BX/GX, I8xx and E7x05 chipset support
                 (CONFIG_AGP_INTEL)
              </para>
            </listitem>
            <listitem>
               <para>
                 Direct Rendering Manager (XFree86 4.1.0 and higher DRI
                 support) (CONFIG_DRM)
              </para>
            </listitem>
            <listitem>
               <para>
                 ATI Radeon (CONFIG_DRM_RADEON)
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </section>
    </section>

    <section id="sect-kernel-pm">
      <title>Power Management</title>
      <para>
        You have two choices when it comes to power management for the
        X31: the older Advanced Power Management, APM, or the newer
        and more modern Advanced Configuration and Power Interface,
        ACPI.
      </para>

      <section id="sect-kernel-pm-apm">
        <title>APM</title>
        <para>
          To use APM you need to kernel options listed below.  You
          will also need <ulink
          url="http://www.worldvisions.ca/~apenwarr/apmd/">apmd</ulink>,
          the Linux APM Daemon.

          <itemizedlist>
            <listitem>
               <para>
                 Power Management support (CONFIG_PM)
              </para>
            </listitem>
            <listitem>
               <para>
                 APM (Advanced Power Management) BIOS support
                 (CONFIG_APM)
              </para>
            </listitem>
            <listitem>
               <para>
                 Enable PM at boot time (CONFIG_APM_DO_ENABLE)
              </para>
            </listitem>
            <listitem>
               <para>
                 Make CPU Idle calls when idle (CONFIG_APM_CPU_IDLE)
              </para>
            </listitem>
            <listitem>
               <para>
                 Enable console blanking using APM
                 (CONFIG_APM_DISPLAY_BLANK)
              </para>
            </listitem>
            <listitem>
               <para>
                 RTC stores time in GMT (CONFIG_APM_RTC_IS_GMT)
              </para>
            </listitem>
            <listitem>
               <para>
                 Allow interrupts during APM BIOS calls
               (CONFIG_APM_ALLOW_INTS)
              </para>
            </listitem>
          </itemizedlist>
        </para>

        <section id="sect-kernel-pm-apm-suspend">
          <title>APM Suspend</title>
          <para>
            You can make the X31 enter standby mode by pressing
            <keycap>Fn</keycap>+<keycap>F3</keycap>.  Pressing
            <keycap>Fn</keycap>+<keycap>F4</keycap> will make the X31
            suspend to RAM.
          </para>

          <para>
            You can use the <ulink
            url="http://samba.org/junkcode/#tphdisk">tphdisk</ulink>
            utility to create a <filename>save2dsk.bin</filename>
            hibernation file on a primary, hidden FAT16 partition.
            You should then be able to make the X31 suspend to disk by
            pressing <keycap>Fn</keycap>+<keycap>F12</keycap>.
          </para>
        </section>
      </section>

      <section id="sect-kernel-pm-acpi">
        <title>ACPI</title>
        <para>
          To use ACPI you will need the kernel options listed below
          instead of the ones listed in <xref
          linkend="sect-kernel-pm-apm" />.  You will also need <ulink
          url="http://acpid.sourceforge.net">acpid</ulink>, the Linux
          ACPI Daemon.

          <itemizedlist>
            <listitem>
              <para>
                Power Management support (CONFIG_PM)
              </para>
            </listitem>
            <listitem>
              <para>
                ACPI Support (CONFIG_ACPI)
              </para>
            </listitem>
            <listitem>
              <para>
                AC Adapter (CONFIG_ACPI_AC)
              </para>
            </listitem>
            <listitem>
              <para>
                Battery (CONFIG_ACPI_BATTERY)
              </para>
            </listitem>
            <listitem>
              <para>
                Button (CONFIG_ACPI_BUTTON)
              </para>
            </listitem>
            <listitem>
              <para>
                Processor (CONFIG_ACPI_PROCESSOR)
              </para>
            </listitem>
            <listitem>
              <para>
                Thermal Zone (CONFIG_ACPI_THERMAL)
              </para>
            </listitem>
            <listitem>
              <para>
                Power Management Timer Support (CONFIG_X86_PM_TIMER)
              </para>
            </listitem>
          </itemizedlist>
        </para>

        <section id="sect-kernel-pm-acpi-suspend">
          <title>ACPI Suspend</title>

          <warning>
            <para>
              The ACPI implementation of the Linux kernel is still not
              complete.  Most notably the LCD back-light stays lit
              during a suspend. Proceed at your own risk.
            </para>
          </warning>

          <para>
            You can make the X31 enter standby mode using the command
            <command>echo -n standby > /sys/power/state</command>.  To
            make the X31 suspend to RAM you use the command
            <command>echo -n mem > /sys/power/state</command>.
          </para>
          <para>
            Suspend to disk under ACPI can be achieved using the kernel
            options listed below.  You should then be able to make the
            X31 suspend to disk using the command <command>echo -n
            disk > /sys/power/state</command>.

            <itemizedlist>
              <listitem>
                <para>
                  Power Management support (CONFIG_PM)
                </para>
              </listitem>
              <listitem>
                <para>
                  Software Suspend (CONFIG_SOFTWARE_SUSPEND)
                </para>
              </listitem>
            </itemizedlist>
          </para>
          <para>
            To tell the kernel which swap partition to read the memory
            dump from at boot time you need need to pass a
            <option>resume=</option> option to the kernel like the one
            shown in <xref linkend="fig-kernel-pm-acpi-suspend-boot"
            />.  For more information see the documentation for the
            kernel and your boot loader.

            <figure id="fig-kernel-pm-acpi-suspend-boot">
              <title>Suspend to disk configuration with swap on /dev/hda2</title>
<programlisting>
resume=/dev/hda2
</programlisting>
            </figure>
          </para>
        </section>
      </section>

      <section id="sect-kernel-pm-cpufreq">
        <title>CPU Frequency Scaling</title>
        <para>

          To enable the dynamic frequency scaling of the Centrino
          chipset you need the kernel options listed below.  The CPU
          frequency can then be adjusted through the
          <filename>/sys/devices/system/cpu/cpu0/cpufreq/</filename>
          interface.  You will need a user-space utility such as
          <ulink
          url="http://www.goop.org/~jeremy/speedfreq/">speedfreq</ulink>
          if you wish to automate the frequency scaling.

          <itemizedlist>
            <listitem>
               <para>
                 CPU Frequency scaling (CONFIG_CPU_FREQ)
              </para>
            </listitem>
            <listitem>
               <para>
                 'performance' governor
                 (CONFIG_CPU_FREQ_GOV_PERFORMANCE)
              </para>
            </listitem>
            <listitem>
               <para>
                 'powersave' governor (CONFIG_CPU_FREQ_GOV_POWERSAVE)
              </para>
            </listitem>
            <listitem>
               <para>
                 'userspace' governor for userspace frequency scaling
                 (CONFIG_CPU_FREQ_GOV_USERSPACE)
              </para>
            </listitem>
            <listitem>
               <para>
                 'ondemand' cpufreq policy governor
                 (CONFIG_CPU_FREQ_GOV_ONDEMAND)
              </para>
            </listitem>
            <listitem>
               <para>
                 CPU frequency table helpers (CONFIG_CPU_FREQ_TABLE)
              </para>
            </listitem>
            <listitem>
               <para>
                 Intel Enhanced SpeedStep
                 (CONFIG_X86_SPEEDSTEP_CENTRINO)
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </section>
    </section>

    <section id="sect-kernel-usb">
      <title>USB Ports</title>
      <para>
        To enable the USB ports of the X31 you need the kernel options
        listed below along with drivers for the devices you plan to
        attach.

        <itemizedlist>
          <listitem>
            <para>
              Support for Host-side USB (CONFIG_USB)
            </para>
          </listitem>
          <listitem>
            <para>
              EHCI HCD (USB 2.0) support (CONFIG_USB_EHCI_HCD)
            </para>
          </listitem>
          <listitem>
            <para>
              UHCI HCD (most Intel and VIA) support
              (CONFIG_USB_UHCI_HCD)
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="sect-kernel-firewire">
      <title>FireWire</title>
      <para>
        The <ulink
        url="http://www.apple.com/firewire/">FireWire</ulink>
        controller of the X31 supports the Open Host Controller
        Interface, OHCI.  To enable it you need the kernel options
        listed below along with drivers for the devices you plan to
        attach.

        <itemizedlist>
          <listitem>
            <para>
              IEEE 1394 (FireWire) support (CONFIG_IEEE1394)
            </para>
          </listitem>
          <listitem>
            <para>
              OHCI-1394 support (CONFIG_IEEE1394_OHCI1394)
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="sect-kernel-irda">
      <title>Infrared Port</title>
      <para>
        To use the FIR port, a Fast Infrared port, of the X31 you need
        at least the kernel options listed below.  You may want to
        enable higher level IrDA protocols such as the IrCOMM protocol
        (CONFIG_IRCOMM) which implements serial port emulation.  You
        will need the irda-utils software package from <ulink
        url="http://irda.sourceforge.net">The Linux IrDA
        Project</ulink>.

        <itemizedlist>
          <listitem>
            <para>
              IrDA (infrared) subsystem support (CONFIG_IRDA)
              <emphasis role="module">[module]</emphasis>
            </para>
          </listitem>
          <listitem>
            <para>
              NSC PC87108/PC87338 (CONFIG_NSC_FIR) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
        </itemizedlist>
      </para>
      <para>
        To have the kernel module recognize the hardware correctly you
        need to add the contents of <xref linkend="fig-kernel-irda-modules-conf"
        /> to <filename>/etc/modules.conf</filename>.

        <figure id="fig-kernel-irda-modules-conf">
          <title>Infrared port related entries in /etc/modules.conf</title>
<programlisting>
alias irda0 nsc-ircc
options nsc-ircc dongle_id=0x9
</programlisting>
        </figure>
      </para>

      <note>
        <para>
          If you have enabled 8250/16550 and compatible serial support
          (CONFIG_SERIAL_8250) in the kernel you may have to add the
          line <option>pre-install nsc-ircc /bin/setserial /dev/ttyS1
          uart none</option> to <filename>/etc/modules.conf</filename>
          to disable the serial driver for the infrared port.
        </para>
      </note>
    </section>

    <section id="sect-kernel-parallel">
      <title>Parallel Port</title>
      <para>
        To enable the parallel port of the X31 you will need to kernel
        options listed below.

        <itemizedlist>
          <listitem>
            <para>
              Parallel port support (CONFIG_PARPORT) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
          <listitem>
            <para>
              PC-style hardware (CONFIG_PARPORT_PC) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
        </itemizedlist>
      </para>
      <para>
        To have the kernel module automatically loaded when needed you
        should add the contents of <xref
        linkend="fig-kernel-parallel-modules-conf" /> to
        <filename>/etc/modules.conf</filename>.

        <figure id="fig-kernel-parallel-modules-conf">
          <title>Parallel port related entries in /etc/modules.conf</title>
<programlisting>
alias parport_lowlevel parport_pc
</programlisting>
        </figure>
      </para>
    </section>

    <section id="sect-kernel-pcmcia">
      <title>CardBus Slot</title>
      <para>
        To enable the CardBus slot of the X31 you need the kernel
        options listed below along with drivers for the cards you plan
        to insert.  You will need the <ulink
        url="http://pcmcia-cs.sourceforge.net">pcmcia-cs</ulink>
        user-space utilities for automatically loading the required
        drivers upon card insertion.

        <itemizedlist>
          <listitem>
            <para>
              Support for hot-pluggable devices (CONFIG_HOTPLUG)
            </para>
          </listitem>
          <listitem>
            <para>
              PCMCIA/CardBus support (CONFIG_PCMCIA) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
          <listitem>
            <para>
              CardBus yenta-compatible bridge support (CONFIG_YENTA)
              <emphasis role="module">[module]</emphasis>
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="sect-kernel-cf">
      <title>Compact Flash Slot</title>
      <para>
        The Compact Flash reader of the X31 is connected to the CardBus
        controller.  Apart from the requirements listed in <xref
        linkend="sect-kernel-pcmcia" /> you will need a device driver
        for your Compact Flash card.  For storage devices you will need
        the following kernel option.

        <itemizedlist>
          <listitem>
            <para>
              PCMCIA IDE support (CONFIG_BLK_DEV_IDECS) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="sect-kernel-eth">
      <title>Ethernet</title>
      <para>
        There are two drivers supporting the ethernet card of the X31:
        The <ulink
        url="http://sourceforge.net/projects/e1000">e100</ulink>
        driver written by <ulink url="">Intel</ulink> and the <ulink
        url="http://www.scyld.com/network/eepro100.html">eepro100</ulink>
        driver written by Donald Becker.  Both are included in the
        Linux kernel.
      </para>

      <section id="sect-kernel-eth-e100">
        <title>E100 Driver</title>
        <para>
          To use the e100 driver written by Intel you need the kernel
          options listed below:

          <itemizedlist>
            <listitem>
              <para>
                Ethernet (10 or 100Mbit) (CONFIG_NET_ETHERNET)
              </para>
            </listitem>
            <listitem>
              <para>
                EISA, VLB, PCI and on board controllers
                (CONFIG_NET_PCI)
              </para>
            </listitem>
            <listitem>
              <para>
                Intel(R) PRO/100+ support (CONFIG_E100)
              </para>
            </listitem>
            <listitem>
              <para>
                Use Rx Polling (NAPI) (CONFIG_E100_NAPI)
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </section>

      <section id="sect-kernel-eth-eepro100">
        <title>EEPRO100 Driver</title>
        <para>
          To use the eepro100 driver written by Donald Becker you need
          the kernel options listed below instead of the ones listed
          in <xref linkend="sect-kernel-eth-e100" />:

          <itemizedlist>
            <listitem>
              <para>
                Ethernet (10 or 100Mbit) (CONFIG_NET_ETHERNET)
              </para>
            </listitem>
            <listitem>
              <para>
                EISA, VLB, PCI and on board controllers
                (CONFIG_NET_PCI)
              </para>
            </listitem>
            <listitem>
              <para>
                EtherExpressPro/100 support (eepro100, original Becker
                driver) (CONFIG_EEPRO100)
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </section>
    </section>

    <section id="sect-kernel-wifi">
      <title>Wireless Network</title>
      <para>
        The kernel does not yet support the Intel PRO/Wireless 2100
        Network Connection mini PCI adapter, but <ulink
        url="http://www.intel.com">Intel</ulink> has started an open
        source driver project for it.
      </para>
      <para>
        Apart from the <ulink
        url="http://ipw2100.sourceforge.net">ipw2100</ulink> driver
        itself you will need the <ulink
        url="http://linux-hotplug.sourceforge.net">Linux hotplug
        scripts</ulink> for loading the firmware of the IPW2100 and
        the <ulink
        url="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html">wireless-tools</ulink>
        for setting up the connection.
      </para>
      <para>
        The ipw2100 driver depends on the kernel options listed below.

        <itemizedlist>
          <listitem>
            <para>
              Hotplug firmware loading support (CONFIG_FW_LOADER)
              <emphasis role="module">[module]</emphasis>
            </para>
          </listitem>
          <listitem>
            <para>
              Wireless LAN drivers (non-hamradio) &amp; Wireless
              Extensions (CONFIG_NET_RADIO)
            </para>
          </listitem>
          <listitem>
            <para>
              Cryptographic API (CONFIG_CRYPTO)
            </para>
          </listitem>
          <listitem>
            <para>
              ARC4 cipher algorithm (CONFIG_CRYPTO_ARC4) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
          <listitem>
            <para>
              Michael MIC keyed digest algorithm
              (CONFIG_CRYPTO_MICHAEL_MIC) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
          <listitem>
            <para>
              AES cipher algorithms (i586) (CONFIG_CRYPTO_AES_586)
              <emphasis role="module">[module]</emphasis>
            </para>
          </listitem>
          <listitem>
            <para>
              CRC32 functions (CONFIG_CRC32) <emphasis
              role="module">[module]</emphasis>
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="sect-kernel-sound">
      <title>Sound Card</title>
      <para>
        There are two different drivers supporting the sound card of
        the X31: The <ulink url="http://www.alsa-project.org">Advanced
        Linux Sound Architecture</ulink>, ALSA, and the deprecated
        <ulink url="http://www.opensound.com/oss.html">Open Sound
        System</ulink>, OSS.
      </para>

      <section id="sect-kernel-sound-alsa">
        <title>ALSA Driver</title>
        <para>
          To use the ALSA driver for the sound card you need the kernel
          options listed below.  They include a backwards compatible
          OSS API enabling legacy applications which has yet to be
          ported to the ALSA API to function correctly.  You will also
          need the alsa-utils software package from <ulink
          url="http://www.alsa-project.org">The ALSA Project</ulink>.

          <itemizedlist>
            <listitem>
              <para>
                Sound card support (CONFIG_SOUND) <emphasis
                role="module">[module]</emphasis>
              </para>
            </listitem>
            <listitem>
              <para>
                Advanced Linux Sound Architecture (CONFIG_SND)
                <emphasis role="module">[module]</emphasis>
              </para>
            </listitem>
            <listitem>
              <para>
                OSS Mixer API (CONFIG_SND_MIXER_OSS) <emphasis
                role="module">[module]</emphasis>
              </para>
            </listitem>
            <listitem>
              <para>
                OSS PCM (digital audio) API (CONFIG_SND_PCM_OSS)
                <emphasis role="module">[module]</emphasis>
              </para>
            </listitem>
            <listitem>
              <para>
                RTC Timer support (CONFIG_SND_RTCTIMER) <emphasis
                role="module">[module]</emphasis>
              </para>
            </listitem>
            <listitem>
              <para>
                Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio;
                AMD768/8111 (CONFIG_SND_INTEL8X0) <emphasis
                role="module">[module]</emphasis>
              </para>
            </listitem>
          </itemizedlist>
        </para>
        <para>
        To have the alsa-utils load the correct modules you need to
        add the contents of <xref
        linkend="fig-kernel-sound-alsa-modules-conf" /> to
        <filename>/etc/modules.conf</filename>.

          <figure id="fig-kernel-sound-alsa-modules-conf">
            <title>ALSA related entries in /etc/modules.conf</title>
<programlisting>
alias char-major-116 snd
alias char-major-14 soundcore

alias snd-card-0 snd-intel8x0

alias sound-slot-0 snd-card-0

alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

options snd cards_limit=1
</programlisting>
          </figure>
        </para>
      </section>

      <section id="sect-kernel-sound-oss">
        <title>OSS Driver</title>
        <para>
          To use the deprecated OSS driver for the sound card you need
          the kernel options listed below instead of the ones listed
          in <xref linkend="sect-kernel-sound-alsa" />.

          <itemizedlist>
            <listitem>
              <para>
                Sound card support (CONFIG_SOUND)
              </para>
            </listitem>
            <listitem>
              <para>
                Open Sound System (DEPRECATED) (CONFIG_SOUND_PRIME)
              </para>
            </listitem>
            <listitem>
              <para>
                Intel ICH (i8xx) audio support (CONFIG_SOUND_ICH)
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </section>

      <section id="sect-kernel-sound-pcspeaker">
        <title>PC Speaker</title>
        <para>
          While technically the PC speaker isn't part of the sound card
          I have listed it here for completeness sake.  To enable the
          PC speaker you need the kernel options listed below.

          <itemizedlist>
            <listitem>
              <para>
                Misc (CONFIG_INPUT_MISC)
              </para>
            </listitem>
            <listitem>
              <para>
                PC Speaker support (CONFIG_INPUT_PCSPKR)
              </para>
            </listitem>
          </itemizedlist>
        </para>
      </section>

    </section>

    <section id="sect-kernel-modem">
      <title>Modem</title>
      <para>
        There are two drivers supporting the modem of the X31: the
        proprietary <ulink url="http://www.smlink.com">Smart
        Link</ulink> driver or the experimental in-kernel ALSA driver.
      </para>

      <section id="sect-kernel-modem-sl">
        <title>Smart Link Driver</title>
        <para>
          To use the proprietary Smart Link modem driver under kernel
          2.6.x you need the latest beta version of the <ulink
          url="http://www.smlink.com/main/index1.php?ln=en&amp;main_id=32">Smart
          Link Linux drivers</ulink>.
        </para>
      </section>

      <section id="sect-kernel-modem-alsa">
        <title>ALSA Driver</title>
        <para>
          To use the ALSA driver instead of the proprietary Smart Link
          driver you need the kernel option listed below (see <xref
          linkend="sect-kernel-sound-alsa" /> for more information on
          ALSA kernel options).  You will still need the open source
          <command>slmodemd</command> application from the Smart Link
          driver.

          <itemizedlist>
            <listitem>
              <para>
                Intel i8x0/MX440; AMD768/8111 modems (EXPERIMENTAL)
                (CONFIG_SND_INTEL8X0M) <emphasis
                role="module">[module]</emphasis>
              </para>
            </listitem>
          </itemizedlist>
        </para>
        <para>
          To have the alsa-utils load the correct module for the modem
          you need to add the contents of <xref
          linkend="fig-kernel-modem-alsa-modules-conf" /> to
          <filename>/etc/modules.conf</filename>.

          <figure id="fig-kernel-modem-alsa-modules-conf">
            <title>ALSA modem related entries in /etc/modules.conf</title>
<programlisting>
alias snd-card-1 snd-intel8x0m

options snd cards_limit=2
</programlisting>
          </figure>
        </para>
      </section>
    </section>

    <section id="sect-kernel-trackpoint">
      <title>Trackpoint Mouse</title>
      <para>
        The Trackpoint mouse is connected to an internal PS/2
        controller.  To enable it you need the kernel options listed
        below.  The device will be called
        <filename>/dev/input/mouse0</filename>.  A common device for
        all mice is available as <filename>/dev/input/mice</filename>
        which replaces the legacy device
        <filename>/dev/psaux</filename>.

        <itemizedlist>
          <listitem>
            <para>
              Mouse interface (CONFIG_INPUT_MOUSEDEV)
            </para>
          </listitem>
          <listitem>
            <para>
              Mice (CONFIG_INPUT_MOUSE)
            </para>
          </listitem>
          <listitem>
            <para>
              PS/2 mouse (CONFIG_MOUSE_PS2)
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="sect-kernel-buttons">
      <title>ThinkPad Buttons</title>
      <para>
        The state of the ThinkPad specific buttons is reported through
        a non-volatile RAM chip.  To enable the buttons you need the
        kernel option listed below.  You will also need the <ulink
        url="http://www.nongnu.org/tpb/">tpb</ulink> utility.

        <itemizedlist>
          <listitem>
            <para>
              /dev/nvram support (CONFIG_NVRAM)
            </para>
          </listitem>
        </itemizedlist>
      </para>
      <para>
        To use the ThinkPad specific buttons under ACPI you'll need
        the experimental <ulink
        url="http://ibm-acpi.sourceforge.net">ibm-acpi</ulink>
        module.
      </para>
    </section>

    <section id="sect-kernel-tcpa">
      <title>IBM Security Chip</title>
      <para>
        The IBM Security Chip, a <ulink
        url="http://www.trustedcomputing.org">TCPA</ulink> chip, is
        not supported by the kernel.  IBM has released an open source
        <ulink url="http://www.research.ibm.com/gsal/tcpa/">TCPA
        driver for Linux</ulink>, which I have yet to try out.

      </para>
    </section>
  </section>

  <section id="sect-x11">
    <title>X11 Configuration</title>
    <para>
      This section describes how to configure <ulink
      url="http://www.freedesktop.org/XOrg">X11R6.8.0</ulink> to work
      with the hardware of the X31.
    </para>

    <section id="sect-x11-config">
      <title>Configuration File</title>
      <para>
        The configuration listed in <xref
        linkend="fig-x11-config-file" /> includes a setup for
        Multihead and Xinerama.  Uncomment the appropriate
        <option>DefaultServerLayout</option> in the
        <option>ServerFlags</option> section if you wish to enable it.
      </para>
      <para>
        You will need to adjust the <option>CRT2HSync</option> and
        <option>CRT2VRefresh</option> options for the external monitor
        according to it's specifications.

        <figure id="fig-x11-config-file">
          <title>Contents of /etc/X11/xorg.conf</title>
<programlisting>
# /etc/X11/xorg.conf
#
# 2004-09-12 Henrik Brix Andersen
#
#       Notes:
#       * Config for the X.Org Foundation X11R6.8.0 release
#
#       Hardware:
#       * IBM Thinkpad X31


Section "Files"
        # location of RGB database
        RgbPath         "/usr/X11R6/lib/X11/rgb"

        # local font server on unix socket
        FontPath        "unix/:-1"
EndSection


Section "ServerFlags"
        # using acpi-enabled kernel - /dev/apm_bios not present
        Option          "PM" "off"
EndSection


Section "Module"
        Load            "dbe"           # double-buffering extension
        Load            "extmod"        # commonly used server extensions
#        Load            "fbdevhw"       # functions for talking to framebuffer device
        Load            "dri"           # direct rendering infrastructure
        Load            "glx"           # OpenGL X protocol interface

        Load            "v4l"           # video4linux

        Load            "record"        # Xevent recorder

        # following two modules needed if not running xfs
        #Load            "freetype"     # freetype font rasterer
        #Load            "type1"        # type 1 font rasterer
EndSection


Section "Extensions"
        Option          "Composite" "on"
EndSection


Section "InputDevice"
        Identifier      "Keyboard"
        Driver          "kbd"

        # the microsoftinet model has support for the
        # forward/backward buttons
        Option          "XkbModel" "microsoftinet"
        Option          "XkbLayout" "dk"
EndSection


Section "InputDevice"
        Identifier      "Mice"
        Driver          "mouse"

        Option          "Device" "/dev/input/mice"
        Option          "Protocol" "Auto"
        Option          "Emulate3Buttons" "off"
        Option          "ZAxisMapping" "4 5"
EndSection


Section "Device"
        Identifier      "ATI Radeon"
        Driver          "radeon"
        VendorName      "ATI Technologies Inc"
        BoardName       "Radeon Mobility M6 LY"

        Option          "AGPMode" "4"
        Option          "AGPFastWrite" "on"
        Option          "EnablePageFlip" "on"
        Option          "RenderAccel" "on"
        Option          "DynamicClocks" "on"

        # enable radeon specific xinerama
#        Option          "MergedFB" "on"
        Option          "MergedFB" "off"

        # external monitor timings
        Option          "CRT2HSync" "30.0-68.0"
        Option          "CRT2VRefresh" "50.0-110.0"

        Option          "CRT2Position" "Clone"
#        Option          "CRT2Position" "LeftOf"
#        Option          "CRT2Position" "RightOf"
#        Option          "CRT2Position" "Above"
#        Option          "CRT2Position" "Below"
EndSection


Section "Monitor"
        Identifier      "Monitor"
        VendorName      "Unknown"
        ModelName       "Unknown"

        # comment this out when using MergedFB
        DisplaySize     245 185

        Option          "dpms"
EndSection


Section "Screen"
        Identifier      "Screen"
        Device          "ATI Radeon"
        Monitor         "Monitor"
        DefaultDepth    24

        Subsection "Display"
                Depth           24
                Modes           "1024x768" "800x600" "640x480"

                # uncomment this for MergedFB
#                Virtual         1024 1536
        EndSubsection
EndSection


Section "ServerLayout"
	Identifier      "ServerLayout"

        Screen          "Screen"
        InputDevice     "Mice" "CorePointer"
        InputDevice     "Keyboard" "CoreKeyboard"
EndSection


Section "DRI"
        Mode            0666
EndSection
</programlisting>
        </figure>
      </para>
    </section>
  </section>


  <section id="sect-conclusion">
    <title>Conclusion</title>
    <para>
      All the hardware of the IBM ThinkPad X31 (perhaps except for the
      IBM Security Chip?) works perfectly well with GNU/Linux.  Given
      the instructions in this HOWTO it should be pretty straight
      forward to set up the kernel and X11 as long as you have a bit
      of experience with GNU/Linux.
    </para>
  </section>

  <section id="sect-links">
    <title>Related Links</title>
    <para>
      This section contains a list of hopefully helpful links to
      various documentation related to the X31 and/or GNU/Linux which
      I've collected during the the writing of this document.
    </para>

    <itemizedlist>
      <title>Official IBM Documentation</title>
      <listitem>
        <para>
          <ulink
          url="http://www-307.ibm.com/pc/support/site.wss/quickPath.do?quickPathEntry=2672xxh"><citetitle>ThinkPad
          X31 2672-XXH Support</citetitle></ulink>: Official support
          page for IBM ThinkPad X31 type 2672-XXH.
        </para>
      </listitem>
      <listitem>
        <para>
          <ulink
          url="http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-44018"><citetitle>Hardware
          Maintenance Manual - ThinkPad X30, X31</citetitle></ulink>:
          The official maintenance manual for the X31.
        </para>
      </listitem>
      <listitem>
        <para>
          <ulink
          url="http://www-1.ibm.com/support/docview.wss?rs=0&amp;q1=2672-cxu&amp;uid=psg1MIGR-44049&amp;loc=en_US&amp;cs=utf-8&amp;cc=us&amp;lang=en"><citetitle>System
          FRU parts list - ThinkPad X30, X31</citetitle></ulink>: The
          official list of Field Replaceable Units in the X31.
        </para>
      </listitem>
      <listitem>
        <para>
          <ulink
          url="http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-42883"><citetitle>Function
          (Fn) key combinations - ThinkPad X30,
          X31</citetitle></ulink>: A list of the function key
          combinations.
        </para>
      </listitem>
      <listitem>
        <para>
          <ulink
          url="http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-50944"><citetitle>
          Extending battery life</citetitle></ulink>: Official hints
          for extending the battery life of your ThinkPad.
        </para>
      </listitem>
    </itemizedlist>

    <itemizedlist>
      <title>Mailing Lists</title>
      <listitem>
        <para>
          <ulink
          url="http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad"><citetitle>Linux-ThinkPad
          </citetitle></ulink>: A mailing list for users of GNU/Linux
          on IBM ThinkPads.
        </para>
      </listitem>
      <listitem>
        <para>
          <ulink
          url="http://www.theshire.org/mailman/listinfo/linux31"><citetitle>Linux31</citetitle></ulink>:
          A mailing list for using GNU/Linux on the IBM ThinkPad X31.
        </para>
      </listitem>
    </itemizedlist>

    <itemizedlist>
      <title>Miscellaneous</title>
      <listitem>
        <para>
          <ulink
          url="http://www.aaltonen.us/forums/viewtopic.php?t=792"><citetitle>Unofficial
          IBM ThinkPad X31 FAQ</citetitle></ulink>: Frequently asked
          questions about the X31.
        </para>
      </listitem>
      <listitem>
        <para>
          <ulink
          url="http://lkml.org/lkml/2004/6/13/69"><citetitle>Solution
          to the "1802: Unauthorized network card"
          problem</citetitle></ulink>: Vojtech Pavlik has written a
          small hack that allows to disable the miniPCI white-list
          check.
        </para>
      </listitem>
    </itemizedlist>

  </section>

</article>
