From d5f172feedbda9ec8fe0f098483ba5a89eb3e2d4 Mon Sep 17 00:00:00 2001 From: gatecat Date: Fri, 23 Jan 2026 09:44:03 +0100 Subject: [PATCH] nexus: Support for CONFIG_LMMI and CONFIG_CLKRST_CORE Signed-off-by: gatecat --- nexus/constids.inc | 7 +++++++ nexus/fasm.cc | 23 +++++++++++++++++++++++ nexus/pack.cc | 2 +- nexus/pins.cc | 13 +++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/nexus/constids.inc b/nexus/constids.inc index 87224179..380d2112 100644 --- a/nexus/constids.inc +++ b/nexus/constids.inc @@ -553,6 +553,13 @@ X(CONFIG_MULTIBOOT_CORE) X(CIBAUTOREBOOT) X(MSPIADDR) +X(CONFIG_LMMI) +X(CONFIG_LMMI_CORE) +X(SMCLK) +X(RSTSMCLK) + +X(CONFIG_CLKRST_CORE) + X(BEL_TYPE) X(BEL_Z) X(CEOUTMUX) diff --git a/nexus/fasm.cc b/nexus/fasm.cc index 9e0fd2ee..02813aa9 100644 --- a/nexus/fasm.cc +++ b/nexus/fasm.cc @@ -540,6 +540,25 @@ struct NexusFasmWriter ctx->parse_lattice_param_from_cell(cell, id_MSPIADDR, 32, 0).intval, 32); pop(); } + // Write config for an CONFIG_LMMI_CORE cell + void write_lmmi(const CellInfo *cell) + { + BelId bel = cell->bel; + push_bel(bel); + write_enum(cell, "LMMI_EN", "DIS"); + pop(); + } + // Write config for an CONFIG_CLKRST_CORE cell + void write_cfg_clkrst(const CellInfo *cell) + { + BelId bel = cell->bel; + push_bel(bel); + write_enum(cell, "MCJTAGGSRNDIS", "EN"); + write_enum(cell, "MCLMMIGSRNDIS", "EN"); + write_enum(cell, "MCSEDCGSRNDIS", "EN"); + write_enum(cell, "MCWDTGSRNDIS", "EN"); + pop(); + } // Write config for DCC void write_dcc(const CellInfo *cell) { @@ -1107,6 +1126,10 @@ struct NexusFasmWriter write_dcs(ci); else if (ci->type == id_CONFIG_MULTIBOOT_CORE) write_multiboot(ci); + else if (ci->type == id_CONFIG_LMMI_CORE) + write_lmmi(ci); + else if (ci->type == id_CONFIG_CLKRST_CORE) + write_cfg_clkrst(ci); blank(); } // Handle DCC route-throughs diff --git a/nexus/pack.cc b/nexus/pack.cc index 7e1e6f7f..58999965 100644 --- a/nexus/pack.cc +++ b/nexus/pack.cc @@ -1081,7 +1081,7 @@ struct NexusPacker {id_PDPSC16K, id_PDPSC16K_MODE}, {id_SP16K, id_SP16K_MODE}, {id_FIFO16K, id_FIFO16K_MODE}, {id_SP512K, id_SP512K_MODE}, {id_DPSC512K, id_DPSC512K_MODE}, {id_PDPSC512K, id_PDPSC512K_MODE}, {id_PLL, id_PLL_CORE}, {id_DPHY, id_DPHY_CORE}, - {id_MULTIBOOT, id_CONFIG_MULTIBOOT_CORE}, + {id_MULTIBOOT, id_CONFIG_MULTIBOOT_CORE}, {id_CONFIG_LMMI, id_CONFIG_LMMI_CORE}, }; // extra prefix needed for this primitive for some reason diff --git a/nexus/pins.cc b/nexus/pins.cc index 97652c8e..bc518cbd 100644 --- a/nexus/pins.cc +++ b/nexus/pins.cc @@ -245,6 +245,19 @@ static const dict base_cell_pin_data = { { {{}, PINSTYLE_CIB}, }}, + {id_CONFIG_LMMI_CORE, + { + {id_LMMICLK, PINSTYLE_DEDI}, + {id_LMMIRESETN, PINSTYLE_DEDI}, + {id_RSTSMCLK, PINSTYLE_DEDI}, + {id_SMCLK, PINSTYLE_DEDI}, + {{}, PINSTYLE_CIB}, + }}, + {id_CONFIG_CLKRST_CORE, + { + {{}, PINSTYLE_DEDI}, + }}, + }; } // namespace