Skip to content

Conversation

@gmarull
Copy link
Member

@gmarull gmarull commented Nov 8, 2024

BICR should be taken as the source of truth for certain oscillator-related parameters, such as:

  • LFOSC
    • Accuracy
    • Mode
    • Load capacitance
    • Startup time
  • HFXO
    • Mode
    • Load capacitance
    • Startup time

Currently, these were replicated in Devicetree, making it possible to have a non-fully functional system due to mismatches.

@gmarull gmarull force-pushed the bicr-rework branch 2 times, most recently from c4525dc to dded562 Compare November 8, 2024 09:12
@gmarull gmarull requested review from anangl and hubertmis November 8, 2024 09:23
@gmarull gmarull force-pushed the bicr-rework branch 2 times, most recently from 9654417 to b92de2c Compare November 8, 2024 16:06
@gmarull gmarull marked this pull request as ready for review November 8, 2024 16:07
@gmarull gmarull requested a review from nordic-krch as a code owner November 8, 2024 16:07
@gmarull gmarull requested a review from carlescufi November 8, 2024 16:07
@gmarull gmarull requested a review from anangl November 8, 2024 16:08
@zephyrbot
Copy link

zephyrbot commented Nov 13, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_nordic DNM This PR should not be merged (Do Not Merge) labels Nov 13, 2024
@zephyrbot zephyrbot removed manifest manifest-hal_nordic DNM This PR should not be merged (Do Not Merge) labels Nov 21, 2024
@gmarull gmarull added the DNM This PR should not be merged (Do Not Merge) label Nov 21, 2024
@gmarull
Copy link
Member Author

gmarull commented Nov 21, 2024

DNM: will likely require reflashing BICR as some parameters were never written there.

Copy link
Contributor

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It pains me to see properties related to specific peripheral instances not be part of the peripherals descriptions themselves, but that is actually how this platform works...

@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Nov 28, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add a prefix to this function, considering it's available in the global scope

Add binding for the Nordic nRF BICR memory.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
BICR (Board Information Configuration Registers) are located within the
application UICR region (ref. MRAM mapping, table 38).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add a utility function to obtain LFOSC accuracy in PPM from BICR.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
(idx * sizeof(array[0])) - \
offsetof(type, array[0]))

#define BICR (NRF_BICR_Type *)DT_REG_ADDR(DT_NODELABEL(bicr))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NRF_BICR could be used here an in other files.

@kartben kartben merged commit bcb2b36 into zephyrproject-rtos:main Dec 18, 2024
31 checks passed
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.

9 participants