How to install Debian on NAND in A20-MICRO?

Started by iso9660, October 17, 2013, 06:58:28 PM

Previous topic - Next topic

AzHofi

Quote from: edualfaia on December 11, 2014, 06:57:42 PM
Hi Guys,
I've installed Debian on NAND, but I have a sata hdd with Debian too, How could I booting from NAND and mount rootfs from hdd?

My opinion is You can't boot directly from sata disk, but dont worry, you can install a small boot partition to nand with kernel (including builtin, not module sata support) and uEnv.txt, where You can set the root partition.

Best regards
Attila

edualfaia

Hi guys,

does anyone have the u-boot source to NAND?

Thanks

fingolfin

Hi Mad Demus!!!!!!!!!
I am using board A20-OLinuXino-Micro-4GB
I am having running SD card with Debian.
I followed the procedure "HOWTO install a running SD-card image to A20-OLinuXino NAND flash"
Procedure is all done...
But when board boots from NAND and displays kernel messages....it stucks at one perticular location
Part of the Log is given below........
///////////////////////////////////////////////////////////////////////////
[    4.288896]   #0: sunxi-CODEC  Audio Codec
VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
[    4.299831] VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
[    4.314304] Please append a correct "root=" boot option; here are the available partitions:
<0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    4.329893] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0572d60>] (panic+0x8c/0x1d0)
[    4.345128] [<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0572d60>] (panic+0x8c/0x1d0)
[<c0572d60>] (panic+0x8c/0x1d0) from [<c07e9d70>] (mount_block_root+0x174/0x228)
[    4.360519] [<c0572d60>] (panic+0x8c/0x1d0) from [<c07e9d70>] (mount_block_root+0x174/0x228)
[<c07e9d70>] (mount_block_root+0x174/0x228) from [<c07ea004>] (mount_root+0xf4/0x114)
[    4.376506] [<c07e9d70>] (mount_block_root+0x174/0x228) from [<c07ea004>] (mount_root+0xf4/0x114)
[<c07ea004>] (mount_root+0xf4/0x114) from [<c07ea188>] (prepare_namespace+0x164/0x1c8)
[    4.393014] [<c07ea004>] (mount_root+0xf4/0x114) from [<c07ea188>] (prepare_namespace+0x164/0x1c8)
[<c07ea188>] (prepare_namespace+0x164/0x1c8) from [<c07e9a24>] (kernel_init+0x1d4/0x218)
[    4.409781] [<c07ea188>] (prepare_namespace+0x164/0x1c8) from [<c07e9a24>] (kernel_init+0x1d4/0x218)
[<c07e9a24>] (kernel_init+0x1d4/0x218) from [<c000f7a8>] (kernel_thread_exit+0x0/0x8)
[    4.426462] [<c07e9a24>] (kernel_init+0x1d4/0x218) from [<c000f7a8>] (kernel_thread_exit+0x0/0x8)
<2>CPU1: stopping
[    4.437004] CPU1: stopping
[<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0013bb0>] (handle_IPI+0x194/0x1c8)
[    4.447186] [<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0013bb0>] (handle_IPI+0x194/0x1c8)
[<c0013bb0>] (handle_IPI+0x194/0x1c8) from [<c00084fc>] (gic_handle_irq+0x50/0x58)
[    4.463259] [<c0013bb0>] (handle_IPI+0x194/0x1c8) from [<c00084fc>] (gic_handle_irq+0x50/0x58)
[<c00084fc>] (gic_handle_irq+0x50/0x58) from [<c000e880>] (__irq_svc+0x40/0x70)
[    4.478896] [<c00084fc>] (gic_handle_irq+0x50/0x58) from [<c000e880>] (__irq_svc+0x40/0x70)
Exception stack(0xef065f88 to 0xef065fd0)
[    4.490977] Exception stack(0xef065f88 to 0xef065fd0)
5f80:                   ffffffed 00000001 0ffe9000 00000000 ef064000 ef064000
[    4.502883] 5f80:                   ffffffed 00000001 0ffe9000 00000000 ef064000 ef064000
5fa0: c0896448 c057e994 ef064000 410fc074 c0840b90 00000000 ffff8c76 ef065fd0
[    4.517903] 5fa0: c0896448 c057e994 ef064000 410fc074 c0840b90 00000000 ffff8c76 ef065fd0
5fc0: c000f80c c000f810 60000013 ffffffff
[    4.529808] 5fc0: c000f80c c000f810 60000013 ffffffff
[<c000e880>] (__irq_svc+0x40/0x70) from [<c000f810>] (default_idle+0x28/0x30)
[    4.541717] [<c000e880>] (__irq_svc+0x40/0x70) from [<c000f810>] (default_idle+0x28/0x30)
[<c000f810>] (default_idle+0x28/0x30) from [<c000fb44>] (cpu_idle+0xd0/0x114)
[    4.556750] [<c000f810>] (default_idle+0x28/0x30) from [<c000fb44>] (cpu_idle+0xd0/0x114)
[<c000fb44>] (cpu_idle+0xd0/0x114) from [<4056f5f4>] (0x4056f5f4)
[    4.570744] [<c000fb44>] (cpu_idle+0xd0/0x114) from [<4056f5f4>] (0x4056f5f4)
<6>[hotplug]: cpu(0) try to kill cpu(1)
[    4.581436] [hotplug]: cpu(0) try to kill cpu(1)
<3>[hotplug]: try to kill cpu:1 failed!
[    5.589473] [hotplug]: try to kill cpu:1 failed!
///////////////////////////////////////////////////////////////////////////
I can see 2 penguins of Olimex on my LCD screen.
Please help...where possibly the problem is???

Quote from: Mad Demus on October 22, 2013, 12:47:16 PM
Today I successfully installed the official Debian Image into A20-OLinuXino's flash.

First, download and uncompress this file which contains the bootloader and an image of the flash partition scheme:

http://dtmh.de/files/olinuxino-a20-flashinstall.zip

After that, change into the folder which contains the uncompressed files.

Now, here is the quick recipe:

#############################################################################
# HOWTO install a running SD-card image to A20-OLinuXino NAND flash
#
# The following steps must be executed as root and on a running SD-card image!
#
# Sunxi kernel 3.4.43 or later is required.
# Tested with official Olimex Debian Wheezy image with kernel 3.4.61+
#
# The flash partition scheme will looks like follow:
# /dev/nanda is BOOT device
# /dev/nandc is ROOT device
# /dev/nandb is MAGIC device
#
#############################################################################

# First of all, make sure that all nand devices /dev/nand* are unmounted
# (check output of mount if you are not sure)

# Copy A20 flash partition image to NAND flash
tar -xzOf nand_part.gz | dd of=/dev/nand
sync


# reboot to make new partitions available
reboot

# after reboot: create filesystems
mkfs.vfat /dev/nanda
mkfs.ext4 /dev/nandc
echo -e 'ANDROID!\0\0\0\0\0\0\0\0\c' > /dev/nandb


# mount new filesystems
mkdir /mnt/nanda
mkdir /mnt/nandc
mount /dev/nanda /mnt/nanda
mount /dev/nandc /mnt/nandc


# install bootloader to /dev/nanda
rm -rf /mnt/nanda/*
rsync -avc bootloader/* /mnt/nanda


# copy script.bin and uImage into new root device under /boot
mount /dev/mmcblk0p1 /boot
rsync -avc /boot/script.bin /boot/uImage /mnt/nandc/boot/


# if you need additional kernel arguments, you can create a uEnv.txt file under
# /mnt/nandc/boot/ wich contains the following line:
Quoteextraargs=<your extra kernel args here>

# copy rootfs
rsync -avc --exclude-from=exclude.txt / /mnt/nandc
sync


# shutdown and remove SD card
shutdown -h now

# now power on the device and it should boot from NAND!

Enjoy!

bremenpl

Hello,
I was trying to use this tutorial to install debian on the NAND flash with A20-SOM board. Everything went well, but after reboot without the sd card I could not boot the NAND flash. Are there any additional steps that should be taken that are not described? I Would aprichiate all help.

JohnS

How far does it get?  Show console output...

John


davidahoward

It looks like it gets to:

VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
[    3.885981] VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
[    3.900442] Please append a correct "root=" boot option; here are the available partitions:
<0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    3.916014] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

JohnS


banata

@JohnS Please be more detailed about root parameter. Where is the file containing this row and what to write after
root = ....?

There are lines in the tutorial:
# if you need additional kernel arguments, you can create a uEnv.txt file under
# /mnt/nandc/boot/ wich contains the following line: (without the leading #)
# extraargs=<your extra kernel args here>

So try to write some parameters there! 

I have another questions:

When I run boot from nand the booting stop here:

HELLO! BOOT0 is starting!
boot0 version : 2.0.0
read dram para.
dram driver version: 1.15
dram size =512MB
0xffffffff
super_standby_flag = 0
Succeed in opening nand flash.
block from 2 to 6
deal block 2
Succeed in reading Boot1 file head.
The size of Boot1 is 0x00068000.
The file stored in 0x00000000 of block 2 is perfect.
Check is correct.
Ready to disable icache.
Succeed in loading Boot1.
Jump to Boot1.

HERE IS BLA BLA BLA

[       1.427] NB1 : init ok
[       1.429] flash init finish
[       1.434] fs init ok
[       1.436] fattype FAT12
[       1.437] fs mount ok
[       1.441] nand good_block_ratio=870
[       1.443] storage_type=0
[       1.455] 0
[       1.470] can't find c:\drv_hdmi.drv
[       1.470] ERR: wBoot_driver_install display driver failed
[       1.474] key value = 0
[       1.476] recovery key high 40, low 4
[       1.481] show pic finish
[       1.483] load kernel start
[       1.495] load kernel successed
[       1.495] start address = 0x4a000000
[       1.497] [LOGICCTL_ERR] LML_Write, invalid bufaddr: 0x0x697bf103
[       1.503] ERR: display driver not open yet
[       1.508] jump to

I don't have c:\drv_hdmi.drv  :)
If somebody have idea ...

Have fun,
Boyan

JohnS

I suppose it will be documented as part of Linux kernel doc.  Or try google.  Or read the sources :)

Which debian & kernel are you using?

John

banata

I,m with a20_Lime_debian_3.4.90_release_3.img and olinuxino-a20-flashinstall from the first post.
This message is in boot.axf file and inside are some binary data and error massages.

I will search around for another file to test with or how do biuld my own.
Boyan

JohnS

You're using Lime kernel but not Lime board? Likely won't work.

John

banata


JohnS

What do you mean?  Your post is in thread A20-Micro and you said Lime.  It's critical what you use.

John

lauhub

Quote from: Mad Demus on October 22, 2013, 12:47:16 PM
Today I successfully installed the official Debian Image into A20-OLinuXino's flash.

First, download and uncompress this file which contains the bootloader and an image of the flash partition

...


Hello,

I would like to compile (and configure) my own bootable images for a NAND. Please can you tell us how did you create the zip file that you provide ?

Do you use u-boot ? How do you compile it (branch, commands) ?

Or which tutorial, documentation, did you follow ?