devicetree_regions: Remove path fallback and sanitize name

This patch is doing two things:

- it is removing the fallback on the path. This is not possible anymore
  since the DT binding file is now actually requiring the
  'zephyr,memory-region' property to be present from which the region
  name is obtained.

- it is sanitizing the name when CONFIG_CMAKE_LINKER_GENERATOR is used
  or not.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2022-03-16 16:43:29 +01:00 committed by Carles Cufí
commit 18914ccdd4
4 changed files with 20 additions and 19 deletions

View file

@ -22,8 +22,9 @@
zephyr,memory-region = "SRAM_REGION";
};
test_sram2: sram@20001000 {
compatible = "mmio-sram";
compatible = "zephyr,memory-region", "mmio-sram";
reg = < 0x20001000 0x1000 >;
zephyr,memory-region = "SRAM@REGION#2";
};
};
};

View file

@ -17,8 +17,10 @@
static void test_linker_regions(void)
{
zassert_true(!strcmp(LINKER_DT_NODE_REGION_NAME(TEST_SRAM1), "SRAM_REGION"), "");
zassert_true(!strcmp(LINKER_DT_NODE_REGION_NAME(TEST_SRAM2), "/test/sram@20001000"), "");
zassert_true(!strcmp(STRINGIFY(LINKER_DT_NODE_REGION_NAME(TEST_SRAM1)),
"SRAM_REGION"), "");
zassert_true(!strcmp(STRINGIFY(LINKER_DT_NODE_REGION_NAME(TEST_SRAM2)),
"SRAM_REGION_2"), "");
}
void test_main(void)