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

drivers: timer: select grtc clock source from clock control kconfig #2158

Draft
wants to merge 1,791 commits into
base: main
Choose a base branch
from

Conversation

sean-madigan
Copy link
Contributor

CONFIG_CLOCK_CONTROL_NRF... kconfigs are used to chose the low frequency clock source, so these should then follow through to setting the grtc clock source.

Without this there can be a mismatch of clocks and can cause issue. For example when running BLE with
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC and GRTC selecting NRF_GRTC_CLKSEL_LFXO the device could just stop sending for up to 400ms after a period of time.

frkv and others added 30 commits October 4, 2024 14:12
-This commit is a [nrf noup] because PSA crypto configs in upstream
 Zephyr doesn't have help-text in their configurations and we don't
 want to duplicate configurations to control the value
-This adds warning for SHA-1 and MD5 usage

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
-This is a [nrf noup] because the upstream Zephyr is generated using
 a script and is not committed as-is as source-code. The relevant
 responsible person for this feature has received information about
 the missing configuration and this will be resolved upstream in
 Mbed TLS and will propagate down to zephyr. Once this has happened,
 this [nrf noup] can be dropped.
-Add missing PSA_WANT_KEY_TYPE_RSA_KEY_DERIVE

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
-This commit contains all Nordic-specific configurations for PSA crypto
 These have been separated from Kconfig.psa, as this file is now
 auto-generated in the upstream project. This commit may be
 reworked later, in case more features are supported in Kconfig.psa
-Add Kconfig.psa.nordic containing Nordics PSA crypto addition
-Add reading this file from modules/mbedtls/Kconfig

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
-This commit is a [nrf noup] as Kconfig.psa is an auto-generated
 file. The changes reflected here has been reported to maintainers
 in upstream Zephyr.
 Change: Mbed TLS resolves PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC and
 PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT internally from the other
 types.

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
-PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC is internally resolved by
 Mbed TLS. It has been made promptless in a previous commit.
 Keeping this change separated since the Kconfig.psa is auto-generated
 and it would likely be a bit more complex to handle this in a
 single commit. Upstream maintainers have been notified about this
 mismatch in configurations.

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
Update path for autoconf.h which is now in zephyr/autoconf.h

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
Add board support for the nrf7002eb shield. This shield uses the
nordic edge-connector to be compatible with multiple boards.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>

Upstream PR: zephyrproject-rtos/zephyr#78330
Add build for nrf7002eb shield on thingy53 board.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>

Upstream PR: zephyrproject-rtos/zephyr#78330
Makes the boot banner function weak, this resolves an issue when
building with llext enabled which uses different build options
than a normal zephyr build

Signed-off-by: Jamie McCrae <[email protected]>
…ken from dt

Currently a user, or a shield definition, must select a Kconfig to
signal that the iovdd_ctrl and bucken GPIOs are connected to the same
pin. We can instead check this in the driver by simply checking if
the iovdd_ctrl_spec and bucken_spec are the same pin.

Update the nrfwifi driver and remove the redundant
NRF_WIFI_COMBINED_BUCKEN_IOVDD_GPIO config.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>

Upstream PR: zephyrproject-rtos/zephyr#78485
In NCS to leverage HW acceleration, use nRF security.

Also, fix Kconfig warnings in NCS compliance for CRYPTO_ALT.

Signed-off-by: Chaitanya Tata <[email protected]>
External flash support is still WIP, so, to get sysbuild working add
dummy Kconfig options.

Signed-off-by: Chaitanya Tata <[email protected]>
fixup! [nrf noup] mbedtls: Add dependency logic for PSA crypto
configurations

-Selecting CHACHA20 key type if PSA_WANT_ALG_STREAM_CIPHER is
 enabled

(fixup of commit 47a1e03)

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
Although ZVFS is experimental, the warning is annoying the matter team.
Therefore, remove the experimental selection.

This may be reverted once upstream unselects experimental.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
External projects building the documentation may not clone all modules, as
they have manifest filtering. Therefore, not having access to a module
should not produce a fatal documentation build error. Convert the error to
a debug log, so it is at least traced.

Upstream PR: zephyrproject-rtos/zephyr#78876

Signed-off-by: Gerard Marull-Paretas <[email protected]>
Signed-off-by: Bjarki Arge Andreasen <[email protected]>
-Enabling MBEDTLS_ECP_DP_SECP256R1_ENABLED curve type to ensure
 we don't get error-warnings about MBEDTLS_ECP_C dependencies not being
 met for WIFI samples.

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
[SHEL-2054] Adding a kconfig option for WMM.
By default it will be enabled. If user needs
to disable it, set it as n.

Tagged as "noup" because I had to fix a conflict because of another
"noup".

Upstream PR: zephyrproject-rtos/zephyr#76754

Signed-off-by: Kapil Bhatt <[email protected]>
…d FAE table

Adds HCI support for:
- LE CS Read Remote Supported Capabilities
- LE CS Read Remote FAE Table

Callbacks have been added to the conn object to allow upper layers to
make use of the cache commands, with which it will be possible to store
this information and provide it again in the case of a disconnect
and reconnect to the same device.

(cherry picked from commit 947a294)

Signed-off-by: Olivier Lesage <[email protected]>
Adds HCI support for the LE CS Test command.

(cherry picked from commit fb9a8eb)

Signed-off-by: Olivier Lesage <[email protected]>
Some of the http_server tests suites were missing netif dependency.

(cherry picked from commit 1dca822)

Signed-off-by: Robert Lubos <[email protected]>
- We don't use this mechanism in nRF Connect SDK

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
…nload

-We handle legacy Crypto API support specially (favoring PSA crypto)
 the tests here require MD interface to build, which needs the config
 MBEDTLS_LEGACY_CRYPTO_C to be enable to get access to

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
-This adds crypto support for ipv6 tests by enabling
 CONFIG_MBEDTLS_LEGACY_CRYPTO_C

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
Reorder functions in order to remove forward function defitions.
No functional changes.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 2c78a4d)
When the queue is full, all messages posted inside interrupt handlers
are simply dropped. This problem can be remedied by having the message
queue large enough, but determining the maximum number of messages that
can ever be posted in the system is really complex task.

Hopefully in DWC2 driver there is finite number of events that have to
be processed inside thread handler. Therefore it is unnecessary to
determine the maximum queue size for the events if the events are posted
to k_event object instead of send to k_msgq object.

Use combination of three k_event structures to handle all possible event
sources. This not only guarantees by design that no event will be lost,
but also slightly reduces the memory usage.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit c2f2d8c)
UDC API handlers and DWC2 driver thread share not only software
constructs, but also the underlying hardware. Ensure that any UDC API
call is not preempted by DWC2 driver thread (and vice versa) by
acquiring the lock in thread handler.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 5fc0405)
Enter hibernation in thread context with the lock held to make sure to
not queue any transfers when the core is hibernated.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit f765026)
The PMU is not reset by core reset and therefore it is necessary to exit
hibernation on DWC2 disable to prevent endless PMU interrupt loop when
the driver is enabled again.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit b89b7ed)
Add missing GHWCFG2 and GHWCFG3 defines based on nRF54H20 registers
documentation.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 68b8818)
According to USB 2.0 Specification the remote wakeup device must hold
the resume signaling for at least 1 ms but for no more than 15 ms. The
DWC2 otg controller requires the software to drive the remote wakeup
signalling for appropriate duration (when LPM is disabled, which is
currently always the case in udc_dwc2). Arbitrarily choose to drive the
resume signalling for 2 ms to have sufficient margin in both directions.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit ac7d55b)
adamkondraciuk and others added 28 commits October 21, 2024 15:42
…e PM

Enable the device runtime power management on the SPIM shim.

Upstream PR: zephyrproject-rtos/zephyr#75715

Signed-off-by: Adam Kondraciuk <[email protected]>
Add configuration for testing SPI with device runtime PM enabled
for nRF platforms.

Upstream PR: zephyrproject-rtos/zephyr#75715

Signed-off-by: Adam Kondraciuk <[email protected]>
Some devices, e.g. SoC level devices like I2C peripheral, can never be
powerd off as they are always energized. Such devices can only go from an
active state or to a low power state (suspended). Allow them to simply
return -ENOTSUP when called with TURN_ON (or TURN_OFF).

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit 740eba1)
Use NRFX_FOREACH_PRESENT macro to iterate over all PWM instances
and create device only for those enabled in the devicetree.
This approach removes need of changing driver code when new
instance id is added.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 0ab86c4)
Shim was not correctly disabling PWM when it was not used. Task
STOP was triggered but PWM->ENABLE remained set which caused
increased current. Added interrupt and enabled event handler in
the nrfx driver to allow disabling PWM on STOPPED event.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit c3a33cf)
Rework PM handling to use pm_device_driver_init(). Shim is not using
put and get internally as there is no api that disables or stops
pwm so it is hard to determine when to put the device. There are cases
when PWM peripheral is stopped but PWM is still active because
duty cycle is 100% or 0% and pin is driven by GPIO and not PWM.

If user want to use runtime PM with PWM it is possible and getting
the device will initialize internal data and putting will suspend
by forcing PWM stop if used and setting pins to sleep state. However,
from power consumption perspective it is enough to set 0% or 100%
duty cycle on all channels.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit e11d050)
Like in all other legacy boards, hw-flow-control should not be
enabled for console UART. With hw-flow-control sample stuck
during printing some initial information and sample appears to
be not working correctly unless com port is opened.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 01f2740)
Change regex for no_multithreading test version for nRF54L15 platform.
This needs to be changed because LOG is running in MINIMAL mode.

Signed-off-by: Jakub Zymelka <[email protected]>
(cherry picked from commit df201e4)
Adds HCI support for LE CS subevent result continue
event and the reassembly logic for the partial results.

When subevent results are completed or the subevent is
aborted, the user callback is invoked with a buffer
pointing to the HCI event buffer, so no copy is done.

When subevent results are incomplete, then a reassembly
buffer is allocated from a fixed sized pool. This buffer
is used for the reassembling of the subevent result
containing all of the step data, which is then passed
to the user via the callback. kconfigs have been added
to set the size and the count of the reassembly buffer.

Signed-off-by: Burak Gorduk <[email protected]>
(cherry picked from commit c5a126c)
… types

Modifies the CS bitfields that are used for accessing HCI
event data to take platform endiannes into consideration.

Signed-off-by: Burak Gorduk <[email protected]>
(cherry picked from commit bfe3c43)
…TX power

The values were swapped, leading to the opposite of the intended
behavior

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit 51a0e94)
These options are in microseconds but not fully configurable,
document what options are allowed in 6.0

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit 5d03664)
These are signed 16-bit integers by spec

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit b1f34a1)
… and RSSI

Add some defines for packet quality and rssi for RTT,
these are useful for filtering out steps where the RTT exchange
was unsuccessful

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit 6c95478)
…p_data_parse()

This function can be used to parse HCI-formatted subevent results
regardless of whether they come from CS Test or not

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit 60a2d7d)
Adds HCI support for:
- LE CS Security Enable
- LE CS Procedure Enable
- LE CS Set Procedure Parameters
- LE CS Set Channel Classification
- LE CS Read Local Supported Capabilities
- LE CS Write Cached Remote Supported Capabilities
- LE CS Write Cached Remote FAE Table

Signed-off-by: Adam Cavender <[email protected]>
(cherry picked from commit 18f508144e4ffc50c13f02866ba4bf47335d35ea)
Add runtime PM to the driver.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit b773306)
… nrf54l

Add common overlay for nrf54l15pdk targets.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 7fc7361)
…uration

Add configuration to the test which is using runtime PM on qdec.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 5371eff)
…dec.pm_runtime

Test was failing because after re-enabling QDEC there is an interrupt
REPORTRDY coming after some time. Test had k_msleep(100) added to
accomodate for that but it was added after sensor_sample_fetch and
should be added before so that sample with data from REPORTRDY event
is fetched so that next read is empty as expected.

Upstream PR: zephyrproject-rtos/zephyr#80051

Signed-off-by: Krzysztof Chruściński <[email protected]>
…LY for non-flash mem"

This reverts commit 30f066a.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
…mentation

Moved MCUboot trailer's status erase ahead any write operation,
which is step which helps with addition of support for devices
don't require explicit pager erase.
For these kind of devices flattening of mcuboot image status in
the trailer was introduced.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
(cherry picked from commit 17c15e3b4edb2e776c748073248c99cecd5cdef8)
New PDM, some present on nRF54L15 FP1, instances have
been added. Modified condfiguration file for nRF5340,
which now requires PDM0 instance.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit c092964)
… instances

Driver now uses multi-instance PDM nrfx API and
defines PDM device based on available instances.
It also introduces calculating PDM frequency using
prescaler, present on nRF54L15 FP1.
Updated nrfx API version changed to 3.7 to use the
new PDM API.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit f8466b4)
nRF54L15 FP1 can now be used in dmic audio sample.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit 3013604)
Revert this noup sicne these configurations are now moved to
sdk-nrf to reduce the amount of noups in Zephyr.

This reverts commit 0892bad.

Signed-off-by: Georgios Vasilakis <[email protected]>
CONFIG_CLOCK_CONTROL_NRF... kconfigs are used to chose the
low frequency clock source, so these should then follow
through to setting the grtc clock source.

Without this there can be a mismatch of clocks and can cause
issue. For example when running BLE with
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC and GRTC selecting
NRF_GRTC_CLKSEL_LFXO the device could just stop sending for
up to 400ms after a period of time.

Signed-off-by: Sean Madigan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.