nanonixos

Documentation
Login

After connecting the serial lines, I could see that pressing 'u' at boot with the usual uboot, I saw in the serial line:

NAND Secondary Program Loader

[U] pressed, goto USBBOOT mode

That means I can use xbboot or usbboot from the xburst tools. I have a jz-3.2 kernel built (vmlinuz.bin). I used this command line, stored in the kernel:

CONFIG_CMDLINE="mem=32M console=ttyS0,57600n8  ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait"

I load it this way:

# xbboot -u 0x80600000 vmlinuz.bin

Info - found XBurst boot device.
set_addr 80002000h
bulk_write successfully wrote 6088 bytes.
start1 80002000h
VR_GET_CPU_INFO JZ4740V1
set_addr 80600000h
bulk_write successfully wrote 2054683 bytes.
VR_FLUSH_CACHES
start2 80600000h

And at boot it says the following. Notice that it says 'ziess 80010000', and some other uncomprehensible lines before the linux presentation. It is what the loader of the compressed kernel outputs to the serial line, but loosing lots of characters. See (arch/mips/boot/compressed/decompress.c) for the text. In short, "Decompressing kernel at 0x80010000". And the first three lines come from the code xbboot executes at the nanonote. The rest is a normal kernel.

Ben NanoNote
GPIO, clocks, SDRAM, UART setup
now jump back to BOOT ROM...
ziess 80010000
Nkernel...
 the kernel...
[    0.000000] Linux version 3.2.0prova-86405-gc97b223 (viric@bergamota) (collect2: ld returned 1 exit status) #5 PREEMPT Wed Jan 11 20:03:56 CET 2012
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0ad0024f (Ingenic JZRISC)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  mem=32M console=ttyS0,9600n8  ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Memory: 27616k/32768k available (3140k kernel code, 5152k reserved, 1060k data, 176k init, 0k highmem)
[    0.000000] NR_IRQS:190
[    0.000000] Console: colour dummy device 80x25
[    0.000000] Calibrating delay loop... 250.67 BogoMIPS (lpj=1253376)
[    0.090000] pid_max: default: 32768 minimum: 301
[    0.100000] Mount-cache hash table entries: 512
[    0.110000] Performance counters: No available PMU.
[    0.130000] NET: Registered protocol family 16
[    0.160000] JZ4740 GPIO initialized
[    0.180000] Qi Hardware JZ4740 QI LB60 setup
[    0.290000] bio: create slab <bio-0> at 0
[    0.310000] Advanced Linux Sound Architecture Driver Version 1.0.24.
[    0.320000] Switching to clocksource jz4740-timer
[    0.480000] NET: Registered protocol family 2
[    0.490000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.500000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.510000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.520000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.530000] TCP reno registered
[    0.540000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.550000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.560000] NET: Registered protocol family 1
[    0.590000] JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.600000] msgmni has been set to 53
[    0.620000] io scheduler noop registered
[    0.620000] io scheduler deadline registered (default)
[    0.660000] Console: switching to colour frame buffer device 40x15
[    0.710000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.730000] serial8250.0: ttyS0 at MMIO 0x10030000 (irq = 17) is a 16550
(AND NOW, LOTS of ^@, so, zeroes)

Failures

After serial8250.0..., I see lots of zeroes

Loading the driver sets 57600n8 ttyS0 configuration. Then, you better use that console setting, instead of overriding it with things like console=ttyS0,9600n8.

UBI error: cannot initialize UBI, error -19

Thats in (drivers/mtd/ubi/build.c:536). -19 means, as -errno, for errno=ENODEV (No such device). It can be the next line to:

[    0.800000] jz4740-nand jz4740-nand.0: No NAND chips found

A normal nanonote kernel without bugs should have that working. In my case, it was a kernel bug, fixed by mth: http://qi-hw.com/p/qi-kernel/450999b

Seeing only until console [tty0] enabled, bootconsole disabled

This means you had another console= setting in the kernel command line, like console=tty0. The kernel will always send to the serial line until this console message.