[Letux-kernel] X1600 / LX16 support - here: fw_getenv() issue

H. Nikolaus Schaller hns at goldelico.com
Wed Feb 7 15:09:09 CET 2024


Hi Andreas,

> Am 07.02.2024 um 07:46 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> On Tue, 6 Feb 2024 22:38:08 +0100
> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> 
>> 
>> I just realized that this all fw_getenv() is MIPS specific! No other architecture
>> or driver uses this.
>> 
>> arch/mips/fw/lib/cmdline.c:char *fw_getenv(char *envname)
>> 
>> So I am not sure if this needs some patch in U-Boot to do what is expected.
>> And I do not exactly know what is expected :)
>> 
>> Some MIPS processors seem to use fw_getenv() to look for "initrd_start", "fdt_start",
>> "yamontty", "cpuclock", "memsize", "modetty0".
>> 
> well, initrd_start and stop is put by recent enough arm u-boot into the choosen section
> of the devicetree. Maybe just tell the u-boot to do the same...

MIPS seems to be different and all that is specialization code in arch/mips. 
MIPS is even lacking a generic configuration where only the device tree
distinguishes between boards, devices and CPU revisions... For ARM there can be
an uImage that fits all after selecting the correct DTB.

To find out what the influence of U-Boot is, I have compiled my debugging code
for the jz4780 CI20 board. There I get (for exmaple - printk starts later):

[    0.000000] arch_mem_init: after parse_early_param
[    0.000000] arch_mem_init: fw_arg1=abf3ff68 fw_arg2=abf40400 fw_arg3=00000000
[    0.000000] arch_mem_init: fw_arg1[0] 00000000
[    0.000000] arch_mem_init: fw_arg1[1] abf40368
[    0.000000] arch_mem_init: fw_arg1[2] abf4037d
[    0.000000] arch_mem_init: fw_arg1[3] abf4038a
[    0.000000] arch_mem_init: fw_arg2[0] abf40800
[    0.000000] arch_mem_init: fw_arg2[1] abf4080d
[    0.000000] arch_mem_init: fw_arg2[2] abf40825
[    0.000000] arch_mem_init: fw_arg2[3] abf40835

Looks all reasonable and fw_arg2 properly initialized so that fw_getenv("rngseed")
does not fail in 6.8 kernels.

This means that there is an incompatibility between old U-Boot (or lx16 u-boot)
and new kernels. This bug was hidden in 5.10...

Our U-Boot is:

U-Boot 2013.07-00324-g0ecd9f212b-dirty (Jul 15 2023 - 15:02:47)
https://git.goldelico.com/?p=letux-uboot.git;a=shortlog;h=refs/heads/ingenic-x1600

We obviously have to patch this U-Boot.

I'll look into that next.

BR,
Nikolaus




More information about the Letux-kernel mailing list