Author Topic: cubieboard A20 install/boot to nand  (Read 13273 times)

djraffon

  • Guest
cubieboard A20 install/boot to nand
« on: October 08, 2013, 12:31:20 pm »
I was stuck more than a week, trying to install to nand on my cubie A20 even if the microSD installation was working very well.

So I ll try to give in this topic the commands I used to make this working.

Prerequisite:
1- you must have a cubieboard 2, A20 Soc and that boot from the microSD.
2- you need to get "nand-part" script + "A20-kernel-3.4.61" + "u-boot-nand-ext4" from http://dl.cubieforums.com/patwood
3- you need also a "boot.axf" check on the forum cause I dont remember where I got it from

Now that you have all the tools, copy everything to the cubieboard /root/ (/dev/mmcblkop1) of the cubieboard (actually booted from microSD) and untar the archives.

1- partitioning of the nand with "nand-part" script with the command:
./nand-part -f a20 /dev/nand 32768 'bootloader 20480' 'boot 512' 'rootfs 0'
# then type "Y"

2- reboot and the verify the nand partitions with
cat /proc/partitions
# you should have result with:

major minor  #blocks  name

  93        0    3989504 nand
  93        1      10240 nand1
  93        2        256 nand2
  93        3    3962624 nand3


3- format nand1 and nand 3 with commands:
mkfs.vfat /dev/nand1
mkfs.ext4 /dev/nand3

4- copy files to make the board boot from nand
4.1- create directory and mont the 1st nand partition
mkdir /mnt/nand1
mount /dev/nand1 /mnt/nand1
mkdir /mnt/nand1/linux

4.2- copy the u-boot in linux directory and rename it u-boot.bin
cp ./u-boot-nand-ext4.bin /mnt/nand1/linux/u-boot.bin

4.3- copy kernel and other files to /mnt/nand1/ (from A20-kernel-3.4.61 tar ball)
at the end you should have in directory (4 files and 1 folder):
ls -l /mnt/nand1
-rwxr-xr-x 1 root root  121524 oct.   5 17:26 boot.axf
-rwxr-xr-x 1 root root   94955 oct.   5 17:26 config
drwxr-xr-x 2 root root    2048 oct.   5 16:32 linux
-rwxr-xr-x 1 root root   46080 oct.   5 17:26 script.bin
-rwxr-xr-x 1 root root 4601760 oct.   5 17:26 uImage

4.4- create the file for boot options (uEnv.txt):
touch /mnt/nand1/uEnv.txt
# edit the file und put inside:

extraargs=disp.screen0_output_mode=EDID:1280x720p60 hdmi.audio=EDID:0
# root=/dev/mmcblk0p2 rootwait
root=/dev/nand3 rootwait
# root=/dev/sda1 rootwait
# partition=0:2
# kernel=/uImage.3.4.43-sun7i+
# machid=0xf35
machid=0x10bb

4.5- depending on your board, you ll have to use 1 of the 2 "machid" so if it doesent boot with:
# machid=0xf35
machid=0x10bb

# then use the other:
machid=0xf35
# machid=0x10bb

At this point the board is able to boot from nand if you remove the microSD. To test it, power of and on the board.
the blue LED will start to blink at the 13 sec and on the screen you ll get 2 Tux logo at the sec 18.

Then you only need to copy your root filesystem on the 3rd partition (/dev/nand3) and also copy there tle lib from A20-kernel-3.4.61 archive.

Hope those messy informations will help someone.


Marcus

  • Guest
Re: cubieboard A20 install/boot to nand
« Reply #1 on: November 05, 2013, 11:46:55 am »
Hello.
I found this very helpful but I have ran into a few problems.

I have the files you stated in the right locations and the partitions formatted as above yet it still doesn't boot.

I've tried the two machine ID's you gave in the uEnv.txt file but still no avail.
Sometimes the uEnv.txt file disappears after a reboot and I'm not exactly sure if this is correct behavior.

Any light you can shed on this issue would be greatly appriciated.

Thanks,
           Marcus

AutoStatic

  • Guest
Re: cubieboard A20 install/boot to nand
« Reply #2 on: November 06, 2013, 04:54:13 pm »
This howto is a bit lacking:
  • You have to write an Android style boot signature to the 'boot' partition
  • You need a boot.ini and a linux.ini

Marcus

  • Guest
Re: cubieboard A20 install/boot to nand
« Reply #3 on: November 11, 2013, 06:12:29 am »
Thank you for replying.

How might I write an Android style boot signature?

Offline patwood

  • Linux geek
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: +129/-0
    • View Profile
Re: cubieboard A20 install/boot to nand
« Reply #4 on: November 11, 2013, 09:53:59 am »

Marcus

  • Guest
Re: cubieboard A20 install/boot to nand
« Reply #5 on: November 12, 2013, 05:41:19 am »
I'll give that a shot!
Thanks Patwood, very much appreciated.