OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - Other distros support => Topic started by: lfdebrux on July 05, 2022, 06:14:25 am

Title: Linux kernel version 6 support
Post by: lfdebrux on July 05, 2022, 06:14:25 am
Hi,

While submitting a patch to the kernel to improve the Zaurus support, it was mentioned that the maintainers for the PXA port are looking to rewrite the code to use the Devicetree format:

https://lore.kernel.org/linux-arm-kernel/CAK8P3a0HBvhe0MHjjO+WyEp669qd2NEC5RC7_jcvnEJM6X0Fug@mail.gmail.com/

They asked if I would like to help, which I said yes to, although I'm a bit new to kernel development.

Is there anyone else who'd like to get involved with this?
Title: Re: Linux kernel version 6 support
Post by: Varti on July 05, 2022, 07:00:49 am
Thanks a lot for taking care of this, I really hope that Zaurus' support will be kept in the future 6.x kernel. I also hope that sa1100 support for the 5500 will be kept too, I have read that qemu already supports it and Linus Walleij seems to be interested to port it to DT:

https://lore.kernel.org/linux-arm-kernel/CACRpkdY2_ZbmcSuuMB9t5bB-tGE0iAc-nE26JwxidRFocRahSw@mail.gmail.com/

I'm not a developer, and unfortunately in general I don't have much free time, but I can help with testing the kernel builds on real hardware, as I have a collection of working Zauruses: I have all the models starting from the 5500 to the SL-C3200.

Varti
Title: Re: Linux kernel version 6 support
Post by: greguu on July 13, 2022, 12:42:33 am
Hi,

I had actually planned to work on migrating spitz.c to DT this year, but to be fair I have not had the time and focus to work on it so far.

As pointed out in the mailing list, while moving PXA270 targets to DT should be relatively straight forward, there are some exotic boards and I think some Sharp devices fall in that category. But with some support from the kernel dev team we should be able to get this moving before spitz.c is dropped.

I got a Borzoi, but I also some ZipIt2 devices that are PXA270 based. For those the move to DT was partially done, but not submitted upstream.

What kernel version did you work with so far and do you have any patches apart from the one you send through to the mailing list ?
What bootloader and rootfs do you use on your Zaurus ?

Also I have not tested kexecboot alongside a DT file yet and do not know if kexecboot supports it, but we can always append the compiled DT to the kernel image.

While maintaining the kernel is a priority, we lost Arch Linux ARM armv5tel support earlier this year and the custom Void Linux build (voidz) is due for a new build as well, or any other distribution that still supports armv5tel.. as not all users want to spin up their own rootfs using buildroot or the like.

Happy to get involved, but a bit cautious about on how much I can commit myself to this activity over the next months as I started this year to port an Intel based ARM board IXP43x based to DT and wanted to progress with this one first before picking up the Zaurus again, but perhaps this can go hand in hand.

Cheers,
Greg

Hi,

While submitting a patch to the kernel to improve the Zaurus support, it was mentioned that the maintainers for the PXA port are looking to rewrite the code to use the Devicetree format:

https://lore.kernel.org/linux-arm-kernel/CAK8P3a0HBvhe0MHjjO+WyEp669qd2NEC5RC7_jcvnEJM6X0Fug@mail.gmail.com/

They asked if I would like to help, which I said yes to, although I'm a bit new to kernel development.

Is there anyone else who'd like to get involved with this?
Title: Re: Linux kernel version 6 support
Post by: lfdebrux on July 13, 2022, 05:40:44 pm
Hi Greg!

Your work on Void Linux has been a massive help and inspiration, so you've already done loads for me!

I got a Borzoi, but I also some ZipIt2 devices that are PXA270 based. For those the move to DT was partially done, but not submitted upstream.

That's interesting, are those patches available anywhere to look at?

What kernel version did you work with so far and do you have any patches apart from the one you send through to the mailing list ?

I'm currently running kernel 5.16.41 and a fork of your 'Voidz' Linux repo. The main difference to your repo is it follows upstream a bit more closely. You can see the interesting changes by going to

http://github.com/void-linux/void-packages/compare/master...lfdebrux:voidz-packages:voidz

Edited to add: Oh, and I'm also working on getting the 5.19 release candidate working, I have some other patches that are work in progress, my code is at https://github.com/lfdebrux/linux/tree/zaurus/fix-corgi-backlight-v3.

What bootloader and rootfs do you use on your Zaurus ?

Also I have not tested kexecboot alongside a DT file yet and do not know if kexecboot supports it, but we can always append the compiled DT to the kernel image.

For bootloader I'm relying on your 'frankenstein' linux 2.6 kexecboot, which works great on my devices (I have a Spitz and an Akita). On my todo list is getting the OpenEmbedded machinery back up and running so I can build a new kexecboot. I know that the latest versions of kexecboot do have support for devicetree, although I don't fully understand how botting with device tree blobs works yet.
Title: Re: Linux kernel version 6 support
Post by: lfdebrux on July 13, 2022, 05:45:07 pm
Thanks a lot for taking care of this, I really hope that Zaurus' support will be kept in the future 6.x kernel. I also hope that sa1100 support for the 5500 will be kept too, I have read that qemu already supports it and Linus Walleij seems to be interested to port it to DT:

https://lore.kernel.org/linux-arm-kernel/CACRpkdY2_ZbmcSuuMB9t5bB-tGE0iAc-nE26JwxidRFocRahSw@mail.gmail.com/

I will try, no promises though!

I'm not a developer, and unfortunately in general I don't have much free time, but I can help with testing the kernel builds on real hardware, as I have a collection of working Zauruses: I have all the models starting from the 5500 to the SL-C3200.

That's very cool! I may ask for testing things in future, I currently have an Akita and a Spitz, but I sometimes have issues that I'm not sure whether they are specific to my hardware or not.
Title: Re: Linux kernel version 6 support
Post by: greguu on July 14, 2022, 01:40:55 am

Good stuff, great to see someone picking up the void build.
It's a bit work to keep following upstream, but if regularly build, it's manageable.
I dropped the ball on it as there was not really much of a user-base, at least not known to me via this forum.

In regards to the DT patched for the ZipIt, these can be found here: https://github.com/openwrt-zipit/openwrt-pxa-target/tree/master/pxa/patches-4.4
The ZipIt is quite different in some aspects to the Zaurus, but the CPU is the same.
The patches may give some insight on how to move from platform file to DT though.

..

Yes, need to try the latest kernels. How does the 5.16 work for you vanilla ?
I would think it will just boot, but did mmc and pcmcia/cf work out of the box ?
Does the screen fade white if not used for a while ?
Yatli did some fixes for 5.4 here recently as well : https://github.com/yatli/linux-zaurus-5.4

..

I build kexecboot natively on Arch Linux ARM the last time as always keen to avoid setting up OE build chain for some reason.
There should be support for DT in kexecboot, but I never used it. 

For a new kexecboot kernel that eventually will use DT, we will need to append the .dtb to the zImage as the Zaurus bootloader will not understand DT.
I hope we can actually trim a newer 5.x or even 6.x to fit into the kernel Zaurus kernel partition! It was getting pretty tight with 4.x even.

Title: Re: Linux kernel version 6 support
Post by: lfdebrux on July 23, 2022, 05:22:29 pm

Good stuff, great to see someone picking up the void build.
It's a bit work to keep following upstream, but if regularly build, it's manageable.


Yes, it's not too bad! Unfortunately I don't have somewhere to host so am unable to share the binaries.


Yes, need to try the latest kernels. How does the 5.16 work for you vanilla ?
I would think it will just boot, but did mmc and pcmcia/cf work out of the box ?
Does the screen fade white if not used for a while ?
Yatli did some fixes for 5.4 here recently as well : https://github.com/yatli/linux-zaurus-5.4


SD Card and CF work no issues with vanilla 5,16 kernel! The fade to white issue is interesting, I had an issue with my SL-C1000 where the screen would turn white when suspending, and then coming out of suspend would be very difficult, but with the SL-C3000 it suspends just fine. I thought it might be something broken with my device, having other people test would be helpful. I do have some other issues though, including offline charging not working.


I build kexecboot natively on Arch Linux ARM the last time as always keen to avoid setting up OE build chain for some reason.
There should be support for DT in kexecboot, but I never used it.


Ah, interesting, I must try that sometime.
Title: Re: Linux kernel version 6 support
Post by: lfdebrux on July 23, 2022, 05:36:22 pm
So a proposal to start removing board files supporting older ARM devices has been made:

https://lore.kernel.org/linux-arm-kernel/20220721141722.2414719-4-arnd@kernel.org/

The SL-C3000 machines have been spared because I volunteered to convert it to devicetree, but lots of other Zaurus models have been marked as unused, including the SL-5500 type.
Title: Re: Linux kernel version 6 support
Post by: greguu on August 11, 2022, 10:39:13 pm
Great initiative.. perhaps some are interested to join the IRC channel for collaboration on this effort... ?
Title: Re: Linux kernel version 6 support
Post by: yatli on August 12, 2022, 03:35:01 am
Where's the party :D :D
Title: Re: Linux kernel version 6 support
Post by: greguu on November 03, 2022, 11:33:32 pm
Everyone is waiting for @yatli to join the party 8)
Title: Re: Linux kernel version 6 support
Post by: greguu on January 16, 2023, 01:13:12 am
Just back out of the holidays and I stumbled across this commit (2023 Spring Cleaning). https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/commit/?h=for-next&id=94ac29dc59d029c6ff61509e3b58fa0beb1f2966

While not unexpected, it is still sad to see such a large amount of unmaintained ARM SoC's getting purged.

The good news is the Cxx00 series (Akita/Spitz/Borzoi) is to remain within linux 6.2 and this gives again some time to move them to device tree, or at least assist in the process of it and do some testing.

Unfortunately, the bad news is that Corgi, Tosa and Poodle are marked as to be removed. I just got a Corgi donated :\

It would be a good idea to move the discussion into the #oesf IRC channel on oftc.net to work out some plan / project / work load sharing for those with some experience in kernel development and device tree. Leave a post below if you like to join the effort. :o
Title: Re: Linux kernel version 6 support
Post by: Varti on January 16, 2023, 03:45:37 am
Hi greguu, nice to hear you back, I hope you had a good holiday. Yes, the removal of Corgi/Tosa/Poodle support is heartbreaking, although as you said not unexpected. I still hope for someone to step in and do the necessary changes to devicetree for these devices. Nice to hear also that your Zaurus collection is being expanded.
This reminds me that I still need to do the testing you asked a while ago, ouch  :( I'll see if I can find some free time in the next days.

Varti
Title: Re: Linux kernel version 6 support
Post by: lfdebrux on January 16, 2023, 04:22:38 pm
It would be a good idea to move the discussion into the #oesf IRC channel on oftc.net to work out some plan / project / work load sharing for those with some experience in kernel development and device tree. Leave a post below if you like to join the effort. :o

I'll admit that I haven't got as far as I hoped in the time since I last posted, but I would still like to be involved. I will join the IRC channel.
Title: Re: Linux kernel version 6 support
Post by: greguu on March 24, 2023, 02:53:26 am
Hey, just an update.

I did find minimal time to play with 6.2 kernel and basic device tree earlier this year, but it would not boot for me.
It seems I may need to debug the platform code on 6.1 first, to get it to boot, before using 6.2+ as some code already was dropped that may have impact on the Zaurus series.
While I had not the time to dig much deeper yet, I came across these :

https://www.phoronix.com/news/Linux-6.4-PCMCIA-Char-Dropping
https://www.phoronix.com/news/Linux-6.4-CardBus-USB-Dropping

Looking further, it does impact Zaurus:
https://lore.kernel.org/all/Y07d7rMvd5++85BJ@owl.dominikbrodowski.net/

While the  PXA PCMCIA driver is not yet to be purged and marked as + (eg may stay) it still an indicator of whats to come:

+ PCMCIA_PXA2XX - pxa2xx_base.c pxa2xx_base.h pxa2xx_mainstone.c pxa2xx_sharpsl.c : bugfix in 2016

Wireless CF cards typically used by Zaurus already have a [-] (eg get removed if no maintainers found):

[-] drivers/net/wireless/intersil/hostap/hostap_cs.c      no specific activity since tree reorganization 2015
[-] drivers/net/wireless/intersil/orinoco/orinoco_cs.c      no specific activity since tree reorganization 2015
[-] drivers/net/wireless/intersil/orinoco/spectrum_cs.c      no specific activity since tree reorganization 2015
[-] drivers/net/wireless/marvell/libertas/if_cs.c              no specific activity since tree reorganization 2015

Long story short, while it looks like there is not much userbase anymore and I am on my own to keep this platform alive, I have not yet caved in, but with the extra pressure mounting to support / maintain extra stuff to keep it usuable (eg PCMCIA and cards), its getting beyond not only my very limited spare time to dedicate to this, but also my skill set as well.

So anyone keen to keep this stuff in the kernel, may pitch it to the kernel mailing list  :o
I still have some laptops with CardBus and PCMCIA and I expect others have too, but it will be seen if kernel support is to remain on the long run..
Good News is 6.1 is a LTS and if we get it to boot on Zaurus we should be good for some time to come, but the writing is clearly on the wall....

Cheers,
Greg
Title: Re: Linux kernel version 6 support
Post by: Varti on March 24, 2023, 05:52:41 am
Hi greguu,

thanks for the update. Please keep us updated about your work on 6.2, I hope not too much code has been left out which would prevent its use on our Z's. Sad to hear about the wireless drivers, though it was inevitable... I'm wondering is if it would be possible to use newer network cards on our Zauruses. An USB wifi dongle, connected via an USB type B-female A connector might be our best chance, though it won't look pretty. This way we wouldn't be limited to 802.11b connections, which might be already not supported anymore by some routers. In the past USB host adapter for the CF slot were available too, though I'm not sure if they are still available somewhere.

Varti