Skip to content

Commit 76e5351

Browse files
authored
Merge pull request embassy-rs#784 from tarfu/dlybsd
STM32N6: fix DLYB layout — use dlybsd_v1 instead of dlyb/v1
2 parents a8f265c + d19b5e3 commit 76e5351

3 files changed

Lines changed: 69 additions & 9 deletions

File tree

data/extra/STM32N6.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,21 @@ peripherals:
104104
version: n6
105105
block: RISAF
106106
# SDMMC DLL delay blocks. Not declared as IPs in cube DB (same situation as
107-
# on STM32H5/H7/U5), so we wire them in here. The N6 SVD names them DLYBSD
108-
# with a different field layout, but the CMSIS device header (DLYB_TypeDef
109-
# in stm32n657xx.h) shows the same CR/CFGR layout as on every other STM32
110-
# with this block — we trust the header here. Same naming convention as
111-
# data/extra/STM32H7.yaml and data/extra/STM32H5[67]x.yaml.
107+
# on STM32H5/H7/U5), so we wire them in here. N6 uses a redesigned
108+
# tap-select DLL (RM0486 §31.5) with a programming model that's
109+
# incompatible with the older sampler-length DLYB used on H7/H5/U5/U3 —
110+
# see data/registers/dlybsd_v1.yaml. Instance names match the H7/U5
111+
# naming convention so embassy-stm32 driver code can reach the same
112+
# peripheral by the same name across families.
112113
- name: DLYB_SDMMC1
113114
address: 0x48028000
114115
registers:
115-
kind: dlyb
116+
kind: dlybsd
116117
version: v1
117-
block: DLYB
118+
block: DLYBSD
118119
- name: DLYB_SDMMC2
119120
address: 0x48026C00
120121
registers:
121-
kind: dlyb
122+
kind: dlybsd
122123
version: v1
123-
block: DLYB
124+
block: DLYBSD

data/registers/dlybsd_v1.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
block/DLYBSD:
2+
description: DLYBSD address block description.
3+
items:
4+
- name: CFG
5+
description: Delay block SDMMC DLL configuration.
6+
byte_offset: 0
7+
fieldset: CFG
8+
- name: STATUS
9+
description: Delay block SDMMC DLL status.
10+
byte_offset: 4
11+
fieldset: STATUS
12+
fieldset/CFG:
13+
description: Delay block SDMMC DLL configuration.
14+
fields:
15+
- name: SDMMC_DLL_EN
16+
description: DLL enable.
17+
bit_offset: 0
18+
bit_size: 1
19+
- name: SDMMC_RX_TAP_SEL
20+
description: selection of RX delay.
21+
bit_offset: 1
22+
bit_size: 6
23+
- name: SDMMC_DLL_BYP_EN
24+
description: DLL configuration.
25+
bit_offset: 16
26+
bit_size: 1
27+
- name: SDMMC_DLL_BYP_CMD
28+
description: Bypass command.
29+
bit_offset: 17
30+
bit_size: 5
31+
- name: SDMMC_DLL_ANTIGLITCH_EN
32+
description: Antiglitch logic enabled when 1.
33+
bit_offset: 22
34+
bit_size: 1
35+
fieldset/STATUS:
36+
description: Delay block SDMMC DLL status.
37+
fields:
38+
- name: SDMMC_DLL_LOCK
39+
description: SDMMC DLL lock.
40+
bit_offset: 0
41+
bit_size: 1
42+
- name: SDMMC_RX_TAP_SEL_ACK
43+
description: SDMMC RX delay selection acknowledge.
44+
bit_offset: 1
45+
bit_size: 1

transforms/DLYBSD.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
transforms:
2+
# Strip the "DLYBSD_" prefix from register and fieldset names.
3+
- !RenameRegisters
4+
block: .*
5+
from: ^DLYBSD_(.*)$
6+
to: $1
7+
- !Rename
8+
from: ^DLYBSD_(.*)$
9+
to: $1
10+
type: Fieldset
11+
12+
# Drop the SVD's generic B_0x0/B_0x1 placeholder enums.
13+
- !DeleteEnums
14+
from: .*

0 commit comments

Comments
 (0)