Commit graph

7 commits

Author SHA1 Message Date
Ederson de Souza 2febacc60b tests/kernel/device: Add tests for device deferred init
Ensure that devices are not ready before calling `device_init()`, but
are after the call.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-04-11 15:50:44 -04:00
Jordan Yates 96138d233f tests: kernel: device: test sub-priority
Add tests for sorting devices at the same init priority based on their
devicetree ordinals.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 15:58:06 +00:00
Jordan Yates 3c1149e058 Revert "tests: kernel: device: test sub-priority"
This reverts commit 01e98fcb5f.
2023-07-25 14:17:11 +02:00
Jordan Yates 01e98fcb5f tests: kernel: device: test sub-priority
Add tests for sorting devices at the same init priority based on their
devicetree ordinals.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-07-25 09:13:16 +02:00
Carlo Caione b6a3d598f3 device_mmio: Introduce DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME
Currently the device MMIO APIs is only able to map single DT-defined
regions and also the _NAMED variant is assuming that each DT-defined
device has only one single region to map.

This is a limitation and a problem when in the DT are defined devices
with multiple regions that need to be mapped.

This patch is trying to overcome this limitation by introducing the
DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME macro that leveraged the 'reg-names'
DT property to map multiple regions defined by a single device.

So for example in the DT we can have a device like:

  driver@c4000000 {
    reg = <0xc4000000 0x1000>, <0xc4001000 0x1000>;
    reg-names = "region0", "region1";
  };

and then we can use DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME doing:

  struct driver_config config = {
    DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME(region0, DT_DRV_INST(0)),
    DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME(region1, DT_DRV_INST(0)),
  };

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-16 11:26:10 +02:00
Carlo Caione 26856ca878 test: device: Specify address and size cells.
The test is wrongly assuming that all the archs have #address-cells =
<1> and #size-cells = <1> at the DT root. This is not always true, and
it makes the test failing for AArch64. Fix the wrong assumption.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-29 19:41:27 -05:00
Andrew Boie 8ec248a0f9 tests: device: add device_mmio tests
Exercise the public macros as well as device_map().
This test has a whitelist for whatever reason; add
mps2_an385 so that the !DEVICE_MMIO_IS_IN_RAM stuff
is tested.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-17 11:38:18 +02:00