Commit graph

86620 commits

Author SHA1 Message Date
Huifeng Zhang abde709b5e arch: arm: cortex_a_r: introduce USE_SWITCH
This commit introduce 'USE_SWITCH' feature into cortex-A/R(aarch32)
architecture

For introducing USE_SWITCH, the exception entry and exit are unified via
`z_arm_cortex_ar_enter_exc` and `z_arm_cortex_ar_exit_exc`. All
exceptions including ISR are using this way to enter and exit exception
handler.

Differentiate exception depth and interrupt depth. Allow doing
context switch when exception depth greater than 1 but not allow doing
this when interrupt depth greater than 1.

Currently, USE_SWITCH doesn't support FPU_SHARING and USERSPACE.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-11-06 15:32:01 -06:00
Huifeng Zhang 87dd43766d arch: arm: cortex_a_r: Hold curr_cpu instance to TPIDRURO
Store the current CPU's struct _cpu instance into TPIDRURO, so that the
CPU core can get its struct _cpu instance by reading TPIDRURO. This is
useful in the SMP system.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-11-06 15:32:01 -06:00
Huifeng Zhang c3b857c434 arch: arm: cortex_ar: Use TPIDRURW as a base pointer for TLS
Replace the TLS base address pointer from TPIDRURO to TPIDRURW.

The difference between them is that TPIDRURO is read-only in user mode
but TPIDRURW isn't. So TPIDRURO is much more suitable for store
the address of _kernel.CPU[n]. For this reason, this commit replaces
the base pointer of the TLS area.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-11-06 15:32:01 -06:00
Huifeng Zhang 813ed3a8a3 arch: arm: cortex_a_r: Move mmu and mpu init to prep_c
MMU or MPU unit need to be initialized by its own CPU.

- Primary core initialize MMU or MPU unit in z_arm_prep_c.
- Secondary core initialize MMU or MPU unit in z_arm_secondary_start.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-11-06 15:32:01 -06:00
Samuel Tardieu ea4e1b328c drivers: sensor: lsm6dsl: Add the 1.6Hz accelerometer rate
Since the accelerometer's HM (high-performance mode) bit is forced to 1,
the 1.6Hz frequency is available by setting the ODR to 11.

1.6Hz is a low-power mode that conserves energy and is suitable for
some applications, such as determining the orientation (portrait or
landscape) of a device.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
2023-11-06 15:23:54 -06:00
Anas Nashif debe7fefe6 ci: assignees: do not set trivial on manifest changes
manifest changes are often a oneliner change, but they are not
necessarily trivial.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-06 12:11:58 -05:00
Alberto Escolar Piedras 3dce4c7ba3 samples/net/cloud/aws_iot_mqtt: Fix sample yaml
The sample yaml filter syntax was incorrect.
Fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 16:06:36 +01:00
Bjarki Arge Andreasen 5639bc0330 modem: modem_cellular: Fix build errors
Build errors where introduced by
c76d5b882c and are fixed with this
commit. They are trivial fixes of malformed lines.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-11-06 16:06:36 +01:00
Alberto Escolar Piedras b3447ec068 tests bsim: Add simple tests for broadcast audio source/sink samples
Add an initial test based on the broadcast audio source/sink samples
which runs them together and after waiting for a predefined
amount of time, checks how many audio packets has the
sink received, and if over a threshold, passes the test.

This test can be expanded after to cover more functionality from
these samples.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 15:17:15 +01:00
Alberto Escolar Piedras 11fddf4a41 Bluetooth samples: broadcast audio: Improve documentation
With examples of how to build for several boards.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 15:17:15 +01:00
Alberto Escolar Piedras c929ac5c23 Bluetooth samples: broadcast audio: Add support for more nrf targets
Add support for the simulated nrf5340 and nrf52 in these samples,
as well as explicit overlays for the nrf5340dk.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 15:17:15 +01:00
Alberto Escolar Piedras 1aa6f85252 Bluetooth samples: broadcast audio sink: Fix overlay for nrf52
Fix controller configuration overlay used when
building the controller (for nrf52 targets),
so the sample can connect to the source and get
audio through.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 15:17:15 +01:00
Alberto Escolar Piedras c9f09b1d66 Bluetooth samples: broadcast audio: Add more test Kconfig options
Instead of handling some of the configuation thru
board overlays let's handle it thru the sample Kconfig
file, which reduces the amount of duplicate lines.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 15:17:15 +01:00
Alberto Escolar Piedras 631a6a765a Bluetooth samples: broadcast audio source: Add sysbuild support
So that for both the simulated nrf5340 and real HW nrf5340dk
we build both network and application core images.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 15:17:15 +01:00
Alberto Escolar Piedras c4628a795f Bluetooth samples: broadcast audio sink: Add sysbuild support
So that for both the simulated nrf5340 and real HW nrf5340dk
we build both network and application core images.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 15:17:15 +01:00
Armando Visconti 01dc3c48e6 drivers/sensor: lis2dh: add INT1/INT2 gpio interrupt config in DT
Add INT1/INT2 gpio interrupt configuration at Device Tree level.

Two new properties:

  - int1-gpio-config
  - int2-gpio-config

Possible values:

  0 = GPIO_INT_EDGE
  1 = GPIO_INT_EDGE_RISING
  2 = GPIO_INT_EDGE_FALLING
  3 = GPIO_INT_LEVEL_HIGH
  4 = GPIO_INT_LEVEL_LOW

Fixes #63736

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-11-06 14:00:54 +00:00
Johan Hedberg f67ecc31aa arch: x86: Use ACPICA typdef instead of struct name
Use ACPI_MADT_LOCAL_APIC instead of struct acpi_madt_local_apic. In the
same go, switch to IF_ENABLED from ifdef - slightly more readable, and
this keeps some static analyzers happy (e.g. upstream Compliance check).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 6e8a1f5859 acpi: shell: Fix specifying string precision
The ACPI table signature is not null terminated, so a precision needs to
be provided in format strings. There was an attempt to do this, but it
was done in an incorrect way, which resulted in garbage characters
getting printed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 584a1cf0fc acpi: Use ACPICA typedef names when available
For most types, ACPICA provides both a struct name as well as a typedef.
The struct names follow the exact same naming style as Zephyr's ACPI
API, which makes it impossible to distinguish which type is defined by
Zephyr and which comes from ACPICA. It's therefore better to use the
typedefs, since they follow a distinct style compared to the Zephyr API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 31cafc3049 acpi: Remove redundant newline characters from logs
The log functions themselves automatically add newline characters, so no
need to do it when calling the log macros.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg fe382d4d30 acpi: shell: Remove unnecessary newlines
The ACPI shell command create way too much vertical empty space. Remove
the unnecesary newlines and use indentation to indicate grouping of
lines. At the same time, place case statments with variable declarations
behind {} since otherwise both the Zephyr compliance checker and some
other static analyzers get confused by the code in the branch.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 537cb1ffbe acpi: Remove unnecessary prs_buffer variable
This was never used for anything, since the ACPI API overwrites the
pointer when fetching a resource list.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 2ca5a3213f acpi: Don't mix ACPI_STATUS and "int" return types
ACPI_STATUS variables should not store values of any other error domain
(like negative POSIX error codes used for Zephyr's ACPI API).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 4f2d03195b acpi: Move local pci_prt_table processing to the right place
The acpi_get_irq_table() function takes a pointer to a table that can
come from anywhere, i.e. it doesn't have to be the acpi.pci_prt.table
that acpi.c uses. Because of this, the correct place to iterate and
process the acpi.pci_prt_table is in the function that actually passes
acpi.pci_prt_table to the acpi_get_irq_table() function.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 149b00f70c acpi: Fix acpi_get_irq_routing_table() rt_size parameter meaning
The acpi_get_irq_routing_table() takes a pointer to an array of
ACPI_PCI_ROUTING_TABLE elements rather than a generic buffer pointer
(e.g. void *).

Because of the above, it makes sense to specify the array size as an
actual ARRAY_SIZE() value, since it makes no sense to accept buffers
which are not a multiple of sizeof(ACPI_PCI_ROUTING_TABLE) long.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 88120ae351 acpi: Fix status variable type
Use the appropriate ACPI_STATUS type for any status variable that stores
return values from ACPICA APIS.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 03cb76e59d acpi: Rename bus_ctx to simply acpi
ACPI is not treated as a bus in Zephyr. Rename the global context from
bus_ctx to simply acpi.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 5d8bbca05b acpi: Don't include PCI PRT code if not enabled in Kconfig
If the CONFIG_PCIE_PRT option is disabled it makes no sense to bloat the
ACPI build with PRT-related code or static tables. The diff looks a bit
larger since functions in acpi.c had to be shuffled around to be able to
be included in a single "#ifdef CONFIG_PCIE_PRT" block.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg 3aa8b9ab83 acpi: Remove unused Kconfig variable
ACPI currently uses implicit (auto) initialization, i.e. it doesn't need
any init level or priority.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Johan Hedberg e562784bac acpi: Remove unnecessary static array
The acpi_tables array is only needed for systems where dynamic memory
allocation is not available during the early ACPI init phase. In the
Zephyr case we can immediately start using k_malloc, so this is
unnecessary.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Magdalena Kasenberg 1747c33796 bluetooth: audio: delegator: Notify state after updating BIG_Encryption
If the server has synchronized to the PA and detected that the BIS is
encrypted, the server writes a value of 0x01 (Broadcast_Code
required) to the BIG_Encryption field of the Broadcast Receive State
characteristic to request a client to provide a Broadcast_Code.
In PTS BASS/SR/CP/BV-14-C test case the PTS (client) expects that the
new value of the Broadcast Receive State characteristicstate will be
notified, so the PTS could sent Set Broadcast_Code operation to the
server.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-06 12:32:23 +01:00
Francois Ramu 0dcaa4c668 boards: arm: stm32f746 with all mpu regions when testing in userspace
Disable the  quadspi mpu region of the nucleo_f746zg
when testing the samples/userspace/shared_mem
or tests/kernel/mem_protect/userspace
The stm32f7 cortex M7 has 8 MPU regions and the one for quadspi prevents
the testcase to PASS.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-11-06 12:32:08 +01:00
Anisetti Avinash Krishna f027b55d02 dts: x86: intel: alder_lake: Added TGPIO instance
Enable TGPIO instance on Alder lake platform.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-11-06 11:34:08 +01:00
Charlie Xiong 8fe6e0130e boards: arm64: provide support for ROC-RK3568-PC
This is support for AArch64 development board.
The board uses 4-core Cortex-A55, which are based on
the ARMv8.2 architecture.
In addition,we support smp support and
it can use 4-cores to run basic samples.

Signed-off-by: Charlie Xiong <1981639884@qq.com>
2023-11-06 10:14:20 +01:00
Charlie Xiong 314b72f332 arch: arm64: Re-init HCR_EL2 in z_arm64_el2_init
HCR_EL2 is configured to certain value by some
loaders such as Uboot on some arm64 boards(such as roc_rk3568_pc),
When HCR_EL2.TGE, HCR_EL2.AMO and HCR_EL2.IMO bits are
set to 1, some unpredictable behaviors may occur during
zephyr boot. So we clear these bits to avoid it.

Signed-off-by: Charlie Xiong <1981639884@qq.com>
2023-11-06 10:14:20 +01:00
Gerson Fernando Budke 3ed1c990dc soc: st: l010xb: Fix the number of IRQs
Change the NUM_IRQS value from 32 to 30 following the rm0451.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-11-06 10:14:10 +01:00
Gerson Fernando Budke 6e3bae727b soc: st: Add all missing stm32l010 SoCs
Add minimal SoC entries to enable the whole stm32l010 family.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-11-06 10:14:10 +01:00
Gerson Fernando Budke 5067e543fa dts: st: Add all missing l010 SoCs
Add minimal devicetree entries to enable the whole stm32l010
SoC family.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-11-06 10:14:10 +01:00
Gerson Fernando Budke 88c9d1fbaf dts: st: Move eeprom from stm32l010 to stm32l010Xb
The variants of this family have different sizes of eeprom. This moves
eeprom definition from common family definition to device specific.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2023-11-06 10:14:10 +01:00
Evgeniy Paltsev 85256a2c19 ARC: boards: enable ticket spinlock on nsim SMP board
Enable ticket spinlock on nsim SMP board as they are
naturally vulnerable to spinlock unfairness due to
SMP nSIM way of work.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-11-06 10:13:54 +01:00
Armando Visconti f39dba5da5 drivers/sensor: lsm6dsv16x: add in DT both INT1 and INT2 pin
Add in DT the possibility to configure both INT1 and INT2
pin. The driver will then assign one of the two (either 1
or 2, according to what value drdy_pin is set) to a gpio
for receiving drdy interrupts.

The other pin may be used in the future to receive event
interrupts.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-11-06 10:13:38 +01:00
Moritz Fischer 016a113eb5 boards: xtensa: Add support for Lolin S2 Mini
Add support for LOLIN S2 Mini board, a cheap board
also sold as Wemos S2 Mini.

Signed-off-by: Moritz Fischer <moritzf@google.com>
2023-11-06 10:12:36 +01:00
Caspar Friedrich 8242ef0a37 soc: arm: st_stm32: stm32l0: Add support for STM32L081
Add support for the STM32L081xx soc series.

Signed-off-by: Caspar Friedrich <c.s.w.friedrich@gmail.com>
2023-11-06 10:11:40 +01:00
Jordan Yates 2283b02ce4 bluetooth: hci: spi: delay between header and data
The HCI receive path has a delay between reading the header and payload
from the controller to give the controller time to setup the SPI
peripheral for the next transaction. Add the same delay on the transmit
path for the same reasons.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-06 10:11:33 +01:00
Jordan Yates 0f903f04ac bluetooth: hci: spi: log TX retransmissions
Add log output when the HCI interface is forced to retransmit a packet
because the controller is not ready.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-06 10:11:33 +01:00
Declan Snyder 4d654250a5 soc: lpc55xxx: Fix system hw clock cycle rate
Commit c6e3bac4f changed the core clock frequency of LPC55XXX series.
That clock is used by the cortex-m systick timer, which is the
default timer used for system time in zephyr on this series.
The bug is that the config SYS_CLOCK_HW_CYCLES_PER_SEC default was not
updated on the affected platforms to account for this change, so system
time is currently recorded as 150% of reality. Fix this by changing the
kconfig to be set automatically at SOC level and remove board defaults.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-06 10:11:25 +01:00
Dmitrii Golovanov 3fde2d3073 kobject: coverage: Fix LCOV_EXCL warnings
Eliminate gcovr '(WARNING) mismatched coverage exclusion flags.'
on missing LCOV_EXCL_START around k_object_init() introduced
with ae265ea96e.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-06 10:11:17 +01:00
Andrzej Głąbek 1081df9554 drivers: nrf_qspi_nor: Activate QSPI peripheral when enabling XIP
The way that the QSPI peripheral is activated has been changed in
nrfx 3.2.0. Now the peripheral is not activated during the driver
initialization. Instead, the driver activates the peripheral when
the first operation is requested or when `nrfx_qspi_activate()` is
called. In case of XIP, the latter needs to be used, as there may
be no standard operation request.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-11-06 10:11:02 +01:00
Grzegorz Swiderski e4448ed498 soc: mimx8mm6_m4: Restore linker script
For this SoC, an additional section is conditionally included on top of
the default linker script for Cortex-M. Set `SOC_LINKER_SCRIPT` to the
local `linker.ld`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-11-06 10:10:55 +01:00
Troels Nilsson 3c9d952820 Bluetooth: Controller: Fix failing LL/DDI/SCN/BV-88-C
Fixes failing EBQ test LL/DDI/SCN/BV-88-C Extended Scanning,
Active, Properly Ignore RFU Fields

Several minor modifications made to le_ext_adv_report() to
properly ignore any invalid fields present in the received PDUs

Signed-off-by: Troels Nilsson <trnn@demant.com>
2023-11-06 10:10:47 +01:00