Commit graph

90236 commits

Author SHA1 Message Date
Fabio Baltieri 23714980b0 input: utils: fix kbd_matrix_state_log types
Change row and col static types to unsigned, this should prevent really
bad things from happening if a negative number ends up there for
whatever reasons without having to explicitly check for < 0.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-22 11:20:50 +00:00
Bjarki Arge Andreasen a9779eca40 modem: ppp: Implement TRANSMIT_IDLE event
Implement TRANSMIT_IDLE event for modem_ppp module. This addition
optimizes the sys workque CPU time when performing a throughput
test from 36% to 5%, while only reducing the throughput by 12%.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-22 10:35:37 +00:00
Yves Vandervennet e5fe1c1625 boards: mimxrt1015_evk: enable support for linkserver
- adds the definitions in the board.cmake file
- updates documentation

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-01-22 10:35:04 +00:00
Kamil Piszczek c16d9699a3 tests: bsim: bluetooth: host: gatt: general: improve conn ref handling
Improved the connection reference handling in the BabbleSim test
project in the Bluetooth Host category.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-01-22 10:32:41 +00:00
Christopher Friedt 0bed5dd459 tests: posix: semaphore: speed up named semaphore test
Reduce N_LOOPS from 999 to 32 by default and use a Kconfig
to encode it as CONFIG_TEST_SEM_N_LOOPS.

Running TESTSUITE semaphore
===============================================================
START - test_named_semaphore
 PASS - test_named_semaphore in 5.685 seconds
===============================================================
START - test_semaphore
 PASS - test_semaphore in 5.010 seconds
===============================================================
TESTSUITE semaphore succeeded

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-22 09:49:39 +00:00
Attie Grande 003d2090b2 cmake: version: stop using to_hex() in favour of CMake's math()
Since v3.13, CMake has supported math(... OUTPUT_FORMAT <format>), which
will perform the same functionality as to_hex().

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2024-01-22 09:48:33 +00:00
Attie Grande 20e2318b9f cmake: hex: deprecate use of to_hex() and from_hex() utility functions
Since v3.13, CMake has supported math(... OUTPUT_FORMAT <format>) and 0x
prefixes on numbers, which together provides the same functionality as
to_hex() and from_hex() that we've previously maintained.

Users should switch to using math() instead, and our functions are now
marked as deprecated.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2024-01-22 09:48:33 +00:00
Attie Grande 902751a19e cmake: hex: fix conversion of zero to hex
Previously, `to_hex(0 output)` would have placed `0x` into the `output`
variable, which is undesirable... this fix ensures that `0x0` is placed
into this variable if the input is zero.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2024-01-22 09:48:33 +00:00
Tomas Galbicka 554f2ba08e tests: mbox: Add test for mbox with data transfer
This commit adds extended test for mbox driver with
data transfer to verify correct mbox functionality.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-01-22 09:48:09 +00:00
Tomas Galbicka e776051cad samples: mbox: Add mbox sample with data transfer
This commits add mbox sample which supports transfering of
4 bytes of data between cores.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-01-22 09:48:09 +00:00
Tomas Galbicka a689228eb8 drivers: mbox: fix nxp mbox data read channel
This commit repairs reading of data from other
channels than 0.

Refactors irq handler outside of DT define.

Trigger registered callback only when proper flag is set.

Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
2024-01-22 09:48:09 +00:00
Ian Morris 5fd3f658ff drivers: clock_control: clock_control_ra.c: protect register fix
Protection for clock control and power mode registers was not being
re-enabled.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-01-22 09:47:43 +00:00
Pieter De Gendt 1c190045b3 soc: arm: atmel_sam: samv71: Rework clock_init
Update clock_init for the Atmel SAMV71 SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 23edb87cab soc: arm: atmel_sam: same70: Rework clock_init
Update clock_init for the Atmel SAME70 SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 5bba8dd101 soc: arm: atmel_sam: sam4e: Rework clock_init
Update clock_init for the Atmel SAM4E SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 89f23f7947 soc: arm: atmel_sam: sam3x: Rework clock_init
Update clock_init for the Atmel SAM3X SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt a69d611de8 soc: arm: atmel_sam: sam4s: Rework clock_init
Update clock_init for the Atmel SAM4S SoC using the new PMC API.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Pieter De Gendt 20f1f44120 soc: arm: atmel_sam: common: Add PMC API for clock management
Add functions to Atmel SAM SoC PMC API. This is an effort to hide
most of the internal registers used in different SAM families.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-01-22 09:47:21 +00:00
Jakub Rzeszutko 04de43b1a1 shell: Fix shell init procedure when configured as inactive on startup
The previous behavior of the CONFIG_SHELL_AUTOSTART option, where setting
it to 'n' disabled shell interaction at startup but kept the logger
active as a shell backend, was inconsistent.
Now, when CONFIG_SHELL_AUTOSTART is set to 'n', both the shell and the
logger are inactive at startup. Calling the shell_start function will
activate them and print any pending logs. This change ensures a more
consistent and logical behavior regarding shell and logger activity at
startup.

Additionally, now when the shell_stop function is called, both the shell
and the logger are halted. This enhancement ensures that stopping
the shell also effectively stops the associated logger.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2024-01-21 16:01:36 +01:00
Henrik Brix Andersen 53da5f6f87 doc: releases: migration-guide: 3.6: removal of run-time CAN RTR filter
Add a note about the removal of the CAN_FILTER_DATA and CAN_FILTER_RTR
flags from the CAN controller driver API.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-21 11:00:31 +01:00
Henrik Brix Andersen 3436c93387 drivers: can: remove run-time RTR filtering, add build-time RTR filter
A growing number of CAN controllers do not have support for individual RX
hardware filters based on the Remote Transmission Request (RTR) bit. This
leads to various work-arounds on the driver level mixing hardware and
software filtering.

As the use of RTR frames is discouraged by CAN in Automation (CiA) - and
not even supported by newer standards, e.g. CAN FD - this often leads to
unnecessary overhead, added complexity, and worst-case to non-portable
behavior between various CAN controller drivers.

Instead, move to a simpler approach where the ability to accept/reject RTR
frames is globally configured via Kconfig. By default, all incoming RTR
frames are rejected at the driver level, a setting which can be supported
in hardware by most in-tree CAN controllers drivers.

Legacy applications or protocol implementations, where RTR reception is
required, can now select CONFIG_CAN_ACCEPT_RTR to accept incoming RTR
frames matching added CAN filters. These applications or protocols will
need to distinguish between RTR and data frames in their respective CAN RX
frame handling routines.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-21 11:00:31 +01:00
Luca Burelli c5b7aabc06 llext: move all flags to compiler specific cmake files
Minimize the amount of flags that are hardcoded in the llext.cmake
module by moving them to the compiler specific cmake files.

The llext.cmake module will now use the new LLEXT_REMOVE_FLAGS and
LLEXT_APPEND_FLAGS global variables to adjust the set of flags used
to compile the llext code. This will make it easier to add support
for new architectures and compilers.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-21 10:59:49 +01:00
Luca Burelli feee017767 llext: rework add_llext_target() to use standard compile step
Separate the compilation of the source file from the conversion to an
llext file. This allows to reuse the include directories and macro
definitions of the current Zephyr build while compiling the llext source.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-21 10:59:49 +01:00
Luca Burelli 0747cd3358 llext: define add_llext_target() for llext compilation
This patch defines a generic function that encapsulates all the
architecture-specific machinery needed to compile llexts from source
files. Current tests are updated to use this function.

Output and source files must be specified using the OUTPUT and SOURCES
arguments. Only one source file is currently supported.

Arch-specific flags will be added automatically. The C_FLAGS argument
can be used to pass additional compiler flags to the compilation of
the source file.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-21 10:59:49 +01:00
Tom Rothamel 3f65552446 boards: arm: atsamd21_xpro: Change sercom0 tx pad and control.
According to the documentation and pinctrl file, sercom0 tx should
be available on PA10C/SERCOM_PAD[2]. However, and somewhat confusingly,
txpo 2 meant SERCOM_PAD[0] with RTS/CTS flow control.

Changing this to txpo 1 uses SERCOM_PAD[2], which allows sercom0
to work as documented.

Signed-off-by: Tom Rothamel <tom@rothamel.us>
2024-01-20 19:14:54 +01:00
Tom Rothamel d1bfea0e4e dts: atmel sam: Document what rxpo and txpo mean.
The meaning of txpo is was a bit confusing, as it's an enumeration
rather than a pad number. This confusion extended to the atsamd21_xpro
board using the wrong pins.

This commit adds ASCII-art tables that explain the meaning of rxpo
and txpo on different platforms.

Signed-off-by: Tom Rothamel <tom@rothamel.us>
2024-01-20 19:14:54 +01:00
Gerson Fernando Budke e9b26b5eb6 soc: sam0: samd: Fix switching between clocks
The clock z_arm_platform_init hangs switching between clocks when using
MCUboot. This fixes the issue using the 8MHz internal clock as gclk_main
source when configuring PLL/DFLL.

Fixes: #67220

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-01-20 14:36:30 +01:00
Ryan McClelland 83c298cd32 drivers: spi: dw: define max-xfer-size
The max size was determined by looking at the ARCH of the cpu. This really
comes from the ip configuration when generated. Add `max-xfer-size`
property to the devicetree.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Ryan McClelland ff99687862 drivers: spi: dw: fix hw cs and slave return rx len
Only toggle the hw cs if the cs is not set as a gpio. SPI trancieve
should also return the rx len when in slave configuration.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Ryan McClelland 909da582c5 drivers: spi: dw: cleanup instantiation macro
This cleans up the instantiation macro. DBG_COUNTER was also removed
as that appears to be unnecessary. This also allows for if it is a
serial target to be configured from the devicetree.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Ryan McClelland 330dba0861 drivers: spi: dw: fix naming convention of aux-reg
aux-reg should be defined with a hyphen in the bindings

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Ryan McClelland 2ee2b6ac08 drivers: spi: dw: remove HAS_SPI_DW Kconfig
The HAS_SPI_DW Kconfig is rather unncessary. If the synopsys designware
spi is to be included. It should come from the devicetree.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Daniel DeGrasse 429188723e drivers: sdhc: sdhc_spi: wait for card response until cmd timeout
In sdhc_spi_response_get, the logic for slow cards previously only
retried reads 16 times. Instead of using this approach, read from the
card every 10 ms until the command timeout is reached or it responds.
This way, the command timeout will be respected for cards that do not
respond.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-20 12:44:02 +01:00
Jai Arora ba7b7ffff2 posix: Adds test to check getpid() is not NULL
Adds test to check getpid() function is not NULL

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
2024-01-20 12:41:28 +01:00
Jai Arora b103dece67 posix: Adds test for clock_getcpuclockid()
Adds test for clock_getcpuclockid() to
make sure clock_id is equal to CLOCK_PROCESS_CPUTIME_ID
after a successful call

Fixes #59954

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
2024-01-20 12:41:28 +01:00
Martin Kiepfer 5a3f53551f drivers: display: gc9a01a: Add support for SPI display controller gc9a01a
Adding driver for GC9A01A 240x240 based LCD displays.
Should be working with GC9C01 as well (untested).

Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
2024-01-20 12:40:15 +01:00
Christopher Friedt 18c23dec5f tests: posix: common: free resource in after() for timer suite
Create a separate ZTEST_SUITE() to properly manage resources
that are shared between test cases. Add some assertions where
they were missing.

Additionally, we don't need verbose printing in this testsuite,
so change `printk()` to `LOG_DBG()`

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-19 13:14:56 -05:00
Peter Mitsis d8108369bc tests: smp_suspend: Tweak duration and timeouts
Reduces the number of seconds that the test runs to 15 seconds
(down from 30 seconds). This should still be sufficient time
to determine if there is anything amiss with the synchonous
thread suspend/resume. Furthermore, the test itself has been
tagged as being slow and its timeout increased to 10 minutes
(600 seconds) as some simulators are rather slow.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-19 12:13:30 -05:00
Parthiban Nallathambi db429004fd drivers: modem: gsm fix rssi range
rssi 31 will be -51dBm or greater, where -51 is valid. Fix the
range by allowing until -51.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2024-01-19 15:15:03 +00:00
Fabio Baltieri 5f989e4378 input: add a keymap driver
Add a "input-keymap" driver to translate keyboard matrix event into key
events.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-19 15:14:25 +00:00
Fabio Baltieri 8a313c152a input: event-codes: define 0 as reserved
Define code 0 as INPUT_KEY_RESERVED, same as linux.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-19 15:14:25 +00:00
Tanmay Kathpalia d267298af2 CODEOWNERS: Update codeowners for SDHC Cadence
Updated codeowners for SDHC Cadence Driver files.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@intel.com>
2024-01-19 15:14:17 +00:00
Tanmay Kathpalia aeb25e3da1 drivers: sdhc: Cadence SDHC driver bug fixes and other improvements
* Internal Clock not getting stable during initialization
* SD clock was not enabled
* Removed duplicate file.
* Removed write to readonly registers
* Moved function pointer structure from data section to RO section
* Wrong macro names
* Refactoring of lower layer header file.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@intel.com>
2024-01-19 15:14:17 +00:00
Gerard Marull-Paretas 48dbcf5479 soc: riscv: remove empty soc.h files
Because they're just not needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas e7cc2fafb4 arch: riscv: remode redundant soc.h includes
They are just not needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 788fda525a soc: riscv: virt: reduce the scope of SIFIVE_SYSCON_TEST
It was used nowhere else, there's no need to expose it publicly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 874513439b soc: riscv: sifive_freedom: move PRCI base address to prci.h
Instead of soc.h. This likely needs to be DT-ized at some point.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas cce467034f soc: riscv: opentitan: reduce the scope of some definitions
Some definitions were only used in soc.c, there's no need to expose them
in a public header like soc.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 95c573f02e soc: riscv: openisa_rv32m1: add missing includes
<soc.h> is needed to pull some APIs defined in soc.h.
<fsl_device_registers.h> is needed to access EVENT0/1 addresses.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Gerard Marull-Paretas 0c5a2b1fe4 soc: riscv: microchip_miv: miv: move MIV_UART_0_LINECFG to driver
Instead of soc.h, since it's not used by anything else.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00