[Letux-kernel] [PATCH 00/20] A bunch of JZ4730 fixups for letux-kernel
Lubomir Rintel
lkundrak at v3.sk
Wed Nov 18 22:04:15 CET 2020
Hello Nikolaus,
On Wed, Nov 18, 2020 at 10:33:29AM +0100, H. Nikolaus Schaller wrote:
> Hi Lubomir,
> I am baffled and amazed!
>
> Especially that you managed to boot the kernel.
>
> Great. Great. Great. Thanks!
>
> Yes,
> I will pick up this to integrate into the Letux tree.
>
> What I do not exactly get is if we need a new U-Boot?
We don't really *need* a new U-Boot. Nevertheless there are slight
advantages to it in addition to my being mildly uncomfortable running a
bitrotten vendor firmware tree.
The vendor U-Boot is limited to loading an uImage from a msdos partition
on a SD card and requires you to push Fn+Shift on each boot. It doesn't
support initrd or a separate flattened device tree.
The mainline U-Boot can be configured with CONFIG_DISTRO_DEFAULTS=y that
makes it possible to place an extlinux/extlinux.conf (or boot.scr) file
on a SD card and provide a means to automate boot, and also specify a
ramdisk and a fdt. This makes it more convenient for general purpose
distros to support the platform if mainline kernel ever lands support
for it.
> I had thought to use the existing U-Boot
> because I am not aware that there is a key combination to load a different U-Boot from SD card.
Correct, there's none.
> And my L400 still has no serial console connector to watch U Boot and break to manual mode...
>
> So maybe could you briefly describe the steps how you did boot the kernel?
Sure. I'm not sure if I made it clear enough though: it doesn't really
boot -- it gets stuck early because the timer tick is not hooked on.
It just thought it's a good idea to share what I got as soon as I got
some output.
In any case, here's the config I used is at [1]. Please note that I
didn't really spent much time thinking about which options do I need --
it's literally the first thing I got booting.
[1] https://people.freedesktop.org/~lkundrak/jz4730-config
Here's how I built the uImage. Again -- it's probably not the smartest
way to do so, just my first cut at creating an image the bootloader is
happy with.
$ make ARCH=mips CROSS_COMPILE=mips64-linux-gnu- -j8 vmlinux.bin dtbs
$ cat arch/mips/boot/vmlinux.bin arch/mips/boot/dts/ingenic/mipsbook_400.dtb |gzip >vmlinux.bin.gz
$ mkimage \
-A mips \
-O linux \
-C gzip \
-T kernel \
-a $(readelf -a vmlinux |awk '/^ *LOAD *0x/ {print $3}') \
-e $(readelf -a vmlinux |awk '/Entry point address:/ {print $NF}') \
-n Linux-5.9.0-rc1-letux-l400+ \
-d vmlinux.bin.gz \
uImage
I'll look more into it as time permits, but not until next week. I'll be
visiting a friend for the next couple of days since tomorrow and I won't
have a space in the backpack to bring a computer with me.
Take care
Lubo
> Best regards and thanks again,
> Nikolaus
>
> PS: most of the work was by Paul not by me... I am just the "system integrator".
>
>
> > Am 17.11.2020 um 21:57 schrieb Lubomir Rintel <lkundrak at v3.sk>:
> >
> > Hello Nikolaus,
> >
> > Chained to this message are JZ4730-related patches I've made against the
> > Letux kernel.
> >
> > I essentially needed a Device Tree that would be good enough for U-Boot
> > bringup and your branches provided very helpful. I'm sharing the changes
> > I've had to make.
> >
> > I've given booting the kernel a shot and it fixed some oversights in the CGU
> > driver as well. It seems to lock up while calculating the bogomips due to not
> > timer tick; I haven't looked further into it yet. Dmesg near the end of this
> > message in case anyone's curious.
> >
> > Most of the patches fix up issues in earlier commits and are intended to be
> > squashed into them. The commit to fix up is indicated in the subject line.
> >
> > The first 14 patches apply against letux/jz4730-v4 (as of d94118cd960a7).
> > Starting with fixes to the CGU driver:
> >
> > [PATCH 01/20] fixup! Introduced JZ4730 watchdog timer support.
> > Add the missing JZ4730_CLK_EXT_128 define.
> > [PATCH 02/20] Revert "CLK: jz4730 CGU: FIXME: there is a clock label...
> > [PATCH 03/20] fixup! Added missing, fixed JZ4730 DT file.
> > Add more input clocks for the CGU:
> > [PATCH 04/20] fixup! Add clock driver for the JZ4730.
> > The parent mux is already called "mclk" -- use a different...
> > [PATCH 05/20] fixup! Add clock driver for the JZ4730.
> > Fix the clock type for the PCLK divisor.
> > [PATCH 06/20] fixup! Add clock driver for the JZ4730.
> > The UHC mux is already called "uhc" -- use a different...
> > [PATCH 07/20] fixup! Add clock driver for the JZ4730.
> > This fixes the WDT clock:
> > [PATCH 08/20] fixup! Add clock driver for the JZ4730
> > Define a SPI clock.
> >
> > Then come the DT fixes, still applicable against letux/jz4730-v4:
> >
> > [PATCH 09/20] fixup! Added missing, fixed JZ4730 DT file.
> > Make the UART compatible with ingenic,jz4780-uart.
> > [PATCH 10/20] fixup! Added missing, fixed JZ4730 DT file.
> > TCU on jz4730 is not a mfd.
> > [PATCH 11/20] fixup! Added missing, fixed JZ4730 DT file.
> > Fix the watchdog node name.
> > [PATCH 12/20] fixup! Added missing, fixed JZ4730 DT file.
> > Remove an unused header. Copy & paste issue I guess.
> > [PATCH 13/20] MIPS: DTS: ingenic/jz4730: Add EMC node
> > Add a node for the EMC node, with a subnode for the NAND...
> > [PATCH 14/20] MIPS: DTS: ingenic/jz4730: Add Ethernet node
> > Add a node for the ethernet MAC, with a subnode for the...
> >
> > Patches that apply against letux/dt-mipsbook400 (as of 05be4206321d3) follow.
> > They generally improve (hopefully the DT). The last one is sort of bogus;
> > only included for reference if anyone wonders for any reason why what I'm
> > submitting to U-Boot differs here.
> >
> > [PATCH 15/20] fixup! Mipsbook400: add includes for bindings
> > According to the specification [1], /chosen/stdout-path is...
> > [PATCH 16/20] fixup! Fixed Letux 400 MMC, backlight pinctrl usage.
> > The vmmc-supply property should be a phandle of the...
> > [PATCH 17/20] fixup! Added more JZ4730 device definitions.
> > Fix the NAND controller pinctrl and enable the device.
> > [PATCH 18/20] MIPS: DTS: ingenic/mipsbook_400: Add the NAND memory node
> > ...along with the partition map.
> > [PATCH 19/20] MIPS: DTS: ingenic/mipsbook_400: Hook on the Ethernet
> > Add a PHY node, use the MAC function on appropriate pins...
> > [PATCH 20/20] [remove me] MIPS: DTS: ingenic/mipsbook_400: Add the...
> > This is a kludge to make U-Boot use the WDT for system...
> >
> > And here's the dmesg:
> >
> > [ 0.000000] Linux version 5.10.0-rc4+ (lkundrak at demiurge.local) (mips64-linux-gnu-gcc (GCC) 10.2.1 20200826 (Red Hat Cross 10.2.1-3), GNU ld version 2.35.1-1.fc33) #99 PREEMPT Tue Nov 17 0
> > [ 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 0x00800000
> > [ 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-0x000000001fffffff]
> > [ 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: 256 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: 32512
> > [ 0.000000] Kernel command line: mem=128M earlycon=jz4740_uart,mmio32,0x10030000,115200n8 console=ttyS0,115200n8 irqpoll ignore_loglevel
> > [ 0.000000] Misrouted IRQ fixup and polling support enabled
> > [ 0.000000] This may significantly impact system performance
> > [ 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: 90684K/131072K available (3568K kernel code, 218K rwdata, 1196K rodata, 1284K init, 145K bss, 7620K 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+0x63c/0x864 with crng_init=0
> > [ 0.000000] timer_probe: no matching timers found
> > [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
> >
> > And in case git is more convenient than e-mail, here are my branches:
> >
> > git pull git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux.git lr/letux/jz4730-v4
> > git pull git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux.git lr/letux/dt-mipsbook400
> >
> > Take care
> > Lubo
> >
>
More information about the Letux-kernel
mailing list