Commit Graph

81971 Commits

Author SHA1 Message Date
Andrzej Kuros 9babac94a7 drivers: ieee802154: nrf5: multiple CCA support
The support for capability IEEE802154_OPENTHREAD_HW_MULTIPLE_CCA is added
to the ieee802154_nrf5 driver.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-25 09:13:41 +02:00
Andrzej Kuros d6567fc9e2 net: openthread: multiple cca as ieee802154 extensions interface
This commit adds extenstion interface that extends ieee802154_radio.h
New OT-specific capability, transmit mode and configuration parameter
is added.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-25 09:13:41 +02:00
Andrzej Kuros a04a059ccc net: ieee802154_radio: add attribute getter API
The `attr_get` method is added to the ieee802154_radio to allow
reading of driver specific attributes of given device.

The enum `ieee802154_attr` provides common extension pattern
allowing to extend the attribute set.

Accessor function `ieee802154_radio_attr_get` is provided.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-25 09:13:41 +02:00
Andrzej Kuros 83ad3fdafa net: ieee802154_radio: add extension values
The ieee802154_tx_mode and ieee802154_config_type types are given
values allowing to extend these types elsewhere.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-25 09:13:41 +02:00
Andrzej Kuros 3f4da29a3c drivers: ieee802154: nrf5: Revert Add transmission with multiple CCA
This reverts commit 5443d4127b.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2023-07-25 09:13:41 +02:00
Jordan Yates a4cfc1eb37 tests: pm: test `pm_device_driver_init`
Test that `pm_device_driver_init` puts devices into the appropriate
state depending on the devicetree configuration.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates b82bbf5e31 tests: pm: update power domain behaviour
Update the expected power domain behaviour in the tests in line with
the driver implementation changes.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates 39b2ec57a0 power_domain: gpio: init with `pm_device_driver_init`
Startup power domains according to the expected final state given the
power supply and PM device runtime support.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates 1f1217e832 power_domain: gpio: compile without `PM_DEVICE_POWER_DOMAIN`
Let the driver compile without `PM_DEVICE_POWER_DOMAIN`, in which case
the driver only controls the GPIO, without notifying dependant devices.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates 84016c1cd3 pm: device: add driver init helper
Adds a helper function for initializing devices into the expected power
state, through the devices `pm_device_action_cb_t`. This eliminates code
duplication between the init functions and the PM callback.

The expected device states in order of priority are:
 * No power applied to device, `OFF`
 * `zephyr,pm-device-runtime-auto` enabled, `SUSPEND`
 * Otherwise, `ACTIVE`

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates c72577d709 gpio: stellaris: implement `gpio_pin_get_config`
Implement `gpio_pin_get_config` for the stellaris platform, and by
extension `qemu_cortex_m3`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates 01e98fcb5f tests: kernel: device: test sub-priority
Add tests for sorting devices at the same init priority based on their
devicetree ordinals.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates bb590b5b6e init: add sub-priority to internal ordering
Add a sub-priority field to `Z_INIT_ENTRY_SECTION`, which is used to
ensure that multiple drivers running at the same init priority still
run in an order that respects their devicetree dependencies.

This is primarily useful when multiple instances of the same device are
instantiated that can depend on each other, for example power domains
and i2c muxes.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Jordan Yates 9b77681473 dts: gen_defines: generate `_ORD_STR_SORTABLE`
Generate a zero padded variant of `_ORD` that is suitable for use in
linker scripts with the `SORT` property, so that `6` is correctly placed
before `24`, and so on.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Nicolas Pitre d1a50e540b subsys/usb: move to timepoint API
Remove sys_clock_timeout_end_calc() usage.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre bd3ed97230 subsys/net: zperf_udp_uploader: Remove sys_clock_timeout_end_calc() usage
The initial goal was to remove sys_clock_timeout_end_calc(). However,
several related issues have been fixed as well.

First this:

    int64_t print_interval = sys_clock_timeout_end_calc(K_SECONDS(1));
    /* Print log every seconds */
    int64_t print_info = print_interval - k_uptime_ticks();

    if (print_info <= 0) {
        [...]
    }

The above condition will simply never be true.

Then there is lots of back-and-forth time conversions using expensive
base-10 divisions for each loop iterations which is likely to impact
performance.

Let's do the time conversion only once outside the loop and track
everything in terms of ticks within the loop. Also the various timeouts
are open-coded based on the absolute uptime tick so to sample it only
once per round. Using sys_timepoint_calc() and sys_timepoint_timeout()
would have introduced additional uptime tick sampling which implies the
overhead of a downstream lock each time for no gain. For those reasons,
open coding those timeouts bears more benefits in this particular case
compared to using the timepoint API.

Then this:

    secs = k_ticks_to_ms_ceil32(loop_time) / 1000U;
    usecs = k_ticks_to_us_ceil32(loop_time) - secs * USEC_PER_SEC;

The above should round down not up to work accurately. And the usecs
value will become garbage past 1.2 hour of runtime due to overflows.

And no need to clamp the wait period which is on the microsec scale
using the total duration argument being on the millisec scale. That's
yet more loop overhead that can be omitted. The actual duration is
recorded at the end anyway.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre 7238b48182 subsys/net: zperf_tcp_uploader: move to timepoint API
Remove sys_clock_timeout_end_calc() usage.
While at it, remove dead last_print_time variable.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre 603cdaa032 subsys/net/lib/socket: move to timepoint API
Remove sys_clock_timeout_end_calc() usage and custom timeout_recalc().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre 13d68185d5 subsys/net: move to timepoint API
Remove sys_clock_timeout_end_calc() usage.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre a7b3584745 subsys/zbus: move to timepoint API
Remove sys_clock_timeout_end_calc() usage as well as custom
_zbus_timeout_remainder().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre 531aa5786d drivers: move to timepoint API
Remove sys_clock_timeout_end_calc() usage.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre 77b7eb1199 kernel/kheap: move to timepoint API
Remove sys_clock_timeout_end_calc() usage.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre 3c9249cedc tests: test the timepoint API
This tests sys_timepoint_calc(), sys_timepoint_timeout() and
sys_timepoint_expired().

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Nicolas Pitre 52e2f83185 kernel/timeout: introduce the timepoint API
This is meant as a substitute for sys_clock_timeout_end_calc()

Current sys_clock_timeout_end_calc() usage opens up many bug
possibilities due to the actual timeout evaluation's open-coded nature.

Issue ##50611 is one example.

- Some users store the returned value in a signed variable, others in
  an unsigned one, making the comparison with UINT64_MAX (corresponding
  to K_FOREVER) wrong in the signed case.

- Some users compute the difference and store that in a signed variable
  to compare against 0 which still doesn't work with K_FOREVER. And when
  this difference is used as a timeout argument then the K_FOREVER
  nature of the timeout is lost.

- Some users complexify their code by special-casing K_NO_WAIT and
  K_FOREVER inline which is bad for both code readability and binary
  size.

Let's introduce a better abstraction to deal with absolute timepoints
with an opaque type to be used with a well-defined API.
The word "timeout" was avoided in the naming on purpose as the timeout
namespace is quite crowded already and it is preferable to make a
distinction between relative time periods (timeouts) and absolute time
values (timepoints).

A few stacks are also adjusted as they were too tight on X86.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Lukasz Mrugala 7dfe0811b5 scripts: tests: twister: CMakeCache test expansion
To enhance out test coverage, this change grants us 100%
coverage on cmakecache.py.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2023-07-25 09:11:26 +02:00
Wojciech Sipak 14b91d6bc3 boards: arm: add docs for efm32gg_sltb009a
This adds the index page and an image of the board.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-07-25 09:11:11 +02:00
Wojciech Sipak e9613856cb boards: arm: add efm32gg_sltb009a board
- Add Silabs SLTB009A board
- Add Silabs EFM32GG12B SoC

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-07-25 09:11:11 +02:00
Wojciech Sipak b9b42bb832 west.yml: update Silabs HAL
Silabs HAL introduces support for EFM32GG12B SoC.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-07-25 09:11:11 +02:00
Daniel DeGrasse 3c23ff051d boards: arm: mimxrt1060_evk: enable PXP rotation for LVGL sample
Enable PXP rotation for LVGL sample. The PXP is configured to
rotate by 0 degrees, so the original image is left untouched.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:10:52 +02:00
Daniel DeGrasse d209c837b5 boards: arm: mimxrt1170_evk: enable PXP
Enable PXP engine with RT1170 EVK. The PXP is set to rotate by 0
degrees in the LVGL sample, for testing purposes.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:10:52 +02:00
Daniel DeGrasse 0645b619e3 dts: arm: nxp: add PXP to RT1xxx series
Add PXP DTS definition to RT1xxx series SOCs

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:10:52 +02:00
Daniel DeGrasse d2372139f3 drivers: display: display_mcux_elcdif: enable display rotation using PXP
Enable display rotation using the NXP pixel pipeline (PXP). The ELCDIF
will only utilize the PXP if a framebuffer equivalent in size to the
screen is provided to display_write. The rotation angle can be
configured via Kconfig at build time.

Fixes #59921

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:10:52 +02:00
Daniel DeGrasse 7fe5ce641a drivers: dma: add DMA driver for NXP PXP engine
The NXP Pixel pipeline engine (PXP) is a 2D DMA engine capable of
accelerating display rotation, color space conversion, and limited
2D blending operations. This DMA driver only supports rotation of a
framebuffer, via a set of custom dma_slot values. Only DMA channel 0
is supported or utilized.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:10:52 +02:00
Fabio Baltieri 6d99e38a84 scripts: check_init_priorities: ignore zephyr,cdc-acm-uart
The new stack zephyr,cdc-acm-uart driver has two separate init path, one
of which kicks in before the USB stack to start buffering log messages.

This generates a false positive in the build time priority checking,
adding a check to ignore that compatible entirely.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-25 09:10:26 +02:00
Manimaran A b4cd531e2c drivers: bbled: pwm: mchp: BBLED low power mode updated
Updated the driver to support low power mode.
Introduced "enable-low-power" flag in device tree to
control(on/off) low power mode.

If flag added in DTS, during sleep BBLED will switch off the LEDs.
Otherwise BBLED will continue the configured blinking pattern on LEDs.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2023-07-25 09:09:44 +02:00
Daniel DeGrasse f907f9592d boards: shields: add g1120b0mipi watch display
Add g1120b0mipi watch display to shields. This shield is currently
supported with the RT595 and RT1170 EVK. The shield contains a 400x392
circular OLED watch display, with an integrated RM67162 display controller

Note that the touchscreen IC can be driven by the FT5336 driver, with the
following changes:

- the FT3267 reports touch data as inverted from the FT5336, so
  LVGL must be made aware of this via CONFIG_LV_Z_POINTER_KSCAN_INVERT_Y
- the FT3267 reports the X and Y coordinates as swapped from the FT5336.
  To resolve this, the RM67162 driver reports the display as rotated by
  90 degrees.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse 066c40bbb0 drivers: input: ft5336: Add support for reset GPIO and FT3267 IC
Add support for resetting controller at boot, and update FT5336
documentation to indicate that the FT3267 IC is also supported by this
driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse e692e57c68 drivers: display: add support for RM67162 controller
Add support for RM67162 MIPI display controller. This controller
is configured to run in MIPI command/DBI mode, driving a 400x392 OLED
display.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse 3e77ef8860 boards: mimxrt595_evk_cm33: only set LV_Z_VDB_CUSTOM_SECTION for shield
Only set LV_Z_VDB_CUSTOM_SECTION for the RK055HDMIPI4M shield, as it
is only required when using displays that require a large framebuffer.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse 35a210be48 drivers: mipi_dsi: dsi_mcux: fix support for DCS_LONG_WRITE command
Fix support for DCS long write command in DSI mcux driver, to enable use
with displays that require this command for full support.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse d1ef34440e drivers: mipi_dsi: dsi_mcux: make DPI mode optional
Only setup DPI input from LCDIF if MODE_VIDEO is set, as this
is the the only case where input from the LCDIF would be required to
drive the display. Do not populate the dpi_config structure unless a
reference the the NXP LCDIF device is provided, since this is the output
device providing DPI data.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse 21469a30d2 drivers: mipi_dsi: dsi_mcux_2l: enable DCS_LONG_WRITE using interrupts
Fixup support for DCS_LONG_WRITE command in DSI MCUX 2L driver. Since long
DCS commands may benefit from nonblocking I/O, add support for non blocking
transfers to the DSI driver.

This commit also corrects the interrupt number for the RT595, which uses
the DSI_MCUX_2L IP block.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse 867acef070 drivers: mipi_dsi: make DPI mode optional for dsi_mcux_2l driver
Make DPI mode an optional configuration for the DSI MCUX 2L driver.
DPI mode will only be enabled when the MIPI is attached in video mode,
since this is when DPI formatted packets are expected.

This will enable the DSI driver to also support DBI/command mode, for
displays that use this format.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Daniel DeGrasse 16f5665817 drivers: display: display_rm68200: add DSI video mode flag
Add DSI video mode flag to MIPI configuration, to indicate to MIPI
drivers that this display uses video mode and must be refreshed
constantly.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-25 09:08:59 +02:00
Benedikt Schmidt 732b54d825 tests: drivers: pwm: add MAX31790
Add MAX31790 to the build all tests of PWM.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-07-25 09:08:30 +02:00
Benedikt Schmidt 44810b190c drivers: pwm: implement MAX31790
Implement a driver for the PWM controller MAX31790. This driver
also implements the RPM mode of the controller, which can
be accessed via setting pwm_flags_t accordingly to macros
defined in the driver specific header.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-07-25 09:08:30 +02:00
Benedikt Schmidt 6587813ce0 dts: bindings: pwm: add MAX31790
Add binding for the PWM and fan driver MAX37190.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-07-25 09:08:30 +02:00
Jason Yuan ad555d08d8 samples: boards: firmware for Twinkie V2
sample firmware for Twinkie V2 that toggles the LED based on charging
status.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-07-25 09:08:19 +02:00
Jason Yuan 8fb198bf01 board: Google Twinkie V2
This is a new board for the google Twinkie V2 tool.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-07-25 09:08:19 +02:00
Fabio Baltieri ab9028518e drivers: uart_nrfx_uart{,e}: on clear async pointers when enabled
Fix a build error introduced in 9f02eeadf8, the async pointers are only
available when UARTE_ANY_ASYNC is set.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-24 17:31:08 +00:00