[Letux-kernel] [PATCH 00/20] A bunch of JZ4730 fixups for letux-kernel

H. Nikolaus Schaller hns at goldelico.com
Sat Dec 5 16:58:49 CET 2020


Hi Lubomir,

> Am 04.12.2020 um 09:11 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> Hi Lubomir,
> 
>> Am 03.12.2020 um 10:34 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> 
>>> The newer U-Boot can also be
>>> turned into an uImage and chain-booted from the factory loader, but I'd
>>> have to dig out my notes.
>> 
>> Ok, that sounds a reasonable idea. Another approach would be to use a minimal
>> uImage and use kexec to load the real thing. This is what the original system
>> already does if I remember correctly with the initrd and minifs/recover concept [1].
> 
> After thinking about this, I guess it is easier to go the U-Boot way
> since debugging the kernel until kexec works successfully is probably much
> more complex and needs additional initrd setup.
> 
> And, it has to be done only once for newer kernel releases and changes.
> 
> Finally, there is a chance to make the second stage U-Boot load the device tree
> so that we can get rid of the appended DTB which currently makes the L400 a quite
> different setup than the CI20 (and potentially other devices).
> 
> So please let me know after you have dug out your notes.
> 
> In the meantime I have found:
> 
> http://bsdimp.blogspot.com/2016/09/chain-booting-u-boot-with-u-boot.html
> 
> which seems to indicate that we just have to compile the new U-Boot with
> the Load and Execute address of Linux, pack and call it uImage. A minor
> issue may be that the real Linux must be loaded somewhere else.
> Or the load address of the second stage U-Boot could even differ from Linux
> but should be inside RAM of course...

I have successfully compiled and started your u-boot:

	https://projects.goldelico.com/p/gta04-kernel/page/Boot/

I only had to work around some cross-compiler issues.

So I can now load your U-Boot as faked "uImage" through the old one in NAND.

Next, I have to learned how to make it automatically load the real kernel ("Image")
from the same partition on the SD card.

The trick was to define a boot.scr. This is configured to load some kernel "Image"
(not "uImage") and the device tree from the same mmc partition and call bootm.

With this setup I can boot from SD into the kernel. And all my helper tools to
create images for 

	https://download.goldelico.com/letux-u-boot/Mipsbook400/
	https://download.goldelico.com/letux-kernel/latest-l400/

are working so that I can (re)generate any SD card through 'makesd' and combine
with my prebuilt Debian rootfs flavors within minutes. That is important for
kernel development to have a short turnaround time between compile and boot/test.

BTW: I have also git committed the source code for the NAND U-Boot 1.1.6 for easier reference:
https://git.goldelico.com/?p=letux-uboot.git;a=shortlog;h=refs/heads/old/mipsbook-u-boot-1.1.6

BR and thanks for the great work,
Nikolaus

---------------------------------

NAND SPL

Starting U-Boot ...


U-Boot 1.1.6 (Jun 24 2008 - 18:57:34)

Board: Ingenic PMP Ver 1.x (CPU Speed 335 MHz)
DRAM:  64 MB
Flash:  0 kB
NAND:1024 MiB
*** Warning - bad CRC or NAND, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   JZ ETHERNET
### main_loop: bootcmd="mmcinit;fatload mmc 0 0x80600000 uimage;bootm"
Hit any key to stop autoboot:  0 
MMC card found
MMC card is ready
I'm sorry wo only surport fat16 and fat32
I'm sorry wo only surport fat16 and fat32
reading uimage
filesize: 234810, got: 234810

234810 bytes read
## Booting image at 80600000 ...
   Image Name:   intermediate-u-boot
   Image Type:   MIPS U-Boot Kernel Image (gzip compressed)
   Data Size:    234746 Bytes = 229.2 kB
   Load Address: 80100000
   Entry Point:  80100000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...



U-Boot 2021.01-rc2-00029-g3453b36750 (Dec 05 2020 - 16:18:43 +0100)

Board: Skytone Alpha 400
DRAM:  128 MiB
WDT:   Started with servicing (0s timeout)
NAND:  2048 MiB
MMC:   MSC: 0
In:    serial at 10030000
Out:   serial at 10030000
Err:   serial at 10030000
Net:   eth0: ethernet at 13100000
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2111 bytes read in 15 ms (136.7 KiB/s)
## Executing script at 81000000
try mmc 0:1 for kernel + DT
5208435 bytes read in 531 ms (9.4 MiB/s)
found kernel /Image on mmc 0:1
11651 bytes read in 28 ms (406.3 KiB/s)
2108 bytes read in 15 ms (136.7 KiB/s)
## Executing script at 81000000
running bootargs.scr
bootargs.scr done...
## Booting kernel from Legacy Image at 84000000 ...
   Image Name:   Linux-5.10.0-rc6-letux-l400+
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    5208371 Bytes = 5 MiB
   Load Address: 80100000
   Entry Point:  808c3194
   Verifying Checksum ... OK
## Flattened Device Tree blob at 81100000
   Booting using the fdt blob at 0x81100000
   Uncompressing Kernel Image
[    0.000000] Linux version 5.10.0-rc6-letux-l400+ (hns at iMac.fritz.box) (mipsel-linux-gnu-gcc (GCC) 4.9.2, GNU ld (GNU Binutils) 2.25) #4159 PREEMPT Sat Dec 5 14:53:41 CET 2020

[    0.000000] CPU0 revision is: 02d0024f (Ingenic XBurst)
[    0.000000] MIPS: machine is letux400,minipc
[    0.000000] earlycon: jz4740_uart0 at MMIO32 0x10030000 (options '115200n8')
[    0.000000] printk: bootconsole [jz4740_uart0] enabled
[    0.000000] printk: debug: ignoring loglevel setting.
[    0.000000] User-defined physical RAM map overwrite
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] cma: Reserved 32 MiB at 0x01800000
[    0.000000] Primary instruction cache 16kB, VIVT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000]   Normal zone: 288 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: mem=128M earlycon=jz4740_uart,mmio32,0x10030000,115200n8 console=ttyS0,115200n8 console=tty0 ignore_loglevel clocksource=jiffies clk_ignore_unused
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 84948K/131072K available (7976K kernel code, 808K rwdata, 2732K rodata, 316K init, 169K bss, 13356K reserved, 32768K cma-reserved)
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 256
[    0.000000] random: get_random_bytes called from start_kernel+0x6d8/0x920 with crng_init=0
[    0.000000] clocksource: ingenic-timer: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 7910990 ns
[    0.000056] sched_clock: 16 bits at 3686kHz, resolution 271ns, wraps every 8888753ns
[    0.009936] Console: colour dummy device 80x25
[    0.014480] printk: console [tty0] enabled
[    0.001105] printk: bootconsole [jz4740_uart0] disabled
[    0.000000] Linux version 5.10.0-rc6-letux-l400+ (hns at iMac.fritz.box) (mipsel-linux-gnu-gcc (GCC) 4.9.2, GNU ld (GNU Binutils) 2.25) #4159 PREEMPT Sat Dec 5 14:53:41 CET 2020

[    0.000000] CPU0 revision is: 02d0024f (Ingenic XBurst)
[    0.000000] MIPS: machine is letux400,minipc
[    0.000000] earlycon: jz4740_uart0 at MMIO32 0x10030000 (options '115200n8')
[    0.000000] printk: bootconsole [jz4740_uart0] enabled
[    0.000000] printk: debug: ignoring loglevel setting.
[    0.000000] User-defined physical RAM map overwrite
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] cma: Reserved 32 MiB at 0x01800000
[    0.000000] Primary instruction cache 16kB, VIVT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000]   Normal zone: 288 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: mem=128M earlycon=jz4740_uart,mmio32,0x10030000,115200n8 console=ttyS0,115200n8 console=tty0 ignore_loglevel clocksource=jiffies clk_ignore_unused
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 84948K/131072K available (7976K kernel code, 808K rwdata, 2732K rodata, 316K init, 169K bss, 13356K reserved, 32768K cma-reserved)
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 256
[    0.000000] random: get_random_bytes called from start_kernel+0x6d8/0x920 with crng_init=0
[    0.000000] clocksource: ingenic-timer: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 7910990 ns
[    0.000056] sched_clock: 16 bits at 3686kHz, resolution 271ns, wraps every 8888753ns
[    0.009936] Console: colour dummy device 80x25
[    0.014480] printk: console [tty0] enabled
[    0.001105] printk: bootconsole [jz4740_uart0] disabled
[    0.006594] Calibrating delay loop... 594.73 BogoMIPS (lpj=2973696)
[    0.019845] pid_max: default: 32768 minimum: 301
[    0.020712] LSM: Security Framework initializing
[    0.021217] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.021419] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.031883] rcu: Hierarchical SRCU implementation.
[    0.034850] devtmpfs: initialized
[    0.025852] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.026089] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.034353] pinctrl core: initialized pinctrl subsystem
[    0.036586] regulator-dummy: no parameters, enabled
[    0.022060] NET: Registered protocol family 16
[    0.027759] thermal_sys: Registered thermal governor 'fair_share'
[    0.027822] thermal_sys: Registered thermal governor 'step_wise'
[    0.027971] thermal_sys: Registered thermal governor 'user_space'
[    0.035805] jz4780-dma 10020000.dma: failed to get I/O memory
[    0.036100] jz4780-dma: probe of 10020000.dma failed with error -22
[    0.037543] vcc: 3300 mV, enabled
[    0.038719] reg-fixed-voltage regulator at 0: vcc supplying 3300000uV
[    0.039844] vmmc: 3300 mV, disabled
[    0.041055] reg-fixed-voltage regulator at 1: vmmc supplying 3300000uV
[    0.044183] SCSI subsystem initialized
[    0.043069] libata version 3.00 loaded.
[    0.045119] usbcore: registered new interface driver usbfs
[    0.028600] usbcore: registered new interface driver hub
[    0.029214] usbcore: registered new device driver usb
[    0.034264] Advanced Linux Sound Architecture Driver Initialized.
[    0.040081] VFS: Disk quotas dquot_6.6.0
[    0.040612] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.051609] NET: Registered protocol family 2
[    0.055382] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.055876] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.056283] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.056566] TCP: Hash tables configured (established 1024 bind 1024)
[    0.057479] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.057827] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.058921] NET: Registered protocol family 1
[    0.045598] RPC: Registered named UNIX socket transport module.
[    0.045854] RPC: Registered udp transport module.
[    0.046056] RPC: Registered tcp transport module.
[    0.046259] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.053681] Initialise system trusted keyrings
[    0.049228] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.052049] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.043640] Key type asymmetric registered
[    0.043893] Asymmetric key parser 'x509' registered
[    0.044411] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.044754] io scheduler mq-deadline registered
[    0.044964] io scheduler kyber registered
[    0.056791] Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
[    0.057023] printk: console [ttyS0] disabled
[    0.057617] 10030000.serial: ttyS0 at MMIO 0x10030000 (irq = 10, base_baud = 230400) is a 16550A
[    0.069769] random: fast init done
[    0.156611] printk: console [ttyS0] enabled
[    0.156004] 10031000.serial: ttyS1 at MMIO 0x10031000 (irq = 11, base_baud = 230400) is a 16550A
[    0.154746] 10032000.serial: ttyS2 at MMIO 0x10032000 (irq = 12, base_baud = 230400) is a 16550A
[    0.170699] 10033000.serial: ttyS3 at MMIO 0x10033000 (irq = 13, base_baud = 230400) is a 16550A
[    0.171746] brd: module loaded
[    0.169483] loop: module loaded
[    0.178325] mtdoops: mtd device (mtddev=name/number) must be supplied
[    0.174878] libphy: Fixed MDIO Bus: probed
[    0.182886] usbcore: registered new interface driver usb-storage
[    0.175716] mousedev: PS/2 mouse device common for all mice
[    0.172667] input: keyboard as /devices/platform/keyboard/input/input0
[    0.180235] jz4740-rtc 10003000.rtc: registered as rtc0
[    0.185733] jz4740-rtc 10003000.rtc: hctosys: unable to read the hardware clock
[    0.179756] i2c /dev entries driver
[    0.184819] jz4730-i2c 10042000.i2c: Bus frequency is 100 kHz
[    0.184046] IR NEC protocol handler initialized
[    0.188832] IR RC5(x/sz) protocol handler initialized
[    0.176749] IR RC6 protocol handler initialized
[    0.181515] IR JVC protocol handler initialized
[    0.186251] IR Sony protocol handler initialized
[    0.191073] IR SANYO protocol handler initialized
[    0.179522] IR Sharp protocol handler initialized
[    0.184477] IR MCE Keyboard/mouse protocol handler initialized
[    0.190525] IR XMP protocol handler initialized
[    0.195258] Driver for 1-wire Dallas network protocol.
[    0.186320] jz4740-wdt: probe of 10004000.watchdog failed with error -22
[    0.198276] pinctrl-ingenic 10010000.pin-controller: invalid group "PC0" for function "mmc"
[    0.189815] pinctrl-ingenic 10010000.pin-controller: invalid group "PC2" for function "mmc"
[    0.198635] pinctrl-ingenic 10010000.pin-controller: invalid group "PA21" for function "mmc"
[    0.191118] jz4740-mmc 10021000.mmc: Got CD GPIO
[    0.196199] jz4740-mmc 10021000.mmc: Got WP GPIO
[    0.201185] jz4740-mmc 10021000.mmc: Looking up vmmc-supply from device tree
[    0.191926] jz4740-mmc 10021000.mmc: Looking up vqmmc-supply from device tree
[    0.199384] jz4740-mmc 10021000.mmc: Looking up vqmmc-supply property in node /mmc at 10021000 failed
[    0.200425] ledtrig-cpu: registered to indicate activity on CPUs
[    0.196419] jz4740-mmc 10021000.mmc: Failed to get dma_tx channel
[    0.198277] usbcore: registered new interface driver usbhid
[    0.204102] usbhid: USB HID core driver
[    0.201906] Initializing XFRM netlink socket
[    0.206554] NET: Registered protocol family 17
[    0.194159] NET: Registered protocol family 15
[    0.199110] 9pnet: Installing 9P2000 support
[    0.203706] Key type dns_resolver registered
[    0.208200] oprofile: using timer interrupt.
[    0.196673] Loading compiled-in X.509 certificates
[    0.209590] clk: Not disabling unused clocks
[    0.196628] ALSA device list:
[    0.199816]   No soundcards found.
[    0.210848] jz4740-mmc 10021000.mmc: Ingenic SD/MMC card driver registered
[    0.200530] jz4740-mmc 10021000.mmc: Using PIO, 4-bit mode
[    0.212054] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.202996] Please append a correct "root=" boot option; here are the available partitions:
[    0.211729] 0100           16384 ram0 
[    0.211772]  (driver?)
[    0.218220] 0101           16384 ram1 
[    0.218264]  (driver?)
[    0.207949] 0102           16384 ram2 
[    0.208000]  (driver?)
[    0.214474] 0103           16384 ram3 
[    0.214518]  (driver?)
[    0.220969] 0104           16384 ram4 
[    0.221012]  (driver?)
[    0.210339] 0105           16384 ram5 
[    0.210390]  (driver?)
[    0.214502] 0106           16384 ram6 
[    0.214554]  (driver?)
[    0.221038] 0107           16384 ram7 
[    0.221081]  (driver?)
[    0.210448] 0108           16384 ram8 
[    0.210498]  (driver?)
[    0.216969] 0109           16384 ram9 
[    0.217012]  (driver?)
[    0.223463] 010a           16384 ram10 
[    0.223506]  (driver?)
[    0.214076] 010b           16384 ram11 
[    0.214403]  (driver?)
[    0.221282] 010c           16384 ram12 
[    0.221332]  (driver?)
[    0.227882] 010d           16384 ram13 
[    0.227925]  (driver?)
[    0.217270] 010e           16384 ram14 
[    0.217321]  (driver?)
[    0.224184] 010f           16384 ram15 
[    0.224233]  (driver?)
[    0.231121] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.221980] Rebooting in 10 seconds..




More information about the Letux-kernel mailing list