[Letux-kernel] Latest news from LetuxOS Kernel development...
H. Nikolaus Schaller
hns at goldelico.com
Sun Jun 1 21:12:24 CEST 2025
Hi,
there are some good news.
1) PocketBeagle 2
I have added support to the arm64 variant of the LetuxOS Kernel.
This meant adding the device tree source and enabling the ADC
companion chip in the arm64/letux_defconfig (it simulates an
8 channel AD7291).
Compiling, creating a new µSD (with makesd -vlatest pocketbeagle2)
and installing the patched kernel worked out of the box. Amazing!
It has 512 MB RAM, an am6254 quad core a53 at 1.4 GHz. Comes with
USB(2)-C client only connector, buttons and LEDs so that it
can run stand-alone.
But beware: it is getting quite warm even if in idle mode.
2) MIPS generic kernel
Unfortunately there is no progress for the LX20 so far.
But for the CI20 I have added a command to the bootcmd
of U-Boot so that it loads a ci20.dtb.
Getting the kernel boot in generic mode was really tricky.
a) there are some hard coded CONFIG dependencies for
jz4780 and/or ci20, mainly in the interrupt handling. I have
added code to the drivers so that they decode what is needed
during runtime.
b) still, I could not get the generic kernel boot. It was
simply the difference between:
(CONFIG_MACH_INGENIC_GENERIC=y)
CONFIG_INGENIC_GENERIC_BOARD=y
and
CONFIG_JZ4780_CI20=y
With JZ4780_CI20 I could boot and with INGENIC_GENERIC_BOARD
the CI20 was stuck in calibrate_delay_converge().
Another difference was that with JZ4780_CI20 there was a
standard console log by printk while it was missing for
INGENIC_GENERIC_BOARD.
And finally, with JZ4780_CI20 some interrupts were working.
Switching between CI20 and GENERIC board has of course dependent
changes, but none was responsible.
After many debugging trials (adding ll_printk and diff-ing
logs) it became clear that the issue appears if
-- U-Boot does not pass -2 as fw_argc to kernel get_fdt()
https://elixir.bootlin.com/linux/v6.15/source/arch/mips/include/asm/bootinfo.h#L130
AND
-- CONFIG_BUILTIN_DTB is set.
To make things worse, setting NO_APPENDED_DTB enforces
BUILTIN_DTB which IMHO is not correct or is at least a strange
name for these CONFIGs:
https://elixir.bootlin.com/linux/v6.15/source/arch/mips/Kconfig#L134
Should it be
select BUILTIN_DTB if !MIPS_NO_APPENDED_DTB ?
All this made a build with single DTB (CI20) of course work, because some DTB
was built into the uImage. But with generic kernel and multiple options
it was random which one was built into the kernel, so it was NOT the ci20.dtb.
The result was that the generic kernel worked on LX16 (because our U-Boot
was already patched properly:
https://git.goldelico.com/?p=letux-uboot.git;a=commitdiff;h=afb3f06726e863fde69a6423ba4b3c9fb0801ff5
but not the CI20 U-Boot:
https://git.goldelico.com/?p=letux-uboot.git;a=blob;f=arch/mips/lib/bootm.c;h=57adb1c2f3a9164e1085674d0ef590815578cca2;hb=c326965fa8c91cc8f3441c0d2e54105d0e48936e#l205
Or in other words, if U-Boot passes fw_argc == -2 this mess is ignored
(even if some DTB is unexpectedly built into the kernel due to CONFIG bugs).
And there was an almost final issue already fixed for LX16/LX20: passing the kernel bootargs
through the DTB by setting /chosen. Here is the fixed U-Boot source:
https://git.goldelico.com/?p=letux-uboot.git;a=shortlog;h=refs/heads/ci20-v2013.10
and binary:
https://download.goldelico.com/letux-u-boot/CI20/latest/
A final big one was that CONFIG_SERIAL_8250_NR_UARTS=4 (which is enough
for LX16/20) must be 5 for the CI20 board and was set correctly in letux_ci20_defconfig.
After tweaking some more details (e.g. enabling DM9000) in CONFIGs we now have a working LetuxOS U-Boot for
LX16/LX20/CI20 that can load and start a LetuxOS MIPS generic kernel that is built with
arch/mips/configs/letux_defconfig.
Mission "mips-generic" accomplished!
Except for a small issue that the jz4780-rtc driver complains:
[ 17.883465] platform 10003000.rtc: deferred probe pending: jz4740-rtc: Failed to get RTC clock
And except for the Alpha400 Mini-Notebook which needs a lot of debugging to get
the boot process right - AFAIR it uses an intermediate kernel and kexec which
makes it very different to pass a DTB file to the final kernel if the intermediate
kernel isn't prepared for this (AFAIR it is some 2.6.something). But that is low
priority since we can't even run Debian 9 on the jz4780 (we have added some
emulaton for missing op-codes but that is incomplete to boot).
But more important is to make the LX20 finally boot.
3) now, Letux-6.15.0 including these fixes can and will be built...
BR,
NIkolaus
More information about the Letux-kernel
mailing list