Commit graph

61266 commits

Author SHA1 Message Date
Krzysztof Chruscinski 47ae656cc1 all: Deprecate UTIL_LISTIFY and replace with LISTIFY
UTIL_LISTIFY is deprecated. Replacing it with LISTIFY.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Krzysztof Chruscinski 9b30b959d5 tests: unit: util: Add test for LISTIFY
Add test for LISTIFY macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Krzysztof Chruscinski 787fa61efd sys: util: Add LISTIFY macro
Add macro similar to existing UTIL_LISTIFY but with option
to provide separator which is used between evaluation of each
iteration. Separator is not added after the last iteration.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Yegor Yefremov 1155d4679b drivers: serial: fix typos
Typos were found with codespell utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2022-03-08 10:24:23 +01:00
Henrik Brix Andersen 4828fa0649 samples: drivers: eeprom: fix spelling
Fix spelling in the EEPROM driver sample application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-08 10:23:53 +01:00
Martí Bolívar c050d1f2ec doc: bindings: improve gpio_dt_spec doc
Use _dt methods for everything.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-03-07 17:39:43 -05:00
Mikkel Jakobsen 5a4d2c5979 samples: sensor: icm42605: remove deprecated *_OWN_THREAD
the icm42605 defaults to a global thread for trigger processing,
the CONFIG_ICM42605_TRIGGER_OWN_THREAD is deprecated.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2022-03-07 16:23:36 -06:00
Mikkel Jakobsen da514737d0 drivers: sensor: icm42605: fix default kconfig issues
by default, a global trigger thread was enabled in kconfig but
the thread priority and stack size depended on a local thread
being enabled.

the local thread option was never used anywhere so it is removed.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2022-03-07 16:23:36 -06:00
Mikkel Jakobsen 9d3f9e3921 drivers: sensor: icm42605: make trigger mode choice named
convert choice to named choice to allow setting from Kconfig.* files

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2022-03-07 16:23:36 -06:00
Bartosz Golaszewski 134f56dd2d lvgl: bump supported version to v8.2.0
In upstream the LV_COLOR_DEPTH_BITS option is called LV_COLOR_DEPTH, this
needs changing if we want to support v8.2.0.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-03-07 16:20:27 -06:00
Kai Vehmanen 209331734b xtensa: intel_adsp: use cavs_ipc driver only if enabled in Kconfig
Commit bdce0a5742 ("soc/intel_adsp: Add a cavs_ipc driver to manage
host IPC") added a new driver for cAVS IPC. Although patch included the
CONFIG_CAVS_IPC option, in practise this had no effect and instead
driver was enabled whenever device tree included IPC hardware. This
caused IPC errors in SOF application builds where two drivers, one out
of tree in SOF and one in Zephyr, initialize the same hardware.

Fix the issue by enabling the driver only when CONFIG_CAVS_IPC is
enabled.

BugLink: https://github.com/thesofproject/sof/issues/5477
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-07 16:35:30 -05:00
Daniel DeGrasse 08d98c247a boards: mimxrt1064: Document debugger issue when entering LPM
Add documentation warning user that entering low power modes can cause
debugger to fail to connect.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse 694e6493af timers: mcux_gpt_timer: Change MCUX GPT timer to use indirect ISR
Indirect ISR automatically calls power management functions, which GPT
timer direct ISR was not calling. Calling these functions means that the
kernel will recognize that it is exiting low power mode when the GPT
timer interrupt fires that wakes the SOC up, and will call
pm_power_state_exit_post_ops, which can in turn raise the clock
frequencies and voltage of the SOC as early as possible.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse cbb52e8c50 soc: mimxrt1064: Enable low power clocking for mimxrt1064
Enables low power clocks for mimxrt1064. This allows the soc to
transition into very low power states during idle, as most PLLs can be
disabled. Power states need to be enabled and selected at the board
level.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse 6696d834cf drivers: serial: Add pm constraint setting to mcux lpuart driver
System entering sleep state before uart tx is complete can result in
characters being dropped from the transmission. Add pm constraint
setting to the lpuart driver to prevent character drops

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse e9ce5cd282 soc: rt10xx: Add power management support
Add power management code for the RT10xx SOC. By default, the code will
simply gate the core clock and transition the SOC to WAIT mode when
sleeping, but if clocking hooks are register to reduce clock frequencies
these will be called as well, and the SOC core voltage will be lowered
for additional power savings.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse cb685709e5 soc: nxp_imx: Enable inclusion of power management HAL drivers
Add KConfig symbols to select power management HAL drivers required for low
power modes. Set ZTEST_NO_YEILD if PM is enabled, since RT series SOCs
do not connect to a debugger in WAIT mode.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Daniel DeGrasse 5ba1787163 tests: ztest: add CONFIG_ZTEST_NO_YIELD to keep SOC awake after test
Some SOCs cannot be flashed reliably in low power modes. If
CONFIG_ZTEST_NO_YIELD is selected, do not yield to the idle thread after
testsuite completes, so that the SOC will not enter low power mode.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Henrik Brix Andersen 2ffce62f61 soc: arm: nxp: kinetis: fix pinctrl compilation for ke1xf SoC series
The NXP KE1xF SoC series does not support neither slew rate nor open
drain PORT configuration registers.

Fix pinctrl compilation for the KE1xF by defining dummy register macros
for the SRE and ODE registers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-07 13:52:12 -06:00
Jay Vasanth 3034693509 drivers: i2c: MEC15xx: Improved error handling
1. Check I2C Clock and Data is high through GPIO driver instead
of the I2C bitbang registers
2. i2c_xec_poll_write() and i2c_xec_poll_read() will poll to
check I2C clock and data lines are high before initiating the
transaction. The polling will be every 25us for a cumulative
max of 2.5ms
3. wait_completion() will not call recover_from_error() to reset
the controller. Instead will poll for 10ms for the PIN bit to
clear before returning error.
4. wait_completion() will send STOP if the 9th bit is NACK
5. If any errors with current transaction:
(a) Set error_seen flag.
(b) In the next transaction do the recovery process (reset the
i2c controller) if the clk and data lines are high.
Note: error_seen flag is set for Address NACK with Repeated
Start as well.
6. If timeout error occurs in wait_completion():
(a) Set timeout_seen flag;
(b) Wait till the slave will release the clock.
(c) Once slave releases clock send STOP on the bus. If the
timeout occurred while master read, read the I2C DATA register
for the hardware to proceed.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 14:13:34 -05:00
Tom Burdick c3c6bf9f2a tests/boards/intel_adsp: CPU halt timeout test fix
Smoke test was timing out in a WAIT_FOR macro on my up xtreme tgl board.
Enabling this sleep fixes it.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-07 12:00:23 -05:00
Bartosz Bilas 718225dadf drivers: ethernet: dsa_ksz8xxx: fix spi bus initialization
spi_dt_spec structure initialization should not be done
in the runtime during spi bus initialization because it
causes kernel panic.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-03-07 09:54:21 -06:00
Hake Huang f5864b50ff test: flash: add rt685 support for flash driver test
enable flash test for rt685

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-03-07 09:46:26 -06:00
Dominik Ermel 92109e1f62 doc/guides/device_mgmt: SMP protocol documentation
The commit adds guide that describes format of SMP reqests/responses
as issued by Zephyr implementation within mcumgr.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-07 16:45:52 +01:00
Torsten Rasmussen f96ee77c7c cmake: function to update Zephyr_DIR when loading old Zephyr packages
Fixes: #43094

This commit introduces a function which updates Zephyr_DIR to point to
the directory of the Zephyr package being loaded.

For Zephyr 3.0 and earlier, the Zephyr_DIR might in some cases be
`Zephyr_DIR-NOTFOUND` or pointing to the Zephyr package including the
boilerplate code instead of the Zephyr package of the included
boilerplate code.

This code ensures that when a package is loaded then Zephyr_DIR will
point correctly.
This ensures that when Zephyr releases <=3.0 is loaded, then Zephyr_DIR
will point correctly, see more in #43094.

Old style Zephyr package will in some cases load boilerplate.cmake
directly so to ensure proper behavior, restrict boilerplate uses of
`find_package(Zephyr)` to not use default search path, but allow only
the current Zephyr.

Of the same reason, only print warning if Zephyr_DIR is not defined as
this indicates old style inclusion.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-03-07 16:35:54 +01:00
Torsten Rasmussen 0a64b08062 cmake: set Zephyr_DIR when loading Zephyr package
CMake find_package() is expected to set the cached variable Zephyr_DIR
with the value of the package included.

Zephyr_DIR in the CMakeCache is used by CMake re-runs for
`find_package(Zephyr)` to directly lookup the package to use.

The Zephyr_DIR is set correctly when a single Zephyr workspace is used
but may in some other cases be set to `Zephyr_DIR=Zephyr_DIR-NOTFOUND`.
This causes CMake to rerun the Zephyr package search mechanism and loop
through potential candidates before loading the correct Zephyr
installation.
After a second run, Zephyr_DIR is n some cases set to
`Zephyr_DIR=<path-to-including-Zephyr>` which might be different from
the Zephyr in use.

The Zephyr_DIR should be pointing to the package defined by ZEPHYR_BASE.

This commit ensures that when ZephyrConfig.cmake package is loaded, then
Zephyr_DIR is set correctly.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-03-07 16:35:54 +01:00
Rafał Kuźnia 1a0fed70d5 drivers: timer: Set user RTC channel count conditionally
The RTC user channel count is increased contitionally to 2 when
nrf_802154 radio driver is enabled.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2022-03-07 09:26:52 -06:00
Rene Bredlau 876ea8d215 modem: hl7800: use correct timeouts on KTCPSND to avoid internal deadlock
The response of a KTCPSND has two phases. According to documentation by
wireless the timeout is 60 seconds. The fix respects the timeout on the
second phase, too (waiting for OK or errors from modem). Previously only
the first phase used 60 seconds and the second phase used 5 seconds.

Without this fix the hl7800 will lock the tcp stack for the current
socket indefinitely if another socket operation is performed before the
response from the modem is received.

Additionally all timeouts are adjusted to be at least one second longer
as the documented timeout from wireless. This avoids races between the
hl7800 and the driver.

Signed-off-by: Rene Bredlau <git@unrelated.de>
2022-03-07 09:24:25 -06:00
Carlo Caione 797c962941 libmetal: Bump to SHA 695d29ba60a5
Bump libmetal to SHA 695d29ba60a5

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-07 09:21:57 -06:00
Andrzej Głąbek 70a9e2055c drivers: Remove undesirable irq_enable calls from nrfx driver shims
Shims for nrfx drivers should only connect the related IRQ handlers,
they should not enable the IRQs, as this could lead to a situation
where the interrupt handler is called before the driver had a chance
to properly initialize the peripheral and install the provided event
handler. nrfx drivers will enable the interrupts appropriately on
their own by calling the NRFX_IRQ_ENABLE macro which is implemented
in nrfx_glue.h as a call to irq_enable().
This commit fixes the above issue spotted in the following shims:
- dmic_nrfx_pdm
- clock_control_nrf
- i2s_nrfx

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-07 09:19:56 -06:00
Georges Oates_Larsen 303c42e70a net: http_client: Add official null response behavior
Adds an official behavior in response to null response from HTTP
endpoint.

Fixes #42988

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2022-03-07 09:18:50 -06:00
Thomas Ebert Hansen 4b18770145 tests: Bluetooth: Test unsupported LLCP opcodes
Test the rejection (LL_UNKNOWN_RSP) of unsupported remotely initiated
procedures in both the central and peripheral role.

Unsupported opcodes are handled by Kconfig manipulation and removal of
source files.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Thomas Ebert Hansen 250075d3dd tests: Bluetooth: Test invalid LLCP opcodes
Test the rejection (LL_UNKNOWN_RSP) of invalid remotely initiated
procedures in both the central and peripheral role.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Thomas Ebert Hansen 0b0a90ae84 Bluetooth: controller: Unsupported proc handling
Add handling of unsupported procedures based on opcode and role.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Thomas Ebert Hansen 995ce7a226 ztest: Add skipping for non-kernel tests
Add ztest_test_skip() support to non-kernel tests by implementing
long jump buffer and TC_SKIP result collection.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Erwan Gouriou d74cb2a3df drivers/clock_control: stm32h7: Simplify SysClk freq computing
Instead of reading registers query the info on sysclock configuration
from existing configuration symbols.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou 2116606ce2 drivers/clock_control/stm32h7: Independent clocks configuration
Rework clock start up functions in order to allow configuration
and enabling of individual clocks.
This way, each clock defined with a "okay" status will be enabled
even if not part of the sysclock clock tree.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou ceb8579854 include/drivers/clock_control: stm32: Add XXX_ENABLED and XXX_FREQ
Add STM32_FOO_ENABLED and STM32_FOO_FREQ to STM32 fixed clocks:
HSI, HSE, MSI(S), CSI, LSI, LSE..

Replace STM32_LSE_CLOCK by STM32_LSE_FREQ and when possible
replace by new STM32_LSE_ENABLED when making sense.

Fix STM32_PLL3_FOO_ENABLE to STM32_PLL3_FOO_ENABLED

Additionally, add STM32_PLL_FOO_ENABLED definitions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou 348070e4ea drivers/clock_control: stm32u5: Use LL API for LSESYS programming
Use LL API when possible.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou 5a1fe914ff drivers/clock_control stm32h7: Move RCC HW semaphore unlock
PLL3 setting should also be protected CFG_HW_RCC_SEMID.
Move semaphore unlock after we're done with PLL3.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou 87eba815dd drivers/clock_control: stm32h7: Complementary readability changes
- Factorize elementary clocks setup code.
- Put conditional logic on CONFIG_CPU_CORTEX_M4 outside init function

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou 12404f7668 drivers/clock_control: stm32h7: Make driver more readable
Re-arrange code using benefits of IS_ENABLED.
Change some #if to #ifdef when possible.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou a911b81a2e drivers/clock_control: stm32u5: Make driver more readable
Use benefits of IS_ENABLED.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou 92936122b3 include/drivers/clock_control: stm32: Make few macros IS_ENABLED-able
Tweak some macros definitions so that they can be used in
IS_ENABLED utility macro.
Finality is to rework STM32 clock_control driver to a more
readable format.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou 78c42719c2 include/driver/clock_control: stm32: Rearrange definitions
Group definitions by related node.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Erwan Gouriou a6e39b88a9 include/drivers/clock_control: stm32: Remove some conditions
Remove conditions around some definitions since these symbols
and the node itself are mandatory.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-07 11:36:28 +01:00
Jay Vasanth 73f24056d5 kscan: update mchp keyscan module to use pinctrl
Changes to keyscan module to support pinctrl

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Jay Vasanth cfe9a960f0 pinmux: Remove pinmux.c source file
Since we are moving to pinctrl, removing pinmux.c
from mec172x board folder and removing pinmux from dts

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Jay Vasanth 9138d81365 adc: updates to MEC172x adc to support pinctrl
Changes to adc module to support pinctrl.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00
Jay Vasanth 535c20e490 qmspi: MEC172x: fix unused variable warning
Fix unused variable warning when CONFIG_SPI_ASYNC
is not defined

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-03-07 11:03:06 +01:00