Commit graph

89839 commits

Author SHA1 Message Date
Gerhard Jörges 72a51c7ec4 net: add set hostname function
This commit adds a function to set the hostname on runtime.

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-01-17 14:42:58 +01:00
Yong Cong Sin 98a631b5bc posix: pthread: allow oldstate & oldtype to be NULL
The POSIX standard doesn't specify if the argument to store
previous state/type in
`pthread_setcancelstate`/`pthread_setcancelstate` can be
`NULL`, but threading implementations in Linux & Apache NuttX
permit the arguments to be `NULL`.

This commit changes Zephyr's implementation to mimic that of
Linux & NuttX, so that user do not get caught off-guard by
NULL pointer dereferencing when porting code over from those
OSes.

Updated test accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-17 14:42:50 +01:00
Jonathan Rico 81d524d081 Bluetooth: L2CAP: always send from workqueue
Always pull from the channel queue from the system workqueue context.
This simplifies debugging.

This also allows us to remove `sent` from the metadata struct.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-17 14:42:40 +01:00
Jonathan Rico 2dcb91ab46 Bluetooth: L2CAP: extract LE part of bt_l2cap_chan_send
Separate most of the param checking in `bt_l2cap_chan_send()`, with the
logic in `bt_l2cap_dyn_chan_send()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-17 14:42:40 +01:00
Vinayak Kariappa Chettimada 60c0087555 Bluetooth: Controller: Fix ISO Sync Receiver time reservation calc
Fix missing ISO Synchronized Receiver radio event time
reservation that did not calculate for all the subevents.

Introduce BT_CTLR_SYNC_ISO_RESERVE_MAX Kconfig option to
allow using a minimal time reservation if needed to allow
other role to pre-empt ISO Synchronized Receiver in
pre-transmission and control subevents.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-17 14:42:32 +01:00
Jordan Yates 7e7ab495c3 wifi: esp_at: compile without NET_NATIVE_IPV4
Allow the driver to compile without `CONFIG_NET_NATIVE_IPV4`. This can
happen if the driver is only desired for SSID scanning.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-17 14:42:19 +01:00
Anas Nashif abef8bde4e twister: reuse test schema in common section
Rather than duplicating the same schema, define it only once and reuse
for both common section and tests section.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-17 14:42:10 +01:00
Bjarki Arge Andreasen 4403d8f4c6 tests: lib: devicetree: api: Add tests for IRQ_INTC_* macros
Extend api test suite to cover the new devicetree macros. This
includes extending the devicetree overlay with two new bindings:

- GPIO device which is also an interrupt controller
- interrupt holder using interrupts-extended to point to both
  existing interrupt controller test_intc, and the newly added
  GPIO device

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-17 13:18:00 +01:00
Bjarki Arge Andreasen 6516e7fac2 devicetree.h: Add macros for interrupt specifiers intc
Add the following macros to devicetree.h to get an interrupt
specifier's interrupt controller:

DT_IRQ_INTC_BY_IDX(node_id, idx)
DT_IRQ_INTC_BY_NAME(node_id, name)
DT_IRQ_INTC(node_id)

and their INST variants

DT_INST_INTC_BY_IDX(inst, idx)
DT_INST_INTC_BY_NAME(inst, name)
DT_INST_IRQ(inst)

which use the newly generated _CONTROLLER output from the
previous commit.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-17 13:18:00 +01:00
Bjarki Arge Andreasen 08d6ff059e scripts: dts: gen_defines: Generate interrupt-controller macro
Extend the gen_defines.py write_interrupts(node) function to
generate macros to get the interrupt controller for an
interrupt specifier by idx and by name.

The information is already generated by edtlib.py and stored in
node.interrupts[].controller. This addition uses the node pointed
to by the controller member to generate the following example output

define DT_N_S_device1_IRQ_IDX_0_CONTROLLER \
       DT_N_S_gpio_800

define DT_N_S_device1_IRQ_NAME_test4_CONTROLLER \
       N_S_device1_IRQ_IDX_0_CONTROLLER

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-17 13:18:00 +01:00
Sateesh Kotapati cbc9439bc0 gecko: se_manager files updated | Update to GSDK 4.4.0
Updated the files present in gecko/se_manager folder in Silabs HAL
as per latest version of gecko_sdk.

Signed-off-by: Sateesh Kotapati <sateesh.kotapati@silabs.com>
2024-01-17 11:45:57 +01:00
Yong Cong Sin d4c2d4140b tests: posix: common: turn the fdtable init test into a testsuite
As there isn't any ZTEST under the `posix_apis` testsuite, its
the testsuite is skipped and its setup function never ran,
let's convert the fdtable initialization setup function into a
test of `posix_apis`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-17 05:41:37 -05:00
Yong Cong Sin 498529ea76 tests: posix: common: split posix_apis into multiple testsuites
Currently all components live under the `posix_apis` testsuite,
this commit split them into a testsuite of their own.

This commit also prefixed a few local functions/variables with
the `static` keyword.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-17 05:41:37 -05:00
Yong Cong Sin 73e20a8967 posix: clock: add ztest rule to reset clock base
Make sure that the POSIX clock base is reset after every
testsuite so that the initial time is the same for every test.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-17 05:41:37 -05:00
Christopher Friedt e223d01b67 tests: posix: shorten the filter in testcase.yaml
CONFIG_NATIVE_LIBC can be used in place of
CONFIG_NATIVE_BUILD and CONFIG_EXTERNAL_LIBC

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-17 04:59:16 -05:00
Christopher Friedt 574e641297 samples: cpp: add a Hello, world! C++ app
Create a separate hello world C++ app for Zephyr.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-17 09:56:34 +01:00
Martin Jäger db24a8b461 boards: arm: lora_e5_dev_board: add flash partitions
Add flash partitions required to use the board with MCUboot.

Also fix the chosen zephyr,code-partition devicetree node and point it
to slot0_partition.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-01-17 09:56:10 +01:00
Martin Jäger 8a3ba22f79 boards: arm: nucleo_wl55jc: add flash partitions
Add flash partitions required to use the board with MCUboot.

Also fix the chosen zephyr,code-partition devicetree node and point it
to slot0_partition.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-01-17 09:56:10 +01:00
Mustafa Abdullah Kus 3135a4cd0b drivers: spi: spi_ll_stm32: add midi and mssi impl
Master Inter-Data Idleness and Master SS Idleness
can configure with STM32 low level spi driver apis.

Signed-off-by: Mustafa Abdullah Kus <mustafa.kus@sparsetechnology.com>
2024-01-17 09:56:03 +01:00
Mustafa Abdullah Kus 0f9ebbded3 dts: bindings: st,stm32h7-spi: add mssi and midi property
add Master Inter-Data Idleness and
Master SS Idleness field. That fields
are integers.

Signed-off-by: Mustafa Abdullah Kus <mustafa.kus@sparsetechnology.com>
2024-01-17 09:56:03 +01:00
Peter Mitsis 5c18a00d37 arch: xtensa: Use wsr.lowercase over wsr.UPPERCASE
wsr.UPPERCASE can lead to compiler errors when UPPERCASE matches
a macro defined in the special register header file.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-17 09:55:57 +01:00
Peter Mitsis 2075a1b770 arch: xtensa: Use rsr.lowercase over rsr.UPPERCASE
rsr.UPPERCASE can lead to compiler errors when UPPERCASE matches
a macro defined in the special register header file.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-17 09:55:57 +01:00
Guennadi Liakhovetski e7217925c9 ace: use a 'switch' statement in pm_state_set()
Use 'switch' to emphasise that we're handling different values of
'state' in pm_state_set().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-17 09:55:48 +01:00
Guennadi Liakhovetski c99a604bbf ace: remove superfluous variable initialisation
'ret' in pm_state_set() is always set before it's used, no need to
initialise it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-17 09:55:48 +01:00
Guennadi Liakhovetski a1fd8cd078 runtime-pm: remove a superfluous k_is_pre_kernel() test
If runtime_suspend() is called early during Zephyr initialisation,
while k_is_pre_kernel() returns 'true,' 'async' is set to 'false,' so
if 'async' is 'true,' Zephyr initialisation is definitely complete,
so there is no need to check k_is_pre_kernel() again.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-17 09:55:48 +01:00
Guennadi Liakhovetski ac71dfae90 intel-adsp: use proper error codes
Use proper errno.h error codes in pd_intel_adsp_set_power_enable()
instead of -1.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-17 09:55:48 +01:00
Jukka Rissanen 16a54f251a net: sockets: Refactor accept() to support objcore better
If user has not supplied address pointer when calling accept(),
then we would not be able to figure out the used socket domain
properly. But as there is now SO_DOMAIN option supported, use
that to get the correct socket domain.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-17 09:55:40 +01:00
Jukka Rissanen 4c88169d03 tests: net: sockets: Add tests for SO_DOMAIN socket option
Make sure that the SO_DOMAIN is a read only value and it
returns correct socket domain (AF_INET or AF_INET6) in the
tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-17 09:55:40 +01:00
Jukka Rissanen 298ab2c95d net: socket: Add support for SO_DOMAIN option
The getsockopt() will return the address domain of the given
socket like AF_INET or AF_INET6.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-17 09:55:40 +01:00
Eduardo Montoya fe9e306a83 net: openthread: fix otLinkMetricsInit usage
Remove usage of `otPlatRadioGetReceiveSensitivity` without the
`otInstance` parameter.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2024-01-17 09:55:34 +01:00
Ibe Van de Veire ba5bcb14ba net: ip: igmp: removed compiler warning when igmpv3 is enabled
Made the definition of in_addr all_routers conditional to remove
compiler warning:
warning: 'all_routers' defined but not used [-Wunused-const-variable=]
The warning occurs when igmpv3 is enabled.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
2024-01-17 09:55:28 +01:00
Abderrahmane Jarmouni c55593cca3 board: arm: stm32h747i_disco: flashing
Add the possibility to flash stm32h747i_disco board using west
STM32CubeProgrammer runner, for both cores.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-01-17 09:54:29 +01:00
Miika Karanki 7c0047263a shell: telnet: Don't close the connection on ENOBUFS error
If there's not enough networking buffers at certain moment,
they might become available later. So instead of closing connection
(and failing assertation) sleep and retry. This avoid the following
assertion failure when there's much of data to send:

    net_pkt: Data buffer (1500) allocation failed.
    net_tcp: conn: 0x20076024 packet allocation failed, len=1460
    shell_telnet: Failed to send -105, shutting down
    ASSERTION FAIL [err == 0] @ .../subsys/shell/shell_ops.c:416
    os: r0/a1:  0x00000004  r1/a2:  0x000001a0  r2/a3:  0x00000004
    os: r3/a4:  0x20044380 r12/ip:  0x00001958 r14/lr:  0x080c9027
    os:  xpsr:  0x41000000
    os: Faulting instruction address (r15/pc): 0x0811ed26
    os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
    os: Current thread: 0x20045100 (shell_telnet)
    os: Halting system

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2024-01-17 09:54:15 +01:00
Tom Burdick 897553af17 logging: Remove hda log backend
The HDA log backend has been buggy for some time, and the fixes are well
understood. The issue with HDA log as it is implemented today means
there are concurrency and ISR issues where it can deadlock.

The fixes are effectively dropping the usage of ipc to communicate
status, using polling on the hda stream, and having a formatter per call
context (cores + isr) when log mode immediate is enabled to fix log
mangling. However it was found this had a lot of unintentional side
effects that made it difficult to make progress on when it came to
changes of the host side python tooling.

Meanwhile the feature has sat unused for nearly a year. Remove it, and
it can always be revisited in the future if something like it happens to
be needed.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-01-17 09:52:48 +01:00
Anas Nashif a0ac2faf9b intel_adsp: ace: enable power domain
Enable power domain drivers for this soc series as it is now needed in
the boot process.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-16 21:12:40 -08:00
Ian Morris 923201abc5 drivers: pinctrl: ra: fix write-protect register access
The write protect register (PWPR) found on RA Microcontrollers is an 8-bit
register at an odd address. It was being accessed using a pointer to a
uint32_t which causes a fault on some devices in the series.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-01-16 20:51:30 -05:00
Cong Nguyen Huu 9eb0a554f9 drivers: nxp_s32_canxl: add support RX FIFO
Driver supports both CAN classic and CAN FD frames
when using RX FIFO mode

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2024-01-16 20:50:49 -05:00
Chekhov Ma c78f583ed7 tests: drivers: gpio_basic_api add board mimx93_evk_a55
Add mimx93_evk_a55.overlay to tests: drivers: gpio_basic_api

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-01-16 20:50:11 -05:00
Chekhov Ma 97fabefa34 board: mimx93_evk_a55: add led and button definitions and alias
Tested with zephyr example project "samples/basic/blinky" and "samples/
basic/button". These examples can run out-of-the-box. No modification
needed.
for "samples/basic/blinky", the red LED inside RGB LED on board will
blink every 2 seconds.
for "samples/basic/button", the red LED inside RGB LED on board will
turn on once BTN1 on board is pressed down. An log will be present in
uart console as well.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-01-16 20:50:11 -05:00
Chekhov Ma 969792bc18 board: mimx93_evk_a55: enable rgpio
Add RGPIO 1,2,3,4 to mimx93_evk_a55 board dts

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-01-16 20:50:11 -05:00
Chekhov Ma 4e59679ce5 soc: imx93: enable rgpio driver
Add HAS_MCUX_RGPIO to Kconfig.soc
Add gpio1 ~ gpio4 dts node and pinctrl node in nxp_mimx93_a55.dtsi

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-01-16 20:50:11 -05:00
Chekhov Ma e1d495be81 driver: add new gpio driver "gpio_mcux_rgpio"
Add RGPIO gpio driver. This driver is used for i.MX93 and i.MX8ULP.
GPIO pinctrl, read/write and interrupt is supported. Runtime mmio
configuration is enabled, so no need for region definition in
mimx9/mmu_region.c

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-01-16 20:50:11 -05:00
Martin Jäger 2effad3b11 drivers: rtc: pcf8563: fix ifdef for alarm_set_callback
The callback should only be available when CONFIG_RTC_ALARM is defined.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-01-16 20:49:19 -05:00
Martin Jäger 1fafa94a35 dts: bindings: rtc: pcf8563: remove unused wakeup-source
The wakeup-source is not used by the driver. Most probably this was
inadvertently left when copying the binding from pcf8523 driver.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-01-16 20:49:19 -05:00
Alberto Escolar Piedras 53c121381f CI bsim workflow: Add UART tests to the bsim workflow
Add new workflow steps to the babblesim workflow to run
also the UART tests on the nrf52_bsim.
This commit:
* Enables the single device tests (which we may
move to the normal twister workflow once we fix the
requirement for a fixture)
* Adds as a placeholder the infra for multidevice tests.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras 9af74504dd tests/drivers uart_mix_fifo_poll: Filter out repetitive tests
Do not run in CI all tests, as they have very similar configuration
and provide little extra coverage to justify the extra CI time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras 7d590a9d3d boards nrf*_bsim: Add tag to filter slow tests
Add a tag to filter slow bsim tests in CI
(or tests which do not provide much extra coverage and
are not worth running all the time in CI)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras e6140f5422 tests/drivers uart_mix_fifo_poll: Allow configuring test length
This test is quite heavy and long in simulation,
but its length is meant to find unlikely issues which
may be triggered only very rarely.
Let's provide a kconfig value to chose how long the
test is, and set it to a lower value when running in simulation
(in CI) to save time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras a6ea4490a9 drivers serial nrfx: Speed up for simulation
Increase the busy wait time granularity while runing in simulation
for poll mode. In this mode, the driver spends a *lot* of time
waiting for the UART to be done. The smallest frame time is
~10µs @ 1Mbps, so busywaiting in very small increments
is very wastefull as we keep shuting down and turning on the simulated
MCU.
Let's increase the busy wait time increments of the driver to 3 micros,
which should not change much the behaviour.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00
Alberto Escolar Piedras 685c88308d tests/drivers uart_mix_fifo_poll: Speed up for nrf52_bsim
Increase the UART speed to 1Mbps for the simulated nrf52
to reduce the amount of time spent busy waiting, and
therefore the real time duration of the test.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-16 14:55:07 -05:00