[Letux-kernel] LX20 prototype is booting

H. Nikolaus Schaller hns at goldelico.com
Wed Apr 30 21:05:40 CEST 2025



> Am 30.04.2025 um 15:01 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> 
> 
>> Am 29.04.2025 um 19:00 schrieb Paul Boddie <paul at boddie.org.uk>:
>> 
>> On Tuesday, 29 April 2025 18:21:59 CEST H. Nikolaus Schaller wrote:
>>> 
>>> Now the sudomaker-6.1.y is finishing calibrate_delay_converge() and starts
>>> scheduling and probing drivers :) But still has no console. Stills seems as
>>> if we have made a big step forward.
>> 
>> Great!
>> 
>>> For the letux-6.15 kernel it appears as if drivers/clk/ingenic/x2000-cgu.c
>>> is not forward-ported yet.
>> 
>> I did look at this briefly a couple of days ago. I seem to remember having to 
>> change various functions in the generic cgu.c for the X1600, and maybe we just 
>> need to bring the x2000-cgu.c file into line with x1600-cgu.c and whatever 
>> adjustments were required in that file.
> 
> Well, it was simply missing - and it's Makefile/Kconfig. So it was not compiled into
> our letux-6.15 kernel...
> 
> I only had to adjust an #include and the signature of x2000_cgu_calc_m_n_od() to
> get it compiled. We have added another parameter to (*calc_m_n_od)() to support
> the x1600.
> 
> But still the 6.15 kernel is stuck while the 6.1.28 even switches on one LED
> (but does not blink).
> 
> So I am currently trying to find out what differs. Well, at least 70000 files show
> diffs.

After adding even more ll_printk() I was lucky to find a difference in the boot logs.
It is that ingenic_ost_probe() is not called. It is in drivers/clocksource/ingenic-sysost.c

upstream: only supports x1000 - https://elixir.bootlin.com/linux/v6.15-rc4/source/drivers/clocksource/ingenic-sysost.c#L540
letux: is the same - https://git.goldelico.com/?p=letux-kernel.git;a=blob;f=drivers/clocksource/ingenic-sysost.c;h=cb6fc2f152d467bbb2777f39eca94eb33dd4e179;hb=923af7f71fde8eacbe1a0633bd48e6fbec8edebe
sudomaker: has a lot of patches on top, adding its own x1600-ost, x1700-ost, x1830-ost, x2000-ost32 &64, x2500-ost32 &64

In letux-kernel we have no OST driver for the x2000. For the x1600 we simply (re)use the x1000-ost.

So I tried to forward port the sysost patches (even if they introduce an unused ingenic,x1600-ost).

It doesn't yet show timer activity but by drilling deeper into ingenic_ost_init() and
ingenic_ost_probe() I have got an "Unable to request IRQ 4" for node ingenic,x2000-ost32

The reason is that there is an irq descriptor translated within __request_percpu_irq()
but the condition

	if (!desc || !irq_settings_can_request(desc) ||
	    !irq_settings_is_per_cpu_devid(desc))

(https://elixir.bootlin.com/linux/v6.15-rc4/source/kernel/irq/manage.c#L2608)
fails. So something in the IRQ subsystem needs to be patched to make OST work...

The best is to ll_printk the irq_settings_can_request() and irq_settings_is_per_cpu_devid()
and find out where they should come from.

DTS for the ost32 node is:

	ost32: timer at 12100000 {
		compatible = "ingenic,x2000-ost32";
		reg = <0x12100000 0x3c>;

		#clock-cells = <1>;

		clocks = <&cgu X2000_CLK_OST>;
		clock-names = "ost";

		interrupt-parent = <&cpuintc>;
		interrupts = <4>;

		/* 6 MHz for the system timers */
		assigned-clocks = <&ost32 OST_CLK_EVENT_TIMER0>, <&ost32 OST_CLK_EVENT_TIMER1>;
		assigned-clock-rates = <6000000>, <6000000>;
	};

The same DTS works within the sudomaker-6.1.28 kernel. So I would assume
that the IRQ number 4 is correct. It is only not fulfilling some required conditions.

Maybe searching the code for (_)IRQ_PER_CPU_DEVID or (_)IRQ_NOREQUEST could give some
hints where they are used specific to the x2000 and what differs between the kernels.

BR,
Nikolaus






More information about the Letux-kernel mailing list