Commit Graph

89511 Commits

Author SHA1 Message Date
Adrien Ricciardi 4824e405cf drivers: i2c: i2c_dw: Fixed integer overflow in i2c_dw_data_ask().
The controller can implement a reception FIFO as deep as 256 bytes.
However, the computation made by the driver code to determine how many
bytes can be asked is stored in a signed 8-bit variable called rx_empty.

If the reception FIFO depth is greater or equal to 128 bytes and the FIFO
is currently empty, the rx_empty value will be 128 (or more), which
stands for a negative value as the variable is signed.

Thus, the later code checking if the FIFO is full will run while it should
not and exit from the i2c_dw_data_ask() function too early.

This hangs the controller in an infinite loop of interrupt storm because
the interrupt flags are never cleared.

Storing the rx_empty empty on a signed 32-bit variable instead of a 8-bit
one solves the issue and is compliant with the controller hardware
specifications of a maximum FIFO depth of 256 bytes.

It has been agreed with upstream maintainers to change the type of the
variables tx_empty, rx_empty, cnt, rx_buffer_depth and tx_buffer_depth to
plain int because it is most effectively handled by the CPUs. Using 8-bit
or 16-bit variables had no meaning here.

Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
2024-01-08 20:57:05 -06:00
Daniel Leung 2ab367d149 x86: ia32/gdbstub: remove dead code
There is logically dead code which will never run. So remove.

Fixes #66848

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-01-08 20:54:16 -06:00
Fabio Baltieri a006ad5399 ci: do_not_merge: check for dev and arch review labels as well
Add "Architecture Review" and "dev-review" to the list of labels that
block a PR from merging, less chances to merge these before discussion
unintentionally.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-08 15:03:04 -05:00
Reto Schneider 698f3b1a58 doc: Fix sentence
Before this commit, the sentence did not make sense.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-01-08 14:06:40 -05:00
Flavio Ceolin 3267bdc4b7 fs: fuse: Avoid possible buffer overflow
Checks path's size before copying it to local variable.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-01-08 13:29:19 -05:00
Håvard Reierstad 9c3ca4573a bsim: Bluetooth: Mesh: Add gatt suspension test
Adds two test-cases to `test_suspend.c`, both checking that gatt
advertisement is stopped when suspending Mesh, and that is started again
when Mesh is resumed.

The first test-case involves suspending and resuming Mesh, and
the second test-case involves suspending Mesh and disabling Bluetooth,
then re-enabling Bluetooth and resuming Mesh.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-01-08 13:21:58 -05:00
Håvard Reierstad 6c5fc658ef Bluetooth: Mesh: suspend/resume gatt advs
Disables pb gatt- and gatt proxy advs when suspending Mesh, and
enables them again when resuming Mesh.

Adds `bt_mesh_adv_gatt_send` to `bt_mesh_resume` to make sure that
GATT advs start after resumption.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-01-08 13:21:58 -05:00
Håvard Reierstad 9285ea3238 Bluetooth: Mesh: fix proxy srv return value
Previously, `bt_mesh_proxy_gatt_enable` returned the return value from
`k_work_schedule`, which could be a positive (non-error) message.
Now, it only returns negative error codes (else 0).

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-01-08 13:21:58 -05:00
Håvard Reierstad 0480367d77 bsim: Bluetooth: Mesh: refactor suspend test
Renames tx to DUT and rx to Tester to clarify roles in test.

Re-uses the same body for suspend/resume and suspend/disable/resume
for DUT with a parameter to toggle disabling BT.

Re-uses the same Tester config in both existing test-cases as the
previous configs were duplicates.

Updates the dut suspension status in the message handler.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-01-08 13:21:58 -05:00
Håvard Reierstad ee337087fa bsim: Bluetooth: Mesh: extract common adv logic
Extracts logic related to waiting for packets from
`test_advertiser.c` and `test_beacon.c` to use in a sync mechanism.
Introduces a sync mechanism in bsim with the functions
`bt_mesh_test_send_over_adv` and `bt_mesh_test_wait_for_packet`

Extracts gatt-related logic from `test_advertiser.c` into a separate
file so it can be re-used.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-01-08 13:21:58 -05:00
Marc Herbert 4aa0e7af68 west: sign.py: add "REM" support to pass comments through cpp
Generated outputs can be difficult to read, preserving comments helps a
lot and they often provide good `git grep` search keywords.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-08 13:20:41 -05:00
Marc Herbert a27e8f9a19 west: sign.py: explain why `-P` is passed to cpp
Zero-functional change.

Also move it to a separate line so it's more convenient to temporarily
comment it out.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-08 13:20:41 -05:00
Marc Herbert 2ee6c26d15 west: sign.py: rename new `generated/platf.toml` to `rimage_config.toml`
CMake-based build systems like Zephyr's use separate build directories;
one for each build configuration. Even Zephyr's multi-build system
"sysbuild" (which is not relevant here) uses separate subdirectories.

So there is only one pre-processed, .toml file generated by build
directory and no need to vary its filename based on the platform name or
any other configuration parameter. It can and should keep the same
filename across build directories as zephyr.elf and all other build
artefacts do.

Moreover, when building a collection of configurations (as for instance
`sof/scripts/xtensa-build-zephyr.py` does), keeping all build
directories consistent with each other simplifies installation,
checksumming and any other post-processing.

"Fixes" recent commit 15336045af ("west: sign.py: generate platf.toml
from platf.toml.h with cc -E")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-08 13:20:41 -05:00
Chun-Chieh Li fe75bb950f shields: esp_8266: support Nuvoton numaker_pfm_m467 board
1. Support H/W reset pin
2. Support UART flow control (CTS/RTS)

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2024-01-08 16:18:38 +00:00
Yong Cong Sin c7ce871a04 tests: exclude `renode` from tests requiring unsimulated peripherals
Physical boards work on these tests but some of the required
peripherals are not simulated by `renode`, executing the tests
with renode-simulated board in CI will fail.

Exclude `renode` simulation from these tests.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 16:17:43 +00:00
Yong Cong Sin fa5cb1afa8 boards: hifive_unmatched: add renode simulation
Changes to this file were missed out from the original
PR #65564 that added Renode support for this board, add them
here so that it gets ran in CI.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 16:17:43 +00:00
Jun Lin 34b9b3aaca dts: npcx: sha: fix the incorrect unit address
Fix the incorrect unit address of sha node from 13C to 148 to avoid
the build warning.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-01-08 16:17:17 +00:00
Fabio Baltieri e0c24c8842 doc: input: few minor fixes
Few documentation fixes that got caught post merge.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-08 16:16:26 +00:00
Manuel Argüelles c68564bc93 boards: arm: ucans32k1sic: enable FlexCAN
Enable FlexCAN peripheral driver for ucans32k1sic board. The GPIO-based
CAN transceiver driver is used to control the on-board CAN transceivers.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-08 08:30:49 -06:00
Manuel Argüelles fa0b1b5fe8 drivers: can: flexcan: add support for S32K1xx
Add message buffer allowed values for S32K1xx devices. Except S32K14xW
parts which supports 64 MBs, the rest of the parts support a maximum of
32 MBs.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-08 08:30:49 -06:00
Manuel Argüelles 58f5720eb4 dts: arm: nxp: add FlexCAN support for S32K1xx
S32K1xx devices have a maximum of 3 FlexCAN peripherals. Each part may
define a different maximum number of instances and message buffers,
hence the interrupt lines are defined in the part specific dts.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-01-08 08:30:49 -06:00
Karol Gugala 133d8c7817 boards: efm32pg_stk3401a: uart: switch to new pinctrl API
The board uses pinctrl API. This commit updates pin USART pin definition
to be compliant with new API.

Signed-off-by: Karol Gugala <kgugala@antmicro.com>
2024-01-08 15:10:03 +01:00
Karol Gugala 57238057f0 boards: efm32gg_sltb009a: uart: switch to new pinctrl API
The board uses pinctrl API. This commit updates pin USART pin definition
to be compliant with new API.

Signed-off-by: Karol Gugala <kgugala@antmicro.com>
2024-01-08 15:10:03 +01:00
Sylvio Alves 617b45ab59 west.yml: update hal_espressif to fix libc calls
Make sure some ROM libc calls are weak to allow
Zephyr's libc implementation instead.

Fixes #66351

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-01-08 15:09:48 +01:00
Sylvio Alves b19c164e7b soc: espressif: add common linker tls entry
Adds common thread-local-storage.ld provided
by Zephyr. This also fixes a wrong xtensa_core entry
that should be riscv_core.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-01-08 15:09:48 +01:00
Yuval Peress 5edc45421a icm42688: Capture the spi return value
Handle the return value of the spi transaction.

Fixes #58582

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-08 15:09:42 +01:00
Yuval Peress 3f2d6efc9c icm42688: Remove unnecessary locks
The entire switch statement is already wrapped in a lock which is
acquired just before configuring the gpio pin.

Signed-off-by: Yuval Peress <peress@google.com>
2024-01-08 15:09:42 +01:00
Bartosz Bilas 9618b761ec dts: bindings: max20335: add regulator-init-microvolt/microamp to allowlist
This PMIC can handle those features, so let's add them.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2024-01-08 15:09:35 +01:00
Bartosz Bilas 0b5ffac8af dts: bindings: max20335: adjust properties order
Match it to the order of the regulator.yaml.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2024-01-08 15:09:35 +01:00
Marcin Niestroj 8caaea2f00 boards: arm: lora_e5_mini: new board support
This board is similar to 'lora_e5_dev_board', but with smaller form-factor,
which makes it better suited as low volume prototype device.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-01-08 15:09:10 +01:00
Dmitrii Golovanov 3bbd34d1b6 twister: coverage: Fix device handler coverage collection mode
Twister DeviceHandler now checks `--enable-coverage` command line argument
instead of `--coverage` when it deals with device output.
This resolves potential problem when only `--enable-coverage` argument
is given and the coverage report is not needed. In this case the test image
which is built for code coverage works slower also producing additional
console output, so the additional DeviceHandler timeout still have to be
applied and the output with coverage data correctly processed by Harness.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-01-08 09:02:47 -05:00
Piotr Pryga cb8d623506 samples: Bluetooth: periph_hr: add use of HRS nofitication changed cb
Add example usage of the HRS notification callback to peripheral_hr.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-01-08 15:34:20 +02:00
Piotr Pryga 4d0ef142f3 Bluetooth: services: Add HRS notification changed app callback
It is useful for an application to be informed when there is
a subscriber waiting for HRS service notification.
Extend HRS service API and add required code to service implementation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-01-08 15:34:20 +02:00
Bartosz Bilas fcb9f41259 boards: xtensa: add Kincony KC868-A32 module suppport
Add support for the KC868-A32 ESP32 home automation relay module.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2024-01-08 14:21:30 +01:00
Tomasz Gorochowik b64915e616 docs: Fix rzt2m starterkit docs formatting
Add additional new lines before bullet points. Otherwise they are not
rendered as bullets.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2024-01-08 14:18:58 +01:00
Aleksandr Khromykh b4dc12b42b tests: Bluetooth: Mesh: optimize proxy beacon test
Emitting network beacons in parallel to proxy functionality
causes collisions. The commit disables network beacons and
allows the test scenario to be more precise.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-01-08 14:17:04 +01:00
Bartosz Bilas 7213e8e1f5 drivers: regulator: max20335: allow current limit operations only for BUCKs
LDOs don't have such possibility so add the extra checks.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2024-01-08 14:16:55 +01:00
Bryan Zhu 6f84f34647 tests: counter: counter_basic_api: Add support for ambiq_counter device
Update counter test to test ambiq_counter devices

Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
2024-01-08 14:16:13 +01:00
Bryan Zhu 6a64bf6b4f drivers: counter: counter_ambiq_timer: Enable interrupt in set_alarm
Alarm interrupt is disabled in cancel_alarm, we should re-enable it
in set_alarm, at meanwhile, should reset the compare register in
cancel_alarm to avoid the contention condition in
cancel_alarm & set_alarm in short time.
This change fixes the test case failure at
zephyr\tests\drivers\counter\counter_basic_api.

Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
2024-01-08 14:16:13 +01:00
Nikodem Kastelik c8d22cf13a manifest: hal_nordic: update revision to have nrfx 3.3.0 release
New hal_nordic revision contains nrfx 3.3.0 which adds support
for nRF54H20 EngA and nRF54L15 EngA devices.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-01-08 13:10:26 +01:00
Jai Arora 5c34726ab1 posix: patch to implement get_pid function
patch to implement get_pid function

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
2024-01-08 12:44:45 +01:00
Jai Arora a7c1a5f9d6 posix: Adds test case for clock_getcpuclockid function
Adds ZTEST for clock_getcpuclockid function

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
2024-01-08 12:44:45 +01:00
Jai Arora a3573a9e30 posix: implement clock_getcpuclockid function
Implements clock_getcpuclockid function

Fixes #59954

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
2024-01-08 12:44:45 +01:00
Hudson C. Dalpra 410684c7b0 drivers: w1: add zephyr-gpio driver
The zephyr-gpio w1 driver introduced in this commit implements
all routines for the w1 api on top of the zephyr gpio driver.
W1 bit read, write, and reset operations are executed by
bit-banging the selected gpio.

Signed-off-by: Hudson C. Dalpra <hudson@bduncanltd.com>
2024-01-08 12:43:52 +01:00
Yong Cong Sin 8f6be9661e tests: build_all: plic: add test for `PLIC_SHELL` build
Add a build-only test for the `PLIC_SHELL` configuration.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 12:35:52 +01:00
Yong Cong Sin dd7193e491 drivers: intc: plic: simplify the handling of the `irq_count` array
Store the compile-time computed length of the `irq_count` into
a variable so that we have less to do in runtime.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 12:35:52 +01:00
Yong Cong Sin 310c4539e9 drivers: intc: plic: fix compilation warning
Change the index variable type to `int` from `size_t` to compile
across 32bit and 64bit platforms without generating warnings.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 12:35:52 +01:00
Yong Cong Sin 7fac758bdb boards: riscv: add RISCV32 Virtual board made with Renode
The RISCV32 Virtual board is a virtual platform made with
Renode as an alternative to QEMU. Contrary to QEMU, the
peripherals of this platform can be easily configured by
editing the `riscv32_virtual.repl` script and the devicetree
files accordingly, this allows certain hardware configurations
that only exist in proprietary boards/SoCs to be tested in
upstream CI.

Added another entry for this board to the excluded platform in
`kernel.timer.timer` test.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 12:35:10 +01:00
Yong Cong Sin c328a38a94 soc: riscv: add support for Renode Virt RISCV32 SoC
Add a beef-ed up version of Renode's `riscv_virt` SoC

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 12:35:10 +01:00
Yong Cong Sin d0a3a50fbe dts: riscv: add a SoC dtsi for Renode RISC-V Virt SoC
RISCV32 simulation dtsi for Renode.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 12:35:10 +01:00