Commit graph

66460 commits

Author SHA1 Message Date
Carlo Caione 0e788b89a6 riscv: Use IRQ vector table for vectored mode
For vectored interrupts use the generated IRQ vector table instead of
relying on a custom-generated table.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-07 10:00:20 +02:00
Carlo Caione 86a67faeaa arch: Add support for IRQ vector tables with jump opcodes
The whole mechanism of IRQ table generation is build around the
assumption that the IRQ vector table contains an array of addresses the
PC will be assigned to when the corresponding interrupt is triggered.

While this is correct for the majority of architectures (ARM, RISCV with
CLIC in vectored mode, etc...) this is not valid in general (for example
RISCV with CLINT/HLINT in vectored mode).

In this alternative format for the IRQ vector table, the pc will get
assigned by the hardware to the address of the vector table index
corresponding to the interrupt ID. From the vector table index, a
subsequent jump will occur from there to service the interrupt.

This means that the IRQ vector table contains an opcode that is a jump
instruction to a specific location instead of the address of the
location itself.

This patch is introducing support for this alternative IRQ vector table
format. The user can now select one format or the other one by acting on
IRQ_VECTOR_TABLE_JUMP_BY_ADDRESS or IRQ_VECTOR_TABLE_JUMP_BY_CODE
Kconfig symbols.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-07 10:00:20 +02:00
Pieter De Gendt e381170282 uart_pipe: Remove obsolete UART_PIPE_ON_DEV_NAME Kconfig
The UART pipe device is selected with devicetree chosen zephyr,uart-pipe

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-07 09:59:49 +02:00
Pieter De Gendt aba4c4ea3e uart_pipe: move driver from console to serial
The uart_pipe driver is not dependent on any console driver,
however a serial driver is required.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-07 09:59:49 +02:00
Emil Gydesen 4b05d75f72 Bluetooth: Audio: Update broadcast_sink_test to use ISO
Update the broadcast_sink_test to use ISO to sync to the
broadcast source BIG, testing both the syncing functionality
as well as the sync stop and delete functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Emil Gydesen deae9d7239 Bluetooth: Audio: Update broadcast_source_test to use ISO
Update the broadcast_source_test to actually create the
BIG and send data over ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Emil Gydesen 5a79445feb Bluetooth: ISO: Add connecting->disconnecting state transition
Add the state transition from connecting to disconnecting
as a valid transition for ISO. This can occur if a ISO channel
is disconnected before it is fully connected, of if a BIG
or a BIG sync is terminated before established.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Emil Gydesen 05ace181d7 Bluetooth: Audio: Add enabling state to broadcast source
There is a brief period between the bt_iso_big_create
and when the ISO channels are established. In this state
it should be possible to call bt_audio_broadcast_source_stop
to stop the BIG from being created.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Emil Gydesen 590ab0567c Bluetooth: Audio: Fix state check in bass
Fix bad state check in biginfo_recv in bass.c which
would cause null-pointer access.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Kumar Gala 5454008edc tests: drivers: sensor: accel: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 09:59:12 +02:00
Kumar Gala 8d4bd6be3a tests: watchdog: wdt_basic_api: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 02:45:13 -04:00
Flavio Ceolin 158a87018c intel: adsp: Simplify PM
Both idle and suspend states were just being used to set the cpu
idle. That is not necessary, if the pm policy does not find a suitable
power state the kernel automatically calls k_cpu_idle().

This remove unnecessary code and the weirdness of having
min-residency-us set to 0 and other arbitrary values.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-07-07 02:10:11 -04:00
Zhao Shuai db186df082 tests: subsys: cpp: move libcxx to new ztest API
Move test libcxx to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-07-07 02:09:52 -04:00
Zhao Shuai feb18cc66e tests: subsys: cpp: move cxx to new ztest API
Move test cxx to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-07-07 02:09:52 -04:00
Guo Lixin 9588ecdba8 tests: no-multithreading: move to new ztest API
Move tests/kernel/fatal/no-multithreading/ to use new ztest API.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-07-06 21:09:55 -04:00
Guo Lixin 6a254c7fb6 tests: kernel: exception: move to new ztest API
Move tests/kernel/fatal/exception/ to use new ztest API.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-07-06 21:09:55 -04:00
Enjia Mai faff3f7ecc soc: xtensa: partial fix of socket misuse and refine the code
1. Improve the firmware transfer reliability by fixing the misuse
of the socket. Fix the most frequent occurence of the common `recv()`
bug described here:

https://docs.python.org/3/howto/sockets.html#using-a-socket

The longer term fix is to switch to a higher level API like Python
Remote Objects.

2. Not rely on the client's command to disconnect. Previously we
rely on the SIGINT to send stop_command to the server, but it does
not work well in some environments. Refine the whole logic and the
sever disconnect service by checking if the client is alive or not.

These changes make the client-server-based cavstool more stable.

Fixes #46864

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-06 20:38:41 -04:00
Spoorthy Priya Yerabolu fe9526313b tests: lib: cmsis_nn: move to new ztest API
Move lib tests to use new ztest API

Part of #47002 effort

Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
2022-07-06 20:02:19 -04:00
Aaron Massey 83253023cf ztest: Track skipping test versus entire suite
The addition of the assumption API introduced a bug where a skipped test
would subsequently skip later tests within the same suite. A skipped test
was being treated as an entire skipped test suite.

Keep track of tests being skipped due to skipping in the suite setup versus
being skipped within their test function.

TEST=west build -p -b native_posix tests/kernel/condvar/condvar_api/ -t run
TEST=twister -T tests/ztest -p native_posix

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-07-06 18:50:35 -04:00
Shaoan Li 54d44ee0d6 tests: arch: arm: move test arm_hardfault_validation to new ztest API
Migrate the testsuite tests/arch/arm/arm_hardfault_validation to the
new ztest API.

Signed-off-by: Shaoan Li <shaoanx.li@intel.com>
2022-07-06 16:53:01 -05:00
Andrey Borisovich e0b1d81acb soc: intel_adsp: added casting for C++ compiler in soc.h
Header soc.h is included during C++ source file compilation
and required adding C++ casts as implicit casting from void*
is forbidden. Fixed minor warning comparing signed with unsigned
integer.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Andrey Borisovich aa253d9ab1 soc: intel_adsp: reading HP SRAM banks count for ACE1X from Devicetree
Replaced hardcoded for intel_adsp_ace15_mtpm board
HP_MEMORY_BANKS value used in SOF code with generic approach -
using PLATFORM_HPSRAM_EBB_COUNT read from Devicetree.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Andrey Borisovich 283953b090 manifest: hal_xtensa: updates to new ace family definitions
Updated hal_xtensa module with new xtensa definitions
for intel_adsp_ace1x soc family.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Flavio Ceolin 92725e3102 soc: adsp: sram: Assorted cosmetic fixes
General code style fixes.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-07-06 15:11:07 -04:00
Flavio Ceolin 7291c518a0 soc: ace: Organizing include headers
Properly prefixing some include files with "zephyr", also organizing
the order they are included.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-07-06 15:11:07 -04:00
Flavio Ceolin 65fbfcd480 soc: ace: Move power management to its own file
Move power management hooks to its own C file.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-07-06 15:11:07 -04:00
Flavio Ceolin e4a3e2d8b6 intel_adsp: Unify cavs and ace timers
These two timers were sharing pretty much the same code. Actually
mtl timer was a "superset" of cavs timer. Just merge them into a
single one called intel audio dsp timer (intel_adsp_timer).

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-07-06 15:11:07 -04:00
Andrey Borisovich e0e2dbf6f0 soc: ace1x: provided register names to addresses
Provided register names to hardcoded addresses in ace_v1x-regs
header.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif 8792dd800d soc: ace1.x: use common code
Do not duplicate code in new SoC and reuse code from intel_adsp/common.
Move SRAM code into own file in common code and setup SRAM in soc for
MTL platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 15:11:07 -04:00
Tomasz Leman 0b15a8d3ef soc: ace_v1x: pm_state_exit_post_ops implementation
Implementation of the function used during the exit from the lower power
states.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-07-06 15:11:07 -04:00
Tomasz Leman 8940b9cae5 soc: ace_v1x: pm_state_set implementation
This patch implements pm_state_set function for ACE platforms.

This is initial implementation and only includes the basic handling of
PM_STATE_SOFT_OFF.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-07-06 15:11:07 -04:00
Tomasz Leman cc9f82de44 soc: ace_v1x: soc_adsp_halt_cpu implementation
This patch add soc_adsp_halt_cpu implementation for ace. Function disable
power and check CPA status to report success. Function should be used only
for secondary cores and can be executed only from primary core.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-07-06 15:11:07 -04:00
Arsen Eloglian 293c55a3ee dts: align CONFIG's with ace hardware
Align CONFIG_HEAP_MEM_POOL_SIZE & CONFIG_DAI with ace hardware.

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-07-06 15:11:07 -04:00
Rafal Redzimski b49d794966 ace: multiprocessing: add polling for core powered up confirmation
Poll for CPA bit by which HW confirms that the core has been powered up.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Co-authored-by: Tomasz Leman <tomasz.m.leman@intel.com>
Co-authored-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Rafal Redzimski 090b01e73c ace: multiprocessing: enable secondary core boot through ROM
Add ace/mtl rom flags definitions.
Set the flags in battr to indicate to rom that it should execute
secondary core procedure.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Co-authored-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif e3c9eb2495 intel_adsp: add the board definition for the Meteorlake
Board definition for the meteorlake platform.
Enable intel_adsp_ace15_mtpm in the sof sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Co-authored-by: Michal Wasko <michal.wasko@intel.com>
Co-authored-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif b330a05539 intel_adsp: add a new series to support Meteorlake
Meteorlake support as part of the Intel ADSP family.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Co-authored-by: Michal Wasko <michal.wasko@intel.com>
Co-authored-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Co-authored-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Co-authored-by: Enjia Mai <enjia.mai@intel.com>
Co-authored-by: Flavio Ceolin <flavio.ceolin@intel.com>
Co-authored-by: Tomasz Leman <tomasz.m.leman@intel.com>
Co-authored-by: Bonislawski Adrian <adrian.bonislawski@intel.com>
Co-authored-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Co-authored-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif 252f4052a6 drivers: dma: Add gpdma derivative of dw dma for ace
This will add ace compatible DMA driver.

Co-authored-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif 17a0f81bfc intel_adsp: meteorlike: add timer driver
Add timer driver based on CAVS driver and adapted for Meteor Lake.

Co-authored-by: Michal Wasko <michal.wasko@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif b951a0ebed drivers: Add ACE V1X interrupt controller
Add Designware Interrupt Controller for ACE v1x platform

Co-authored-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif 3ccafb1af3 intel_adsp: meteorlake: add memory driver
Add TLB driver specific for Meteorlake.

Add missing kconfig resource and fix include path
add hpsram power up and ref counter

Use memblock to track physical page usage in mtl tlb driver. The
applications that will be using the tlb memory driver should not
track the physical page mapping to virtual address space:
 - adds an option to use the phys argument value of 0 to tell the
   driver to autonomously assign physical pages upon map request
 - makes the tlb driver use memblock to track mapped physical pages

Co-authored-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Co-authored-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Co-authored-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Co-authored-by: Michal Wasko <michal.wasko@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 15:11:07 -04:00
Benjamin Björnsson 092251017f drivers: sensor: stts751: Add multi-instance support
Move driver to use DT_INST_FOREACH_STATUS_OKAY to add
multi-instance support.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-06 18:00:21 +00:00
Benjamin Björnsson 0ce4d8b2da drivers: sensor: stm32_vbat: Add multi-instance support
Move driver to use DT_INST_FOREACH_STATUS_OKAY to add
multi-instance support.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-06 18:00:02 +00:00
Damian Krolik fc9f59ce0f shell: fix synchronization in log immediate mode
When LOG_MODE_IMMEDIATE is used, logs processed by the shell
log backend may be intertwined with messages printed by
shell commands running on the shell thread.

It is because the shell uses a mutex while the shell log
backend uses the IRQ lock for synchronization. Switch the
latter to use the mutex as well whenever it's possible.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2022-07-06 17:59:32 +00:00
Kumar Gala 1cce353536 drivers: eswifi: Remove unused 'csn' field from struct
The 'csn' field is not being used so remove it.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:42:45 -05:00
Kumar Gala 19636b5087 sapmles: watchdog: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:42:29 -05:00
Kumar Gala 046cb83996 samples: esp32: flash_encryption: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:42:11 -05:00
Kumar Gala 057f1555c3 samples: lorawan: class_a: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:41:54 -05:00
Kumar Gala ceeaef5100 samples: gsm_modem: Remove use of DT_BUS_LABEL
The use of DT_BUS_LABEL in a logging call can easily be replaced
with uart_dev->name.  This moves us slowly forward to removing
use of devicetree `label` property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:41:35 -05:00
Kumar Gala c96f8f9c29 samples: lsm6dso: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Also, Removed 'lsm6dso' from board & sample yaml's and move to just
filtering based on devicetree compat.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:26:42 -05:00