[Letux-kernel] X1600 / LX16

H. Nikolaus Schaller hns at goldelico.com
Mon Feb 5 22:46:34 CET 2024

Hi all,
thanks to the work by Paul we can partially boot a letux-6.8-rc3 kernel
on the X1600 / LX16.

I have rebased the code to v6.8-rc3 and here is the latest kernel:

	https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-x1600-v2 <https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-x1600-v2>

As you can see it is just 4 patches ahead of letux-current to make it partially boot.

The first patch (prevent disabling the TCU) is probably not even needed.
The second one seems to need polishing to be activated only on the X1600.
The thrid one is something I have analysed a little (see below).
The fourth one needs analysis because it not really disables UART nodes but takes the default ones.

Now about the cmdline parsing failure. It happens in fw_getenv().

It is not possible to printk() here (because it is too early), but with the old work-x1600
branch and it's ll_printk() hack I was able to debug a little:

char *fw_getenv(char *envname)
	char *result = NULL;

ll_printk("%s: %px\n", __func__, _fw_envp);
if (_fw_envp) ll_printk("%s: %px\n", __func__, fw_envp(0));

	if (_fw_envp != NULL && fw_envp(0) != NULL) {
		 * Return a pointer to the given environment variable.
		 * YAMON uses "name", "value" pairs, while U-Boot uses
		 * "name=value".
		int i, yamon, index = 0;

		yamon = (strchr(fw_envp(index), '=') == NULL);

results in this boot log:

setup_arch: after paging_init
setup_arch: after memblock_dump_all
setup_rng_seed: start
fw_getenv: a1f64440
fw_getenv: 333d6d65
=== here the processor hangs ===

Hangs most likely in strchr().

The string is said to start at 0x333d6d65 - but it looks more like
being some string itself and not a pointer to a string.

So most likely _fw_envp is a dangling pointer and not what it should be.

Most likely it should be set up here:


Something to analyse further. Maybe by comparing code with the working
letux-5.10.y-lx16 kernel.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20240205/332c87c7/attachment.htm>

More information about the Letux-kernel mailing list