Skip to content

How to run an up to date Linux on a XO 1.75

Lubomir Rintel edited this page Oct 16, 2018 · 4 revisions

Overview

The lr/olpc-xo175-for-upstream contains an octopus merge of the feature branches that were sent out for review already and a couple of hacks on top.

The ARM: dts: add OLPC XO 1.75 machine commit's message contains a good description of the current state. Notably, the machine's actual DT is not good enough and an appended DTB needs to be used instead. If you have development board different from what I have (less/more memory) or need different kernel parameters, edit arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts.

Build the kernel

  1. Check out the lr/olpc-xo175-for-upstream branch
  2. Configure: make ARCH=arm CROSS_COMPILE=arm-linux-gnu- olpc_xo175_defconfig
  3. Build make -j ARCH=arm CROSS_COMPILE=arm-linux-gnu-

Append the DTB to the image

You also need to change the zImage size to account for the appended DTB, otherwise it won't load:

# Append a FDT to a zImage and adjust the length header field so that OFW
# loads the full file into memory

flen() { printf "%08x" $(cat $* |wc -c) |sed 's/\(..\)\(..\)\(..\)\(..\)/\4\3 \2\1/'; }

BEFORE=$(flen arch/arm/boot/zImage)
AFTER=$(flen arch/arm/boot/zImage arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb)

cat arch/arm/boot/zImage arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb |xxd |
        sed "s/^\(00000020: .... .... .... .... .... ....\) $BEFORE/\1 $AFTER/" |
        xxd -r >arch/arm/boot/zImage-olpc

Prepare a SD card

(...or a USB storage for that matter. You'll just need to adjust the root= in the DTS.)

You need to have an active VFAT or EXT4 partition with /boot. It's easiest to have just a single large EXT4 partition. Note that I've seen OpenFirmware crash when dealing with some EXT4 features (don't remember the details, sorry). I recommend you disable them: mkfs.ext4 -O ^64bit,^extent /dev/mmcblk0p1

Copy your favorite Linux distro to the SD card and place the built kernel with DTB appended into /boot: cp arch/arm/boot/zImage-olpc /mnt/boot/zImage.

Prepare the boot script:

$ cat >/mnt/boot/olpc.fth <<EOF
\ OLPC XO-1.75 boot script

visible unfreeze   \ Enable the DCON
" last:\boot\zImage" to boot-device
boot
EOF

Done

Most of the patches that have been posted for review: https://lore.kernel.org/patchwork/bundle/lkundrak/OLPC%20XO%201.75/

Your feedback is welcome, and much needed!