A10 Nand booting

Started by scott-alex, May 25, 2014, 02:33:29 PM

Previous topic - Next topic

scott-alex

I'm trying to set up the A10 Lime board (with Nand) to boot from Nand. I can already boot from SD card. I would like to erase the existing Nand partitions and just uses a BOOT and ROOTFS partition. I have experimented with nand-part and can partition but can not find a working article on the correct file to put into the BOOT partition. I have tried many variations on u-boot, boot.axf, script.bin etc but can not get a working system.
There are also articles that seem to be working on replacing boot0/1 with a new version of u-boot?

I can across this article that also details how to make a live suit image but that failed with a make error when following the instructions:

Article: http://linux-sunxi.org/BSP

scott@armdev:~/sunxi-bsp$ ./configure a10-olinuxino-lime
a10-olinuxino-lime configured. Now run `make`
scott@armdev:~/sunxi-bsp$ make
mkdir -p /home/scott/sunxi-bsp/build/a10-olinuxino-lime-u-boot
make -C u-boot-sunxi a10-olinuxino-lime_config O=/home/scott/sunxi-bsp/build/a10-olinuxino-lime-u-boot CROSS_COMPILE=arm-linux-gnueabihf- -j4
make[1]: Entering directory `/home/scott/sunxi-bsp/u-boot-sunxi'
make: *** No rule to make target `a10-olinuxino-lime_config'.  Stop.
make[1]: *** [a10-olinuxino-lime_config] Error 1
make[1]: Leaving directory `/home/scott/sunxi-bsp/u-boot-sunxi'
make: *** [/home/scott/sunxi-bsp/build/a10-olinuxino-lime-u-boot/include/config.h] Error 2


Any help would be much appreciated.


JohnS

Check the makefile etc to see if you're using the wrong target name or it needs upper/lower case different or such like.

And whether it's an old file that needs changing...

John

scott-alex

Managed to get this working in the end by compiling the lichee-dev version of u-boot. That supports band flash booting.

pepahajek

Hi,

I have been successful to boot from nand on LIME board. This advance is based on cubian nandinstall tool for similar board with a10 - cubieboard. I used bootloader and partitioning from cubian-nandinstall.

The board must be booted from SD card. I used debian image prepared by olimex - https://docs.google.com/file/d/0B-bAEPML8fwlamRKQzl1N0M4THc/edit

Download archive with kernel and bootloader

wget http://pepa.hovnet.cz/wiki/files/lime-nand-install.tar.gz
tar zxf lime-nand-install.tar.gz
cd lime-nand-install


Create partition table. There are two partitions nanda (1MB) and nandb (3983MB) after reboot.

tar -xzOf cubian_nand.gz | dd of=/dev/nand
reboot


Partitions formating. mkfs.vfat is in dosfstools package.

mkfs.vfat /dev/nanda
mkfs.ext4 /dev/nandb


In case of need is possible to resize nand partition

resize2fs /dev/nandb

Mounting partitions to current filesystem

mkdir /mnt/bootfs
mkdir /mnt/rootfs
mount /dev/nanda /mnt/bootfs/
mount /dev/nandb /mnt/rootfs/


bootloader and kernel instalation

rsync -avc lime-nand-install/bootloader/* /mnt/bootfs/
rsync -avc lime-nand-install/boot /mnt/rootfs/


Kernel

lime-nand-install.tar.gz archive contain exactly same kernel as in the tutorial from olimex blog. There is only different in NAND support straight in kernel, not in module.

debian@debian-armhf:~$ zgrep NAND /proc/config.gz
CONFIG_SUNXI_NAND_PARTITION=y
CONFIG_SUNXI_NAND=y
CONFIG_SUNXI_NAND_COMPAT_DEV=y
# CONFIG_SUNXI_NAND_TEST is not set


If there are special requirement for the kernel, is possible to choose from several tutorials how to compile own kernel.

    http://eewiki.net/display/linuxonarm/A10-OLinuXino-LIME#A10-OLinuXino-LIME-LinuxKernel
    http://olimex.wordpress.com/2013/12/13/building-debian-linux-image-for-a10-olinuxino-lime-with-kernel-3-4-67/
    https://romanrm.net/a10/cross-compile-kernel

Root file system

Debian root file system is done by armhf.com and donwloaded from http://www.armhf.com/download/ with "no kernel" at the bottom of the page.

wget http://s3.armhf.com/dist/basefs/debian-wheezy-7.5-armhf.com-20140603.tar.xz 
tar xf debian-wheezy-7.5-armhf.com-20140603.tar.xz -C /mnt/rootfs/


Allow to login via serial line. At the end of file /mnt/rootfs/etc/inittab add row

T0:2345:respawn:/sbin/getty -L ttyS0 115200 linux

Turn off linux from SD card (poweroff), unplug SD card and system should boot from NAND. Login and possword is debian/debian.


deepe

Hi @pepahajek,
your solution works great. Can not wait to fully open source solution booting from NAND.

Once again great job, Thank you.

Regards,
Deepe

cprcpr

#5
Hello I am trying to follow the steps of @pepahajek. I have the Olinuxino A10 lime booting from the NAND as @pepahajek explained but my problem is that I have the screen flickering always (like in this video but all the time:https://www.youtube.com/watch?v=1NC2mJ6tIVE), in higher or lower frequency but flickering since it boots. I tried with different power supply and I still have the same problem. I tried xrandr command but it says can't open display. When I try to create the Xorg.conf file (it is not in /etc/X11) using X -configure, it says "No devices to configure. Configuration failed." but it shows:
"List of video drivers:
    nouveau
    mach64
    ati
    radeon
    r128
    fbdev
    vesa
"
I've also tried lspci command and it shows:
"pcilib: Cannot open /proc/bus/pci
lspci: Cannot find any working access method."
I googled this and I didn't get any solution.
I have also read this post: https://www.olimex.com/forum/index.php?topic=2756.0 in the last reply @jpc says:
"The flickering can be fixed by enabling the SCALER module in the HDMI pipeline." I don't know what it means and I can't find any module called SCALER and I don't know what is the HDMI pipeline.

Any idea of why I am getting this flickering screen?

PS: I am using a A10 Olinuxino Lime 4gb and I followed the steps that @pepahajek posted

MBR

Quote from: cprcpr on October 23, 2014, 03:43:39 PM
I've also tried lspci command and it shows:
"pcilib: Cannot open /proc/bus/pci
lspci: Cannot find any working access method."

There is no PCI bus in A10, so the lspci command obviously cannot work. And the config file autogeneration is probably too PCI-centric and doesn't work well without the device enumeration. But, IIRC, you don't need to make/modify Xorg.conf anyway, because the resolution is set in the FEX file.

cprcpr

#7
okay, Thank you for the answer MBR.
I've tried the Wheezy 7.2 as well and I have the same problem.
But where is the FEX file that you talk about?
And do you know what is the SCALER module in the HDMI pipeline?
Thank you
EDIT:
It's working. I activated the fb0_hdmi_scaler_mode in the script.bin :)

akshay

Hi,
     I following this thread and method, however my boards stays just dumb -- does not boot from NAND at all. It boots fine with uSD though.

Any inputs on what can be the reason for this...

thanks,

Quote from: pepahajek on July 20, 2014, 06:00:08 PM
Hi,

I have been successful to boot from nand on LIME board. This advance is based on cubian nandinstall tool for similar board with a10 - cubieboard. I used bootloader and partitioning from cubian-nandinstall.

The board must be booted from SD card. I used debian image prepared by olimex - https://docs.google.com/file/d/0B-bAEPML8fwlamRKQzl1N0M4THc/edit

Download archive with kernel and bootloader

wget http://pepa.hovnet.cz/wiki/files/lime-nand-install.tar.gz
tar zxf lime-nand-install.tar.gz
cd lime-nand-install


Create partition table. There are two partitions nanda (1MB) and nandb (3983MB) after reboot.

tar -xzOf cubian_nand.gz | dd of=/dev/nand
reboot


Partitions formating. mkfs.vfat is in dosfstools package.

mkfs.vfat /dev/nanda
mkfs.ext4 /dev/nandb


In case of need is possible to resize nand partition

resize2fs /dev/nandb

Mounting partitions to current filesystem

mkdir /mnt/bootfs
mkdir /mnt/rootfs
mount /dev/nanda /mnt/bootfs/
mount /dev/nandb /mnt/rootfs/


bootloader and kernel instalation

rsync -avc lime-nand-install/bootloader/* /mnt/bootfs/
rsync -avc lime-nand-install/boot /mnt/rootfs/


Kernel

lime-nand-install.tar.gz archive contain exactly same kernel as in the tutorial from olimex blog. There is only different in NAND support straight in kernel, not in module.

debian@debian-armhf:~$ zgrep NAND /proc/config.gz
CONFIG_SUNXI_NAND_PARTITION=y
CONFIG_SUNXI_NAND=y
CONFIG_SUNXI_NAND_COMPAT_DEV=y
# CONFIG_SUNXI_NAND_TEST is not set


If there are special requirement for the kernel, is possible to choose from several tutorials how to compile own kernel.

    http://eewiki.net/display/linuxonarm/A10-OLinuXino-LIME#A10-OLinuXino-LIME-LinuxKernel
    http://olimex.wordpress.com/2013/12/13/building-debian-linux-image-for-a10-olinuxino-lime-with-kernel-3-4-67/
    https://romanrm.net/a10/cross-compile-kernel

Root file system

Debian root file system is done by armhf.com and donwloaded from http://www.armhf.com/download/ with "no kernel" at the bottom of the page.

wget http://s3.armhf.com/dist/basefs/debian-wheezy-7.5-armhf.com-20140603.tar.xz 
tar xf debian-wheezy-7.5-armhf.com-20140603.tar.xz -C /mnt/rootfs/


Allow to login via serial line. At the end of file /mnt/rootfs/etc/inittab add row

T0:2345:respawn:/sbin/getty -L ttyS0 115200 linux

Turn off linux from SD card (poweroff), unplug SD card and system should boot from NAND. Login and possword is debian/debian.