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

[nrf fromtree] soc: nrf53: Add workaround for anomaly 160 #1075

Merged
merged 6 commits into from
Feb 23, 2023

Conversation

anangl
Copy link
Contributor

@anangl anangl commented Feb 21, 2023

Cherry-pick a set of upstream commits to get the workaround for nRF53 anomaly 160 in NCS.

Add a DSB before doing WFE in cpu_sleep(), to ensure the
memory transactions are complete.

Add a note clarifying a dependency for the existing solution
(dependency is satisfied by ARCH code but is good to state
clearly).

Relates to commit f1264b7 ("drivers: entropy: nrf5: add
docs and a DSB in get_entropy_isr").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 67fa62f)
Signed-off-by: Andrzej Głąbek <[email protected]>
cvinayak and others added 5 commits February 22, 2023 09:11
Reuse cpu_sleep() interface consistently in Controller.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit b46b833)
Signed-off-by: Andrzej Głąbek <[email protected]>
…ic_idle()

Replace the use of WFE with Zephyr kernel supplied
k_cpu_atomic_idle() interface.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 3c0c9ac)
Signed-off-by: Andrzej Głąbek <[email protected]>
…tructions

Use the appropriate kernel function, i.e. `k_cpu_atomic_idle()`,
instead of directly executing the WFE instruction.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 68bd036)
…) hook

Introduce an optional hook to be called when the CPU is made idle.
If needed, this hook can be used to prevent the CPU from actually
entering sleep by skipping the WFE/WFI instruction.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 22b17e4)
Implement a workaround for the nRF53 anomaly 160. This consist of
a set of writes to certain hardware registers that is done at boot
and a piece of code that is executed when the CPU is made idle and
that prevents the CPU from switching between active and sleep modes
more than five times within a 200 us period.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit fe3b97a)
@anangl anangl force-pushed the nrf53_anomaly_160_ncs branch from ca2548e to ac7a34b Compare February 22, 2023 08:12
@anangl anangl changed the title [nrf fromlist] soc: nrf53: Add workaround for anomaly 160 [nrf fromtree] soc: nrf53: Add workaround for anomaly 160 Feb 22, 2023
@PerMac
Copy link
Contributor

PerMac commented Feb 22, 2023

@gmarull @thst-nordic Doc building is failing on this PR with the below error. Have you seen it before/know the fix?

WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
error: externally-managed-environment

@gmarull
Copy link
Member

gmarull commented Feb 22, 2023

@gmarull @thst-nordic Doc building is failing on this PR with the below error. Have you seen it before/know the fix?

WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. error: externally-managed-environment

We should actually not be building PDF on PRs, zephyrproject-rtos/zephyr@e11d82b can be imported

@PerMac
Copy link
Contributor

PerMac commented Feb 22, 2023

@gmarull I see. However, I fail to see if this will address the issue seen in this PR. It looks like something on the environment configuration side. I checked and it looks like all pdf docs building wrokflows, from last 12h failed. Even the "scheduled" ones (no pr). https://github.com/nrfconnect/sdk-zephyr/actions/workflows/doc-build.yml
I will open a separate gh issue for this workflow, since it is not only issue of this PR.

@gmarull
Copy link
Member

gmarull commented Feb 22, 2023

@gmarull I see. However, I fail to see if this will address the issue seen in this PR. It looks like something on the environment configuration side. I checked and it looks like all pdf docs building wrokflows, from last 12h failed. Even the "scheduled" ones (no pr). https://github.com/nrfconnect/sdk-zephyr/actions/workflows/doc-build.yml I will open a separate gh issue for this workflow, since it is not only issue of this PR.

we should actually disable pdf build in our fork, in NCS we don't use PDF at all.

@PerMac
Copy link
Contributor

PerMac commented Feb 22, 2023

I see e.g. this python/cpython#102134 It seems this might be related to same recent change in ubuntu?

@carlescufi carlescufi merged commit 71cacd5 into nrfconnect:main Feb 23, 2023
@anangl anangl deleted the nrf53_anomaly_160_ncs branch February 23, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants