Skip to content

Commit

Permalink
Merge branch 'apply-otg-fixes-stm32f446' of https://github.com/FLampa…
Browse files Browse the repository at this point in the history
…rski/stm32-rs into FLamparski-apply-otg-fixes-stm32f446
  • Loading branch information
adamgreig committed Feb 12, 2020
2 parents a34ddd5 + 9cc8e87 commit 1f90804
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# For F401, F411

OTG_FS_GLOBAL:
_add:
GRXSTSP_Device:
Expand All @@ -7,6 +9,10 @@ OTG_FS_GLOBAL:
resetValue: 0x00000000
access: read-only
fields:
STSPHST:
description: Status phase start
bitOffset: 27
bitWidth: 1
FRMNUM:
description: Frame number
bitOffset: 21
Expand Down Expand Up @@ -64,13 +70,19 @@ OTG_FS_GLOBAL:
alternateRegister: DIEPTXF0

_array:
DIEPTXF[123]: {}
DIEPTXF[123]:
displayName: DIEPTXF%s
description: OTF_FS device IN endpoint transmit FIFO size register


OTG_FS_DEVICE:
_array:
DIEPCTL[123]: {}
DOEPCTL[123]: {}
DIEPCTL[123]:
displayName: DIEPCTL%s
description: OTG_FS device endpoint %s IN control register
DOEPCTL[123]:
displayName: DOEPCTL%s
description: OTG_FS device endpoint %s OUT control register

DIEPCTL0:
_modify:
Expand Down
173 changes: 173 additions & 0 deletions devices/common_patches/usb_otg/otg_fs_fixes_v1_446_469.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# For F446, F469, F479

OTG_FS_GLOBAL:
_derive:
DIEPTXF4:
_from: DIEPTXF1
addressOffset: 0x110
DIEPTXF5:
_from: DIEPTXF1
addressOffset: 0x114

_add:
GRXSTSP_Device:
description: OTG status read and pop (device mode)
addressOffset: 0x20
size: 32
resetValue: 0x00000000
access: read-only
fields:
STSPHST:
description: Status phase start
bitOffset: 27
bitWidth: 1
FRMNUM:
description: Frame number
bitOffset: 21
bitWidth: 4
PKTSTS:
description: Packet status
bitOffset: 17
bitWidth: 4
DPID:
description: Data PID
bitOffset: 15
bitWidth: 2
BCNT:
description: Byte count
bitOffset: 4
bitWidth: 11
EPNUM:
description: Endpoint number
bitOffset: 0
bitWidth: 4

GRXSTSP_Host:
description: OTG status read and pop (host mode)
addressOffset: 0x20
size: 32
resetValue: 0x00000000
access: read-only
alternateRegister: GRXSTSP_Device
fields:
PKTSTS:
description: Packet status
bitOffset: 17
bitWidth: 4
DPID:
description: Data PID
bitOffset: 15
bitWidth: 2
BCNT:
description: Byte count
bitOffset: 4
bitWidth: 11
CHNUM:
description: Channel number
bitOffset: 0
bitWidth: 4

GLPMCFG:
addressOffset: 0x54
# TODO

_modify:
CID:
name: OTG_CID
resetValue: 0x00002000

GNPTXFSIZ_Device:
name: DIEPTXF0
displayName: DIEPTXF0

GNPTXFSIZ_Host:
name: HNPTXFSIZ
displayName: HNPTXFSIZ
alternateRegister: DIEPTXF0

_array:
DIEPTXF[12345]:
displayName: DIEPTXF%s
description: OTF_FS device IN endpoint transmit FIFO size register


OTG_FS_DEVICE:
_derive:
DIEPCTL4:
_from: DIEPCTL1
addressOffset: 0x180
description: OTG device endpoint-4 control register
DIEPCTL5:
_from: DIEPCTL1
addressOffset: 0x1A0
description: OTG device endpoint-5 control register
DIEPINT4:
_from: DIEPINT1
addressOffset: 0x188
description: device endpoint-4 interrupt register
DIEPINT5:
_from: DIEPINT1
addressOffset: 0x1A8
description: device endpoint-5 interrupt register
DTXFSTS4:
_from: DTXFSTS1
addressOffset: 0x198
DTXFSTS5:
_from: DTXFSTS1
addressOffset: 0x1B8
DIEPTSIZ4:
_from: DIEPTSIZ1
addressOffset: 0x190
DIEPTSIZ5:
_from: DIEPTSIZ1
addressOffset: 0x1b0
DOEPCTL4:
_from: DOEPCTL1
addressOffset: 0x380
DOEPCTL5:
_from: DOEPCTL1
addressOffset: 0x3a0
DOEPINT4:
_from: DOEPINT1
addressOffset: 0x388
DOEPINT5:
_from: DOEPINT1
addressOffset: 0x3a8
DOEPTSIZ4:
_from: DOEPTSIZ1
addressOffset: 0x390
DOEPTSIZ5:
_from: DOEPTSIZ1
addressOffset: 0x3b0

DIEPCTL0:
_modify:
EPENA:
access: read-write

DIEPCTL*:
_modify:
Stall:
name: STALL
description: STALL

DOEPCTL*:
_modify:
Stall:
name: STALL
description: STALL

DAINTMSK:
_modify:
OEPINT:
name: OEPM
description: OUT EP interrupt mask bits

_array:
DIEPCTL[12345]: {}
DIEPINT[12345]: {}
DIEPTSIZ[12345]: {}
DOEPCTL[12345]: {}
DOEPINT[12345]: {}
DOEPTSIZ[12345]: {}
DTXFSTS[12345]: {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# For F405, F407, F427, F429, F446, F469

# TODO: Support devices with different number of endpoints
# eg. 405, 407, 427, 429 -> 6 endpoints total
# eg. 446, 469, 479 -> 9 endpoints total

# Fix power and clock gating control register name
OTG_HS_PWRCLK:
_modify:
Expand Down
4 changes: 2 additions & 2 deletions devices/stm32f401.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ _include:
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/otg_fs_fixes.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
8 changes: 4 additions & 4 deletions devices/stm32f405.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ _include:
- ../peripherals/exti/exti.yaml
- common_patches/hash/hash.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/otg_fs_fixes.yaml
- common_patches/otg_hs_remove_prefix.yaml
- common_patches/otg_hs_fixes.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
- common_patches/usb_otg/otg_hs_remove_prefix.yaml
- common_patches/usb_otg/otg_hs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
Expand Down
8 changes: 4 additions & 4 deletions devices/stm32f407.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ _include:
- ../peripherals/exti/exti.yaml
- common_patches/hash/hash.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/otg_fs_fixes.yaml
- common_patches/otg_hs_remove_prefix.yaml
- common_patches/otg_hs_fixes.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
- common_patches/usb_otg/otg_hs_remove_prefix.yaml
- common_patches/usb_otg/otg_hs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
Expand Down
4 changes: 2 additions & 2 deletions devices/stm32f411.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ _include:
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/otg_fs_fixes.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
2 changes: 1 addition & 1 deletion devices/stm32f412.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ _include:
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
2 changes: 1 addition & 1 deletion devices/stm32f413.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ _include:
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
Expand Down
8 changes: 4 additions & 4 deletions devices/stm32f427.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ _include:
- ../peripherals/exti/exti.yaml
- common_patches/hash/hash.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/otg_fs_fixes.yaml
- common_patches/otg_hs_remove_prefix.yaml
- common_patches/otg_hs_fixes.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
- common_patches/usb_otg/otg_hs_remove_prefix.yaml
- common_patches/usb_otg/otg_hs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
Expand Down
8 changes: 4 additions & 4 deletions devices/stm32f429.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ _include:
- ../peripherals/exti/exti.yaml
- common_patches/hash/hash.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/otg_fs_fixes.yaml
- common_patches/otg_hs_remove_prefix.yaml
- common_patches/otg_hs_fixes.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1.yaml
- common_patches/usb_otg/otg_hs_remove_prefix.yaml
- common_patches/usb_otg/otg_hs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- common_patches/fsmc/fsmc_sram.yaml
Expand Down
6 changes: 4 additions & 2 deletions devices/stm32f446.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ _include:
- ../peripherals/iwdg/iwdg.yaml
- ../peripherals/exti/exti.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_hs_remove_prefix.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_hs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_fixes_v1_446_469.yaml
- common_patches/usb_otg/otg_hs_fixes_v1.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- common_patches/fsmc/fsmc_sram.yaml
Expand Down
4 changes: 2 additions & 2 deletions devices/stm32f469.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ _include:
- ../peripherals/fsmc/fsmc_sd.yaml
- common_patches/hash/hash.yaml
- common_patches/rtc/rtc_bkpr.yaml
- common_patches/otg_hs_remove_prefix.yaml
- common_patches/otg_fs_remove_prefix.yaml
- common_patches/usb_otg/otg_hs_remove_prefix.yaml
- common_patches/usb_otg/otg_fs_remove_prefix.yaml
- common_patches/tim/tim_ccr.yaml
- common_patches/dbgmcu.yaml
- ../peripherals/tim/tim_ccm_v1.yaml
Expand Down

0 comments on commit 1f90804

Please sign in to comment.