Sony Vaio PCG-C1MRX running Linux

I upgraded my VAIO PCG-C1XF Picturebook to the newer PCG-C1MRX model, running Redhat 7.2 Linux under a 2.4.18 kernel. The PCG-C1MRX is the Japanese keyboard version of Sony's half-height screen laptop and includes:

This particular model also comes equipped with 256meg RAM though a quick glance at the PhoenixBIOS Setup page indicates 16megs of that is nicked by the Crusoe's "code morphing" software.

As with my previous Picturebook, I still access the internet via ADSL attached to a Sony PCWA-A100 access point and PCWA-C100 wireless pcmcia card. Configuration notes for this rebranded lucent implementation of 802.11b and access point may be found here.

Following are working notes kept while I sorted the configuration. The main details should be relevant to any system, but note that some choices are simply personal preference.

Install Base OS

After burning the rh-7.2 iso images, I booted from CD using a Sony PCGA-CD5 PCMCIA CDROM. On various models of VAIO, this one included, you need to pass "ide2=0x180,0x386" as a kernel option in order for the drive to be accessible. Due to a buggy interaction between the alim15x3.c driver and recent Picturebooks, you will also need to pass "pci=conf2" or "pci=off" to avoid a system lockup during the installation. The pcg-c1mrx, pcg-c1mv and according to mail I received this week, the Fujitsu P series of notebook computers are affected by this. More on this below.

After booting the installation CD into a textmode installation with:

            text ide2=0x180,0x386 pci=conf2
        

the remainder of the install was a vanilla Redhat install. I'll spare you the details of the disk partitioning dance I did to get OpenBSD into a separate partition :-). I chose to wipe the disk clean and make this Linux/OpenBSD only but if you decide to preserve the preinstalled Windows XP parition, you have a few additional steps using FIPS and fdisk to split, shrink and relabel partitions appropriately. As many other Linux laptop install docs do cover this process, I will not go into that in any further detail here.

After installation, remember that you will either have to add an

            append="ide2=0x180,0x386 pci=conf2"
        

to the kernel entry in lilo.conf or remember to add it by hand when rebooting until the steps below are completed.

Kernel Lockup in alim15x3.c and DMA

In recent releases of the 2.4 kernels, including Redhat 7.2's default of 2.4.7-10 and version 2.4.18 to which I upgraded, there is a bug in the unmodified alim15x3.c driver initialization code where it outputs a configuration bitmap that locks-up the c1mrx. I adopted the simple, but (as it turns out) effective expedient of amputating the offending "write" with #ifdef:

           ;: pueo; pwd /usr/src/linux/drivers/ide ;: pueo; diff
           -c orig-alim15x3.c alim15x3.c *** orig-alim15x3.c     Mon
           Jul 16 08:22:23 2001 --- alim15x3.c  Tue Mar 26 12:36:15
           2002 *************** *** 574,579 **** --- 574,580 ----
                            * set south-bridge's enable bit, m1533,
                            0x79 */
                           pci_read_config_byte(isa_dev, 0x79,
                           &tmpbyte);
           + #if 0
                           if (m5229_revision == 0xC2) {
                                   /*
                                    * 1543C-B0 (m1533, 0x79, bit
                                    2)
           *************** *** 585,590 **** --- 586,593 ----
                                    */
                                   pci_write_config_byte(isa_dev,
                                   0x79, tmpbyte | 0x02);
                           }
           + #endif +
                           /*
                            * Ultra66 cable detection (from Host
                            View) * m5229, 0x4a, bit0: primary,
                            bit1: secondary 80 pin
           ;: pueo;
        

This is enough to allow the device to be initialize although the ide drive on the PCG-C1MRX and other affected laptops will still default to PIO mode. You need to add:

            /sbin/hdparm -d1 -X66 /dev/hda
        

to /etc/rc.d/rc.local file to activate DMA transfers.

The remainder of the 2.4.18 kernel was setup using this configuration file. However, if you are feeling bold, a 2.5.7 kernel configuration file that mostly works may be found here.

One last step after building the kernel is to add:

            append="idebus=50"
        

to the /etc/lilo.conf stanza for your new kernel. I have not yet had the chance to investigate why but it seems that without this, the driver code is assuming a default bus speed of 30 instead of 50.

PCMCIA

While the 2.4.X series kernels now integrate more of the PCMCIA support into the kernel, quite a few drivers remain (and likely will continue to do so) in the pcmcia-cs package.

As of this writing, the lastest pcmcia package is pcmcia-cs-3.1.33. Untar the package into /usr/src/linux and then:

                cd /usr/src/linux/pcmcia-cs-3.1.33 make config make
                all cd clients make make install cd ../wireless
                make make install rm /lib/modules/2.4.18/pcmcia/3c575_cb.o
                /lib/modules/2.4.18/pcmcia/apa1480_cb.o
                /lib/modules/2.4.18/pcmcia/eepro100_cb.o
                /lib/modules/2.4.18/pcmcia/epic_cb.o
                /lib/modules/2.4.18/pcmcia/memory_cb.o
                /lib/modules/2.4.18/pcmcia/serial_cb.o
                /lib/modules/2.4.18/pcmcia/tulip_cb.o depmod -a
                /etc/rc.d/init.d/pcmcia stop /etc/rc.d/init.d/pcmcia
                start
        

Notice that really questionable line where I removed a bunch of .o's that were just compiled and installed by "make install". I think there is a conflict between the kernel pcmcia configuration which I am using and the standalone package. I will probably resolve this by not using the kernel package for the time being but as everything I really need is working, this has not bubbled to the top of my list yet.

GPM

If you want both the built in "knob" mouse as well as any USB mouse that happen to be attached to work with gpm, your /etc/sysconfig/gpm should look something like this:

           # Additional options for gpm (e.g. acceleration), device
           OPTIONS="-tps2 -m/dev/input/mice -M" DEVICE="/dev/mouse"
        

Built-in Ethernet

The built-in ethernet worked right out of the box with the kernel config mentioned above.

USB

USB worked right out of the box with the kernel config mentioned above.

Sound

Sound worked right out of the box with the kernel config mentioned above. I have not tested this extensively but sound seemed fine for me. Others, on the c1-forum list, have reported poor sound quality. I will note that I am seeing some "read timeout" errors for the ac97 codec which I have not-yet investigated -- more to follow when I install the latest release of the ALSA package.

XFree86

After briefly struggling and failing to get the 4.1 release of XFree86 that comes with the RedHat 7.2 distribution to work, I decided to upgrade to XFree86 release 4.2. I did this manually the first time round but happily, you no longer have to go through that stage because RedHat have recently released a new beta (Skipjack 7.3) which has all the XFree86 rpm's you need. Grab kernel-drm-stub-4.1.0-0.ximian.1.i386.rpm from http://rpmfind.net and install with:

           rpm -i kernel-drm-stub-4.1.0-0.ximian.1.i386.rpm
        

and then gather the XFree86 .rpm's listed below into a directory and install with:

           rpm -U XFree86-4.2.0-6.47.i386.rpm
           XFree86-font-utils-4.2.0-6.47.i386.rpm
           XFree86-xfs-4.2.0-6.47.i386.rpm XFree86-libs-4.2.0-6.47.i386.rpm
           XFree86-devel-4.2.0-6.47.i386.rpm Glide3-20010520-12.i386.rpm
           XFree86-base-fonts-4.2.0-6.47.i386.rpm
           XFree86-100dpi-fonts-4.2.0-6.47.i386.rpm
           XFree86-75dpi-fonts-4.2.0-6.47.i386.rpm ttfonts-1.0-9.noarch.rpm
           freetype-2.0.9-1.i386.rpm freetype-devel-2.0.9-1.i386.rpm
        

I used the following XF86Config-4 configuration. I have not tried getting this working on a full-sized monitor yet so there is no configuration stanza for a screen at 1600. Note that this also includes configuration for a USB mouse which will work in parallel with the builtin "button" mouse anytime you happen to have one plugged into the system.

/dev/sonypi

Support for the Sony jogdial, camera and other Vaio specific features was quite primitive until the folks at Alcove Labs reverse engineered Sony's driver to produce a Linux driver. This driver provides a /dev/sonypi device file interface to the Sony Programmable I/O Control Device which manages a variety of functions on Vaio laptops including the "jogdial" and the "motion eye" built-in camera. This driver has been integrated into the official linux kernel since 2.4.7.

Detailed instructions on how to use this device along with pointers to some utilities are available by clicking on /dev/sonypi.

JOG dial

The Jogdial worked perfectly via the sonypi device driver. I used jogdiald but a search through google will reveal other utilities.

Camera

I do not have the camera working yet on the PCG-C1MRX either via the capture program or the sonypi device. For those eager to get started, please check with the following:

As with the sonypi driver, changes to video4linux driver were integrated into the official since 2.4.7. Information on configuration may be found on the video4linux driver page.

Alternatively, there is a user mode camera capture program available called capture which works with my pcg-c1xf and several other models of pcg-c1.

Bluetooth

I have managed to get the sonypi driver to turn the Bluetooth light on and off using spicctrl but still working my way through the configuration of the Bluez Bluetooth stack in the stock kernel. I am optimistic this will be working soon as many other Picturebooks with Bluetooth seem to already be working under Linux.

Suspend to Disk

To prepare the system for suspend-to-disk, you can use lphdisk to set up a suspend-to-disk partition. Alternatively, if you like playing russian roulette with you partition tables, there is the phdisk.exe utility from Phoenix Technologies, makers of the NoteBIOS used on this VAIO.

Unfortunately, suspension itself is still is not working. On first-pass, I have been able to see certain events (like lid opening) via the ACPI kernel code looking at device files beneath /proc/acpi and in a separate attempt, I managed to get some twitches of life from the APM kernel code but this is a work-in-progress.