New kernels

AmigaOne X1000 platform specific issues related to Linux only.
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 910
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: New kernels

Post by Hypex »

xeno74 wrote: Thu Feb 27, 2025 6:41 pm I don't have really much knowledge about patching the dtb during the boot.
I'm still learning myself but writing the X1 loader taught me some quirks about the OF API works. :-)
Maybe this can help but I am not sure if it is correct:
I'll make some comments. ;)

Code: Select all

    + prom_setprop(iob, NULL, "#address-cells", "3", sizeof(3));
    + prom_setprop(iob, NULL, "#size-cells", "2", sizeof(2));
    + prom_setprop(iob, NULL, "#interrupt-cells", "1", sizeof(1));
What do you think?
That's a good start. I'm not sure if it will reject properties that don't exist as it needs to add them but it should work fine. The only issue is the hash values are integers so will need be sent as such. So the following (untested) example may be needed:

Code: Select all

arch/powerpc/kernel/prom_init.c:

/*
	 * The io-bridge has device_type set to 'io-bridge' change it to 'isa'
	 * so that generic isa-bridge code can add the SB600 and its on-board
	 * peripherals.
	 */
	name = "/pxp@0,e0000000/io-bridge@0";
	iob = call_prom("finddevice", 1, 1, ADDR(name));
	if (!PHANDLE_VALID(iob))
		return;
	/* device_type is already set, just change it. */
	prom_printf("Changing device_type of SB600 node...\n");
	prom_setprop(iob, name, "device_type", "isa", sizeof("isa"));

    + u32 addresss_cells = 3, size_cells =2, interrupt_cells = 1;
	
    + prom_setprop(iob, name, "#address-cells", &address_cells, sizeof(u32));
    + prom_setprop(iob, name, "#size-cells", &size_cells, sizeof(u32));
    + prom_setprop(iob, name, "#interrupt-cells", &interrupt_cells, sizeof(u32));
Though I think it would be better to pull the cell sizes from the parent pxp device, rather than use direct values.
User avatar
xeno74
Posts: 10707
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: New kernels

Post by xeno74 »

xeno74 wrote: Fri Feb 28, 2025 10:39 am Hi All,

I created a patch because of the missing properties today.

After that, I compiled a new RC4 with this patch.

Download: v6.14.0-rc4-2

Please test this kernel.

If it boots then please post the output of dtc -I dtb /sys/firmware/fdt.

Thanks,
Christian
Hypex,

Thank you for your comments. Could you also please test the kernel v6.14.0-rc4-2?

After that, I will replace my code with yours. :-)

Thanks,
Christian
User avatar
xeno74
Posts: 10707
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: New kernels

Post by xeno74 »

Hypex wrote: Fri Feb 28, 2025 4:45 pm That's a good start. I'm not sure if it will reject properties that don't exist as it needs to add them but it should work fine. The only issue is the hash values are integers so will need be sent as such.
I tested the kernel 6.14.0-rc4-2 today and you're right with that's a good start.

The output of missing properties is gone. That means, we can patch the dtb during the boot. :-)

But you're also right with sending the hash values as integers.

Currently the values are:

Code: Select all

io-bridge@0 {
			#interrupt-cells = <0x31000000>;
			#size-cells = <0x32000000>;
			#address-cells = <0x33000000>;
			device_type = "isa";
			vendor-id = <0x1959>;
			device-id = <0xa001>;
			revision-id = <0x12>;
			class-code = <0x60000>;
			reg = <0x00 0x00 0x00 0x00 0x00 0x82000000 0x00 0xe0000000 0x00 0x2000 0xc2000000 0x00 0xfd800000 0x00 0x1000>;
			assigned-addresses = <0x82000000 0x00 0xe0000000 0x00 0x2000 0xc2000000 0x00 0xfd800000 0x00 0x1000>;
			interrupt-parent = <0x7fe2f6e8>;
			interrupts = <0x56 0x01>;
			compatible = "pasemi,1682m-iob\0pasemi,io-bridge";
			phandle = <0x7fe32728>;
The values are incorrect.
User avatar
xeno74
Posts: 10707
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: New kernels

Post by xeno74 »

Hypex,

Your code works! I created a new patch and compiled a new RC4 with this patch today.

Download and further information: v6.14.0-rc4-3

@All
Please test this kernel.

Thanks,
Christian
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 910
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: New kernels

Post by Hypex »

xeno74 wrote: Sat Mar 01, 2025 11:30 am Hypex,

Your code works! I created a new patch and compiled a new RC4 with this patch today.
Great! :-D

Sorry I had to dog sit over the week end so away from my X1000. Back tonight. Will also test the patch for interest but did the rc4-2 crash?

Another way would be add Nemo to the excluded default cells list like below. But it would silence the warning and use default values which may still be faulty. So I think your solution of fixing up the tree to be compliant is better. :-)

https://github.com/torvalds/linux/commi ... 72fb3bc895
User avatar
xeno74
Posts: 10707
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: New kernels

Post by xeno74 »

Hypex wrote: Sat Mar 01, 2025 12:25 pm Will also test the patch for interest but did the rc4-2 crash?
No, it didn't crash.
User avatar
musa
Posts: 873
Joined: Tue Aug 23, 2011 8:58 pm

Re: New kernels

Post by musa »

Hi
vmlinux-6.14_rc4-2 and vmlinux-6.14_rc4-3 running on my system.





Image

Image
AmigaX1000
User avatar
xeno74
Posts: 10707
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: New kernels

Post by xeno74 »

musa wrote: Sun Mar 02, 2025 9:55 am Hi
vmlinux-6.14_rc4-2 and vmlinux-6.14_rc4-3 running on my system.
Great! Thanks a lot for testing! :-)
User avatar
xeno74
Posts: 10707
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: New kernels

Post by xeno74 »

Last edited by xeno74 on Mon Mar 03, 2025 4:22 am, edited 1 time in total.
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 910
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: New kernels

Post by Hypex »

xeno74 wrote: Sat Mar 01, 2025 1:50 pm No, it didn't crash.
Confirmed. Ran both patches. Seems to work fine and soon onto the RC5. :-)
Post Reply