[Letux-kernel] LX20 prototype is booting

H. Nikolaus Schaller hns at goldelico.com
Tue May 6 17:06:08 CEST 2025



> Am 06.05.2025 um 10:50 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
>> 
>> NOTE 1: git diff v6.1.28 sudomaker-6.1.28 arch/mips/kernel/cpu-probe.c is not empty!
> 
> There are three sudomaker-patches modifying this file:
> 
> https://git.goldelico.com/?p=letux-kernel.git;a=history;f=arch/mips/kernel/cpu-probe.c;h=49282a6aa8c88b7f129ffb3e7bf4163cb4be3993;hb=39077e7113a1bc29f316a786e13a57e9df92a1eb

Now, I have tried to find out why the 6.15-rc5 stalls with SYS_HAS_CPU_MIPS32_R2.
It happens at the same location as in 6.1.28-sudomaker.

So the above mentioned changes are not relevant at all.

Some more checks show boot with SYS_HAS_CPU_MIPS32_R2 hangs here:

	BUG_ON(current_cpu_type() != c->cputype);
	https://elixir.bootlin.com/linux/v6.15-rc5/source/arch/mips/kernel/cpu-probe.c#L1907

Ah, that finally was the correct hint.

There is a non-upstream patch for cpu_probe_ingenic() to set c->cputype = CPU_XBURST2:

	https://git.goldelico.com/?p=letux-kernel.git;a=commitdiff;h=a67c8db0a394fc

This also adds CPU_XBURST2 to __get_cpu_type() - but only for CONFIG_SYS_HAS_CPU_MIPS32_R5!
And if it is missing this ends in the unreachable() call in __get_cpu_type().

So we have found the reason why it does not work with CONFIG_SYS_HAS_CPU_MIPS32_R2.

But should it or not? To be compatible with elf-loading of Debian Jessie MIPSEL code?

Indeed this hack (but is it correct?) makes the sudomaker-6.1.28 kernel boot a little further:

diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h
index a412895a8b4f1..24f26f6b271ec 100644
--- a/arch/mips/include/asm/cpu-type.h
+++ b/arch/mips/include/asm/cpu-type.h
@@ -39,6 +39,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)
     defined(CONFIG_SYS_HAS_CPU_MIPS32_R2)
        case CPU_4KEC:
        case CPU_XBURST:
+       case CPU_XBURST2:
 #endif
   #ifdef CONFIG_SYS_HAS_CPU_MIPS32_R2
diff --git a/arch/mips/ingenic/Kconfig b/arch/mips/ingenic/Kconfig
index 22940d2c2a4ac..1f80372ce9a62 100644
--- a/arch/mips/ingenic/Kconfig
+++ b/arch/mips/ingenic/Kconfig
@@ -148,7 +148,7 @@ config MACH_X1830
 config MACH_X2000
        bool
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
-       select SYS_HAS_CPU_MIPS32_R5
+       select SYS_HAS_CPU_MIPS32_R2
        select SYS_SUPPORTS_HIGHMEM
        select SYS_SUPPORTS_SMP
        select MIPS_O32_FP64_SUPPORT

At least this explains why the X2000 is so special and all other devices we support
are not affected. The X2000 is the only XBurst2 and MIPS32_R5 system have.

I think I should now better focus on fixing the hardware and build some more prototypes.
There is only a major problem to be found on one of the current prototpyes - if it needs
a general fix.

And, I have assigned some I2C and GPIO pins to the headers. In a ways that it should be
useful, but certainly not optimal. A big issue is the 1.8V I/O level on some GPIO ports.
Which means I would have to add expensive bidirectional level shifters to get the RasPi
3.3V levels. But let's discuss when the next version is finished and kernel is booting...

BR,
Nikolaus



More information about the Letux-kernel mailing list