-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add pinctrl_bcm2835_rust.rs #1
base: rust
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! You can add more details about how to evaluate this driver and what you can do with this. Besides, you can add some links of the prior mails when we had touch out with the community.
macro_rules! FSEL_REG { | ||
($p:expr) => { | ||
GPFSEL0 + (($p / 10) * 4) | ||
}; | ||
} | ||
|
||
macro_rules! FSEL_SHIFT { | ||
($p:expr) => { | ||
(($p % 10) * 3) | ||
}; | ||
} | ||
|
||
macro_rules! GPIO_REG_OFFSET { | ||
($p:expr) => { | ||
$p / 32 | ||
}; | ||
} | ||
|
||
macro_rules! GPIO_REG_SHIFT { | ||
($p:expr) => { | ||
$p % 32 | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not move these to macro.rs of RFL of gpio related files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGFM
Rewrite GPIO registration part in
pinctrl-bcm2835.c
using Rust.pinctrl_bcm2835_rust.rs
has been tested on thevirt
machine in QEMU, andlibgpiod
can successfully call the GPIO controller through the `pinctrl_bcm2835_rust'.Issue:
bcm2835_rust
fails to register on Raspberry Pi 4B, and the error displayed in syslog is:pinctrl_bcm2835_rust: probe of fe200000.gpio failed with error -22
And KGDB and jlink cannot be used to debug this driver since both kgdb and jlink are based on the gpio driver on the board.
Changes needed:
bcm2835_rust
on Raspberry Pi 4B.