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>
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>
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>