diff --git a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi index aa95021d887..0daaa21a85f 100644 --- a/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi +++ b/boards/nordic/nrf9280pdk/nrf9280pdk_nrf9280-memory_map_iron.dtsi @@ -75,5 +75,9 @@ storage_partition: partition@600000 { reg = <0x600000 DT_SIZE_K(40)>; }; + + periphconf_partition: partition@60a000 { + reg = <0x60a000 DT_SIZE_K(8)>; + }; }; }; diff --git a/dts/vendor/nordic/nrf9280.dtsi b/dts/vendor/nordic/nrf9280.dtsi index fb27488e9dc..f3dbbb3d900 100644 --- a/dts/vendor/nordic/nrf9280.dtsi +++ b/dts/vendor/nordic/nrf9280.dtsi @@ -116,16 +116,12 @@ write-block-size = <16>; }; - cpuapp_uicr: uicr@fff8000 { - compatible = "nordic,nrf-uicr-v2"; + uicr: uicr@fff8000 { + compatible = "nordic,nrf-uicr"; reg = <0xfff8000 DT_SIZE_K(2)>; - domain = <2>; - }; - - cpurad_uicr: uicr@fffa000 { - compatible = "nordic,nrf-uicr-v2"; - reg = <0xfffa000 DT_SIZE_K(2)>; - domain = <3>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0xfff8000 DT_SIZE_K(2)>; }; ficr: ficr@fffe000 { diff --git a/soc/nordic/common/uicr/Kconfig b/soc/nordic/common/uicr/Kconfig index 73b5e5cf2d1..a352c8a9bf4 100644 --- a/soc/nordic/common/uicr/Kconfig +++ b/soc/nordic/common/uicr/Kconfig @@ -3,7 +3,7 @@ config NRF_PERIPHCONF_SECTION bool "Populate global peripheral initialization section" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP depends on LINKER_DEVNULL_SUPPORT imply LINKER_DEVNULL_MEMORY help @@ -12,7 +12,7 @@ config NRF_PERIPHCONF_SECTION config NRF_PERIPHCONF_GENERATE_ENTRIES bool "Generate PERIPHCONF entries source file" - default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD + default y if SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD || SOC_NRF9280_CPUAPP depends on NRF_PERIPHCONF_SECTION depends on NRF_PLATFORM_HALTIUM help diff --git a/soc/nordic/common/uicr/Kconfig.sysbuild b/soc/nordic/common/uicr/Kconfig.sysbuild index eb885beaaaf..6a9341f9099 100644 --- a/soc/nordic/common/uicr/Kconfig.sysbuild +++ b/soc/nordic/common/uicr/Kconfig.sysbuild @@ -3,7 +3,7 @@ config NRF_HALTIUM_GENERATE_UICR bool "Generate UICR file" - depends on SOC_SERIES_NRF54HX + depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF92X default y help Generate UICR HEX file. diff --git a/soc/nordic/common/uicr/gen_periphconf_entries.py b/soc/nordic/common/uicr/gen_periphconf_entries.py index 92f5f1d2455..15c1f12e681 100644 --- a/soc/nordic/common/uicr/gen_periphconf_entries.py +++ b/soc/nordic/common/uicr/gen_periphconf_entries.py @@ -55,11 +55,50 @@ def get_additional_node_kwargs(node: Node) -> dict[str, Any]: return additional_kwargs +class Family(enum.Enum): + """Families of SoCs supported by this script""" + + SERIES_NRF54HX = "nrf54h" + SERIES_NRF92 = "nrf92" + SERIES_UNKNOWN = "unknown" + + @classmethod + def family(cls, soc): + if soc.startswith("nrf54h") and len(soc) == 8: + return cls.SERIES_NRF54HX + elif soc.startswith("nrf92") and len(soc) == 7: + return cls.SERIES_NRF92 + else: + return cls.SERIES_UNKNOWN + + class Soc(enum.Enum): """Names of SoCs supported by this script""" NRF54H20 = "nrf54h20" NRF9280 = "nrf9280" + UNKNOWN = "unknown" + + @classmethod + def soc(cls, soc): + if soc.startswith("nrf54h20") and len(soc) == 8: + return cls.NRF54H20 + elif soc.startswith("nrf9280") and len(soc) == 7: + return cls.NRF9280 + else: + return cls.UNKNOWN + + +def validate_soc_choice(soc): + """Helper for argparse to validate soc parameter type""" + + if (soc.startswith("nrf54h") and soc[6:].isdigit() and len(soc) == 8) or \ + (soc.startswith("nrf92") and soc[5:].isdigit() and len(soc) == 7): + return soc + else: + raise argparse.ArgumentTypeError( + f"Invalid soc '{soc}'. Must start with 'nrf54h' or 'nrf92' followed by 2 digits." + ) def parse_args() -> argparse.Namespace: @@ -79,8 +118,8 @@ def parse_args() -> argparse.Namespace: ) parser.add_argument( "--soc", + type=validate_soc_choice, required=True, - choices=[soc.value for soc in Soc], help=( "SoC to generate PERIPHCONF macros for. " "Used to look up soc specific hardware information" @@ -105,7 +144,7 @@ def main() -> None: args = parse_args() dt = pickle.load(args.in_edt_pickle) processor = dt_processor_id(dt) - lookup_tables = lookup_tables_get(Soc(args.soc)) + lookup_tables = lookup_tables_get(Soc.soc(args.soc), Family.family(args.soc)) builder = PeriphconfBuilder(dt, lookup_tables) # Application local peripherals @@ -135,7 +174,7 @@ def main() -> None: args.out_periphconf_source.write(generated_source) -def lookup_tables_get(soc: Soc) -> SocLookupTables: +def lookup_tables_get(soc: Soc, family : Family) -> SocLookupTables: if soc == Soc.NRF54H20: ctrlsel_lookup = { # CAN120 @@ -427,7 +466,7 @@ def lookup_tables_get(soc: Soc) -> SocLookupTables: NrfPsel(fun=NrfFun.IGNORE, port=2, pin=11): Ctrlsel.CAN, }, } - elif soc == Soc.NRF9280: + elif soc == Soc.NRF9280 or (soc == Soc.UNKNOWN and family == Family.SERIES_NRF92) : ctrlsel_lookup = { # PWM120 0x5F8E_4000: { diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 4f17e32e5d5..f8e5245b51c 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -346,7 +346,7 @@ CHECK_DT_REG(uart134, NRF_UARTE134); CHECK_DT_REG(uart135, NRF_UARTE135); CHECK_DT_REG(uart136, NRF_UARTE136); CHECK_DT_REG(uart137, NRF_UARTE137); -#if !defined(CONFIG_SOC_SERIES_NRF54HX) +#if !defined(CONFIG_SOC_SERIES_NRF54HX) && !defined(CONFIG_SOC_SERIES_NRF92X) CHECK_DT_REG(uicr, NRF_UICR); #else CHECK_DT_REG(uicr, NRF_APPLICATION_UICR);