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] Upstream fixes for NCS 2.6.0 #1508

Merged
merged 12 commits into from
Feb 19, 2024

Conversation

anangl
Copy link
Contributor

@anangl anangl commented Feb 16, 2024

A set of fixes from upstream that should be included in NCS 2.6.0

Adam Wojasinski and others added 12 commits February 16, 2024 15:43
…for nRF5340

The CLOCK HAL header is only needed for nRF5340 SoC. It's used when
user wants to configure SPIM instance to 32 Mbps. The HAL checks
if is running at 128 MHz as only then 32 Mbps is supported.

Signed-off-by: Adam Wojasinski <[email protected]>
(cherry picked from commit e6bcc98)
Signed-off-by: Andrzej Głąbek <[email protected]>
…ck for frequency

Some targets may not have `NRF_SPIM_HAS_32_MHZ_FREQ` or
`NRF_SPIM_HAS_16_MHZ_FREQ` symbols but have `NRF_SPIM_HAS_PRESCALER`
symbol defined. The symbol informs that target supports 32 MHz and
16 MHz frequencies for SPIM instances.

Signed-off-by: Adam Wojasinski <[email protected]>
(cherry picked from commit 058eebe)
Signed-off-by: Andrzej Głąbek <[email protected]>
… address check

Instead of assuming only RAM is accessible by EasyDMA, use the generic
DMA accessible function.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 2c0f121)
Signed-off-by: Andrzej Głąbek <[email protected]>
This check has to be done independent of whether RAM is used for buffers
or not and depends on device maximum length property.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 0a1eff8)
Signed-off-by: Andrzej Głąbek <[email protected]>
…n nRF52832

While enabling workaround for PAN 58 the PPI driver is used.
This requires the nrfx PPI driver to be enabled thus CONFIG_NRFX_PPI
Kconfig symbol needs to be set.

Jira: NRFX-1616

Signed-off-by: Marcin Szymczyk <[email protected]>
(cherry picked from commit 2a38230)
Signed-off-by: Andrzej Głąbek <[email protected]>
… from RAM region

This patch adds support for RX buffer placed by a linker in
memory region defined in SPIM devicetree node. The buffer is placed
in memory region defined as devicetree node. The memory region node's
reference is then stored in `memory-regions` property of SPIM node.

Added build time assertion to check if `CONFIG_SPI_NRFX_RAM_BUFFER_SIZE`
Kconfig symbol has value greater than 0 when given SPIM node has
`memory-region` property.

Signed-off-by: Adam Wojasinski <[email protected]>
(cherry picked from commit ae75a8f)
Signed-off-by: Andrzej Głąbek <[email protected]>
…nfig symbol

Update documentation for SPI_NRFX_RAM_BUFFER_SIZE Kconfig symbol
to reflect new usage of it. Now the symbol specifies size of RX buffer.
The change introducing support for RX buffer placed by a linker in
memory region defined in SPIM devicetree node is in a parent commit
of that one.

Signed-off-by: Adam Wojasinski <[email protected]>
(cherry picked from commit c88b492)
Signed-off-by: Andrzej Głąbek <[email protected]>
…ly 168

Use the already available in the tree mechanism of adding assembly
instructions right after WFI/WFE to implement the workaround for
nRF5340 anomaly 168 (replace the 4 NOP solution used on the network
core as it turned out to be insufficient) and provide two related
Kconfig options so that users are able to adjust the workaround to
their actual needs (disable it entirely or use it in the extended
version).

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 23e15c4)
With GCC 12.3 and binutils 2.40, the build fails with:

<...>/zephyr/arch/arm/core/cortex_m/cpu_idle.S: Assembler messages:
<...>/zephyr/arch/arm/core/cortex_m/cpu_idle.S:51: Error: junk at end of line, first unrecognized character is `n'
<...>/zephyr/arch/arm/core/cortex_m/cpu_idle.S:133:   Info: macro invoked from here

Because the SOC_ON_EXIT_CPU_IDLE macro puts all the statements on a
single line, there must be a semicolon after .rept

Signed-off-by: Ben Wolsieffer <[email protected]>
(cherry picked from commit 37352d3)
Signed-off-by: Andrzej Głąbek <[email protected]>
... so that it is possible to use a GPIO expander pin as the CS line.
Communication with the expander may involve an operation that cannot
be done from the interrupt context (e.g. an I2C transaction).

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit db4344b)
…ion layer

Whenever UART_RX_DISABLED event is received module attempts to
re-enable receiver since in interrupt driven API receiver is
always on. However, it is possible that there is no free buffers
and in that case attempt to enable the receiver will fail with
-EBUSY. That scenario shall be accepted since the receiver will
be re-enabled when at least one buffer will be freed.

Given that, -EBUSY return shall be accepted (no assert) and
number of pending RX buffer requests shall be reset only on
successful enabling.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit f6ecad2)
Signed-off-by: Andrzej Głąbek <[email protected]>
…eemption

UART_RX_RDY event can be generated from UARTE interrupt or k_timer
handler. When ENDRX event occurs then k_timer is stopped (it can
be restarted if there is another buffer provided). However, if UARTE
interrupt priority is higher than k_timer priority (RTC is used
underneath) then k_timer handler may still be executed later.
K_timer notifies new bytes based on RXDRDY HW event which is
counter by the TIMER (using PPI). It may happen that RXDRDY
event arrives due to byte received into RX FIFO but since there is
not buffer provided it stays in that FIFO. Given all this, it
was possible that RX_RDY event was reported from ENDRX UARTE event,
timer was stopped but because UARTE interrupt had higher priority
timer handler is executed after UARTE interrupt is handled. In
timer handler TIMER counter reports more bytes and calls
UART_RX_RDY event with null buffer and non-zero amount of bytes.

Fixed by generating UART_RX_RDY event only if RX buffer is not
null.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 5db338c)
Signed-off-by: Andrzej Głąbek <[email protected]>
@jfischer-no jfischer-no merged commit 4d8b300 into nrfconnect:main Feb 19, 2024
16 checks passed
@anangl anangl deleted the upstream_fixes_for_2_6_0 branch February 26, 2024 07:10
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.

10 participants