aboutsummaryrefslogtreecommitdiff
path: root/transform.yaml
blob: c5996010519f60e6e767560e4eabf60a0cc8020f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
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