Commit Graph

324 Commits

Author SHA1 Message Date
Jamie McCrae 8f245d764d tests: Update board names for hwmv2
Updates tests that use board names which have changed with
boards v2

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:17:14 +00:00
Torsten Rasmussen db9e46010c twister: update testcase.yaml and sample.yaml to mps3/an547 identifier
This commit updates testcase.yaml and sample.yaml to use mps3/an547
identifier which replaces former mps3_an547 board name.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-03-01 14:17:06 +00:00
Gerard Marull-Paretas 6810a53297 twister: s/riscv(32|64)/riscv
Only riscv is supported now, any 32/64-bit requirements need to use
CONFIG_64BIT now.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 12:49:06 +01:00
Andrzej Głąbek c50c4130a0 tests: arm_irq_vector_table: Add special handling for nRF54H20
Different set of IRQ lines need to be used for this SoC and the CLOCK
IRQ is not to be installed in the vector table.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-02-02 16:40:11 +01:00
Witold Lukasik cac2990c04 tests: arch: arm: arm: align tests to nRF54L15
Changed _ISR_OFFSET to be 28 as specified in OPS.
Removed console ISR.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
Markus Swarowsky 11175c3ad3 tf-m: Change NS include path for TF-M 2.0.0
The place where TF-M places its non-secure api header files has changed
Therefore changing it for for all applications that use it.

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
2024-01-17 16:52:52 +01:00
Andrei Emeltchenko 8924feb960 tests: Refactor ACPI info sample
Take into account multiple DMAR HARDWARE_UNIT tables.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-19 11:04:19 +01:00
Flavio Ceolin dca352bfa3 tests: arm64_high_addresses: Remove unused build option
This test does not define any syscall. It does not need to set
CONFIG_APPLICATION_DEFINE_SYSCALL.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-12-14 19:07:39 +00:00
Anas Nashif 044e2d6bff arch: make CONFIG_EXCEPTION_DEBUG cross arch config
Define CONFIG_EXCEPTION_DEBUG globally and remove architecture specific
definition of config.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-14 09:32:27 +01:00
Tomasz Bursztyka 64153a7910 tests/x86: Clarify DMAR output
Cleaning the messy output

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-12-05 10:12:29 +00:00
Andrei Emeltchenko 0290ae92b2 tests: acpi: Fix getting APIC id
Fixes accessing wrong memory.

Fixes: #66085

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-04 16:39:47 +00:00
Andrei Emeltchenko 9f7209241b tests: acpi: Refactor ACPi test
Use helpers to print scope also for not found entries.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-01 10:55:22 +00:00
Anas Nashif aed0c451f8 arch: introduce DSP_SHARING and CPU_HAS_DSP configs
introduce global DSP_SHARING and CPU_HAS_DSP to be used by all
architectures and change existing usage in ARC to use those global
configs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-27 09:05:54 +00:00
Anas Nashif b58a1f15af kernel: sanitize thread options
Some thread options were made architecture specific, i.e. K_ARC_DSP_IDX. We
have other architectures with similar functionality and we need to be
architecture agnostic at this level.

Changed the option to be more generic. The option is now called K_DSP_IDX.

Also remove multiple level of ifdefs and guards around those defines to
allow for documentation to be published and added a note about required
configs in the docstring.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-27 09:05:54 +00:00
Anas Nashif f25e2201a4 tests: fix various test identifiers
Fix a few inconsistent test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-17 09:27:40 +01:00
Nicolas Pitre 171cecb1d6 riscv: FPU trap: test case comment typo fix
Test case comment typo fix.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-11-13 09:51:34 +01:00
Nicolas Pitre 38373aa599 riscv: FPU trap: catch fused multiply-add instructions
The FMADD, FMSUB, FNMSUB and FNMADD instructions occupy major opcode
spaces of their own, separate from LOAD-FP/STORE-FP and OP-FP spaces.
Insert code to cover them.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-11-10 10:39:28 +01:00
Corey Wharton 0fdb50b869 tests: arch: arm: add new test for custom interrupt control on Cortex-M
Adds a new test for ARM Cortex-M architectures with the
CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER option enabled.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2023-11-09 11:20:01 +01:00
Anas Nashif 4e396174ce kernel: move syscall_handler.h to internal include directory
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
TOKITA Hiroshi a17d49511f tests: arch: arm: arm_irq_vector_table: exclude arduino_uno_r4_minima
Renesas RA always uses interrupt handlers dynamically.
But this test requires static vector tables.
So, it needs to exclude platforms that use Renesas RA.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-11-01 10:56:46 +00:00
Benedikt Schmidt aa25e212d1 tests: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Tomasz Bursztyka 7b2cb95cd5 tests/x86: Reverting back to old logic
It was simpler, and it worked: it counted the cpu number correctly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-10-27 17:36:44 +01:00
Michael Arnold 9e4a403d21 tests: arch: Make ramfunc test generic and enable test for riscv arch
The ramfunc test can be reused for multiple architectures.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2023-10-25 17:35:07 +02:00
Michael Arnold f67c11cb2a tests: arch: Move ramfunc test from arm specific to common
The feature ramfunc is generic and can be
reused for other architectures.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2023-10-25 17:35:07 +02:00
Anas Nashif 345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Manuel Argüelles da56b98f8b tests: arch: arm_irq_vector_table: exclude mr_canhubk3 board
The mr_canhubk3 board enables by default an off-chip watchdog that must
be serviced to avoid triggering a reset and cannot be disabled on a
per-test basis.

To add the needed ISR for this test involve doing modifications to the
LPSPI MCUX driver that does not worth the trouble for this test only,
so exclude this board.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-09-18 10:37:22 +01:00
Carlo Caione e4a125b6a4 dt: Make zephyr,memory-attr a capabilities bitmask
This is the final step in making the `zephyr,memory-attr` property
actually useful.

The problem with the current implementation is that `zephyr,memory-attr`
is an enum type, this is making very difficult to use that to actually
describe the memory capabilities. The solution proposed in this PR is to
use the `zephyr,memory-attr` property as an OR-ed bitmask of memory
attributes.

With the change proposed in this PR it is possible in the DeviceTree to
mark the memory regions with a bitmask of attributes by using the
`zephyr,memory-attr` property. This property and the related memory
region can then be retrieved at run-time by leveraging a provided helper
library or the usual DT helpers.

The set of general attributes that can be specified in the property are
defined and explained in
`include/zephyr/dt-bindings/memory-attr/memory-attr.h` (the list can be
extended when needed).

For example, to mark a memory region in the DeviceTree as volatile,
non-cacheable, out-of-order:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_VOLATILE |
			       DT_MEM_NON_CACHEABLE |
			       DT_MEM_OOO )>;
   };

The `zephyr,memory-attr` property can also be used to set
architecture-specific custom attributes that can be interpreted at run
time. This is leveraged, among other things, to create MPU regions out
of DeviceTree defined memory regions on ARM, for example:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-region = "NOCACHE_REGION";
       zephyr,memory-attr = <( DT_ARM_MPU(ATTR_MPU_RAM_NOCACHE) )>;
   };

See `include/zephyr/dt-bindings/memory-attr/memory-attr-mpu.h` to see
how an architecture can define its own special memory attributes (in
this case ARM MPU).

The property can also be used to set custom software-specific
attributes. For example we can think of marking a memory region as
available to be used for memory allocation (not yet implemented):

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_NON_CACHEABLE |
			       DT_MEM_SW_ALLOCATABLE )>;
   };

Or maybe we can leverage the property to specify some alignment
requirements for the region:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_CACHEABLE |
			       DT_MEM_SW_ALIGN(32) )>;
   };

The conventional and recommended way to deal and manage with memory
regions marked with attributes is by using the provided `mem-attr`
helper library by enabling `CONFIG_MEM_ATTR` (or by using the usual DT
helpers).

When this option is enabled the list of memory regions and their
attributes are compiled in a user-accessible array and a set of
functions is made available that can be used to query, probe and act on
regions and attributes, see `include/zephyr/mem_mgmt/mem_attr.h`

Note that the `zephyr,memory-attr` property is only a descriptive
property of the capabilities of the associated memory  region, but it
does not result in any actual setting for the memory to be set. The
user, code or subsystem willing to use this information to do some work
(for example creating an MPU region out of the property) must use either
the provided `mem-attr` library or the usual DeviceTree helpers to
perform the required work / setting.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-09-15 12:46:54 +02:00
Gerard Marull-Paretas 691facc20f include: always use <> for Zephyr includes
Double quotes "" should only be used for local headers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-14 13:49:58 +02:00
Huifeng Zhang 2c22e83dfb include: arch: arm: Remove aarch32 directory
This commit follows the parent commit work.

This commit introduces the following major changes.

  1. Move all directories and files in 'include/zephyr/arch/arm/aarch32'
    to the 'include/zephyr/arch/arm' directory.

  2. Change the path string which is influenced by the changement 1.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-09-13 10:08:05 +01:00
Huifeng Zhang df41deac1c arch: arm: Remove aarch32 directory
It doesn't make sense to keep the aarch32 directory in the
'arch/arm/core' directory as the aarch64 has been moved out.

This commit introduces the following major changes.

  1. Move all directories and files in 'arch/arm/core/aarch32' to
    'arch/arm/core' and remove the 'arch/arm/core/aarch32' directory.
  2. Move all directories and files in 'arch/include/aarch32' to
    'arch/include' and remove the 'arch/include/aarch32' directory.
  3. Remove the nested including in the 'arch/include/kernel_arch_func.h'
    and 'arch/include/offsets_short_arch.h' header files.
  4. Change the path string which is influenced by the changement 1
    and 2.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-09-13 10:08:05 +01:00
Najumon B.A 7597bc1de4 test: arch: x86: update with new acpica interface
modified existing x86 tests app with the new acpica interface

Signed-off-by: Najumon B.A <najumon.ba@intel.com>
2023-09-07 09:42:38 +02:00
Gerard Marull-Paretas 9c961571a2 modules: cmsis: move glue code to modules/cmsis
The CMSIS module glue code was part of arch/ directory. Move it to
modules/cmsis, and provide a single entry point for it: cmsis_core.h.
This entry header will include the right CMSIS header (M or A/R).

To make this change possible, CMSIS module Kconfig/CMake are declared as
external, allowing us to add a new Zephyr include directory.

All files including CMSIS have been updated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-24 13:20:21 +02:00
Carlo Caione 15e84cbfac dts: Move to 'zephyr,memory-attr'
Move to 'zephyr,memory-attr' and use the newly introduced helpers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-07-25 11:22:10 +02:00
Anas Nashif 3a24476fb7 tests: kernel: fix some test identifiers
Fixed few test identifiers and tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-07-19 18:07:49 -04:00
Joakim Andersson 82024ad5cf tests: arch: arm: Use a more common SHA algorithm
The profile type "not set" uses the "default crypto config" header.
However platform may set their own crypto configuration headers.
SHA-512 algorithm is not the most common algorithm to support and
are for example disabled in profile types medium and small.

Change to SHA-256 which is much more common and is even needed
internally by TF-M for protected storage and sub-key derivation.

Update the QEMU icount setting to make the interrupt occur during
the secure call to TF-M.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-07-13 10:44:08 +02:00
Najumon Ba b3d78de656 arch: x86: updated acpi config macro
renamed x86 CONFIG_ACPI config macro to CONFIG_x86_ACPI.

Signed-off-by: Najumon Ba <najumon.ba@intel.com>
2023-06-30 17:53:01 +03:00
Anas Nashif b835b02136 tests: cleanup metadata and filtering
- Add integration_platforms to avoid excessive filtering
- Make sure integration platforms are actually part of the filter
- Fix some tags and test meta data

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-13 09:38:27 -04:00
Carlo Caione 7a043d6f19 tests: arm_runtime_nmi: Add barriers
Testing NMI on emulated QEMU platforms brings some interesting and wrong
results like:

  START - test_arm_runtime_nmi
  Trigger NMI in 10s: 0 s
  Trigger NMI in 10s: 1 s
  Trigger NMI in 10s: 2 s
  Trigger NMI in 10s: 3 s
  Trigger NMI in 10s: 4 s
  Trigger NMI in 10s: 5 s
  Trigger NMI in 10s: 6 s
  Trigger NMI in 10s: 7 s
  Trigger NMI in 10s: 8 s
  Trigger NMI in 10s: 9 s
  NMI triggered (test_handler_isr)!
      Assertion failed at ... arm_runtime_nmi_fn_test_arm_runtime_nmi:
        (nmi_triggered is false)
  Isr not triggered!

where the NMI handler is correctly called, see `NMI triggered`, but the
assert still fails on `nmi_triggered` being false.

This is due to a limitation in the emulation but also in the test not
being strictly architecturally compliant (you need a DSB;ISB sequence
after writing to SCB).

Add the proper barriers after writing to `SCB->ISCR` to make it
compliant and making it pass on QEMU as well.

Also reduce the timing to 2 sec.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-06-05 20:20:54 -04:00
Anas Nashif 29bcc34448 tests: arm_no_multithreading: move to new API
Make test use new API.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-28 11:35:12 -04:00
Carlo Caione 6f3a13d974 barriers: Move __ISB() to the new API
Remove the arch-specific ARM-centric __ISB() macro and use the new
barrier API instead.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-05-24 13:13:57 -04:00
Carlo Caione cb11b2e84b barriers: Move __DSB() to the new API
Remove the arch-specific ARM-centric __DSB() macro and use the new
barrier API instead.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-05-24 13:13:57 -04:00
Carlo Caione 2fa807bcd1 barriers: Move __DMB() to the new API
Remove the arch-specific ARM-centric __DMB() macro and use the new
barrier API instead.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-05-24 13:13:57 -04:00
Anas Nashif c5d798173c tests: improve filtering and use integration_platforms
Use integration platforms to limit scope in CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-24 07:50:50 -04:00
Fabio Baltieri b9ea2c2705 build: downgrade the no optimization ztest error to warning
The current approach of failing the build on ztest with no optimization
broke coverage builds, and generally raised some concerns about being
too aggressive.

Downgrade the error to a warning and rework the option to inhibit the
warning, while also dropping it automatically for POSIX (that are not
really affected by stack size) and coverage run (that always runs with
no optimization).

Will reconsider this down the road if we still see issues filed for the
tests broken with no optimization and no further tuning.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-23 14:51:24 +00:00
Fabio Baltieri f5830f3c3f ztest: error out when building tests with no compiler optimizations
Many tests are known to fail when built and no compiler optimizations.
Add a CMake check to error out when building a ztest based test with no
optimization, ask not file issues about it but also adds an opt-out
option to bypass the error for tests are actually designed to work in
this setup.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-22 12:25:43 -04:00
Keith Packard 9fe47b4fe2 tests/x86/pagetables: Disable malloc arena for pagetables test
The page tables test checks to make sure the various page permissions are
set as expected, but when there's a malloc heap, things don't match the
test expectations. As this test doesn't require a heap, just disable it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-05-11 01:25:01 +09:00
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Keith Packard bfa6a44746 tests,samples: Fix picolibc malloc arena settings
With picolibc moving to using the common malloc implementation, samples and
tests with picolibc-specific settings need to switch to using the common
malloc settings instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-05-09 01:29:16 +09:00
Keith Packard 0b90fd5adf samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Most of these changes were automated using coccinelle with the following
script:

@@
@@
- void
+ int
main(...) {
	...
-	return;
+	return 0;
	...
}

Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Thomas Stranger 77d2490164 arch: arm: core: aarch32: rename z_NmiHandlerSet
rename the function that sets the handler for the nmi.
It should be namespaced and not camel-case:
z_NmiHandlerSet to z_arm_nmi_set_handler

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2023-04-12 08:59:36 +02:00