Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partially fix aarch64 BE on the zero2w #6295

Open
wants to merge 1 commit into
base: rpi-6.7.y
Choose a base branch
from

Conversation

cleverca22
Copy link

@cleverca22 cleverca22 commented Aug 2, 2024

this PR allows booting big-endian linux on a zero2w

what works:

  • serial console
  • dwc2 gadget mode

what partially works:

  • mailbox framebuffer byte order is backwards, but it does display text
  • cpufreq is reporting incorrect clocks
  • wifi (if the sdhci driver is modified to not use DMA, TODO)

what doesnt work:

  • vchiq
  • dma (TODO)
  • sdhost
  • dwc

untested:

  • kms/fkms

@pelwell
Copy link
Contributor

pelwell commented Aug 2, 2024

Why is this something somebody (else) would want to do? It looks like most of these files are unmodified upstream files, so proposals for changes should be sent to the maintainers.

@cleverca22
Copy link
Author

cleverca22 commented Aug 2, 2024

@pelwell in my case, i need a big-endian build machine, because of some issues with cross-compiling to a different BE arch

https://forums.raspberrypi.com/viewtopic.php?t=328078
there is also prior work, where somebody else already did these fixes, and they never got upstreamed

i can also see it being useful to test existing software, to ensure it handles byte-swaps correctly
having these fixes merged/upstreamed, would greatly simplify producing an aarch64-be rpi image, where anybody can then test their software to see if it handles BE properly
a software solution on the rpi is far cheaper then having to buy some exotic BE system

i had assumed that since all of those files are rpi related, it would be best to target this downstream fork of linux first, and then it gets upstreamed later?
or would it be better to try and submit the changes directly to mainline?

@6by9
Copy link
Contributor

6by9 commented Aug 2, 2024

fkms and bcm2708_fb are irrelevant to upstream, and TBH adding BE support to those feels like unnecessary churn downstream.

Using simple_fb should work instead of bcm2708_fb. The firmware looks for display0 as an alias, and /soc/fb being disabled in order to configure simple_fb.

A patch should only touch one subsystem, and requires a commit message and Signed-off-by tag.
Debugging printk's need to be removed.

Whilst booting basic BE support may be reasonable, going for full BE support feels unnecessary.

@cleverca22
Copy link
Author

cleverca22 commented Aug 2, 2024

Whilst booting basic BE support may be reasonable, going for full BE support feels unnecessary

yep, thats why i'm ignoring things like (f)kms and vchiq
the only thing i might do, is a Kconfig change, so they conflict with the BE flag, then it wont cause any problems and it will be clear that they arent supported

A patch should only touch one subsystem, and requires a commit message and Signed-off-by tag.

i'll work on splitting this PR up into several commits, and fixing all of the CI complains as well

bcm2708_fb throws numerous errors when unpatched, but i dont fully need it either, so i could just toss it in with the same Kconfig flag as vchiq and (f)kms

my end goal is to just have a headless BE machine with working network

@cleverca22
Copy link
Author

the dwc_otg looks like too big of a task for me to fix

its using bitfield structs, and the compiler has reversed the fields, rather then the bytes
so now every field the code is using to decode registers is mis-aligned and the whole driver is hosed
fixing that would basically require duplicating every struct it uses, or rewriting the entire thing, and thats not the kind of patch i want to submit

dwc2 on the other hand is using a lot of shifts, so it may work better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants