config files

script.fex

I had more luck with this fex, http://www.gplsquared.com/eoma_boot/script.fex_2013_09_17

gplsquared seems no longer active. There is a version of script.fex_2013_09_17 at the Internet Archive (WaybackMachine).

eoma68-a20-3.3-config
eoma68-a20-3.4-config
eoma68-a20-4.7-config
eoma68-a20-4.7.0-rc5-sunxi-next.config
sun7i-a20-eoma68-a20.dts

kernel compile (3.3 development)

note: this is an experimental kernel, still containing proprietary binary drivers (libnand). DO NOT DISTRIBUTE compiled binary kernel images unless you disable CONFIG_MTD and other options which will ensure that libnand is not added.

to compile the standby code you will need arm-linux-gnueabi-gcc-4.4. modify arch/arm/mach-sun7i/pm/Makefile to use $(CROSS_COMPILE)gcc-4.4 (if you use arm-linux-gnueabi-gcc-4.7 you will later encounter "VPF" linker errors at the kernel compile phase).

to obtain the arm-linux-gnueabi-gcc-4.4 compiler toolchain on debian add these to /etc/apt/sources.list and then apt-get install the appropriate package:

deb http://ftp.uk.debian.org/emdebian/toolchains squeeze main
deb http://ftp.uk.debian.org/emdebian/toolchains testing main
git clone http://git.hands.com/linux.git
cd linux
git checkout -b lkcl-3.3-a20
make -j3 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KDIR="$PWD" -C arch/arm/mach-sun7i/pm/standby all
make -j3 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage modules

setup instructions for u-boot with MEB


1. Correct the MEB board as per prior discussions. There is some diodes
that need changing and a wire to add iirc
(see micro engineering board)

2. Connect EOMA board to the MEB.

3. Connect ethernet

4. On the MEB, wire up Serial GND to PIN: 43/GND, Serial TX to Pin 42/RX,
   Serial RX to Pin 41/TX.

5. Connect UART cable, open terminal program in a new window and hold down button 2 on
your keyboard. Leave terminal program running all the time.

6. Use a serial terminal configured for 115200baud, 8 bits, 1 stop bit, no parity, and no flow control.

when boot1 says it jumps to FEL then you can release button 2 on your
keyboard.

(If you open the EOMA-68 A20 then you can short the uboot pad instead of
messing with button 2. But for now use the UART method, that also
verifies that UART cable connection works.)

Connect µUSB cable. 

Type lsusb. The board should now be seen in the list as an unknown device with no
description.

Now you need FEL u-boot with Ethernet support

    git clone https://github.com/linux-sunxi/u-boot-sunxi.git
    cd u-boot-sunxi
    make CROSS_COMPILE=arm-linux-gnueabihf- EOMA68_A20_FEL
    cd ..

And sunxi-tools

    apt-get install libusb-1.0-0-dev

    git clone https://github.com/linux-sunxi/sunxi-tools.git
    cd sunxi-tools
    make

Now you are ready to boot. Connect uUSB cable (if not connected yet) and enter this command

    ./usb-boot ../u-boot-sunxi/spl/u-boot-spl.bin ../u-boot-sunxi/u-boot.bin

You should see u-boot start up messages on the UART, failing to boot and leaving
you at the u-boot prompt.

testing ethernet with MEB (and only u-boot)

Load u-boot as above, press space if necessary to stop countdown. Adjust ip address and netmask according to network (example below). Link light on router/hub should go on immediately that u-boot loads up. If it doesn't, check the hardware: there is no point proceeding with the instructions below until the link light is on.

   setenv ethaddr 00:00:00:00:00:01
   setenv ipaddr 192.168.1.42
   setenv netmask 255.255.255.0
   ping 192.168.1.1

check uSD card is working

Insert a fat formatted uSD card. On the UART terminal window enter the following commands:

   mmc rescan
   fatls mmc 0

A file list of the root directory will appear.

setup boot instructions for booting directly off of sd/mmc

the issue we have is that routing SD0 through to a MicroSD card slot proved to be much too challenging for a 6-layer board where there are only 3 signal layers (41 x 75mm PCB). instead, SD3 was routed to the MicroSD.

the upshot of that is that booting from SD/MMC directly is not possible. so - leaving the wits-tech compiled NAND-capable boot0/boot1 in place, and copying a sunxi-compiled u-boot into the FAT NAND partition seems to do the trick.

1) obtain u-boot: 

    git clone https://github.com/linux-sunxi/u-boot-sunxi.git
    cd u-boot-sunxi
    git checkout origin/sunxi

2) edit boards.cfg, look for the entry "EOMA68-A20" and remove "SPL"
   from the list.

3) compile non-SPL u-boot:

    make CROSS_COMPILE=arm-linux-gnueabihf- EOMA68_A20

4) set up a MEB with serial access (see above) and run a suitable
   terminal (minicom -D /dev/ttyUSB0 will do)

5) boot the EOMA68-A20 CPU Card from USB-OTG whilst simultaneously
   and repeatedly pressing the key "1".  repeat this process
   until you see this:

[       0.312] fs mount ok
[       0.317] nand good_block_ratio=944
[       0.318] storage_type=0
[       0.365] 49
[       0.365] part count = 2
[       0.365] USB Device!!
[       0.367] USB Connect!!
[       0.423] uSuspend
[       0.549] uSuspend
[       0.664] uSuspend
[       0.771] usb_device: Set Address 0x0x00000052
[       1.791] usb_device: Get MaxLUN

6) on the PC see which partition has appeared (there will typically be 4)

    ls /dev/sd*

7) mount the 2nd from last one (e.g. if you see /dev/sdd and /dev/sde
   then run "mount /dev/sdd /mnt/card")

8) do "cd /mnt/card/linux" and then "mv u-boot.bin u-boot.bin.orig" to make copy in flash
    and "mv u-boot.bin ~/u-boot.bin.orig" to take a backup copy to disk.
   (this is a recoverable step: if you ever want to boot the original
    u-boot.bin just move/copy it back).

9) copy the compiled u-boot.bin from step 3 in its place.

   The typical messages for flash write appear on the UART:
   [      70.564] MSG:L1285(usb_device/usb_storage.c):write start = 3375105, count1 
   [      77.061] MSG:L1285(usb_device/usb_storage.c):write start = 33993, count =2
   [     107.059] MSG:L1285(usb_device/usb_storage.c):write start = 33993, count =2
   [     107.062] MSG:L1285(usb_device/usb_storage.c):write start = 33281, count =1
   [     210.935] uSuspend     

   It can take minutes to complete.
   Powering off before flash write is completed corrupts files.

10) cd out of /mnt/card (anywhere) and then umount /mnt/card
    (wait for flash write messages to finish)

the defaults for u-boot that hno has prepared for EOMA68-A20 CPU Cards are such that if you place a file named "uImage" and another file named "script.bin" into the first partition of an SD/MMC card it will by default load that.

if you prefer you can as usual set up alternative parameters etc. etc. in the usual way - here is an example boot.cmd:

setenv console 'ttyS0,115200'
setenv machid f35
setenv root '/dev/mmcblk0p2'
setenv panicarg 'panic=10'
setenv extra 'earlyprintk=ttyS0,115200 rootfstype=ext4 rootwait hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1920x1080p60 sunxi_fb_mem_reserve=32 debug'
setenv loglevel '8'
setenv setargs 'setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extra}'
setenv kernel 'uImage'
setenv boot_mmc 'fatload mmc 0 0x43000000 script.bin; fatload mmc 0 0x48000000 ${kernel}; bootm 0x48000000'
setenv bootcmd 'run setargs boot_mmc'

which is converted to boot.scr as usual with:

    mkimage -C none -A arm -T script -d boot.cmd boot.scr

and also here is a uEnv.txt example which may prove useful:

bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rdinit=/sbin/init panic=10 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1920x1080p60 sunxi_fb_mem_reserve=32 debug
kernel=uImage
loglevel=8

in this way the combination of replacing the android-based u-boot on the NAND and using a sunxi-compiled version of u-boot that reads by default from SD/MMC 3 results in the possibility of booting any OS directly from the SD/MMC Card.