jamie.lentin.co.uk

OQO Model 01+ and Debian (squeeze)

It's a very little, full featured PC.

The following page details some of the weirder bits you'd encounter whilst installing Debian (or another linux) on the OQO. If you need a more general guide on installing Debian, then I suggest going elsewhere first and come back for specifics.

If you have questions, best to start a thread on OQO Talk or Oqoasis and I should notice it.

Hardware

Replacing HDD

The HDD is a 1.8" Toshiba PATA disk, the same used in larger iPods. The connector is a Toshiba-specific 50-pin connector, as pictured on the left-hand side here. NB: It is not a ZIF connector, nor is it of the type in IBM X-series thinkpads. Removing these terms from ebay searches is quite useful.

The operation itself is reasonably simple:-

  1. Ensure all BIOS HDD performance options (transfer mode, etc) are turned down to standard. Mileage may vary, but some CF cards will not be detected, or the OQO will refuse to boot with, e.g. DMA on. Linux will renegotiate properly anyway so not worth the hassle.
  2. Remove battery & stylus, undo three torx screws (including warranty stickered one) with T6 driver. Cover should wiggle off.
  3. Unwrap blue rubber protector from HDD.
  4. Gently pull HDD from connector.

BIOS Setup

To enter the BIOS, press F2 (this is Fn then 2). Not much setup to do, although you have to tweak the boot order to be able to boot off USB key and install.

You can also switch which of the antennae (the lumps on the side of the case) is active.

Installation

Booting

The only tricky part of getting the install process going is booting the device, since it's PC-BIOS and no handy CD drive.

Any other steps will be the same as a normal computer.

Kernel

I'm using the mainline kernel (as of writing 2.6.30), various patches and config options are mentioned below, but this is the full .config, and all the patches can be found here. Hopefully in time most will become irrelevant.

GRUB

Whilst it works out of the box fine, I'd suggest making the default item in the list "Turn off again" so if the power button gets whacked in your pocket, no harm should be done. GRUB cannot turn the device off, so use Linux:-

 kernel /boot/vmlinuz root=/dev/hda1 ro vga=5 init=/sbin/poweroff

Graphics configuration

Xorg - siliconmotion

xserver-xorg-video-siliconmotion version 1.7.1 fully supports the device, including dualheading & rotation. Try the following config:-

  Section "Device"
	Identifier      "OQO VGA"
	Driver          "siliconmotion"
	Option "Dualhead"	"off" # Works, but get no H/W cursor
	Option "UseBIOS"	"off" # Otherwise no VT switching
	Option "PanelSize"	"800x480" # 1.7.0+ detect as 800x600 otherwise
	Option "Monitor-LVDS"	"OQO LCD"
	Option "Monitor-VGA"	"External Monitor"
	Option "AccelMethod"	"EXA" # Gets you acceleration when rotated
  EndSection

  Section "Monitor"
	Identifier      "OQO LCD"
  EndSection

  Section "Monitor"
	Identifier      "External Monitor"
	Option	"RightOf"	"OQO LCD"
	Option	"PreferredMode"	"1024x768"
  EndSection

  Section "Screen"
	Identifier	"Default Screen"
	Device		"OQO VGA"
	DefaultDepth	16
	SubSection "Display"
		Depth	16
		Virtual	1824 1248
	EndSubSection
  EndSection

xrandr should provide you with rotation and dualheading, I have the following script attached to my "video" key, screenrotate, which switches orientation as well as switching jogwheel direction and wacom rotation at the same time:-

#!/bin/bash
#screenrotate: switch between portrait/landscape

res=`xrandr | awk '/^LVDS connected/ {split($3,res,/x|\+/); print (res[1] > res[2]? "wide": "tall")}'`

if [ "$res" == "wide" ]; then
  xrandr -o right
  xmodmap -e 'pointer = 1 2 3 5 4'
  xsetwacom set Touchscreen Rotate cw
fi

if [ "$res" == "tall" ]; then
  xrandr -o normal
  xmodmap -e 'pointer = 1 2 3 4 5'
  xsetwacom set Touchscreen Rotate none
fi

Linux console

No native framebuffer driver for the siliconmotion chip, so it'd have to be a VESA driver. This I haven't tried, however you can get a text console filling the screen with the following kernel option:-

vga=5

Powersaving/ACPI configuration

CPU Frequency Scaling

Transmeta chips do this using their LongRun feature. Unlike other chips the frequency variation happens automatically---you choose a minimum & maximum frequency which the crusoe will jump between according to workload. The range can be set via. sysfs:-

 $ grep -E . /sys/devices/system/cpu/cpu0/cpufreq/scaling_*_freq
 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:1000000
 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:300000

Halving the maximum frequency will result in the device running a lot cooler. For more info, and to change the frequency profile, use the longrun userspace tool.

 # modprobe cpuid ; modprobe msr
 # longrun -l
   %   MHz  Volts  usage  SDR  DDR  PCI
   0   300  0.800  0.114   75  100   33
  28   500  0.950  0.267  100  125   33
  42   600  1.050  0.391  100  120   33
  71   800  1.150  0.626  114  133   33
  80   867  1.250  0.802  108  123   33
 100  1000  1.300  1.000  111  125   33
 # longrun -s 0 42 # Only allow chip to vary between lowest and half-power

Sleep States

As of 2.6.28.8, S3 works fine. Earlier versions would crash repeatedly, and then sometimes sleep. Do:-

  s2ram --force --vbe_save

uswsusp also works fine with recent kernels. Since the HDD is relatively slow, setting the image to be as small as possible increases hibernate speed dramatically. In /etc/uswsup.conf:-

  image size = 0

Kernels < 2.6.30 couldnt halt the device, see bug 13041. The EC access within the OQO DSDT's _GTS method has no hope of working, but windows doesn't test this. Newer kernels no longer call _GTS by default.

Input devices

Keyboard

The keyboard tries to be a standard PS/2 keyboard, but fails in several places.

The Video/Mute/WiFi keys report a different scancode when they mean to say the key is being released---this is fixed by this patch which is found in 2.6.32 onwards.

PgUp/PgDn/Home/End are mapped to numeric keypad keys, not PgUp, etc. This generally works fine, but shift-PgUp results in "9", rather than scrolling upwards in an xterm/console/whatever. The keymap oqo.kbdmap can be applied to help both the above using input-kbd (aptitude install input-utils). I trigger the running using udev and the following rule:-

  SUBSYSTEM=="input", ATTRS{name}=="AT Translated Set 2 keyboard", \
    KERNEL=="event[0-9]", RUN+="/bin/input-kbd -f /etc/udev/oqo.kbdmap %n"

Unmarked firmware key-combinations

The OQO firmware also recognises a pile extra Fn-Ctrl commands, as mentioned here and here. NB: an OQO 01+ needs Ctrl pressed as well as Fn for most of these to work.

Trackpoint and Jog-wheel

The trackpoint & jogwheel works either with the trackpoint driver or the generic wheel mouse driver. The former gives you press-to-select and other trackpoint-specifics, the latter wheel events. Linux loads trackpoint by default, to suppress this edit / create a /etc/modprobe.d/oqo_hw.conf containing :-

  options psmouse proto=imps

NB: Initalising wheel mouse mode, then trackpoint mode results in a confused driver. It's possible that this would give full trackpoint support, but would mean a lot of changes to linuxes trackpoint driver.

Touchscreen

The touchscreen is a Wacom tablet sitting on /dev/ttyS0. This can be accessed via X11 using the following config:-

  Section "InputDevice"
      Identifier "Tablet"
      Driver "wacom"
      Option "Type" "stylus"
      Option "Device" "/dev/ttyS0"
      Option "ForceDevice" "ISDV4"
  EndSection

The touchscreen will also support erasers, etc., but the default pen doesn't have them. Config would be the same as any wacom tablet if you wanted it.

To calibrate, you need to provide values for the screen corners. Outside X11, use wacdump -f tpc /dev/ttyS0 to get X/Y co-ordinates for the screen corners, and add to the tablet section thus:-

      # Calibration values found with wacdump
      Option "TopX"           "200"
      Option "BottomX"        "11120"
      Option "TopY"           "0"
      Option "BottomY"        "6635"

Accelerometer

According to OQOTalk, this is a "STMicroelectronics LIS3L02AQ Inertial Sensor ("LIS3L02AQ","HAAAH 1N","KOR 434","E AFAF")". It seems to be attached to the ADC inputs of the embedded controller. Apply ec_dump.patch and you will see 4 bytes at 0x20 changing as you wobble the device, possibly 0x2A and 0x2B too. According to the EC datasheet, the ADC measures in 10-bit resolution.

Network configuration

Bluetooth

The bluetooth behaves like a regular USB dongle attached to the internal USB bus---should just work out of the box.

Firewire

Again, nothing unusual, just works.

Wi-fi - non WPA

The Wi-Fi is an Amtel 505a on an internal USB bus. There are currently 3 drivers available for it

To use at76c50x-usb, you will also need some firmware. install the non-free atmel-firmware package or go to http://thekelleys.org.uk/atmel/. Given this, it should largely work out of the box.

Wi-fi - WPA

In theory, at76c50x-usb should be able to do WPA encryption in software. However, the driver stops receiving frames at the Group key exchange stage. Is the firmware expecting to be able to decrypt them, and since it can't, ignoring them?

The official Atmel driver contains firmware (the 1.3 versions) in .h files that can do WPA in hardware. Experimental support for these firmwares was added to at76_usb, ported to at76c50x-usb without success. The port was also untested on a 505a anyway, so may need more work.

Other bits

Real-Time Clock

The realtime clock will currently not work via the kernel, you need to use the --directisa option (add to HWCLOCKPARS in /etc/init.d/hwclock*)

 # hwclock --show
 select() to /dev/rtc to wait for clock tick timed out
 # hwclock --show --directisa
 Sat 28 Mar 2009 22:01:53 GMT  -0.572465 seconds

This may be a result of HPET/RTC fights. Disabling HPET support shouldn't be harmful since there isn't one.

TSC clocksource

There is no HPET timer on the device (a fact that powertop whines about profusely), however the following patch seems to give you a stable TSC to use. I'm not sure how useful this is in comparison to HPET, or how safe it is.

--- a/drivers/acpi/processor_idle.c	2009-03-28 19:59:57.000000000 +0000
+++ b/drivers/acpi/processor_idle.c	2009-03-28 19:54:10.000000000 +0000
@@ -373,6 +373,9 @@ int acpi_processor_resume(struct acpi_de
 static int tsc_halts_in_c(int state)
 {
 	switch (boot_cpu_data.x86_vendor) {
+	case X86_VENDOR_TRANSMETA:
+		/* All Transmeta CPUs have a constant TSC */
+		return 0; 
 	case X86_VENDOR_AMD:
 		/*
 		 * AMD Fam10h TSC will tick in all

Hardware watchdog

The M7101 PMU has a built-in hardware watchdog---its the same chip as used in the Sun Netra T1. What use it is on the OQO, I've no idea. But thats not the point :)

 # modprobe alim7101_wdt use_gpio=1
 # dmesg | tail
 alim7101_wdt: WDT driver for ALi M7101 initialised. timeout=30 sec (nowayout=1)

Link-o-rama

Just in case it dissapears, here's what OQOTalk said about the innards:-

Anyway, I've managed to identify most of the parts I was interested in so I thought I'd list them here in case anyone else is interested, now or in the future. Note that this is a model 01+. Some of these markings are very small and/or faint, so it is possible that I misread some characters. The Bluetooth is provided by a CSR (www.csr.com) chip with the markings "BC219", "159BL","447AB". There seem to be two supporting chips. One appears to be marked "LW083A","TI 4AW","210L" and the other "SH1202","3c096" (with the 'c' circled making a copyright symbol),"4304". The mainboard is marked "PCB-9051-03-rev01". A few components are mounted on the back of the board, but they are only visible after the WLAN board and fan assembly are removed. Right behind the scroll wheel is a CY22393 (marked "CY22393FC","0531 A 02","636095"), which is a "Three-PLL Serial-Programmable Flash-Programmable Clock Generator" capable of generating clock signals up to 200MHz. Near that is an ICS-branded chip marked "CN420744A","0446","9248AG-192" and then the NEC µPD720101 USB 2.0 host controller (markings: "D720101F1","0529PUA08"). The Transmeta Crusoe CPU is also on this side of the board. Its markings are "5800N100021","301251","101568","0515","6507F -3","D10128.99". Parts visible once the panel under the screen is removed include the ALi M1535+ ("M1535+ A1","0444 TH07","XHH2QY00000F"), The Lynx3DM8+ ("SM722G8 AB 0436","MHL07 AF3FS","L F6DC"), and a National Semiconductor PC87591E ("2S442AB","cmNSC2000C2","PC87591E-VLB") LPC Mobile Embedded Controller. There is also an STMicroelectronics LIS3L02AQ Inertial Sensor ("LIS3L02AQ","HAAAH 1N","KOR 434","E AFAF"), which I assume is how the OQO detects "freefall" so it can shut off the hard drive. Finally, the battery that keeps the clock running is a Sanyo ML614 (3V 3.4mAh rechargeable Lithium, 1.4mm high, 6.8mm diameter).