Debian on the Efika MX and Efika Smartbook ARM based devices

What is EfikaMX?

The EFIKA MX Open Client is a network computer based around the EFIKA MX micro-motherboard. Thist hardware is now discontinued.

The specifications are as follows (T03):

This device lacks of hardware schematics or documentation on the board, but you have access to several resources at Gitorious GIT infrastructure and power developer site sources. There is a slightly effort to port Linux kernel sources into mainline kernel, but Freescale should be taking the leadership in this task to be a feasible goal.

user@efikamx:~$ cat /proc/cpuinfo 
Processor       : ARMv7 Processor rev 1 (v7l)
BogoMIPS        : 799.53
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 
CPU implementer : 0x41
CPU architecture: 7CPU variant     : 0x2
CPU part        : 0xc08
CPU revision    : 1

Hardware        : Efika MX
Revision        : 51020
Serial          : 0000000000000000

Note that old T02 have a hardware bug on the NEON (floating point co-processor) silicon.

Quick start

Preparing an SD card

Genesi image approach

Genesi provides 2 armhf images for Debian:

See http://www.powerdeveloper.org/platforms/efikamx/linux

To copy the image on a SD card, run something like:

 $ sudo dd if=armhf-xxxxxxx.img of=/dev/mmcblk0 

Other images

Some other handy images are provided by talon at Steuben Technologies. These images includes steup scripts that make easy to run Debian from SD card or to install Debian directly in the Smarttop.

Konstantinos Margaritis has provided more recent Wheezy and Jessie images.

Parted approach

$ dmesg
[...]
[ 9916.960194] mmc0: new SD card at address fb8d
[ 9917.620844] mmcblk0: mmc0:fb8d SD02G 1.83 GiB 
[ 9917.620909]  mmcblk0: p1 p2

$ parted /dev/mmcblk0
$ mkpart primary 0% 128M
$ mkpart primary 128M 100%
$ quit

mkfs.vfat /dev/mmcblk0p1
mkfs.ext4 /dev/mmcblk0p2

You can now mount them as the root filesystem and boot disk.

mkfs.ext2 /dev/mmcblk0p1
mkfs.ext4 /dev/mmcblk0p2

You will also need a valid "boot.scr" to boot systems from 2.0.x U-Boot revisions, as the boot method changed to be controlled by the script and not automated in the bootloader for reasons of flexibility. Making your own boot script TBW.

JTAG support

What bootloader?

Limitations

Default U-Boot Environment

For 2009.01 1.x.x:

printenv
bootdelay=1
baudrate=115200
loadaddr=0x90007FC0
netdev=eth0
ethprime=smc911x
kernel=uImage
uboot_addr=0x00000000
uboot_size=0x00040000
loadaddr=0x90007FC0
sd_boot=run bootargs_base bootargs_sdhc
pata_boot=run bootargs_base bootargs_pata
bootinfo=rw
bootargs_sdhc=setenv bootargs ${bootargs} root=/dev/mmcblk0p2 ${bootinfo};run boot_sdhc
bootargs_pata=setenv bootargs ${bootargs} root=/dev/sda2 ${bootinfo};run boot_pata
base_cmd1=pmic 15 0x00400022;mw.l 0x73fa84b8 0xe7 1;mw.l 0x73fd4014 0x59239100 1
base_cmd2=mw.l 0x83fd9010 0xcaaaf6d0 1;mw.l 0x73f88000 0x01025200 1;mw.l 0x73f84000 0x20 1
base_cmd3=mw.l 0x83fd9004 0x333574aa 1;mw.l 0x83fd900c 0x333574aa 1;
base_cmd4=mw.l 0x83fd9020 0x00f48b00 1;mw.l 0x83fd9024 0x00f49700 1;mw.l 0x83fd9028 0x00f48700 1
base_cmd5=mw.l 0x83fd902c 0x00f48400 1;mw.l 0x83fd9030 0x00f44e00 1;
base_cmds=run base_cmd1;run base_cmd2;run base_cmd3;run base_cmd4;run base_cmd5;run base_cmd99
boot_sdhc=run base_cmds;mmcinit;fatload mmc 0:1 ${loadaddr} ${kernel}; bootm ${loadaddr}
boot_pata=run base_cmds;ide reset;fatload ide 0:1 ${loadaddr} ${kernel}; bootm ${loadaddr}
prog_nor_flag=1
prog_nor_uboot=mmcinit;fatload mmc 0:1 ${loadaddr} u-boot.bin;sf probe 0:1 25000000 3;sf erase ${uboot_size} 0x10000;sf erase ${uboot_addr} ${uboot_size};sf write ${loadaddr} ${uboot_addr} ${filesize}
check_nor_flash=sf probe 0:1 25000000 3;sf read ${loadaddr} 0 4
check_ext_boot=1
default_env=sf probe 1 25000000 3;sf erase ${uboot_size} 0x10000
filesize=4
bootargs_base=setenv bootargs noinitrd console=ttymxc0,115200 console=tty1 rootwait
stdin=serial
stdout=serial
stderr=serial
bootcmd=run pata_boot

Environment size: 1623/65532 bytes

For U-Boot 2009.01-2.0.6:

bootdelay=3
baudrate=115200
loadaddr=0x90007FC0
firmware_version=20101102171353
uboot_addr=0x00000000
uboot_size=0x00040000
env_addr=0x00040000
kerneladdr=0x90007FC0
scriptaddr=0x91000000
ramdiskaddr=0x92000000
console=ttymxc0,115200
model=mx
bootcmd=for device in "mmc ide"; do if strcmp ${device} == mmc; then; mmcinit; setenv units "0 1"; else; setenv units "0"; fi; for interface in ${units}; do if strcmp ${device} == mmc; then mmcprobe ${interface}; else; ide reset; fi; for fs in "ext2 fat"; do setenv loadcmd "${fs}load ${device} 0:1"; if ${loadcmd} ${scriptaddr} boot.scr; then; if imi ${scriptaddr}; then; autoscr ${scriptaddr}; fi; fi; done; done; done;
stdin=serial
stdout=serial
stderr=serial

Environment size: 706/65532 bytes
U-Boot# 

Smartbook is identical except model code.

Instructions for upgrading

  1. Download Powerdeveloper.org U-Boot Updater

  2. Uncompress  xzcat efikamx-updater.img.xz > efikamx-updater.img 

  3. Copy image into SD card  dd if=efikamx-updater.img of=/dev/mmcblk0 

  4. Now get your Efika device and boot it with SD card inserted.

U-Boot 2009.01-1.1.7-efikamx (Dec 21 2009 - 14:00:56)

CPU:   Freescale i.MX51 family 2.5V at 400 MHz
mx51 pll1: 800MHz
mx51 pll2: 665MHz
mx51 pll3: 216MHz
ipg clock     : 66500000Hz
ipg per clock : 665000000Hz
uart clock    : 66500000Hz
cspi clock    : 54000000Hz
Board: Genesi Efika MX [POR]
DRAM:  512 MB
JEDEC ID: 0xbf:0x25:0x4a
Reading SPI NOR flash 0x40000 [0x10000 bytes] -> ram 0x975f06e8
.SUCCESS

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Boot Source: SPI NOR FLASH BOOT
board rev1.1
SD card.
Vendor: Man 02 OEM TM "SD02G" Date 03/2010
Product: 2863884823
Revision: 6.0
board rev1.1
SD card.
Vendor: Man 02 OEM TM "SD02G" Date 03/2010
Product: 2863884823
Revision: 6.0
  3275204   uimage 
        5   type_id.bin 
   165060   ubootsb.bin 
     1093   boot.scr 

4 file(s), 0 dir(s)

reading type_id.bin

4 bytes read
Type ID = 2336 
Boot Cmd: run sd_boot
Hit any key to stop autoboot: 10  9  8  7  6  5  4  3  2  0 
EfikaMX > boot
Write reg = 15  value = 0x00400022
board rev1.1
SD card.
Vendor: Man 02 OEM TM "SD02G" Date 03/2010
Product: 2863884823
Revision: 6.0
reading uImage

3275204 bytes read
## Booting kernel from Legacy Image at 90007fc0 ...
   Image Name:   Linux-2.6.31.99-efikamx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3275140 Bytes =  3.1 MB
   Load Address: 90008000
   Entry Point:  90008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux......................................................................................................................................................................... done, booting the kernel.
[    0.000000] Linux version 2.6.31.99-efikamx (misc@linux) (gcc version 4.4.4 (GCC) ) #39 Fri Dec 3 11:53:31 CET 2010
[    0.000000] CPU: ARMv7 Processor [412fc081] revision 1 (ARMv7), cr=10c53c7f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: Genesi Efika MX (Smarttop)
[    0.000000] Ignoring unrecognised tag 0x54410009
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 105664
[    0.000000] Kernel command line: console=ttymxc0,115200 root=/dev/ram0
[    0.000000] PID hash table entries: 2048 (order: 11, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 416MB = 416MB total
[    0.000000] Memory: 416432KB available (3764K code, 510K data, 1212K init, 0K highmem)
[    0.000000] SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:368
[    0.000000] MXC IRQ initialized
[    0.000000] MXC_Early serial console at MMIO 0x73fbc000 (options '115200')
[    0.000000] console [ttymxc0] enabled
[    0.000000] Console: colour dummy device 80x30
[    0.000000] Calibrating delay loop... 799.53 BogoMIPS (lpj=3997696)
[    0.000000] Mount-cache hash table entries: 512
[    0.000000] CPU: Testing write buffer coherency: ok
[    0.000000] regulator: core version 0.5
[    0.000000] NET: Registered protocol family 16
[    0.000000] i.MX IRAM pool: 128 KB@0x9a840000
[    0.000000] IRAM READY
[    0.000000] CPU is i.MX51 Revision 2.5
[    0.000000] MXC GPIO hardware
[    0.000000] mx51_efikamx_init_spi()
[    0.000000] mx51_efikamx_init_pmic()
[    0.000000] mx51_efikamx_init_nor()
[    0.000000] Efika MX: IOMUX for ATA (29 pins)
[    0.000000] Genesi Efika MX (Smarttop) Revision 1.1
[    0.000000] Using SDMA I.API
[    0.000000] MXC DMA API initialized
[    0.000000] bio: create slab <bio-0> at 0
[    0.000000] SCSI subsystem initialized
[    0.000000] IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
[    0.000000] NET: Registered protocol family 2
[    0.666298] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.674031] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.681848] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[    0.688667] TCP: Hash tables configured (established 16384 bind 16384)
[    0.695205] TCP reno registered
[    0.698513] NET: Registered protocol family 1
[    0.788485] regulator: Unable to get requested regulator: SW1
[    0.794394] LPMode driver module loaded
[    0.798276] Static Power Management for Freescale i.MX51
[    0.803822] PM driver module loaded
[    0.807754] sdram autogating driver module loaded
[    0.812721] Bus freq driver module loaded
[    0.816902] DVFS driver module loaded
[    0.820578] i.MXC CPU frequency driver
[    0.824345] regulator: Unable to get requested regulator: SW1
[    0.830131] mxc_cpufreq_driver_init: failed to get gp regulator
[    0.836200] DVFS PER driver module loaded
[    0.841660] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.847593] msgmni has been set to 813
[    0.854551] alg: No test for stdrng (krng)
[    0.859003] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.866465] io scheduler noop registered (default)
[    0.871275] io scheduler cfq registered
[    0.875610] sii9022_probe
[    0.879153] mxc_init_fb: vmode passed 
[    0.883864] mode_option=800x600-16@60
[    0.887588] desired pixel clock (25000)
[    0.891431] pixel clock 25000 rate 80000000
[    0.895661] current PLL rates pll3 216000000 ipu_di0_clk 27000000 
[    0.901805] new PLL rates pll3 80000000 ipu_di0_clk 40000000 
[    0.907581] skip sii9022_reinit!
[    0.911617] mxc_ipu mxc_ipu: Channel already disabled 9
[    0.911628] mxc_ipu mxc_ipu: Channel already uninitialized 9
[    0.911640] desired pixel clock (25000)
[    0.911646] pixel clock (25000) unchanged
[    0.911676] mxc_ipu mxc_ipu: WARNING: adapt panel end blank lines
[    0.930534] Console: switching to colour frame buffer device 100x37
[    0.969044] sii9022 lcd_probe
[    0.972019] sii9022 lcd_init_fb
[    0.977258] mxcfb_read_edid2 
[    0.980572] read_edid error!
[    0.983631] mxcfb_update_default_var mode_opt=<NULL> vmode=
[    0.989237] desired pixel clock (13468)
[    0.993080] pixel clock 13468 rate 148500000
[    0.997395] current PLL rates pll3 80000000 ipu_di0_clk 40000000 
[    1.003408] new PLL rates pll3 148500000 ipu_di0_clk 74250000 
[    1.009271] reinit 1280x720 13468 fail!
[    1.155934] desired pixel clock (13468)
[    1.155940] pixel clock (13468) unchanged
[    1.175939] IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)
[    1.452834] Serial: MXC Internal UART driver
[    1.457433] mxcintuart.0: ttymxc0 at MMIO 0x73fbc000 (irq = 31) is a Freescale i.MX
[    1.465126] console handover: boot [ttymxc0] -> real [ttymxc0]
[    1.471868] mxcintuart.1: ttymxc1 at MMIO 0x73fc0000 (irq = 32) is a Freescale i.MX
[    1.480448] mxcintuart.2: ttymxc2 at MMIO 0x7000c000 (irq = 33) is a Freescale i.MX
[    1.492551] loop: module loaded
[    1.496854] spi_gpio_init()
[    1.500174] mc13892 Rev 0.0 FinVer 0 detected
[    1.504565] pmic_spi: probe of spi0.0 failed with error -1
[    1.510610] m25p80 spi0.1: sst25vf032b (4096 Kbytes)
[    1.515585] Creating 3 MTD partitions on "spi_nor_flash":
[    1.521025] 0x000000000000-0x000000040000 : "u-boot"
[    1.527507] 0x000000040000-0x000000050000 : "config"
[    1.533452] 0x000000050000-0x000000400000 : "spare"
[    1.540456] mice: PS/2 mouse device common for all mice
[    1.545853] MXC keypad loaded
[    1.549462] i2c /dev entries driver
[    1.553675] Linux video capture interface: v2.00
[    1.559326] MXC Video Output MXC Video Output.0: Registered device video0
[    1.566371] MXC WatchDog Driver 2.0
[    1.569974] clk: Unable to get requested clock: wdog_clk
[    1.575702] MXC Watchdog # 0 Timer: initial timeout 60 sec
[    1.581421] cpuidle: using governor ladder
[    1.585521] cpuidle: using governor menu
[    1.590011] PMIC Character device: successfully loaded
[    1.595768] VPU initialized
[    1.598986] Registered led device: power:green
[    1.603585] Registered led device: power:red
[    1.608060] Registered led device: power:blue
[    1.612872] Advanced Linux Sound Architecture Driver Version 1.0.20.
[    1.620002] regulator: Unable to get requested regulator: VDDIO
[    1.625988] regulator: Unable to get requested regulator: VDDA
[    1.631824] regulator: Unable to get requested regulator: VDDD
[    1.656601] sgtl5000-i2c 1-000a: SGTL5000 revision 17
[    1.683489] No device for DAI imx-ssi-1-0
[    1.687530] No device for DAI imx-ssi-1-1
[    1.691572] No device for DAI imx-ssi-2-0
[    1.695585] No device for DAI imx-ssi-2-1
[    1.700325] DMA Sound Buffers Allocated:UseIram=1 buf->addr=1fff6000 buf->area=9a856000 size=24576
[    1.709441] DMA Sound Buffers Allocated:UseIram=1 buf->addr=a85a0000 buf->area=f9e98000 size=24576
[    1.718420] asoc: SGTL5000 <-> imx-ssi-2-0 mapping ok
[    1.767586] ALSA device list:
[    1.770561]   #0: imx-3stack (SGTL5000)
[    1.775194] TCP cubic registered
[    1.778484] NET: Registered protocol family 17
[    1.782956] ThumbEE CPU extension supported.
[    1.787257] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
[    1.796502] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    1.803041] Freeing init memory: 1212K
mount: mounting sys on /sys failed: No such device
mdev: /sys/class: No such file or directory
Upgrading U-Boot firmware
Clearing U-Boot env area
16+0 records in
16+0 records out
65536 bytes (64.0KB) copied, 3.386105 seconds, 18.9KB/s
Writing U-Boot to NOR spi
291+1 records in
291+1 records out
149496 bytes (146.0KB) copied, 9.396456 seconds, 15.5KB/s
All done. Reboot.
swapoff: /etc/fstab: No such file or directory
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system reboot
[   16.618457] MXC Watchdog # 0 shutdown
[   16.622997] Restarting system.
[   16.627980] clk: Unable to get requested clock: wdog_clk


U-Boot 2009.01-2.0.6-efikamx (Nov 02 2010 - 17:13:53)

CPU:   Freescale i.MX51 family 2.5V at 400 MHz
mx51 pll1: 800MHz
mx51 pll2: 665MHz
mx51 pll3: 216MHz
ipg clock     : 66500000Hz
ipg per clock : 665000000Hz
uart clock    : 66500000Hz
cspi clock    : 54000000Hz
Board: MX51 Efika MX 3.0 [WDOG]
DRAM:  512 MB
JEDEC ID: 0xbf:0x25:0x4a
Reading SPI NOR flash 0x40000 [0x10000 bytes] -> ram 0x975f06e8
.SUCCESS

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
board id: 1.1.1, rev1.1
Boot Source: SPI NOR FLASH BOOT
Boot Cmd: for device in "mmc ide"; do if strcmp ${device} == mmc; then; mmcinit; setenv units "0 1"; else; setenv units "0"; fi; for interface in ${units}; do if strcmp ${device} == mmc; then mmcprobe ${interface}; else; ide reset; fi; for fs in "ext2 fat"; do setenv loadcmd "${fs}load ${device} 0:1"; if ${loadcmd} ${scriptaddr} boot.scr; then; if imi ${scriptaddr}; then; autoscr ${scriptaddr}; fi; fi; done; done; done;
Hit any key to stop autoboot:  3  2  1  0 
SD card.
Vendor: Man 02 OEM TM "SD02G" Date 03/2010
Product: 2863884823
Revision: 6.0
No MMC card found
Please initial the Card first
** Can't read partition table on 0:0 **
** Bad partition 1 **
Please initial the Card first
** Can't read from device 0 **

** Unable to use mmc 0:1 for fatload **
SD card.
Vendor: Man 02 OEM TM "SD02G" Date 03/2010
Product: 2863884823
Revision: 6.0
MMC interface 1 selected
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - mmc 0:1 **
reading boot.scr

## Checking Image at 91000000 ...
   Legacy image found
   Image Name:   Efika MX Installer
   Image Type:   ARM Linux Script (uncompressed)
   Data Size:    1029 Bytes =  1 kB
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
      Image 0: 1021 Bytes =  1 kB
   Verifying Checksum ... OK
## Executing script at 91000000
Unknown command 'poweroff' - try 'help'
Unknown command 'poweroff' - try 'help'

Reset IDE: Bus 0: OK 
  Device 0: Model: Flash Module Firm: Ver2.M1B Ser#: 38A30798060000001667
            Type: Hard Disk
            Capacity: 3679.5 MB = 3.5 GB (7535808 x 512)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - ide 0:1 **
reading boot.scr

** Unable to read "boot.scr" from ide 0:1 **
U-Boot# 
  1. If you do not have serial adapter, power LED will turn from blue to green, then a blue LED flashing light for EfikaMX should happen, then the board reboots itself and you get a stable blue LED light. It should be safe to turn it off.
  2. Remove the SD card and delete its contents with newer kernel and rootfs of your preference (see next kernel and rootfs sections).

Mainline U-Boot support

Which kernel?

Mainline

Genesi/Pegatron/Freescale SDK kernel

Hands on dirt

$ git clone https://gitorious.org/efikamx/linux-kernel.git
$ git checkout -b efikasb-10.08.00
$ git merge origin/efikasb-10.08.00
$ make ARCH=arm mx51_efikamx_devtmpfs_config 
$ cd linux-kernel
$ make-kpkg --arch=armel --revision=10.08.00 --initrd --rootcmd=fakeroot --cross-compile=arm-linux-gnueabi- kernel_image

You may want to hack flash-kernel to do something like this or run mkimage manually.

For uImage

                mkimage -A arm -O linux -T kernel -C none -a 0x90008000 \
                        -e 0x90008000 -n "$desc" -d "$kfile" "$tmp.uboot" >&2 1>/dev/null

and for uInitrd

                mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 \
                        -e 0x0 -n "$idesc" -d "$ifile" "$tmp.uboot" >&2 1>/dev/null

Sample boot script for new U-Boot on Smartbook and Smarttop:

setenv ramdisk uInitrd;
setenv kernel uImage;
setenv bootargs console=tty1 root=/dev/sda2 rootwait rw quiet splash;
${loadcmd} ${ramdiskaddr} ${ramdisk};
if imi ${ramdiskaddr}; then; else
  setenv bootargs ${bootargs} noinitrd;
  setenv ramdiskaddr "";
fi;
${loadcmd} ${kerneladdr} ${kernel}
if imi ${kerneladdr}; then
  bootm ${kerneladdr} ${ramdiskaddr}
fi; 

Then make it with

mkimage -A arm -O linux -a 0 -e 0 -T script -C none -n "EfikaMX Boot Script" -d myboot.script boot.scr

Which rootfs?

Hands on dirt

Use debootstrap or even better multistrap, either with Debian or Emdebian

Please read instructions from EmDebian/CrossDebootstrap page.

After rootfs is generated you might manually have to do some tweaks to the rootfs:

Now pack the filesystem and install it in your device

manual System installation

Place the uImage file in the SD card partition 1.

Place kernel modules on partition 2.

Place filesystem on partition 2.

Installing Debian (sid and wheezy) via serial console

http://http.debian.net/debian/dists/testing/main/installer-armhf/current/images/mx5/ has images for testing == wheezy

http://http.debian.net/debian/dists/sid/main/installer-armhf/current/images/mx5/ has images for unstable == sid.

Just copy those four files on a vfat formatted SD card and boot the efika. Access debian-installer via serial console.

Currently these images are broken due to 675017 - "no disk found".

Installing Debian (sid and wheezy) pre-seeded without a serial console

TBD...

Get a serial port

Efika MX nettop

Efika SB smartbook

References

Efika MX Open Client site

Efika MX Platform support

Efika MX blog

Gentoo on the EfikaMX

LTSP on ARM

Debian ARM hardfloat port

Thanks