From 6f313f98fc8162c8dc7bac330fde927901cb9ba8 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Sat, 5 Jul 2025 16:24:52 -0400 Subject: First commit --- transform.yaml | 245 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 transform.yaml (limited to 'transform.yaml') diff --git a/transform.yaml b/transform.yaml new file mode 100644 index 0000000..c599601 --- /dev/null +++ b/transform.yaml @@ -0,0 +1,245 @@ +# A port of the raltool-cfg.yaml from imxrt-ral. This is how raltool +# transforms its peripherals, so it's only fair that chiptool does +# the same. + +transforms: + # Transform device names, keeping the RAL convention. + - !Rename + from: Mimxrt1011 + to: imxrt1011 + type: Device + - !Rename + from: Mimxrt1015 + to: imxrt1015 + type: Device + - !Rename + from: Mimxrt1021 + to: imxrt1021 + type: Device + - !Rename + from: Mimxrt1051 + to: imxrt1051 + type: Device + - !Rename + from: Mimxrt1052 + to: imxrt1052 + type: Device + - !Rename + from: Mimxrt1061 + to: imxrt1061 + type: Device + - !Rename + from: Mimxrt1062 + to: imxrt1062 + type: Device + - !Rename + from: Mimxrt1064 + to: imxrt1064 + type: Device + - !Rename + from: Mimxrt1176Cm7 + to: imxrt1176_cm7 + type: Device + - !Rename + from: Mimxrt1176Cm4 + to: imxrt1176_cm4 + type: Device + - !Rename + from: Mimxrt1189Cm33 + to: imxrt1189_cm33 + type: Device + - !Rename + from: Mimxrt1189Cm7 + to: imxrt1189_cm7 + type: Device + - !Rename + from: pit::Pit1 + to: pit::Pit + type: Block + - !Rename + from: usb::Usb1 + to: usb::Usb + type: Block + - !DeleteEnums + from: usb::vals::Fs2 + # Combine GPT OCR and ICR registrers for 10xx MCUs. + # This allows it to match the 11xx MCUs, and reduce + # code bloat. + - !MakeRegisterArray + blocks: gpt::Gpt(\d) + from: OCR(\d) + to: OCR + - !MakeRegisterArray + blocks: gpt::Gpt(\d) + from: ICR(\d) + to: ICR + # Drop select enums from GPT fields. These extra enums + # are present in 11xx SVDs and prevent the tool from + # combining with the 10xx GPT definition. + - !DeleteEnums + from: gpt::vals::Im(\d) + - !DeleteEnums + from: gpt::vals::Om(\d) + - !DeleteEnums + from: gpt::vals::Fo(\d) + - !DeleteEnums + from: gpt::vals::Sr(\d) + - !DeleteEnums + from: gpt::vals::Of(\d) + - !DeleteEnums + from: gpt::vals::If(\d) + - !DeleteEnums + from: gpt::vals::Of(\d)ie + - !DeleteEnums + from: gpt::vals::If(\d)ie + # Move the CAN wrapper instance number to the far right + # so it's properly parsed. + - !Rename + from: CAN(\d)_WRAPPER + to: CAN_WRAPPER$1 + type: Block + # This resembles a XECC_FLEXSPI peripheral. + # It consolidates when there's a number at the end. + - !Rename + from: XECC_SEMC + to: XECC_SEMC0 + type: Block + # This peripheral is tricky to support. + # + # - It has clusters in clusters. While we can generate code for this, + # we can't easily add macro support for this. + # - It has clusters that alias each other. This is trickier to support + # in today's codegen tool, so we're punting. + - !Delete + from: caam::Caam + # 1176 CM7 has GPIO blocks under a "cm7_gpio" module. Change this + # so that they're under a "gpio" module. Also, rename the block so + # that it matches the 10xx GPIO block name, and can be combined. + - !Rename + from: cm7_gpio::Cm7Gpio2 + to: gpio::Gpio1 + type: Block + # Same goes for the 1176 CM4: rename for combining. + - !Rename + from: gpio::Gpio2 + to: gpio::Gpio1 + type: Block + # Change the fast GPIO numbers on the 1176 CM7 so that they have a + # unique instance number. Add 10 to make it distinct. This is faily hacky, + # so TODO make this better. + - !Rename + from: CM7_GPIO2 + to: FAST_GPIO20 + type: Block + - !Rename + from: CM7_GPIO3 + to: FAST_GPIO30 + type: Block + # Similar number suffixes result in duplicate instance types. Define unique + # numbers (that are a bit less hacky, maybe). + - !Rename + from: PGMC_CPC0_MIF0 + to: PGMC_CPC_MIF00 + type: Block + - !Rename + from: PGMC_CPC0_MIF1 + to: PGMC_CPC_MIF01 + type: Block + - !Rename + from: PGMC_CPC1_MIF0 + to: PGMC_CPC_MIF10 + type: Block + - !Rename + from: PGMC_CPC1_MIF1 + to: PGMC_CPC_MIF11 + type: Block + # 1176 LPSPI has fewer enums which prevent combining. Remove them from + # the 10xx variants. They're simple, intuitive bool fields, so it's no + # bit deal to remove. + - !DeleteEnums + from: lpspi::vals::Hren + - !DeleteEnums + from: lpspi::vals::Hrpol + - !DeleteEnums + from: lpspi::vals::Hrsel + - !DeleteEnums + from: lpspi::vals::Pcspol + # The 1189 has two DMA peripherals. Avoid collision when unifying with 10xx + # names. + - !Delete + from: dma3::Dma3 + # DMA and DMAMUX are suffixed with numbers on the 1176, since each core + # has its own instance. They're also suffixed on 10xx chips, even though + # there's just one instnace. Rename them so that the names are the same across + # all chips. + - !Rename + from: dma(\d)::Dma(\d) + to: dma::Dma + type: All + - !Rename + from: DMA(\d) + to: DMA + type: All + - !Rename + from: dmamux(\d)::Dmamux(\d) + to: dmamux::Dmamux + type: All + - !Rename + from: DMAMUX(\d) + to: DMAMUX + type: All + - !RenameRegisters + block: ocotp::Ocotp + from: HW_OCOTP_(.*) + to: $1 + # Field is needlessly named 'AM1F' on the 1176. + # All 1000-series use AM1IE. The field meaning + # is the same regardless, and this lets us combine + # the LPI2C blocks. + - !RenameFields + fieldset: lpi2c::regs::Sier + from: AM1F + to: AM1IE + - !RenameFields + fieldset: src::regs::Srsr + from: LOCKUP + to: LOCKUP_SYSRESETREQ + # Groups of 1189 peripherals that use derivedFrom but with meaningful names + # instead of plain numbering. raltool only handles the numbered case, so + # delete them until someone needs them. + - !Delete + from: aon_mif_ln28fdsoi_spllram::AonMifLn28fdsoiSpllram + - !Delete + from: aon_mif_s28spregh::AonMifS28spregh + - !Delete + from: aon_mix_slice::AonMixSlice + - !Delete + from: enetc0_revmii_mac::Enetc0RevmiiMac + - !Delete + from: enetc0_revmii_phy::Enetc0RevmiiPhy + - !Delete + from: ethernet_pll::EthernetPll + - !Delete + from: mu2_mua::Mu2Mua + - !Delete + from: sw0_global::Sw0Global + - !Delete + from: tstmr2_tstmra::Tstmr2Tstmra + - !Delete + from: xcache_pc::XcachePc + - !Delete + from: m33_pcf::M33Pcf1 + # Aliased cluster arrays are not supported by raltool at the time of writing. + - !Delete + from: ecat::RxErrorCntr + - !Delete + from: ecat::ForwardedRxErrorCntr + - !Delete + from: ecat::LostLinkCntr + - !Delete + from: ecat::Fmmu + - !Delete + from: ecat::Syncmanager + # This one probably just needs some renaming to work. + - !Delete + from: mu2_mub::Mu2Mub -- cgit v1.2.3