-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
boards: nrf7002dk: Fix SR coexistence GPIOs ownership #83028
base: main
Are you sure you want to change the base?
Conversation
Hello @muraliThokala, and thank you very much for your first pull request to the Zephyr project! |
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.
Can you please elaborate commit log with affects of having/not having these entries?
22a715a
to
5ee1ceb
Compare
5ee1ceb
to
58120e3
Compare
it needs more details, here's my stab, please review:
|
In nRF53 SoC, the CPUAPP owns all the GPIOs by default. Therefore, even if the GPIOs are exclusively used by CPUNET, we must redefine them for CPUAPP and then set up GPIO forwarding to CPUNET using SoC registers (this is done as part of the MPSL CX initialization). Previously, these GPIOs were mistakenly removed from CPUAPP and defined only for CPUNET. This caused the GPIOs to be available for CPUNET but still owned by CPUAPP, breaking SR coexistence. Signed-off-by: Murali Thokala <[email protected]>
58120e3
to
a1e18d0
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.
This is done using GPIO forwarding:
gpio_fwd: nrf-gpio-forwarder {
compatible = "nordic,nrf-gpio-forwarder";
status = "okay";
uart {
gpios = <&gpio1 1 0>, <&gpio1 0 0>, <&gpio0 11 0>, <&gpio0 10 0>;
};
};
in this case add:
&gpio_fwd {
coex {
gpios = <&gpio0 28>, <&gpio0 30>, <&gpio0 24>, <&gpio 29>;
};
};
or add:
coex {
gpios = <&gpio0 28>, <&gpio0 30>, <&gpio0 24>, <&gpio 29>;
};
directly to gpio_fwd
Not just GPIO forwarding, we also need this for MPSL CX, https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/mpsl/cx/nrf700x/mpsl_cx_nrf700x.c#L250 in the downstream. |
The commit clearly states that its purpose is to forward the GPIOs, which is done using gpio forwarding upstream. If a downstream app wants to do it differently, add an overlay downstream. |
What is the issue with just adding or using Lines 565 to 574 in 798122e
|
No issue in using DTS to forward GPIOs, just stating that the commit has multiple purposes. If a downstream purpose isn't acceptable, then we can do the DTS based GPIO forwarding in upstream and handle rest in downstream (cannot use an app overaly as this has to be for all apps using that board). |
I don't get it really. A board overlay seems fitting I guess, but still, why is downstream not just using the same forwarding as upstream? Seems we are adding duplicate or even redundant code both in dts and downstream. It wont't hurt anyone adding the coex interface to the cpuapp I guess, but it feels wrong |
The downstream code has a conditional forward |
@@ -111,6 +111,15 @@ | |||
mcuboot-led0 = &led0; | |||
watchdog0 = &wdt0; | |||
}; | |||
|
|||
nrf_radio_coex: coex { |
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 to use generic gpio forwarder node for this purpose?
gpio_fwd: nrf-gpio-forwarder { |
You could add there:
gpio_fwd: nrf-gpio-forwarder {
compatible = "nordic,nrf-gpio-forwarder";
status = "okay";
uart {
gpios = <&gpio1 1 0>, <&gpio1 0 0>, <&gpio1 5 0>, <&gpio1 4 0>;
};
coex {
gpios = <&gpio0 28 0>, <&gpio0 30 0>, <&gpio0 24 0>, <&gpio0 29>;
};
};
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.
... as already mentioned by #83028 (review)
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.
Sure, we agreed to use that, but wanted to get some context about removing the manual forwarding from MPSL in NCS.
In nRF53 SoC, the CPUAPP owns all the GPIOs by default. Therefore, even if the GPIOs are exclusively used by CPUNET, we must redefine them for CPUAPP and then set up GPIO forwarding to CPUNET using SoC registers (this is done as part of the MPSL CX initialization).
Previously, these GPIOs were mistakenly removed from CPUAPP and defined only for CPUNET. This caused the GPIOs to be
available for CPUNET but still owned by CPUAPP, breaking SR coexistence.