Commit graph

73182 commits

Author SHA1 Message Date
Corey Wharton
21a7c2d7eb pm: don't suspend unready devices when entering low power states
The PM subsystem should not call the PM control callbacks on
uninitialized devices when entering low-power states.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2022-12-19 09:46:17 +00:00
BJ Chen
108d516397 ITE: drivers/espi: fix the VW valid flag issue in MAFS mode
Add CONFIG_ESPI_SET_VW_VALID_WITH_LEVEL to fix the VW Valid Bits Issue

fixes #52776

Signed-off-by: BJ Chen <bj.chen@ite.com.tw>
2022-12-19 09:44:31 +00:00
Chris St John
ecbb386d85 Bluetooth: audio: correct arg usage in BT_CODEC_LC3_CONFIG_DATA
Correct _frame_blocks_per_sdu usage in BT_CODEC_LC3_CONFIG_DATA

Signed-off-by: Chris St John <chris_st._john@bose.com>
2022-12-19 09:42:07 +00:00
Jonathan Rico
dc4d63e97b Bluetooth: host: adv: set the address in bt_le_adv_resume
The address could have changed. The issue linked (and bsim test in previous
commit) shows a scenario where that could happen:

- we start scanning, host will use NRPA
- we start advertising, host will use identity address
- a device connects (as a central)
-> advertising resume fails for some unrelated reason
- another device connects (as a peripheral)
- the central device disconnects, we resume scanning
- the peripheral disconnects, the stack resumes advertising
-> but it mistakenly advertises using the NRPA set by the scanner

Fixes #52059 .

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-12-19 09:37:25 +00:00
Jonathan Rico
57d7d62bee Bluetooth: host: add bsim test for #52059
The test should fail.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-12-19 09:37:25 +00:00
Jonathan Rico
5f98b1bea4 Bluetooth: host: adv: add adv_is_directed helper
Makes it more readable.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-12-19 09:37:25 +00:00
Chris Friedt
74c9c0e7a3 tests: time_units: check for overflow in z_tmcvt intermediate
Prior to #41602, due to the ordering of operations (first mul,
then div), an intermediate value would overflow, resulting in
a time non-linearity.

This test ensures that time rolls-over properly.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-12-19 09:36:38 +00:00
Erwan Gouriou
50473ec0a9 drivers: hwinfo: stm32: Deal with iwdgX and wwdgX instances
On some STM32 series (H7, MP1), iwdg and wwdg have multiple instances.
Due to current driver implementation, these wdg instances were not
checked in the function.

Fixes #53002

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-19 09:22:28 +00:00
Serhiy Katsyuba
9cf89603df intel_adsp: dai: Add support for ALH streams 2 and 3
Adds two additional alh2 and alh3 "devices" to already defined
alh0 and alh1. This (seems) is a temporarily solution as
the hardware actually supports 16 streams and future update
to device tree is required.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-12-17 06:47:55 -05:00
Johann Fischer
10165b7d79 boards: degu_evk: disable CDC ACM logging
Board degu_evk uses CDC ACM UART as default backend for logging.
Disable logging module in CDC ACM to prevent recursive logging loop.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 21:00:57 +01:00
Tomasz Leman
720787f75a intel_adsp: boot: allow boot from imr without restore
This patch makes IMR context save an option that can be enabled. By
default FW, after D3 state transition, will be boot using normal flow.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-16 11:03:46 -08:00
Nils Larsen
ca6d02147d nxp_imx: fix base address of Flexspi2
The base address is 0x400d0000 not 0x4000d000

Signed-off-by: Nils Larsen <nils.larsen@posteo.de>
2022-12-16 15:37:55 +01:00
Emil Gydesen
0114bc8199 Bluetooth: Audio: Shell: Add TBS Client debug logging in audio.conf
Add TBS client debug logging like all the other modules.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
18fe973df2 Bluetooth: Audio: Shell: Enable optional TBS features
Enable the optional TBS features to provide a full TBS experience.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
24d22ebbdb Bluetooth: Audio: Shell: Add support for more connections
Add support for 3 connections. Mainly we need to support
at least 2 connection to use the CSIP Set Coordinator role,
but some sets may also be 3 or even larger.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
cc9006f211 Bluetooth: Audio: Shell: Add EATT to audio.conf
Add EATT support for audio.conf as that is quite useful
for LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Fabio Baltieri
4b48d91cce drivers: usb_dc_stm32: implement usb_dc_wakeup_request
Implement usb_dc_wakeup_request for STM32 USB DC and default to enable
remote wakeup functionality when the drivers is selected.

This allows the device to wake the host up by calling
usb_wakeup_request().

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2022-12-16 14:46:25 +01:00
Marcin Niestroj
0d26fe6c45 tests: settings: functional: remove per platform prj_*.conf
All per-platform prj_*.conf files are the same as prj.conf, so there is no
need to duplicate those configuration files.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
a854d1d6f5 tests: settings: remove explicit CONFIG_STDOUT_CONSOLE=y
This option is selected by default, so there is no need to select it
explicitly. Additionally, selecting this option for native_posix platforms
results in configuration time warning due to unsatisfied
!NATIVE_APPLICATION dependency.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
eea6587ac5 tests: settings: enable ARM MPU
Remove CONFIG_ARM_MPU=n from all settings tests. This is possible due to
CONFIG_MPU_ALLOW_FLASH_WRITE=y automatically being enabled, which was not
true some time ago.

Enabling ARM MPU allows to detect stack overflows during tests runtime.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
1088a2d9d5 tests: settings: file: increase main stack size to 2kB
Running tests on `nrf52840dk_nrf52840` with ARM MPU enabled results in
following error:

  Running TESTSUITE settings_config_fs
  ===================================================================
  I: LittleFS version 2.5, disk version 2.0
  I: FS at mx25r6435f@0:0x0 is 16 0x1000-byte blocks with 512 cycle
  I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
  E: WEST_TOPDIR/modules/fs/littlefs/lfs.c🔢 Corrupted dir pair at \
     {0x0, 0x1}
  W: can't mount (LFS -84); formatting
  E: ***** MPU FAULT *****
  E:   Stacking error (context area might be not valid)
  E:   Data Access Violation
  E:   MMFAR Address: 0x20001f78
  E: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000
  E: r3/a4:  0x0000b461 r12/ip:  0x00000000 r14/lr:  0x0000da8d
  E:  xpsr:  0x00003800
  E: Faulting instruction address (r15/pc): 0x00000000
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x20000468 (main)
  E: Halting system

Increase main stack size to 2kB to prevent stack overflow.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
06454d9ac6 tests: settings: functional: file: increase ztest stack size to 2kB
Running tests on `qemu_x86` results in following error:

  START - test_direct_loading
  E: Double Fault
  E: EAX: 0x00224820, EBX: 0x00000000, ECX: 0x00000010, EDX: 0x00000010
  E: ESI: 0x00224820, EDI: 0x00000000, EBP: 0x0021e020, ESP: 0x0021e000
  E: EFLAGS: 0x00000206 CS: 0x0008 CR3: 0x0022b000
  E: call trace:
  E: EIP: 0x001096ec
  E:      0x00109a76 (0x4)
  E:      0x0010a1f8 (0x78000000)
  E:      0x0010dbec (0x0)
  E:      0x00107a3c (0x224894)
  E:      0x00106ce2 (0x224940)
  E:      0x00104f11 (0x21e260)
  E:      0x00104747 (0x224f00)
  E:      0x0010476f (0x21e3c4)
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x11a0a0 (test_direct_loading)
  E: Halting system

Similar error is on `nrf52840dk_nrf52840` when ARM MPU is enabled:

  START - test_clear_settings
  I: LittleFS version 2.5, disk version 2.0
  I: FS at flash-controller@4001e000:0xde000 is 16 0x1000-byte blocks \
     with 512 cycle
  I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
  E: WEST_TOPDIR/modules/fs/littlefs/lfs.c🔢 Corrupted dir pair at \
     {0x1, 0x0}
  W: can't mount (LFS -84); formatting
  E: ***** MPU FAULT *****
  E:   Data Access Violation
  E:   MMFAR Address: 0x20000d70
  E: r0/a1:  0x20000074  r1/a2:  0x20000084  r2/a3:  0x20000074
  E: r3/a4:  0x00000000 r12/ip:  0x000004ff r14/lr:  0x0000f221
  E:  xpsr:  0x41000000
  E: Faulting instruction address (r15/pc): 0x000093d8
  E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
  E: Current thread: 0x20000348 (test_clear_settings)
  E: Halting system

Increase ZTEST stack size to 2kB to prevent stack overflow.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
4cef4de98d tests: settings: fcb: increase ztest stack size to 2kB
Tests are passing now on `nrf52840dk_nrf52840` platform, just because ARM
MPU is disabled and stack overflow is not detected. When running those
tests on `qemu_x86` there is following error during runtime:

  START - test_config_compress_reset
  E: Double Fault
  E: EAX: 0x0011c1c8, EBX: 0x00000002, ECX: 0x00000002, EDX: 0x0000100a
  E: ESI: 0x0000000a, EDI: 0x0021f370, EBP: 0x0021f000, ESP: 0x0021f000
  E: EFLAGS: 0x00000202 CS: 0x0008 CR3: 0x0022b000
  E: call trace:
  E: EIP: 0x001075be
  E:      corrupted? (bp=0x21f000)
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x11b140 (test_config_compress_reset)
  E: Halting system

Same happens on `nrf52840dk_nrf52840` when ARM MPU is enabled:

  START - test_config_compress_reset
  E: ***** MPU FAULT *****
  E:   Stacking error (context area might be not valid)
  E:   Data Access Violation
  E:   MMFAR Address: 0x20008cb8
  E: r0/a1:  0x39beca54  r1/a2:  0x9abe9566  r2/a3:  0xe333d994
  E: r3/a4:  0x41387fc2 r12/ip:  0x7c2e5c00 r14/lr:  0xdc5006d9
  E:  xpsr:  0x81000000
  E: Faulting instruction address (r15/pc): 0x0000b50e
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x200001d8 (test_config_compress_reset)
  E: Halting system

Increase ZTEST stack size to 2kB to prevent stack overflow.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Mateusz Wielgos
217987f1b5 usb: host: add port power and port reset USB hub features
Add port power and port reset USB hub features.

Signed-off-by: Mateusz Wielgos <mateusz.wielgos@emerson.com>
2022-12-16 13:21:12 +01:00
Mateusz Wielgos
a914a33e61 include: usb_hub: add macros for the USB hub class
Add new usb_hub header file, along with class feature selectors and
request codes.

Signed-off-by: Mateusz Wielgos <mateusz.wielgos@emerson.com>
2022-12-16 13:21:12 +01:00
Johann Fischer
eb6207707a samples: usb: shell: extend new USB support sample by host support
Extend new USB support sample to include experimental host support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Johann Fischer
e939c1d8ae drivers: uhc: add driver for virtual USB host controller
Add support for virtual USB host controller intended for use
together with virtual bus and virtual device controllers.
This driver is not an emulation of any real host controller.
The driver has initial support for handling control and bulk
transfers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Johann Fischer
ac649c35fd drivers: udc: add driver for virtual USB device controller
Add support for virtual USB device controller intended for use
by virtual bus and virtual UHC controllers. This driver is not
an emulation of any real host controller.
The driver has initial support for handling control and bulk
transfers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Johann Fischer
deb637eb8a drivers: usb: add support for virtual USB bus
Add support for virtual USB bus (UVB) intended for use
by virtual UDC and UHC controllers. UVB is not an emulation
of the USB bus or protocol but a simplified service to connect
a virtual host controller to one or more virtual device
controllers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Johann Fischer
7c1ef35027 usb: add initial USB host support
This is initial support. Necessary to test the UHC driver API,
for the USB support test implementations, and upcoming USBIP support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Johann Fischer
bb7ab1e0f2 shields: add Sparkfun MAX3421E shield support
Add Sparkfun MAX3421E shield support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Johann Fischer
da639954c1 drivers: usb: add common layer of UHC API and MAX3421E driver
Add common layer of UHC API and MAX3421E host controller driver.
This implements the bare minimum necessary to communicate with
one peripheral device.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Johann Fischer
0024038c91 include: drivers: add USB host controller (UHC) driver API header
Add USB host controller (UHC) driver API header.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Emil Gydesen
c27db9ed90 Bluetooth: Shell: Move the name filter last
Moved the name filter last, as that it the most expensive
to use.

The address filter has almost been moved after the more
trivial checks.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 11:05:24 +00:00
Emil Gydesen
f4ff8f2230 samples: Bluetooth: ISO broadcast receiver pa_interval check move
Move the check for the pa_interval to before we start
parsing the data for the name, as that is more optimized.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 11:05:24 +00:00
Emil Gydesen
bc1bb4f63c Bluetooth: Shell: Add pa_interval scan filter
Add filtering for the pa_interval. This can be used to
easier find devices that are advertising with periodic
advertising.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 11:05:04 +00:00
Tomasz Leman
af6d827b64 drivers: hda: enable runtime power mgmt in intel hda dma
Enable Zephyr device runtime power management mechanisms in Intel HDA
DMA driver. This allows Zephyr to track usage reference for power domain
gating.

PM action handler is currently empty and will be fill out later.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-16 11:03:15 +00:00
Tomasz Leman
d9432ebcb9 ace: dts: hda: add power domain
Assigning power domain to the HDA DMA.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-16 11:03:15 +00:00
Troels Nilsson
c0a5b1ef7b bluetooth: controller: Reduce user ops status to uint8_t
The status field is currently a uint32_t even though there are only
3 possible values. Reducing it to a uint8_t allows status to fit in
existing padding in the struct, saving 4 bytes per ticker_user_op

Updated function signatures to match; ticker_op_func left as-is
to avoid having to update a whole bunch of files for no real benefit

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-12-16 11:02:30 +00:00
Gerard Marull-Paretas
460f2d04fa samples: shields: npm6001_ek: add utility to test regulators
Add a utility sub-shell to test all regulators embedded in the nPM6001
PMIC.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-16 11:26:47 +01:00
Gerard Marull-Paretas
5f8d59d69f boards: npm6001_ek: add regulator entries
Add entries for the BUCK0/1/2/3 and LDO0/1 regulators. Note that voltage
min/max limits have been set to the hardware limits. They can be
adjusted using overlays in applications, depending on the consumer
circuit constraints.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-16 11:26:47 +01:00
Gerard Marull-Paretas
7568749c8c drivers: regulator: initial driver for nPM6001
Add initial driver for the nPM6001 PMIC.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-16 11:26:47 +01:00
Fabio Baltieri
b8f8c3c10e MAINTAINERS: add an entry for google_* boards
There's now two google_* boards in the repository and it looks like we
are going to keep a common prefix for these.

Add an explicit maintainer entry for these with Keith and I as
maintainers so that PRs against these will get reviewers and assignees.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-12-16 09:32:02 +01:00
Daniel DeGrasse
ad10d1c832 boards: arm: update documentation for imxrt to reflect use of systick
Update documentation for imxrt boards to reflect the default clock
source being systick, and clarify that the GPT timer will only be
used in low power modes. Add a build time warning when the GPT
timer is enabled, so that the user will be aware of the resolution
tradeoff when using the GPT timer.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-16 09:31:48 +01:00
Daniel DeGrasse
4be1fb81ce soc: arm: nxp: switch imxrt boards to use systick timer unless CONFIG_PM=y
Switch all imxrt boards to use the systick timer by default, and only
enable the GPT timer when using low power modes. This is desirable
because the systick has a higher resolution, but the GPT can run
while the core clock is gated, making it useful for low power modes.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-16 09:31:48 +01:00
Armin Brauns
c1cc2c4a26 modules: lvgl: change mentions of "LittleVGL" to "LVGL"
The project was renamed to LVGL with release 7.0.0, from 2020-05-18.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-12-16 09:31:41 +01:00
Jaroslaw Stelter
caf309c6f6 intel_adsp: remove ace_v1x-regs.h file
ACE code is no longer using this header, so it could be dropped.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-12-16 05:53:23 +01:00
Carlo Caione
a337bfc3b3 pm: runtime: Move from mutexes to semaphores
To be able to call pm_device_runtime_put() from an IRQ context, move
from mutexes to semaphores and force the async path when the put
operation is called from an ISR.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-12-15 22:35:38 +01:00
Carlo Caione
d38a6b4bcd pm: runtime: Migrate from condition variables to events
For the async operation move from condition variables to events to
reduce the dependency on the mutexes that cannot be used in IRQ
context.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-12-15 22:35:38 +01:00
Stephanos Ioannidis
6bf275a8ca hardening: Require CONFIG_TIMER_RANDOM_GENERATOR=n
This commit adds the requirement for the `TIMER_RANDOM_GENERATOR`
Kconfig to be set to `n` because it enables timer-based pseudo-random
number generator, which is only intended to be used for testing
purposes.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-12-15 22:35:31 +01:00