Commit Graph

105295 Commits

Author SHA1 Message Date
Pieter De Gendt 2ee5a24417 scripts: ci: check_compliance: Simplify line number in loop
Use the builtin enumerate function rather than a manual variable.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-16 14:06:12 -05:00
Emil Gydesen 8703381764 Bluetooth: Host: Add conversion macros from ms to various units
Add conversion macros from milliseconds to various units.
The purpose of these macros is to make it more clear/easier
for users to set and read values using milliseconds rather
than the various BT units which may be in 0.625, 1.25 or 10ms
units.

This is especially useful when comparing related values using
different units, such as advertising interval (0.625ms units)
and periodic advertising interval units (1.25ms units).

Users will have to be aware that these macros can provide slightly
different values than what is provided, if the provided values
do not match the units.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-11-16 14:06:03 -05:00
Alberto Escolar Piedras 0d249ecd23 tests/bsim: Also runtime test the UART drivers for the nrf5340
To increase coverage.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 7065b4628b doc boards nrfbsim: Mention the UARTE as supported for nrf5340
Include in the list of supported peripherals the UARTE for the
simulated nrf5340

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 5321941a5d tests uart_pm: Enable for nrf5340bsim
Enable this test in the simulated nrf5340 and provide
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 51053cce11 tests uart_mix_fifo_poll: Enable for nrf5340bsim
Enable this test in the simulated nrf5340 and provide
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras dd13fa0c47 tests uart_async_api: Enable in nrf5340bsim//cpuapp
Enable this test in the simulated nrf5340 by providing
an appropriate overlay.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras a7abf80064 boards nrfbsim: Enable UART(E) peripherals for nrf5340bsim
The HW models now support this peripheral for these targets.
Let's enable them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 3418305eb8 doc boards nrfbsim: Mention the GPIO & GPIOTE as supported
Include in the list of supported peripherals the GPIO
and GPIOT for both the nrf5340 and nrf54l15

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras da01758908 tests gpio_get_direction: Enable for nrf5340bsim
Enable this test by providing an overlay for the nrf5340bsim
Both for the app and net core.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 14c096ff38 tests gpio_basic_api: Enable for nrf5340bsim
Enable this test, and provide overlays, in the nrf5340bsim

Note this test specs 2 GPIO pins to be shorted. This can be done
for the simulation target by calling zephyr.exe with the option
`-gpio_conf_file=shorts_config.txt`
Where  that file would contain this one line (for the provided overlay),
for the cpunet:
---- shorts_config.txt
short 1.1 1.2
----
And this for the cpuapp:
---- shorts_config.txt
short 3.1 3.2
----

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 8bd0a2525c tests gpio_hogs: Enable for nrf5340bsim
Enable this test, and provide overlays, for the nrf5340bsim.
Both for the app and net core.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras d0746f1177 boards nrfbsim: Enable GPIO & GPIOTE peripherals for nrf5340bsim
The HW models now support these pheripherals, let's enable them

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 990fc4c130 tests gpio_get_direction: Enable for nrf54l15bsim
Enable this test by providing an overlay for the nrf54l15bsim

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras fb5ee609a0 tests gpio_hogs: Enable for nrf54l15bsim
Enable this test, and provide overlays, in the nrf54l15bsim

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 1b1d3ca5d5 tests gpio_basic_api: Enable for nrf54l15bsim
Enable this test, and provide overlays, in the nrf54l15bsim

Note this test specs 2 GPIO pins to be shorted. This can be done
for the simulation target by calling zephyr.exe with the option
`-gpio_conf_file=shorts_config.txt`
Where  that file would contain this one line (for the provided overlay)
---- shorts_config.txt
short 1.1 1.2
----

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 4b890bc7b5 boards nrfbsim: Enable GPIO & GPIOTE peripherals for nrf54l15bsim
The HW models now support these pheripherals, let's enable them

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Alberto Escolar Piedras 0efbca30a5 manifest: Update nRF hw models to latest
Update the HW models module to:
aeef3db9fa9e4b9d12b3bbec44f9cedc8fcb7d9c

Including the following:
aeef3db GPIO & GPIOTE: Improve notes and documentation
93549c4 UART: Fix command line parameter description
dbab746 nrf_hack: Add a few missing peripherals
4b1a61b 53 UARTE: Correct subscribe sideeffects function name
197e9cf docs: UART can be used now for 5340 in Zephyr
dc18d14 53: GPIO+TE: Add app core instances
b236c08 GPIO+TE: Add to 5340's netcore
7a621f6 GPIO: Clarify function description
1a2e1e4 GPIO+TE: Build for 54L
d121db4 nrf_gpio hal: Add new nrf_gpio_port_pin_{in,out}put_set
9bc41ce GPIOTE: Connect to DPPI
7141042 GPIOTE: Add simple support for PORT.SECURE & NONSECURE
dc930ba GPIOTE: Support having or not sense functionality per instance
a07180d GPIO: Support multiple GPIOTEs
14bdce5 GPIO: Collect status in single struct
b91da53 GPIOTE: Add support for N interrupt lines
9963424 GPIO & GPIOTE: Generalize to N instances
7379c23 GPIO+TE: Fix indentation
8d691c6 Add SPU registers stub
dd68ca9 Add NFCT register stub
cf2cc5b HW_models: NHW_NVMC: fix buffer read validation
f3db727 zephyr: module.yml: add `depends` field
09fc98f CMakeLists: remove trailing whitespace

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 14:05:52 -05:00
Yong Cong Sin ad7f3a9a0c soc: andestech: refactor out soc_early_init_hook() from pma.c
Refactor out the `soc_early_init_hook()` function from `pma.c` to
`soc.c` which is always compiled so that it can be extended to run
other init functions easily in the future. Then, restore the function
in `pma.c` to `pma_init()`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-11-16 14:04:25 -05:00
Yong Cong Sin 01b69e9c22 soc: andestech: run pma_init_per_core() with soc_per_core_init_hook()
The function `pma_init_per_core()`, as its name suggest, should be
run from every core, so call it from `soc_per_core_init_hook()`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 14:04:25 -05:00
Yong Cong Sin de347a4e07 init: support per-core init hook
Allow SoC to implement their custom per-core initialization function by
selecting `CONFIG_SOC_PER_CORE_INIT_HOOK` and implement
`soc_per_core_init_hook()`.

Signed-off-by: Maxim Adelman <imax@meta.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 14:04:25 -05:00
Yong Cong Sin cc0796ab86 soc: andestech: soc_per_core_init_hook() shouldn't return value
The `soc_per_core_init_hook()` function now has `void` type after
da118b9, so it should just return without any value.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-16 14:04:25 -05:00
Piotr Zierhoffer b05136fc06 x86: Add intel,x86_64 compat to all x86-64 platforms
This will help distinguish 64 and 32-bit platforms by tooling, following
the pattern visible in e.g. RISC-V.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-11-16 14:04:12 -05:00
Piotr Zierhoffer 12a27f31a1 intel: Explicitly set x86 compat in intel_ish5 and lakemont
Those dtsi are a base for a range of 32-bit platforms. Setting this
compatible makes it easier to distinguish all 32-bit x86 platforms.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>

y
2024-11-16 14:04:12 -05:00
Piotr Zierhoffer 8f14d08bf5 x86: Divide Intel Atom CPU compatible to x86 and x86_64
atom.dtsi enforces "intel,x86", but it doesn't help us discern if the
platform is 32 or 64-bit. We do that for example in RISC-V and it's
useful from the tooling perspective.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-11-16 14:04:12 -05:00
Damian Nikodem f556a76081 driver: ssp: Refactor SSP driver to use SSP_IP_VER for version checks
This commit updates the SSP driver to use the newly defined
SSP_IP_VER macros for IP version checks instead of relying
on CONFIG_SOC_* macros. The change ensures better readability
and maintainability by centralizing the IP version definitions
and comparisons.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-11-16 14:04:01 -05:00
Tomasz Leman 5cf2cb6a37 soc: intel_adsp: ace: Use DT macros instead of hardcoded values
Replace hardcoded register addresses and values in
asm_memory_management.h with Devicetree (DT) macros for LPSRAM
power-down operations. This change ensures that register addresses and
bank counts are dynamically obtained from the Devicetree, improving code
portability and reducing the risk of errors due to manual updates.

- Removed hardcoded LSPGCTL address definitions.
- Updated m_ace_lpsram_power_down_entire macro to use DT_NODELABEL to
  fetch LPSRAM bank count and control register address
- Adjusted bit field extraction logic to align with the updated register
  information from the Devicetree.

This commit aligns with the ongoing effort to utilize Devicetree for
hardware abstraction and to facilitate easier maintenance and updates to
the codebase.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman 946aeaa7e8 soc: intel_adsp: ace: Remove obsolete HPSRAM power change macro
Remove the m_ace_hpsram_power_change macro from asm_memory_management.h
as it is no longer used after refactoring the power_down function to
utilize the new m_ace_hpsram_power_down_entire macro. This cleanup helps
to reduce code complexity and maintainability.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman 2d997082fc soc: intel_adsp: ace: Update power_down to use new HPSRAM power-down macro
Refactor the power_down function to utilize the newly introduced
m_ace_hpsram_power_down_entire macro for shutting down the entire
HPSRAM. This change simplifies the power-down process by replacing the
previous segment-based power gating mask approach with a single boolean
flag that indicates whether the entire HPSRAM should be disabled.

The function signature of power_down has been updated to accept the new
boolean flag, and the corresponding call sites have been modified to
pass the flag based on the CONFIG_ADSP_POWER_DOWN_HPSRAM Kconfig option.

Additionally, the assembly code has been cleaned up to remove the
now-obsolete hpsram_mask array and related logic.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman f447d10b0a soc: intel_adsp: ace: Add macro to power down entire HPSRAM
Introduce a new assembly macro, m_ace_hpsram_power_down_entire, which
utilizes Zephyr Devicetree macros to power down the entire HPSRAM on
Intel ADSP ACE platforms.

This macro dynamically retrieves the HPSRAM bank count and control
register address from the Devicetree, streamlining the power-down
process. The macro is designed to iterate over all HPSRAM banks and
issue a power down command to each, ensuring a complete shutdown of the
HPSRAM when required by the system's power management policy.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman e0977dccd8 dts: xtensa: intel: Add hsbcap register node for ADSP ACE platforms
This commit introduces the L2 Memory Capabilities (hsbcap) register node
to the Devicetree specifications for Intel ADSP ACE platforms. The
hsbcap register provides information on the general capabilities
associated with the L2 memory, which is critical for system
configuration and resource management. The hsbcap node has been added to
the Devicetree source files for ACE 1.5 (MTPM), ACE 2.0 (LNL), and ACE
3.0 (PTL) platforms.

In addition, the DFL2MM_REG macro in adsp_memory.h has been updated to
use the Devicetree node label for hsbcap, ensuring a consistent and
maintainable approach to accessing this register across the codebase.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman f810b5d292 soc: intel_adsp: ace: Clean up macro indentation in power_down.S
This commit improves the readability of the power_down.S assembly file
by standardizing the indentation of the preprocessor definitions.

No functional changes have been made; this is purely a cosmetic update
to the code formatting.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman 095bc56a57 soc: intel_adsp: ace: Ensure TLB entry for HW registers during power-down
This commit addresses an issue on platforms with an MMU where a
LoadStoreTLBMissCause exception occurs when accessing hardware registers
during the power-down process. The exception arises when attempting to
access the IPC register after HPSRAM has been powered down, leading to a
double exception: LoadStoreTLBMissCause followed by
InstrPIFDataErrorCause.

To resolve this, we preload the IPC register before shutting down
LPSRAM. This change prevents the double exception by ensuring that the
page table entries are correctly managed in the TLB before HPSRAM is
powered down and allowing the power-down sequence to complete
successfully.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
romain pelletant bea68273d5 lorawan: replace booleans by atomic flags
ADR status and devtime updated flags merged into an atomic bits array.
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
romain pelletant ae0c1b72cf lorawan: add devicetime request support
Add devicetime request support.
Update lorawan sample
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
romain pelletant 866905fd6a lorawan: change downlink callback
Change downlink callback to transport data using flags.
Related to Issue #55072

Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>

Signed-off-by: romain pelletant <romainp@kickmaker.net>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2024-11-16 14:03:36 -05:00
Maksim Drachov 91d3eb9107 soc: atmel: fix wait state value
The datasheet specifies that 2 wait states are required at 48 MHz.

Signed-off-by: Maksim Drachov <maksim.drachov@outlook.com>
2024-11-16 14:03:27 -05:00
Philip-Dylan Gleonec 8084111e54 boards: shields: add adafruit adalogger featherwing
Add definition for the Adafruit Adalogger Featherwing. This shield
compatible with the Adafruit Feather family is equipped with an SD card
slot and a PCF8524 RTC.

This work is based on the Adafruit Data Logger shield definition.

Signed-off-by: Philip-Dylan Gleonec <philip-dylan@gleonec.bzh>
2024-11-16 14:03:16 -05:00
Sreeram Tatapudi 0a9c0f4017 soc: infineon: Support for power management on 20829
- Initial changes in board, dts, and soc files to support
 system power management

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-11-16 14:03:04 -05:00
Andriy Gelman 041f9821ca drivers: xmc4xxx_uart: Delay transmit interrupt until byte is sent out
Generate the Tx service request after the symbol is shifted out of the
UART. This is useful when the UART is connected to an RS485 transducer
which has a separate transmit enable gpio/line. Hence it's important
to know when the transmission actually finishes so that the drive
enable line can be disabled.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-11-16 14:02:43 -05:00
Peter Ujfalusi a8ac02f9ad drivers: dma: intel-adsp-gpdma: Account for LLPL wrapping
In case the LLP wraps we need to re-read the LLPU to make sure we return
the correct value.

Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-11-16 14:02:35 -05:00
Jan Faeh 22945254ef drivers: sensor: STS4x Add driver
This adds support for Sensirion's STS4x temperature sensor.

Signed-off-by: Jan Faeh <jan.faeh@sensirion.com>
2024-11-16 14:02:15 -05:00
Meir Komet 5595f66851 multi_heap: introduce support for realloc()
Add support for realloc (and realloc_aligned) into the multi heap lib,
where the buffer sent in will either be reused (maybe shrinked),
or enlarged by allocating on any of the matching heaps of the multi heap.

Signed-off-by: Meir Komet <mskomet1@gmail.com>
2024-11-16 14:02:07 -05:00
Zhang Xingtao 0cf866037d boards: xtensa: add M5Stack CoreS3 support
Initial support for M5Statck CoreS3 development board.

Signed-off-by: Zhang Xingtao <zhxt@live.cn>
Co-authored-by: Benjamin Cabé <kartben@gmail.com>
Co-authored-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-11-16 14:01:42 -05:00
Mathieu Choplain f27323a45d arch: arm: cortex_m: pm_s2ram: add support for all architectures
Extend the ARM M-profile suspend-to-RAM implementation to be compatible
with all versions of the M-profile supported by Zephyr: ARMv6-M, ARMv7-M,
and ARMv8-M Baseline.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Mathieu Choplain 18f41aa63c arch: arm: cortex_m: pm_s2ram: wrap context save/restore in macros
Wrap the CPU register save/restore operations (GPR and special registers)
in macros to make core logic simpler to follow. This is also a preparatory
step to introduce ARMv6-M and ARMv7-M support.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Mathieu Choplain 041714cb37 arch: arm: cortex_m: pm_s2ram: use macros to access struct __cpu_context
Use macros to wrap the interaction between the assembly code and the
struct __cpu_context. This helps making the assembly more readable.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Mathieu Choplain 7dd7dffe33 arch: arm: cortex_m: pm_s2ram: ignore xPSR
Remove all xPSR-related registers from struct __cpu_context, and the
associated save/restore code in S2RAM code, as they are not needed:

* EPSR and IPSR are read-only - they cannot be "restored"
* Bits N, V, Z, C, V, Q, and GE (if DSP Extension is implemented) of APSR
  could be restored, but this is not needed as the AAPCS indicates these
  bits to be "undefined on entry to or return from a public interface"

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-11-16 14:00:44 -05:00
Adrien Leravat 1d6a89d26e tests: drivers: sensor: add hc-sr04 tests
Add automated build and functional tests for the HC-SR04.

Signed-off-by: Adrien Leravat <adrien.leravat@gmail.com>
2024-11-16 14:00:34 -05:00
Adrien Leravat 9df661ea1a drivers: sensor: hc-sr04: add driver
Add a simple driver for the HC-SR04 ultrasonic distance sensor.

Signed-off-by: Adrien Leravat <adrien.leravat@gmail.com>
2024-11-16 14:00:34 -05:00