-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Refactor nordic socs/drivers to remove GPD and decouple pin retention. #90754
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
base: main
Are you sure you want to change the base?
Refactor nordic socs/drivers to remove GPD and decouple pin retention. #90754
Conversation
afa9528
to
87e9f3a
Compare
f737ae0
to
8654ac9
Compare
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.
Didn't look at SWEXT changes, but the gpio port/pad power domain handling looks good.
Will this trigger more power domain requests/releases?
95015ed
to
1de2f64
Compare
3acab47
to
9163316
Compare
126e8cb
to
3e4dca4
Compare
12801a1
to
4477c75
Compare
4477c75
to
2083028
Compare
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.
Awesome! :)
const struct nrf_port_retain_config *dev_config = dev->config; | ||
|
||
LOG_DBG("%s pads 0x%08x retain %s", dev->name, dev_config->retain_mask, "enable"); | ||
nrf_gpio_port_retain_enable(dev_config->regs, dev_config->retain_mask); |
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.
Nit: comment here with what is written in commit massage would be nice:
If no ACTIVE device is using any of the pads in the pad group, the pad groups power domain may be SUSPENDED. Before the pad groups power domain is SUSPENDED, pad config retention must be enabled to prevent the pads from loosing their state.
2083028
to
e2079fd
Compare
Introduce the NRFS GDPWR (Global Domain Power Request) device driver and devicetree binding. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Introduce the NRF GPIO Pad Group device driver and binding. The pad group device represents the GPIO pads (pins), contrary to a GPIO controller, which is one of the many devices which can be muxed to pads in the pad group. The pad group belong to a power domain, which is not neccesarily the same power domain as devices being muxed to the pads, like GPIO or UART. If no ACTIVE device is using any of the pads in the pad group, the pad groups power domain may be SUSPENDED. Before the pad groups power domain is SUSPENDED, pad config retention must be enabled to prevent the pads from loosing their state. That's what this device driver manages. Once retained, the pad configs and outputs are locked, even when their power domain is SUSPENDED. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Transition nrf54h away from the soc specific gpd (global power domain) driver which mixed power domains, pinctrl and gpio pin retention into a non scalable solution, forcing soc specific logic to bleed into nrf drivers. The new solution uses zephyrs PM_DEVICE based power domains to properly model the hardware layout of device and pin power domains, and moves pin retention logic out of drivers into pinctrl and gpio, which are the components which manage pins (pads). Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Remove the deprecated GPD (Global Power Domain) driver. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
e2079fd
to
fb766d7
Compare
Rebased to solve merge conflict |
ping @anangl @nika-nordic |
|
Replace highly coupled use of GPD (gpd.h) from device drivers, with power domain device drivers using zephyr's PM_DEVICE_POWER_DOMAIN infrastructure.
The gpd.h currently is used for two things:
Nordic device drivers currently have to do this manually, conditionally, which is adding immense complexity to them, only relevant for certain SoCs, and which is in theory duplicate code. In reality, device drivers do their best, but since gpd is not well understood, device drivers implement it slightly differently, in some cases working by design, some cases working by accident, and in some cases working, but breaking something else.
No more!
Both pin retention and power domains are actually designed in a way that is entirely logical, and can be expressed using power domains and the devicetree. So, using pinctrl and power domains, we can entirely decouple devices from this complexity :)
What does the refactor do?
power-domains
property from breaking user's applications if they "dare" to use zephyrs power domain framework. See first commit.