UBI Fastmap on the Devkit8000

Tonight I tried the (new) UBI Fastmap feature on the Devkit8000.

For this reason I created a UBI image with ptxdist. The UBI fastmap was not activated in the kernel that installed the UBI image in NAND.

After first boot I got the following output:

[ 2.842315] UBI: attaching mtd5 to ubi0
[ 3.146972] UBI: scanning is finished
[ 3.165374] UBI: attached mtd5 (name "File System", size 121 MiB) to ubi0

That make around 300 ms from “attaching…” to “attached …”.

Then I activated UBI fastmap in the kernel configuration and got the following output:

[ 2.839019] UBI: default fastmap pool size: 45
[ 2.843780] UBI: default fastmap WL pool size: 25
[ 2.848754] UBI: attaching mtd5 to ubi0
[ 3.154663] UBI: scanning is finished
[ 3.173156] UBI: attached mtd5 (name "File System", size 121 MiB) to ubi0

After changing the bootargs in the bootloader U-Boot and adding ubi.fm_autoconvert=1 there is nothing to see from conversion:

[ 2.839019] UBI: default fastmap pool size: 45
[ 2.843780] UBI: default fastmap WL pool size: 25
[ 2.848754] UBI: attaching mtd5 to ubi0
[ 3.154663] UBI: scanning is finished
[ 3.173156] UBI: attached mtd5 (name "File System", size 121 MiB) to ubi0

But with the next boot ubi fastmap is active:

[ 2.844116] UBI: default fastmap pool size: 45
[ 2.848876] UBI: default fastmap WL pool size: 25
[ 2.853820] UBI: attaching mtd5 to ubi0
[ 2.927093] UBI: attached by fastmap
[ 2.930877] UBI: fastmap pool size: 45
[ 2.934844] UBI: fastmap WL pool size: 25
[ 2.953826] UBI: attached mtd5 (name "File System", size 121 MiB) to ubi0

That are around 100 ms from “attaching …” to “attached…”. For such a small UBIFS with only 121 MiB is it a gain of 200 ms.

Debugging U-Boot after relocation

My ~/.gdbinit

target remote 192.168.11.200:2001
monitor reset halt

Type in gdb:

(gdb)monitor reset halt
(gdb)continue

Output in terminal:

U-Boot 2013.04-rc3-dirty (Apr 16 2013 - 14:33:48)

OMAP36XX/37XX-GP ES1.2, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
OMAP3 Tricorder + LPDDR/NAND
I2C: ready
DRAM: 256 MiB
NAND: 512 MiB
MMC: OMAP SD/MMC: 0
*** Warning – bad CRC, using default environment

In: serial
Out: serial
Err: serial
Die ID #065a00229e38000001683b0601020024
Hit any key to stop autoboot: 0
OMAP3 Tricorder #

In U-Boot type:

OMAP3 Tricorder # bdinfo
arch_number = 0x00000BE2
boot_params = 0x80000100
DRAM bank = 0x00000000
-> start = 0x80000000
-> size = 0x10000000
DRAM bank = 0x00000001
-> start = 0x90000000
-> size = 0x00000000
baudrate = 115200 bps
TLB addr = 0x8FFF0000
relocaddr = 0x8FF67000
reloc off = 0x0FE67000
irq_sp = 0x8FE66F38
sp start = 0x8FE66F28
OMAP3 Tricorder #

So we get the relocation address of U-Boot: 0x8FF67000
And in gdb we can load the symbol-file:

Program received signal SIGSTOP, Stopped (signal).
0x8ff90554 in ?? ()
(gdb) add-symbol-file u-boot 0x8ff67000
add symbol table from file "u-boot" at
.text_addr = 0x8ff67000
(y or n) y
Reading symbols from /home/tweber/build/tricorder/u-boot/u-boot...done.
(gdb)

Simple test, set breakpoint @ do_version:

(gdb) b do_bdinfo
Breakpoint 1 at 0x8ff6a680: file cmd_bdinfo.c, line 373.
(gdb) c
Continuing.

In U-Boot type version:

OMAP3 Tricorder # bdinfo

And in gdb the breakpoint is hit:

Breakpoint 1, do_bdinfo (cmdtp=0x8ffbc048, flag=0, argc=1, argv=0x8fe76090) at cmd_bdinfo.c:373
373 {
(gdb)

Boot times (part 2)

The candidates are this time: gzip, lzma, lzo, xz and uncompressed.
The boot time is measured with grabserial. The image is read from a sd card.

compression method image size loading time decompression time
gzip 3978136 0.327381 0.744222
lzma 2939704 0.245322 2.41247
lzo 4368056 no boot
xz 2792912 0.220659 1.961494
uncompressed 7967108 0.641257

Test network speed

One of my actual projects uses a USB-Ethernet (LAN9512) interface. So I am interested in the real speed for this combination.

On the embedded device I used netcat with the following parameters:
nc -l -p 1234 | dd of=/dev/null

And on the host side I used netcat with:
dd if=/dev/urandom bs=4096 count=100000 | nc host.tld 1234

For the different counts I got the following numbers

count duration speed
1000 1 s 4.1 MB/s
10000 10.8 s 3.8 MB/s
100000 108 s 3.8 MB/s
1000000 1092 s 3.7 MB/s

Okay, the last test copied 4.1 GB and lasted 18 minutes.