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

Fix Raspberry Pi model detection on mainline Linux #1677

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

neuschaefer
Copy link
Contributor

@neuschaefer neuschaefer commented Jul 9, 2024

(please do not squash)

@neuschaefer neuschaefer marked this pull request as ready for review July 9, 2024 22:22
lib/gpio.cc Outdated Show resolved Hide resolved
@hzeller
Copy link
Owner

hzeller commented Jul 10, 2024

Looks good in general, but I don't think it does what you think it does.

lib/gpio.cc Outdated Show resolved Hide resolved
The next commit will introduce another method of determining the
revision, so this commit moves the code for the /proc/cpuinfo method out
of the way.

While at it, also update the documentation link.
Mainline Linux does not expose the Raspberry Pi revision codes[1] in
/proc/cpuinfo, and this isn't likely to change[2].

To work around this, try to retrieve the revision from the devicetree.

[1]: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes
[2]: https://lore.kernel.org/lkml/[email protected]/
@neuschaefer
Copy link
Contributor Author

I think the logic is sound now, and I've checked that the revision is read correctly.

@hzeller hzeller merged commit 97607f7 into hzeller:master Jul 11, 2024
2 checks passed
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.

2 participants