How to install Debian on NAND in A20-MICRO?

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

Previous topic - Next topic

Jox

Thanks a lot. Will try that during the weekend, though watching those benchmarks may set me back...

Got to think about it. I would rather wear out a SD card than NAND and the improvement is not that big...

catch33

Quote from: Jox on December 04, 2013, 12:22:32 AMWill try that during the weekend, though watching those benchmarks may set me back...

Honestly I don't know how this "fio" benchmark works in detail, but when I try out the same commands posted by Mad Demus on my Fedora machine, I get this:

====
fio --name=test --rw=readwrite --size=100M --direct=1 --bs=1024k --filename=file1
====

== Crucial m4 SSD ==
   READ: io=49152KB, aggrb=92390KB/s, minb=92390KB/s, maxb=92390KB/s, mint=532msec, maxt=532msec
  WRITE: io=53248KB, aggrb=100090KB/s, minb=100090KB/s, maxb=100090KB/s, mint=532msec, maxt=532msec

== Generic 7200rpm 2,5" HDD ==
   READ: io=51200KB, aggrb=853333KB/s, minb=853333KB/s, maxb=853333KB/s, mint=60msec, maxt=60msec
  WRITE: io=51200KB, aggrb=853333KB/s, minb=853333KB/s, maxb=853333KB/s, mint=60msec, maxt=60msec

====
fio --name=test --rw=randrw --size=10M --numjobs=2 --direct=1 --filename=file1
====

== SSD ==
   READ: io=10192KB, aggrb=9454KB/s, minb=4730KB/s, maxb=4812KB/s, mint=1058msec, maxt=1078msec
  WRITE: io=10288KB, aggrb=9543KB/s, minb=4768KB/s, maxb=4865KB/s, mint=1058msec, maxt=1078msec

== HDD ==
   READ: io=10260KB, aggrb=64125KB/s, minb=31900KB/s, maxb=32632KB/s, mint=158msec, maxt=160msec
  WRITE: io=10220KB, aggrb=63875KB/s, minb=32100KB/s, maxb=32177KB/s, mint=158msec, maxt=160msec


Which, overall, tells me my hard drive is 6-9 times faster than my SSD ???
OK, my SSD could have a serious problem, but besides that, I can't believe I can write 100MB to my HDD with >850MB per second! This leaves me uncertain on how valuable this benchmark's data is concerning the A20-Micro.

Mad Demus

Seems like there was still some kernel page caching involved... over 800 MB/s is a way too much ;-)

However, I have done some further benchmarks using "sysbench" (also using O_DIRECT flag to bypass the page cache) and here are the results:


# sysbench --test=fileio --max-time=60 --max-requests=1000000  --file-num=1 --file-extra-flags=direct --file-fsync-freq=0  --file-total-size=128M prepare
# sysbench --test=fileio --max-time=60 --max-requests=1000000  --file-num=1 --file-extra-flags=direct --file-fsync-freq=0  --file-total-size=128M --file-test-mode=rndrd run

==========================
== Class 10 MicroSD
==========================
Operations performed:  32289 Read, 0 Write, 0 Other = 32289 Total
Read 504.52Mb  Written 0b  Total transferred 504.52Mb  (8.4085Mb/sec)
  538.14 Requests/sec executed

Test execution summary:
    total time:                          60.0008s
    total number of events:              32289
    total time taken by event execution: 59.7645
    per-request statistics:
         min:                                  1.58ms
         avg:                                  1.85ms
         max:                                 45.40ms
         approx.  95 percentile:               1.95ms

Threads fairness:
    events (avg/stddev):           32289.0000/0.00
    execution time (avg/stddev):   59.7645/0.00


==========================
== NAND
==========================
Operations performed:  39577 Read, 0 Write, 0 Other = 39577 Total
Read 618.39Mb  Written 0b  Total transferred 618.39Mb  (10.306Mb/sec)
  659.59 Requests/sec executed

Test execution summary:
    total time:                          60.0021s
    total number of events:              39577
    total time taken by event execution: 59.5524
    per-request statistics:
         min:                                  0.25ms
         avg:                                  1.50ms
         max:                                 18.29ms
         approx.  95 percentile:               1.66ms

Threads fairness:
    events (avg/stddev):           39577.0000/0.00
    execution time (avg/stddev):   59.5524/0.00


==========
So here we have quite better results with 10.31 MB/s (NAND) vs. 8.41 MB/s (uSD).

ludo

Hello Mad Demus,

I'am following your tuto to put debian on my NAND, but it seems that the link for the flashinstaller doesn't work anymore.

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

I may miss something. Can i have some help please.

thanks you very much.


Mad Demus

Quote from: ludo on December 18, 2013, 05:04:25 PM
Hello Mad Demus,

I'am following your tuto to put debian on my NAND, but it seems that the link for the flashinstaller doesn't work anymore.

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

I may miss something. Can i have some help please.

thanks you very much.

My bad... now it is available again! Sorry ;-)

miloose

For those who are interested, you can find here the uImage with NAND support as well as PWM. It has been built following the tuto here and adding the following lines to a20_defconfig
CONFIG_SUNXI_NAND=y
CONFIG_SUNXI_NAND_COMPAT_DEV=y
CONFIG_SUNXI_PWM=y


Just replace the uImage on your sd card by this one and you should see the NAND. I didn't try the PWM as I don't even know what's the meaning of it :-)

andrea2277

Hi guys,

I want install a Debian olimex distro on A20-OLinuXino-MICRO-4GB.

I have connect the A20 with serial cable and work fine,
but when execute the command (the first on tutorial):

tar -xzOf nand_part.gz | dd of=/dev/nand
sync



I receive on my terminal:

tar -xz0f nand_part.gz | dd of=/dev/nand
tar: Options `-[0-7][lmh]' not supported by *this* tar
Try `tar --help' or `tar --usage' for more information.
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.0132197 s, 0.0 kB/s


have any suggestion?

PS: i have search in the filesystem of SD-CARD with Debian but don't see /dev/nand ..is correctly??









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!

andrea2277

Hi guys,

i have solved my problem..the command is not correct (used number 0 in "tar xzOf", but char O is correct).

I have a new problem.
When execute the command "mkfs.vfat /dev/nanda" i received:

"UNABLE TO GET DRIVE GEOMETRY, USING DEFAULT 255/63"

Have a idea for solve the problem???

thx

mauris

Hi,
When I execute the command "mkfs.vfat /dev/nanda" I recieved :

"/dev/nanda: No such file or directory"

Have a idea for solve the problem ?
Thanks in advance

dipsie

Thanks Mad Demus for the tutorial!

May I ask which version of u-boot did you use? Or what changes have you done to u-boot sources?
I need to shut up the serial console (then my cmdline should contain console= ) but I can't rebuild a working u-boot.bin as the one provided in the .zip file.

thx

aauer1

Quote from: Mad Demus on December 20, 2013, 09:11:57 AM
Quote from: ludo on December 18, 2013, 05:04:25 PM
Hello Mad Demus,

I'am following your tuto to put debian on my NAND, but it seems that the link for the flashinstaller doesn't work anymore.

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

I may miss something. Can i have some help please.

thanks you very much.

My bad... now it is available again! Sorry ;-)

Hello Mad Demus,

I think the link for downloading the flash install zip file isn't working again. I would appricicate if you can fix it. Or is it available from another host?

Best Regards,
Andreas

Mad Demus

Quote from: aauer1 on April 23, 2014, 12:09:12 PM

Hello Mad Demus,

I think the link for downloading the flash install zip file isn't working again. I would appricicate if you can fix it. Or is it available from another host?

Best Regards,
Andreas

Hello Andreas,

the link should be working now... Sorry again! ;-)

mauris

When I execute the command "mkfs.vfat /dev/nanda" I recieved :

"/dev/nanda: No such file or directory"

Where is the problem ?

jlucius

Quote from: mauris on June 25, 2014, 07:55:43 PM
When I execute the command "mkfs.vfat /dev/nanda" I recieved :

"/dev/nanda: No such file or directory"

Where is the problem ?

Most likly missing NAND drivers in kernel. See post #20 for this.

mauris

#29
Thank you for your help,

The NAND driver is the "nand_driver" file of the "nand_driver.gz" ?
If I understand correctly, the command line "tar-xvf nand_part.gz | dd of = /dev/nand" and "sync" install the driver in the NAND then after a reboot the partions /dev/nanda,  /dev/nandb, /dev/nandc are recognized by the system ?
But I successfully uncompressed nand_part.gz into /dev/nand and reboot

Sincerely,
Mauris