Commit graph

90118 commits

Author SHA1 Message Date
Christopher Friedt b0a83a9177 posix: rwlock: make pthread_rwlock_t a pooled ipc type
Like mutex, barrier, cond, spinlock, etc, make
pthread_rwlock_t a pooled ipc type.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-18 09:22:35 -05:00
Tim Lin 9948c29885 ITE: drivers/i2c: Adjust the prescale of I2C SCL low and high period
When adjusting the prescale to increase the I2C SCL low period,
the high period must also be subtracted to maintain a consistent
frequency.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-01-18 07:22:55 -05:00
Tim Lin ba11dc8065 ITE: drivers/i2c: Add the property of I2C data hold time
Add a property to adjust the I2C data hold time which will pass
the SI test.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-01-18 07:22:55 -05:00
Gerard Marull-Paretas 1d128f13b6 samples: modules: tflite-micro: remove incorrect check
sensor cannot be null because it is initialized with DEVICE_DT_GET_ONE,
which always resolves to a device. The deleted check triggered a
compiler warning ("warning: the address of '__device_dts_ord_23' will
never be NULL").

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-18 12:09:53 +00:00
Ben Wolsieffer 37352d3d29 soc: nrf53: fix building anomaly 168 workaround
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 <benwolsieffer@gmail.com>
2024-01-18 12:53:12 +01:00
Filip Kokosinski 18deb582ef boards/riscv: use the same board name convention for ITE platforms
This commit unifies the board name convention used by ITE RISC-V platforms.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-01-18 06:40:34 -05:00
Fabio Baltieri 979e7a6c56 github: footprint: set ZEPHYR_SDK_INSTALL_DIR after the rebase
The ZEPHYR_SDK_INSTALL_DIR currently tries to read the SDK_VERSION at
the PR base ref, but this has only been introduced recently. Move the
ZEPHYR_SDK_INSTALL_DIR settings down as part of the build step after the
rebase so the file will always be found from now, even on old PRs.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-18 11:29:07 +00:00
Fabio Baltieri 1c9be802bc usbc: fix shadowed declaration build error
Fixes:

/__w/zephyr/zephyr/subsys/usb/usb_c/usbc_tc_src_states.c:260:21: error:
declaration of 'ret' shadows a previous local [-Werror=shadow]

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-18 11:28:54 +00:00
Krzysztof Chruściński e2dccab4d5 boards: posix: nrf_bsim: Use legacy UART shim
New UART shim must be adapted to work in the simulated environment.
Use legacy version until it is fixed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Krzysztof Chruściński 2ebf83176c tests: drivers: uart: uart_pm: Use legacy nrf driver
New nrf uart shim requires addiotional work around PM. Use legacy
version for those tests until it is fixed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Krzysztof Chruściński e47bdb2555 tests: drivers: uart: async_api: Add configuration for legacy nrf driver
Add configuration which tests legacy nrf uart driver.
Prevent tests on nrf52_bsim of the new driver (it is requiring
adjustments for the simulation). It will be fixed by another
patch.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Krzysztof Chruściński b8c9aad728 tests: drivers: uart: uart_mix_fifo_poll: Align the the new nrfx driver
Align test configurations to the new uart driver based on nrfx_uarte.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Krzysztof Chruściński 4cc213bc8d drivers: serial: nrfx: Add new shim based on nrfx_uarte
Add new shim which is based on nrfx driver.

Legacy shim is kept for transition period. It can be used after
setting CONFIG_UART_NRFX_UARTE_LEGACY_SHIM.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Krzysztof Chruściński 4fcf8e0630 modules: hal_nordic: nrfx: Add new UARTE options to Kconfig
Add Kconfig options to new configuration flags for nrfx_uarte.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Krzysztof Chruściński a0382bd0f3 soc: arm: nordic_nrf: Disable UART runtime configuration
Since it takes 400 bytes of code and it is rarely used disable
by default this feature.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Krzysztof Chruściński 2854fc18fd drivers: serial: Add async to interrupt driven adaptation
Add adaptation layer which allows to provide interrupt driven
API for drivers which exposes only asynchronous API.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-18 11:12:55 +01:00
Alexander Kozhinov 5db55b01af drivers: can: can_stm32h7_fdcan: add device fail on invalid fed clock value
Fail on wrong FDCAN clock in can_stm32h7_clock_enable() stage.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-01-18 11:03:21 +01:00
Chaitanya Tata df6d4e7717 wifi: shell: Log errors for validation
Handy in giving feedback to the user rather than silent failure.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-18 10:55:45 +01:00
Chaitanya Tata c9363a9c71 wifi: shell: Fix the channel extraction
The channel extraction from string directly uses the end variable with
limited data type, this causes issue if an invalid channel that exceeds
the data is given as an input e.g., 300, which would end up as a valid
channel 44.

Use an intermediate variable with type that can hold all possible
combinations (valid and invalid) and only after validation assign that
to the end type.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-18 10:55:45 +01:00
Chaitanya Tata 2f88df9cef wifi: shell: Add channel validation
Validate the channel for both STA and AP modes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-18 10:55:45 +01:00
Chaitanya Tata 2f99379dd5 wifi: utils: Move channel helpers to public API
These can be used for channel validation outside the utils.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-18 10:55:45 +01:00
Chaitanya Tata c6f2152348 wifi: shell: Add a sanity check for MFP
For none and WPA-PSK MFP isn't applicable, it was only introduced in
WPA2-PSK (RSN) and later.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-18 10:55:45 +01:00
Chaitanya Tata 4a1847eb22 wifi: shell: Make channel mandatory for AP
For starting an AP mode, channel is mandatory, so, fix the arguments and
the help text.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-18 10:55:45 +01:00
Yves Vandervennet 2a8b25660a boards: mimxrt1020_evk: enable linkserver support
- adds the definitions in the board.cmake file
- updates documentation

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-01-18 10:55:39 +01:00
Dominik Ermel 8ecda0418d tests/flash: Fix test assuming erase value to be 0xff
Test assumed non-writen flash to contain 0xff while it is
supposed to check for erase_value.
The "random" buffer has also been updated to skip values that
are equal to erase value.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-01-18 10:55:32 +01:00
Pavel Vasilyev 7a41a9d864 Bluetooth: Mesh: Fix processing SegAcks to wrong destination
Do not process SegAcks which were not targeted to the node.

They were rejected in the next if statement always, but generated
the annyoing warning "No matching TX context for ack".

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-18 10:55:24 +01:00
Bjarki Arge Andreasen 1bc8490c6c drivers: gnss: match: Change RMC/GGA sync from timeout to UTC
Change the synchronization of RMC and GGA NMEA messages from a
timeout to matching their UTC timestamps.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-18 10:55:17 +01:00
Vit Stanicek f0b4e4c88d drivers: gpio_mcux_lpc: Fix xt-clang error
Remove gpio_clock_names and gpio_mcux_lpc_config->clock_ip_name from
drivers/gpio/gpio_mcux_lpc.c.

The drivers/gpio/gpio_mcux_lpc.c file did not compile with xt-clang
RI-2021.8-win32, as the gpio_clock_names was initialised with a
reference to a static const array. The clock_ip_name member was
initialised from this variable, but it isn't used anywhere else.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2024-01-18 10:55:05 +01:00
Ian Wakely 715dc68b22 boards: Enabling neopixel on Adafruit Qt Py RP2040
Using the recently added WS2812 PIO driver, this enables the LED on the
QT PY to work with the built in RGB LED examples.

Signed-off-by: Ian Wakely <raveious.irw@gmail.com>
2024-01-18 10:54:55 +01:00
Yong Cong Sin 7c42c01f10 posix: pthread: use is_posix_policy_prio_valid to check POSIX priority
Use the existing `is_posix_policy_prio_valid()` function to
verify the POSIX's priority in the conversion functions.

Changed the `priority` arg of `is_posix_policy_prio_valid` to
`int` since that is the output of `sched_get_priority_min` &
`sched_get_priority_max`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin c3cc2e4e6d posix: pthread: test the priority conversion functions
Made the conversion functions non-static and added ztests for
them to make sure that they work across the full range of
Zephyr priorities.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin 5ad7f4b314 posix: pthread: priority should be of int type
Changed the variable type of the priority in the args and the
return type of the conversion functions to `int`, as both
Zephyr's priority & POSIX's `sched_priority` has type `int`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin b2caec8601 posix: pthread: fix typos
- 'piority' should be 'priority'
- COOP should start from `-CONFIG_NUM_COOP_PRIORITIES`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin 66fdd39ec5 posix: pthread: fix zephyr_to_posix_priority assert test
If `z_prio` is negative and we want to make sure that it is
within `[-CONFIG_NUM_COOP_PRIORITIES, -1]`, we should invert
its sign and make sure that it is `<=`
`CONFIG_NUM_COOP_PRIORITIES` instead of `<`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin 45c554d082 posix: shell: introduce top level posix command
Added a top level `posix` shell command for other POSIX
commands. Currently only `uname` is supported.

New POSIX commands can be added by including the
`posix_shell.h` header and use the `POSIX_CMD_ADD` helper
macro.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Yong Cong Sin 2cd0265f7e samples: posix: uname: add Makefile to compile on POSIX OS
Previously the sample was using some headers that aren't
available to the host, now we can add a `Makefile.host` to
compile the example on a POSIX OS like Linux:

```
# Go to the sample dir
cd ${ZEPHYR_BASE}/samples/posix/uname

# Compile the sample
make -f Makefile.host

# Run the binary
./build/uname

sysname[65]: Linux
nodename[65]: LAPTOP-YC
release[65]: 5.10.16.3-microsoft-standard-WSL2
version[65]: #1 SMP Fri Apr 2 22:23:49 UTC 2021
machine[65]: x86_64
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Yong Cong Sin 635dabf07a posix: uname: shell: update help message with more information
Populate the help message with more information when an error
occurs.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Yong Cong Sin 48c16f9052 posix: uname: move uname shell from sample
Relocate the `uname` shell implementation from uname sample, so
that it can be reused by other application and the uname sample
only uses POSIX APIs.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Yong Cong Sin cf13057c8d samples: posix: uname: convert to use printf
Convert to `printf` from `printk` to be more POSIX-y.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Jun Lin d34cd3e311 driver: I2C: npcx: re-enable interrupts after bus error
When the I2C is in the target mode and encounters the bus error, the
driver has to reset the bus to recover the I2C hardware. However, when
the hardware is disabled, the interrupt enable bits are also cleared
automatically by design. As a result, we need to enable the interrupts
after resetting the I2C hardware.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-01-18 10:54:25 +01:00
Fabio Baltieri 6529e316a5 workflows: find the SDK version from the top level SDK_VERSION file
Drop all hardcoded ZEPHYR_SDK_INSTALL_DIR settings, set the variable
automatically from the SDK_VERSION file instead.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-18 10:54:20 +01:00
Fabio Baltieri 24cf2f6548 doc: use substitutions to replace all current harcoded SDK versions
This creates a set of substitution rules to replace all current usages
of SDK versions in the documentation, apart from a few that were not
meant to be copy-pastable anyway and the version has just been swapped
with a <version> placeholder.

Since code-block does not parse the content, these have all been
replaced with parsed-literal. That one though parses URLs, which cannot
be broken, so a series of URL substitutions are provided too.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-18 10:54:20 +01:00
Fabio Baltieri 53f01807f6 SDK_VERSION: add a SDK_VERSION file
Add a SDK_VERSION file pointing to the current SDK version.
This is meant to be used by upstream and downstream CIs to automatically
determined the current version of SDK based on the upstream checked out
version, as well as the documentation references, and intended to stay
in sync with the version used in the main CI.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-18 10:54:20 +01:00
Michał Barnaś 77187548ff usbc: add driver for nx20p3483 PPC chip
Add driver for NXP nx20p3483 power path controller that can be used
to control and protect sink and source path of USB-C connector.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2024-01-18 10:53:53 +01:00
Michał Barnaś 551c7654f5 usbc: integrate the PPC with the USB-C stack
Add calls to the PPC API that enables and disables the sink and source
paths in the appropriate USB-C stack states.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2024-01-18 10:53:53 +01:00
Michał Barnaś 6bd26a0575 usbc: add shell commands for PPC manipulation
Add support for ppc shell command with subcommands that can print
the status of PPC (dead battery, sinking, sourcing, vbus detected),
dump registers and request the PPC to exit dead battery mode.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2024-01-18 10:53:53 +01:00
Michał Barnaś 85219ed13c usbc: add API for the Power Path Controllers
This commit adds an API to the Power Path Controllers (PPC) that
may be used with USB-C subsystem to control the current paths,
enabling and disabling sourcing and sinking VBUS and protect against
shorts, overvoltage and overcurrent.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2024-01-18 10:53:53 +01:00
Greter Raffael 08a2ca5b9b riscv: irq: Correct interrupt handling in clic non-vectored mode
According to the clic specification
(https://github.com/riscv/riscv-fast-interrupt), the mnxti register has
be written, in order to clear the pending bit for non-vectored
interrupts. For vectored interrupts, this is automatically done.

From the spec:
"If the pending interrupt is edge-triggered, hardware will automatically
clear the corresponding pending bit when the CSR instruction that
accesses xnxti includes a write."

I added a kconfig `RISCV_SOC_HAS_CUSTOM_IRQ_HANDLING` to allow custom
irq handling. If enabled, `__soc_handle_all_irqs` has to be implemented.

For clic, non-vectored mode, I added a `__soc_handle_all_irqs`, that
handles the pending interrupts according to the pseudo code in the spec.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-18 10:53:27 +01:00
Greter Raffael 9c955ce869 test: gen_isr_table: Adjust test for clic
The CLIC has different software-triggerable irqs than the PLIC. I
adjusted them.

Additionally, in a clic the the irq flag 0 would mean triggering on a
positive level. To work with software-triggering, the irqs have to
trigger on a positive edge, i.e. 1.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-18 10:53:27 +01:00
Greter Raffael 5b19fcd7e8 riscv: irq: Add trigger_irq function for clic
In a clic the mip register does not exist and software irq are triggered
in the clicintip register.

Signed-off-by: Greter Raffael <rgreter@baumer.com>
2024-01-18 10:53:27 +01:00