Merged in david_s5/nuttx/master_l4_usbfix (pull request #140)
Master l4 usbfix
This commit is contained in:
commit
fc78eb6b28
@ -82,11 +82,6 @@
|
||||
#define STM32L4_OTGFS_HPTXFSIZ_OFFSET 0x0100 /* Host periodic transmit FIFO size register */
|
||||
|
||||
#define STM32L4_OTGFS_DIEPTXF_OFFSET(n) (104+(((n)-1) << 2))
|
||||
#define STM32L4_OTGFS_DIEPTXF1_OFFSET 0x0104 /* Device IN endpoint transmit FIFO1 size register */
|
||||
#define STM32L4_OTGFS_DIEPTXF2_OFFSET 0x0108 /* Device IN endpoint transmit FIFO2 size register */
|
||||
#define STM32L4_OTGFS_DIEPTXF3_OFFSET 0x010c /* Device IN endpoint transmit FIFO3 size register */
|
||||
#define STM32L4_OTGFS_DIEPTXF4_OFFSET 0x0110 /* Device IN endpoint transmit FIFO4 size register */
|
||||
#define STM32L4_OTGFS_DIEPTXF5_OFFSET 0x0114 /* Device IN endpoint transmit FIFO5 size register */
|
||||
|
||||
/* Host-mode control and status registers */
|
||||
|
||||
@ -105,60 +100,12 @@
|
||||
#define STM32L4_OTGFS_HCTSIZ_CHOFFSET 0x0010 /* Host channel interrupt register */
|
||||
|
||||
#define STM32L4_OTGFS_HCCHAR_OFFSET(n) (0x500 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_HCCHAR0_OFFSET 0x0500 /* Host channel-0 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR1_OFFSET 0x0520 /* Host channel-1 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR2_OFFSET 0x0540 /* Host channel-2 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR3_OFFSET 0x0560 /* Host channel-3 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR4_OFFSET 0x0580 /* Host channel-4 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR5_OFFSET 0x05a0 /* Host channel-5 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR6_OFFSET 0x05c0 /* Host channel-6 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR7_OFFSET 0x05e0 /* Host channel-7 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR8_OFFSET 0x0600 /* Host channel-8 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR9_OFFSET 0x0620 /* Host channel-9 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR10_OFFSET 0x0640 /* Host channel-10 characteristics register */
|
||||
#define STM32L4_OTGFS_HCCHAR11_OFFSET 0x0660 /* Host channel-11 characteristics register */
|
||||
|
||||
#define STM32L4_OTGFS_HCINT_OFFSET(n) (0x508 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_HCINT0_OFFSET 0x0508 /* Host channel-0 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT1_OFFSET 0x0528 /* Host channel-1 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT2_OFFSET 0x0548 /* Host channel-2 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT3_OFFSET 0x0568 /* Host channel-3 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT4_OFFSET 0x0588 /* Host channel-4 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT5_OFFSET 0x05a8 /* Host channel-5 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT6_OFFSET 0x05c8 /* Host channel-6 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT7_OFFSET 0x05e8 /* Host channel-7 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT8_OFFSET 0x0608 /* Host channel-8 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT9_OFFSET 0x0628 /* Host channel-9 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT10_OFFSET 0x0648 /* Host channel-10 interrupt register */
|
||||
#define STM32L4_OTGFS_HCINT11_OFFSET 0x0668 /* Host channel-11 interrupt register */
|
||||
|
||||
#define STM32L4_OTGFS_HCINTMSK_OFFSET(n) (0x50c + ((n) << 5))
|
||||
#define STM32L4_OTGFS_HCINTMSK0_OFFSET 0x050c /* Host channel-0 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK1_OFFSET 0x052c /* Host channel-1 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK2_OFFSET 0x054c /* Host channel-2 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK3_OFFSET 0x056c /* Host channel-3 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK4_OFFSET 0x058c /* Host channel-4 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK5_OFFSET 0x05ac /* Host channel-5 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK6_OFFSET 0x05cc /* Host channel-6 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK7_OFFSET 0x05ec /* Host channel-7 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK8_OFFSET 0x060c /* Host channel-8 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK9_OFFSET 0x062c /* Host channel-9 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK10_OFFSET 0x064c /* Host channel-10 interrupt mask register */
|
||||
#define STM32L4_OTGFS_HCINTMSK11_OFFSET 0x066c /* Host channel-11 interrupt mask register */
|
||||
|
||||
#define STM32L4_OTGFS_HCTSIZ_OFFSET(n) (0x510 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_HCTSIZ0_OFFSET 0x0510 /* Host channel-0 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ1_OFFSET 0x0530 /* Host channel-1 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ2_OFFSET 0x0550 /* Host channel-2 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ3_OFFSET 0x0570 /* Host channel-3 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ4_OFFSET 0x0590 /* Host channel-4 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ5_OFFSET 0x05b0 /* Host channel-5 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ6_OFFSET 0x05d0 /* Host channel-6 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ7_OFFSET 0x05f0 /* Host channel-7 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ8_OFFSET 0x0610 /* Host channel-8 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ9_OFFSET 0x0630 /* Host channel-9 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ10_OFFSET 0x0650 /* Host channel-10 interrupt register */
|
||||
#define STM32L4_OTGFS_HCTSIZ11_OFFSET 0x0670 /* Host channel-11 interrupt register */
|
||||
|
||||
/* Device-mode control and status registers */
|
||||
|
||||
@ -180,36 +127,12 @@
|
||||
#define STM32L4_OTGFS_DTXFSTS_EPOFFSET 0x0018 /* Device IN endpoint transmit FIFO status register */
|
||||
|
||||
#define STM32L4_OTGFS_DIEPCTL_OFFSET(n) (0x0900 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DIEPCTL0_OFFSET 0x0900 /* Device control IN endpoint 0 control register */
|
||||
#define STM32L4_OTGFS_DIEPCTL1_OFFSET 0x0920 /* Device control IN endpoint 2 control register */
|
||||
#define STM32L4_OTGFS_DIEPCTL2_OFFSET 0x0940 /* Device control IN endpoint 3 control register */
|
||||
#define STM32L4_OTGFS_DIEPCTL3_OFFSET 0x0960 /* Device control IN endpoint 4 control register */
|
||||
#define STM32L4_OTGFS_DIEPCTL4_OFFSET 0x0980 /* Device control IN endpoint 4 control register */
|
||||
#define STM32L4_OTGFS_DIEPCTL5_OFFSET 0x09a0 /* Device control IN endpoint 4 control register */
|
||||
|
||||
#define STM32L4_OTGFS_DIEPINT_OFFSET(n) (0x0908 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DIEPINT0_OFFSET 0x0908 /* Device endpoint-0 interrupt register */
|
||||
#define STM32L4_OTGFS_DIEPINT1_OFFSET 0x0928 /* Device endpoint-1 interrupt register */
|
||||
#define STM32L4_OTGFS_DIEPINT2_OFFSET 0x0948 /* Device endpoint-2 interrupt register */
|
||||
#define STM32L4_OTGFS_DIEPINT3_OFFSET 0x0968 /* Device endpoint-3 interrupt register */
|
||||
#define STM32L4_OTGFS_DIEPINT4_OFFSET 0x0988 /* Device endpoint-3 interrupt register */
|
||||
#define STM32L4_OTGFS_DIEPINT5_OFFSET 0x09a8 /* Device endpoint-3 interrupt register */
|
||||
|
||||
#define STM32L4_OTGFS_DIEPTSIZ_OFFSET(n) (0x910 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DIEPTSIZ0_OFFSET 0x0910 /* Device IN endpoint 0 transfer size register */
|
||||
#define STM32L4_OTGFS_DIEPTSIZ1_OFFSET 0x0930 /* Device IN endpoint 1 transfer size register */
|
||||
#define STM32L4_OTGFS_DIEPTSIZ2_OFFSET 0x0950 /* Device IN endpoint 2 transfer size register */
|
||||
#define STM32L4_OTGFS_DIEPTSIZ3_OFFSET 0x0970 /* Device IN endpoint 3 transfer size register */
|
||||
#define STM32L4_OTGFS_DIEPTSIZ4_OFFSET 0x0990 /* Device IN endpoint 3 transfer size register */
|
||||
#define STM32L4_OTGFS_DIEPTSIZ5_OFFSET 0x09b0 /* Device IN endpoint 3 transfer size register */
|
||||
|
||||
#define STM32L4_OTGFS_DTXFSTS_OFFSET(n) (0x0918 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DTXFSTS0_OFFSET 0x0918 /* Device OUT endpoint-0 TxFIFO status register */
|
||||
#define STM32L4_OTGFS_DTXFSTS1_OFFSET 0x0938 /* Device OUT endpoint-1 TxFIFO status register */
|
||||
#define STM32L4_OTGFS_DTXFSTS2_OFFSET 0x0958 /* Device OUT endpoint-2 TxFIFO status register */
|
||||
#define STM32L4_OTGFS_DTXFSTS3_OFFSET 0x0978 /* Device OUT endpoint-3 TxFIFO status register */
|
||||
#define STM32L4_OTGFS_DTXFSTS4_OFFSET 0x0998 /* Device OUT endpoint-3 TxFIFO status register */
|
||||
#define STM32L4_OTGFS_DTXFSTS5_OFFSET 0x09b8 /* Device OUT endpoint-3 TxFIFO status register */
|
||||
|
||||
#define STM32L4_OTGFS_DOEP_OFFSET(n) (0x0b00 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DOEPCTL_EPOFFSET 0x0000 /* Device control OUT endpoint 0 control register */
|
||||
@ -217,28 +140,10 @@
|
||||
#define STM32L4_OTGFS_DOEPTSIZ_EPOFFSET 0x0010 /* Device endpoint OUT transfer size register */
|
||||
|
||||
#define STM32L4_OTGFS_DOEPCTL_OFFSET(n) (0x0b00 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DOEPCTL0_OFFSET 0x00b00 /* Device OUT endpoint 0 control register */
|
||||
#define STM32L4_OTGFS_DOEPCTL1_OFFSET 0x00b20 /* Device OUT endpoint 1 control register */
|
||||
#define STM32L4_OTGFS_DOEPCTL2_OFFSET 0x00b40 /* Device OUT endpoint 2 control register */
|
||||
#define STM32L4_OTGFS_DOEPCTL3_OFFSET 0x00b60 /* Device OUT endpoint 3 control register */
|
||||
#define STM32L4_OTGFS_DOEPCTL4_OFFSET 0x00b80 /* Device OUT endpoint 4 control register */
|
||||
#define STM32L4_OTGFS_DOEPCTL5_OFFSET 0x00ba0 /* Device OUT endpoint 5 control register */
|
||||
|
||||
#define STM32L4_OTGFS_DOEPINT_OFFSET(n) (0x0b08 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DOEPINT0_OFFSET 0x00b08 /* Device endpoint-0 interrupt register */
|
||||
#define STM32L4_OTGFS_DOEPINT1_OFFSET 0x00b28 /* Device endpoint-1 interrupt register */
|
||||
#define STM32L4_OTGFS_DOEPINT2_OFFSET 0x00b48 /* Device endpoint-2 interrupt register */
|
||||
#define STM32L4_OTGFS_DOEPINT3_OFFSET 0x00b68 /* Device endpoint-3 interrupt register */
|
||||
#define STM32L4_OTGFS_DOEPINT4_OFFSET 0x00b88 /* Device endpoint-4 interrupt register */
|
||||
#define STM32L4_OTGFS_DOEPINT5_OFFSET 0x00ba8 /* Device endpoint-5 interrupt register */
|
||||
|
||||
#define STM32L4_OTGFS_DOEPTSIZ_OFFSET(n) (0x0b10 + ((n) << 5))
|
||||
#define STM32L4_OTGFS_DOEPTSIZ0_OFFSET 0x00b10 /* Device OUT endpoint-0 transfer size register */
|
||||
#define STM32L4_OTGFS_DOEPTSIZ1_OFFSET 0x00b30 /* Device OUT endpoint-1 transfer size register */
|
||||
#define STM32L4_OTGFS_DOEPTSIZ2_OFFSET 0x00b50 /* Device OUT endpoint-2 transfer size register */
|
||||
#define STM32L4_OTGFS_DOEPTSIZ3_OFFSET 0x00b70 /* Device OUT endpoint-3 transfer size register */
|
||||
#define STM32L4_OTGFS_DOEPTSIZ4_OFFSET 0x00b90 /* Device OUT endpoint-4 transfer size register */
|
||||
#define STM32L4_OTGFS_DOEPTSIZ5_OFFSET 0x00bb0 /* Device OUT endpoint-5 transfer size register */
|
||||
|
||||
/* Power and clock gating registers */
|
||||
|
||||
@ -249,24 +154,6 @@
|
||||
#define STM32L4_OTGFS_DFIFO_DEP_OFFSET(n) (0x1000 + ((n) << 12))
|
||||
#define STM32L4_OTGFS_DFIFO_HCH_OFFSET(n) (0x1000 + ((n) << 12))
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP0_OFFSET 0x1000 /* 0x1000-0x1ffc Device IN/OUT Endpoint 0 DFIFO Write/Read Access */
|
||||
#define STM32L4_OTGFS_DFIFO_HCH0_OFFSET 0x1000 /* 0x1000-0x1ffc Host OUT/IN Channel 0 DFIFO Read/Write Access */
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP1_OFFSET 0x2000 /* 0x2000-0x2ffc Device IN/OUT Endpoint 1 DFIFO Write/Read Access */
|
||||
#define STM32L4_OTGFS_DFIFO_HCH1_OFFSET 0x2000 /* 0x2000-0x2ffc Host OUT/IN Channel 1 DFIFO Read/Write Access */
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP2_OFFSET 0x3000 /* 0x3000-0x3ffc Device IN/OUT Endpoint 2 DFIFO Write/Read Access */
|
||||
#define STM32L4_OTGFS_DFIFO_HCH2_OFFSET 0x3000 /* 0x3000-0x3ffc Host OUT/IN Channel 2 DFIFO Read/Write Access */
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP3_OFFSET 0x4000 /* 0x4000-0x4ffc Device IN/OUT Endpoint 3 DFIFO Write/Read Access */
|
||||
#define STM32L4_OTGFS_DFIFO_HCH3_OFFSET 0x4000 /* 0x4000-0x4ffc Host OUT/IN Channel 3 DFIFO Read/Write Access */
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP4_OFFSET 0x5000 /* 0x5000-0x5ffc Device IN/OUT Endpoint 4 DFIFO Write/Read Access */
|
||||
#define STM32L4_OTGFS_DFIFO_HCH4_OFFSET 0x5000 /* 0x5000-0x5ffc Host OUT/IN Channel 4 DFIFO Read/Write Access */
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP5_OFFSET 0x6000 /* 0x6000-0x6ffc Device IN/OUT Endpoint 5 DFIFO Write/Read Access */
|
||||
#define STM32L4_OTGFS_DFIFO_HCH5_OFFSET 0x6000 /* 0x6000-0x6ffc Host OUT/IN Channel 5 DFIFO Read/Write Access */
|
||||
|
||||
/* Register Addresses *******************************************************************************/
|
||||
|
||||
#define STM32L4_OTGFS_GOTGCTL (STM32L4_OTGFS_BASE+STM32L4_OTGFS_GOTGCTL_OFFSET)
|
||||
@ -290,11 +177,6 @@
|
||||
#define STM32L4_OTGFS_HPTXFSIZ (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HPTXFSIZ_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DIEPTXF(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTXF_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DIEPTXF1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTXF1_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTXF2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTXF2_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTXF3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTXF3_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTXF4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTXF4_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTXF5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTXF5_OFFSET)
|
||||
|
||||
/* Host-mode control and status registers */
|
||||
|
||||
@ -309,60 +191,12 @@
|
||||
#define STM32L4_OTGFS_CHAN(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_CHAN_OFFSET(n))
|
||||
|
||||
#define STM32L4_OTGFS_HCCHAR(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR_OFFSET(n))
|
||||
#define STM32L4_OTGFS_HCCHAR0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR0_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR1_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR2_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR3_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR4_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR5_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR6 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR6_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR7 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR7_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR8 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR8_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR9 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR9_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR10 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR10_OFFSET)
|
||||
#define STM32L4_OTGFS_HCCHAR11 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCCHAR11_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_HCINT(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT_OFFSET(n))
|
||||
#define STM32L4_OTGFS_HCINT0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT0_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT1_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT2_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT3_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT4_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT5_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT6 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT6_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT7 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT7_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT8 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT8_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT9 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT9_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT10 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT10_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINT11 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINT11_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_HCINTMSK(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK_OFFSET(n))
|
||||
#define STM32L4_OTGFS_HCINTMSK0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK0_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK1_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK2_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK3_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK4_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK5_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK6 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK6_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK7 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK7_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK8 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK8_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK9 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK9_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK10 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK10_OFFSET)
|
||||
#define STM32L4_OTGFS_HCINTMSK11 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCINTMSK11_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_HCTSIZ(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ_OFFSET(n))
|
||||
#define STM32L4_OTGFS_HCTSIZ0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ0_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ1_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ2_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ3_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ4_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ5_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ6 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ6_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ7 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ7_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ8 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ8_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ9 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ9_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ10 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ10_OFFSET)
|
||||
#define STM32L4_OTGFS_HCTSIZ11 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_HCTSIZ11_OFFSET)
|
||||
|
||||
/* Device-mode control and status registers */
|
||||
|
||||
@ -380,62 +214,20 @@
|
||||
#define STM32L4_OTGFS_DIEP(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEP_OFFSET(n))
|
||||
|
||||
#define STM32L4_OTGFS_DIEPCTL(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPCTL_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DIEPCTL0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPCTL0_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPCTL1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPCTL1_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPCTL2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPCTL2_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPCTL3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPCTL3_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPCTL4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPCTL4_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPCTL5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPCTL5_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DIEPINT(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPINT_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DIEPINT0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPINT0_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPINT1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPINT1_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPINT2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPINT2_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPINT3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPINT3_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPINT4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPINT4_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPINT5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPINT5_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DIEPTSIZ(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTSIZ_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DIEPTSIZ0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTSIZ0_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTSIZ1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTSIZ1_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTSIZ2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTSIZ2_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTSIZ3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTSIZ3_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTSIZ4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTSIZ4_OFFSET)
|
||||
#define STM32L4_OTGFS_DIEPTSIZ5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DIEPTSIZ5_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DTXFSTS(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DTXFSTS_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DTXFSTS0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DTXFSTS0_OFFSET)
|
||||
#define STM32L4_OTGFS_DTXFSTS1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DTXFSTS1_OFFSET)
|
||||
#define STM32L4_OTGFS_DTXFSTS2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DTXFSTS2_OFFSET)
|
||||
#define STM32L4_OTGFS_DTXFSTS3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DTXFSTS3_OFFSET)
|
||||
#define STM32L4_OTGFS_DTXFSTS4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DTXFSTS4_OFFSET)
|
||||
#define STM32L4_OTGFS_DTXFSTS5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DTXFSTS5_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DOEP(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEP_OFFSET(n))
|
||||
|
||||
#define STM32L4_OTGFS_DOEPCTL(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPCTL_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DOEPCTL0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPCTL0_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPCTL1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPCTL1_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPCTL2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPCTL2_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPCTL3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPCTL3_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPCTL4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPCTL4_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPCTL5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPCTL5_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DOEPINT(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPINT_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DOEPINT0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPINT0_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPINT1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPINT1_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPINT2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPINT2_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPINT3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPINT3_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPINT4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPINT4_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPINT5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPINT5_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DOEPTSIZ(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPTSIZ_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DOEPTSIZ0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPTSIZ0_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPTSIZ1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPTSIZ1_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPTSIZ2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPTSIZ2_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPTSIZ3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPTSIZ3_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPTSIZ4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPTSIZ4_OFFSET)
|
||||
#define STM32L4_OTGFS_DOEPTSIZ5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DOEPTSIZ5_OFFSET)
|
||||
|
||||
/* Power and clock gating registers */
|
||||
|
||||
@ -446,23 +238,7 @@
|
||||
#define STM32L4_OTGFS_DFIFO_DEP(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_DEP_OFFSET(n))
|
||||
#define STM32L4_OTGFS_DFIFO_HCH(n) (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_HCH_OFFSET(n))
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_DEP0_OFFSET)
|
||||
#define STM32L4_OTGFS_DFIFO_HCH0 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_HCH0_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_DEP1_OFFSET)
|
||||
#define STM32L4_OTGFS_DFIFO_HCH1 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_HCH1_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_DEP2_OFFSET)
|
||||
#define STM32L4_OTGFS_DFIFO_HCH2 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_HCH2_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_DEP3_OFFSET)
|
||||
#define STM32L4_OTGFS_DFIFO_HCH3 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_HCH3_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_DEP4_OFFSET)
|
||||
#define STM32L4_OTGFS_DFIFO_HCH4 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_HCH4_OFFSET)
|
||||
|
||||
#define STM32L4_OTGFS_DFIFO_DEP5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_DEP5_OFFSET)
|
||||
#define STM32L4_OTGFS_DFIFO_HCH5 (STM32L4_OTGFS_BASE+STM32L4_OTGFS_DFIFO_HCH5_OFFSET)
|
||||
|
||||
/* Register Bitfield Definitions ********************************************************************/
|
||||
/* Core global control and status registers */
|
||||
@ -911,7 +687,7 @@
|
||||
#define OTGFS_DCTL_CGONAK (1 << 10) /* Bit 10: Clear global OUT NAK */
|
||||
#define OTGFS_DCTL_POPRGDNE (1 << 11) /* Bit 11: Power-on programming done */
|
||||
/* Bits 12-17: Reserved, must be kept at reset value */
|
||||
#define OTGFS_DCTL_DSBESLRJCT (1 << 18) /* Bit 18: XXX */
|
||||
#define OTGFS_DCTL_DSBESLRJCT (1 << 18) /* Bit 18: Deep sleep BESL reject */
|
||||
/* Bits 19-31: Reserved, must be kept at reset value */
|
||||
/* Device status register */
|
||||
|
||||
@ -939,9 +715,9 @@
|
||||
#define OTGFS_DIEPMSK_ITTXFEMSK (1 << 4) /* Bit 4: IN token received when TxFIFO empty mask */
|
||||
#define OTGFS_DIEPMSK_INEPNMM (1 << 5) /* Bit 5: IN token received with EP mismatch mask */
|
||||
#define OTGFS_DIEPMSK_INEPNEM (1 << 6) /* Bit 6: IN endpoint NAK effective mask */
|
||||
/* Bits 7-11: Reserved, must be kept at reset value */
|
||||
#define OTGFS_DIEPMSK_NAKM (1 << 12) /* Bit 12: XXX mask */
|
||||
/* Bits 13-31: Reserved, must be kept at reset value */
|
||||
/* Bits 7-12: Reserved, must be kept at reset value */
|
||||
#define OTGFS_DIEPMSK_NAKM (1 << 13) /* Bit 13: NAK interrupt mask */
|
||||
/* Bits 14-31: Reserved, must be kept at reset value */
|
||||
/* Device OUT endpoint common interrupt mask register */
|
||||
|
||||
#define OTGFS_DOEPMSK_XFRCM (1 << 0) /* Bit 0: Transfer completed interrupt mask */
|
||||
@ -1154,9 +930,9 @@
|
||||
#define OTGFS_PCGCCTL_GATEHCLK (1 << 1) /* Bit 1: Gate HCLK */
|
||||
/* Bits 2-3: Reserved, must be kept at reset value */
|
||||
#define OTGFS_PCGCCTL_PHYSUSP (1 << 4) /* Bit 4: PHY Suspended */
|
||||
#define OTGFS_PCGCCTL_ENL1GTG (1 << 5) /* Bit 5: XXX */
|
||||
#define OTGFS_PCGCCTL_PHYSLEEP (1 << 6) /* Bit 6: XXX */
|
||||
#define OTGFS_PCGCCTL_SUSP (1 << 7) /* Bit 7: XXX */
|
||||
#define OTGFS_PCGCCTL_ENL1GTG (1 << 5) /* Bit 5: Enable Sleep clock gating */
|
||||
#define OTGFS_PCGCCTL_PHYSLEEP (1 << 6) /* Bit 6: PHY in Sleep */
|
||||
#define OTGFS_PCGCCTL_SUSP (1 << 7) /* Bit 7: Deep Sleep */
|
||||
/* Bits 8-31: Reserved, must be kept at reset value */
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32L4_CHIP_STM32L4X6XX_OTGFS_H */
|
||||
|
@ -336,7 +336,7 @@
|
||||
|
||||
#define CONFIG_USB_DUMPBUFFER
|
||||
|
||||
#if !defined(CONFIG_DEBUG_INFO) || !defined(CONFIG_DEBUG_USB)
|
||||
#if !defined(CONFIG_DEBUG_INFO) || !defined(CONFIG_DEBUG_FEATURES)
|
||||
# undef CONFIG_USB_DUMPBUFFER
|
||||
#endif
|
||||
#ifdef CONFIG_USB_DUMPBUFFER
|
||||
@ -582,7 +582,7 @@ struct stm32l4_usbdev_s
|
||||
|
||||
/* Register operations ********************************************************/
|
||||
|
||||
#if defined(CONFIG_STM32L4_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG_USB)
|
||||
#if defined(CONFIG_STM32L4_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG_FEATURES)
|
||||
static uint32_t stm32l4_getreg(uint32_t addr);
|
||||
static void stm32l4_putreg(uint32_t val, uint32_t addr);
|
||||
#else
|
||||
@ -902,7 +902,7 @@ const struct trace_msg_t g_usb_trace_strings_intdecode[] =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_STM32L4_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG_USB)
|
||||
#if defined(CONFIG_STM32L4_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG_FEATURES)
|
||||
static uint32_t stm32l4_getreg(uint32_t addr)
|
||||
{
|
||||
static uint32_t prevaddr = 0;
|
||||
@ -923,7 +923,7 @@ static uint32_t stm32l4_getreg(uint32_t addr)
|
||||
{
|
||||
if (count == 4)
|
||||
{
|
||||
lldbg("...\n");
|
||||
uinfo("...\n");
|
||||
}
|
||||
|
||||
return val;
|
||||
@ -940,7 +940,7 @@ static uint32_t stm32l4_getreg(uint32_t addr)
|
||||
{
|
||||
/* Yes.. then show how many times the value repeated */
|
||||
|
||||
lldbg("[repeats %d more times]\n", count-3);
|
||||
uinfo("[repeats %d more times]\n", count-3);
|
||||
}
|
||||
|
||||
/* Save the new address, value, and count */
|
||||
@ -952,7 +952,7 @@ static uint32_t stm32l4_getreg(uint32_t addr)
|
||||
|
||||
/* Show the register value read */
|
||||
|
||||
lldbg("%08x->%08x\n", addr, val);
|
||||
uinfo("%08x->%08x\n", addr, val);
|
||||
return val;
|
||||
}
|
||||
#endif
|
||||
@ -965,12 +965,12 @@ static uint32_t stm32l4_getreg(uint32_t addr)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_STM32L4_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG_USB)
|
||||
#if defined(CONFIG_STM32L4_USBDEV_REGDEBUG) && defined(CONFIG_DEBUG_FEATURES)
|
||||
static void stm32l4_putreg(uint32_t val, uint32_t addr)
|
||||
{
|
||||
/* Show the register value being written */
|
||||
|
||||
lldbg("%08x<-%08x\n", addr, val);
|
||||
uinfo("%08x<-%08x\n", addr, val);
|
||||
|
||||
/* Write the value */
|
||||
|
||||
@ -1075,7 +1075,7 @@ static void stm32l4_ep0in_activate(void)
|
||||
|
||||
/* Set the max packet size of the IN EP. */
|
||||
|
||||
regval = stm32l4_getreg(STM32L4_OTGFS_DIEPCTL0);
|
||||
regval = stm32l4_getreg(STM32L4_OTGFS_DIEPCTL(0));
|
||||
regval &= ~OTGFS_DIEPCTL0_MPSIZ_MASK;
|
||||
|
||||
#if CONFIG_USBDEV_EP0_MAXSIZE == 8
|
||||
@ -1090,7 +1090,7 @@ static void stm32l4_ep0in_activate(void)
|
||||
# error "Unsupported value of CONFIG_USBDEV_EP0_MAXSIZE"
|
||||
#endif
|
||||
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPCTL0);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPCTL(0));
|
||||
|
||||
/* Clear global IN NAK */
|
||||
|
||||
@ -1116,13 +1116,13 @@ static void stm32l4_ep0out_ctrlsetup(FAR struct stm32l4_usbdev_s *priv)
|
||||
regval = (USB_SIZEOF_CTRLREQ * 3 << OTGFS_DOEPTSIZ0_XFRSIZ_SHIFT) |
|
||||
(OTGFS_DOEPTSIZ0_PKTCNT) |
|
||||
(3 << OTGFS_DOEPTSIZ0_STUPCNT_SHIFT);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DOEPTSIZ0);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DOEPTSIZ(0));
|
||||
|
||||
/* Then clear NAKing and enable the transfer */
|
||||
|
||||
regval = stm32l4_getreg(STM32L4_OTGFS_DOEPCTL0);
|
||||
regval = stm32l4_getreg(STM32L4_OTGFS_DOEPCTL(0));
|
||||
regval |= (OTGFS_DOEPCTL0_CNAK | OTGFS_DOEPCTL0_EPENA);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DOEPCTL0);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DOEPCTL(0));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -2416,8 +2416,6 @@ static inline void stm32l4_ep0out_stdrequest(struct stm32l4_usbdev_s *priv,
|
||||
|
||||
stm32l4_setaddress(priv, (uint16_t)priv->ctrlreq.value[0]);
|
||||
stm32l4_ep0in_transmitzlp(priv);
|
||||
|
||||
uinfo("USB_REQ_SETADDRESS %02x\n",(uint16_t)priv->ctrlreq.value[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2983,7 +2981,7 @@ static inline void stm32l4_epin_interrupt(FAR struct stm32l4_usbdev_s *priv)
|
||||
{
|
||||
if ((daint & 1) != 0)
|
||||
{
|
||||
uinfo("DIEPINT(%d) = %08x\n",
|
||||
uerr("DIEPINT(%d) = %08x\n",
|
||||
epno, stm32l4_getreg(STM32L4_OTGFS_DIEPINT(epno)));
|
||||
stm32l4_putreg(0xFF, STM32L4_OTGFS_DIEPINT(epno));
|
||||
}
|
||||
@ -3240,8 +3238,6 @@ static inline void stm32l4_rxinterrupt(FAR struct stm32l4_usbdev_s *priv)
|
||||
int bcnt;
|
||||
int epphy;
|
||||
|
||||
/* Disable the Rx status queue level interrupt */
|
||||
|
||||
while(0 != (stm32l4_getreg(STM32L4_OTGFS_GINTSTS) & OTGFS_GINT_RXFLVL))
|
||||
{
|
||||
|
||||
@ -3325,21 +3321,10 @@ static inline void stm32l4_rxinterrupt(FAR struct stm32l4_usbdev_s *priv)
|
||||
{
|
||||
usbtrace(TRACE_INTDECODE(STM32L4_TRACEINTID_SETUPDONE), epphy);
|
||||
|
||||
/* Now that the Setup Phase is complete if it was an OUT enable
|
||||
* the endpoint
|
||||
* (Doing this here prevents the loss of the first FIFO word)
|
||||
/* On the L4 This event does not occur on the next SETUP
|
||||
* after a SETUP OUT.
|
||||
*/
|
||||
|
||||
if (priv->ep0state == EP0STATE_SETUP_OUT)
|
||||
{
|
||||
|
||||
/* Clear NAKSTS so that we can receive the data */
|
||||
|
||||
regval = stm32l4_getreg(STM32L4_OTGFS_DOEPCTL0);
|
||||
regval |= OTGFS_DOEPCTL0_CNAK;
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DOEPCTL0);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3375,17 +3360,23 @@ static inline void stm32l4_rxinterrupt(FAR struct stm32l4_usbdev_s *priv)
|
||||
datlen = GETUINT16(priv->ctrlreq.len);
|
||||
if (USB_REQ_ISOUT(priv->ctrlreq.type) && datlen > 0)
|
||||
{
|
||||
/* Reset the endpoint and Stop NAK-ing */
|
||||
|
||||
stm32l4_ep0out_ctrlsetup(priv);
|
||||
|
||||
/* Wait for the data phase. */
|
||||
|
||||
priv->ep0state = EP0STATE_SETUP_OUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We can process the setup data as soon as SETUP done word is
|
||||
* popped of the RxFIFO.
|
||||
/* We can process the setup data Now no need to wait for SETUP done word
|
||||
* to be popped of the RxFIFO.
|
||||
*/
|
||||
|
||||
priv->ep0state = EP0STATE_SETUP_READY;
|
||||
stm32l4_ep0out_setup(priv);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -3642,7 +3633,7 @@ static int stm32l4_usbinterrupt(int irq, FAR void *context)
|
||||
uint32_t regval;
|
||||
uint32_t reserved;
|
||||
|
||||
usbtrace(TRACE_INTENTRY(STM32L4_TRACEINTID_USB), 0);
|
||||
usbtrace(TRACE_INTENTRY(STM32L4_TRACEINTID_USB), priv->ep0state);
|
||||
|
||||
/* Assure that we are in device mode */
|
||||
|
||||
@ -3699,7 +3690,7 @@ static int stm32l4_usbinterrupt(int irq, FAR void *context)
|
||||
|
||||
/* Host/device mode mismatch error interrupt */
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if ((regval & OTGFS_GINT_MMIS) != 0)
|
||||
{
|
||||
usbtrace(TRACE_INTDECODE(STM32L4_TRACEINTID_MISMATCH), (uint16_t)regval);
|
||||
@ -3750,7 +3741,7 @@ static int stm32l4_usbinterrupt(int irq, FAR void *context)
|
||||
/* Perform the device reset */
|
||||
|
||||
stm32l4_usbreset(priv);
|
||||
usbtrace(TRACE_INTEXIT(STM32L4_TRACEINTID_USB), 0);
|
||||
usbtrace(TRACE_INTEXIT(STM32L4_TRACEINTID_USB), priv->ep0state);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -3811,7 +3802,7 @@ static int stm32l4_usbinterrupt(int irq, FAR void *context)
|
||||
#endif
|
||||
}
|
||||
|
||||
usbtrace(TRACE_INTEXIT(STM32L4_TRACEINTID_USB), 0);
|
||||
usbtrace(TRACE_INTEXIT(STM32L4_TRACEINTID_USB), priv->ep0state);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -4317,7 +4308,7 @@ static int stm32l4_ep_disable(FAR struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct stm32l4_ep_s *privep = (FAR struct stm32l4_ep_s *)ep;
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -4357,7 +4348,7 @@ static FAR struct usbdev_req_s *stm32l4_ep_allocreq(FAR struct usbdev_ep_s *ep)
|
||||
{
|
||||
FAR struct stm32l4_req_s *privreq;
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -4390,7 +4381,7 @@ static void stm32l4_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req
|
||||
{
|
||||
FAR struct stm32l4_req_s *privreq = (FAR struct stm32l4_req_s *)req;
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep || !req)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -4463,7 +4454,7 @@ static int stm32l4_ep_submit(FAR struct usbdev_ep_s *ep,
|
||||
|
||||
/* Some sanity checking */
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!req || !req->callback || !req->buf || !ep)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -4475,7 +4466,7 @@ static int stm32l4_ep_submit(FAR struct usbdev_ep_s *ep,
|
||||
usbtrace(TRACE_EPSUBMIT, privep->epphy);
|
||||
priv = privep->dev;
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!priv->driver)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_NOTCONFIGURED), priv->usbdev.speed);
|
||||
@ -4553,7 +4544,7 @@ static int stm32l4_ep_cancel(FAR struct usbdev_ep_s *ep,
|
||||
FAR struct stm32l4_ep_s *privep = (FAR struct stm32l4_ep_s *)ep;
|
||||
irqstate_t flags;
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!ep || !req)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -5012,7 +5003,7 @@ static int stm32l4_selfpowered(struct usbdev_s *dev, bool selfpowered)
|
||||
|
||||
usbtrace(TRACE_DEVSELFPOWERED, (uint16_t)selfpowered);
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!dev)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_INVALIDPARMS), 0);
|
||||
@ -5366,7 +5357,7 @@ static void stm32l4_hwinitialize(FAR struct stm32l4_usbdev_s *priv)
|
||||
address = STM32L4_RXFIFO_WORDS;
|
||||
regval = (address << OTGFS_DIEPTXF0_TX0FD_SHIFT) |
|
||||
(STM32L4_EP0_TXFIFO_WORDS << OTGFS_DIEPTXF0_TX0FSA_SHIFT);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF0);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF(0));
|
||||
#endif
|
||||
|
||||
#if STM32L4_NENDPOINTS > 1
|
||||
@ -5375,7 +5366,7 @@ static void stm32l4_hwinitialize(FAR struct stm32l4_usbdev_s *priv)
|
||||
address += STM32L4_EP0_TXFIFO_WORDS;
|
||||
regval = (address << OTGFS_DIEPTXF_INEPTXSA_SHIFT) |
|
||||
(STM32L4_EP1_TXFIFO_WORDS << OTGFS_DIEPTXF_INEPTXFD_SHIFT);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF1);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF(1));
|
||||
#endif
|
||||
|
||||
#if STM32L4_NENDPOINTS > 2
|
||||
@ -5384,7 +5375,7 @@ static void stm32l4_hwinitialize(FAR struct stm32l4_usbdev_s *priv)
|
||||
address += STM32L4_EP1_TXFIFO_WORDS;
|
||||
regval = (address << OTGFS_DIEPTXF_INEPTXSA_SHIFT) |
|
||||
(STM32L4_EP2_TXFIFO_WORDS << OTGFS_DIEPTXF_INEPTXFD_SHIFT);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF2);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF(2));
|
||||
#endif
|
||||
|
||||
#if STM32L4_NENDPOINTS > 3
|
||||
@ -5393,7 +5384,7 @@ static void stm32l4_hwinitialize(FAR struct stm32l4_usbdev_s *priv)
|
||||
address += STM32L4_EP2_TXFIFO_WORDS;
|
||||
regval = (address << OTGFS_DIEPTXF_INEPTXSA_SHIFT) |
|
||||
(STM32L4_EP3_TXFIFO_WORDS << OTGFS_DIEPTXF_INEPTXFD_SHIFT);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF3);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF(3));
|
||||
#endif
|
||||
|
||||
#if STM32L4_NENDPOINTS > 4
|
||||
@ -5402,7 +5393,7 @@ static void stm32l4_hwinitialize(FAR struct stm32l4_usbdev_s *priv)
|
||||
address += STM32L4_EP3_TXFIFO_WORDS;
|
||||
regval = (address << OTGFS_DIEPTXF_INEPTXSA_SHIFT) |
|
||||
(STM32L4_EP4_TXFIFO_WORDS << OTGFS_DIEPTXF_INEPTXFD_SHIFT);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF4);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF(4));
|
||||
#endif
|
||||
|
||||
#if STM32L4_NENDPOINTS > 5
|
||||
@ -5411,7 +5402,7 @@ static void stm32l4_hwinitialize(FAR struct stm32l4_usbdev_s *priv)
|
||||
address += STM32L4_EP4_TXFIFO_WORDS;
|
||||
regval = (address << OTGFS_DIEPTXF_INEPTXSA_SHIFT) |
|
||||
(STM32L4_EP5_TXFIFO_WORDS << OTGFS_DIEPTXF_INEPTXFD_SHIFT);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF5);
|
||||
stm32l4_putreg(regval, STM32L4_OTGFS_DIEPTXF(5));
|
||||
#endif
|
||||
|
||||
|
||||
@ -5501,7 +5492,7 @@ static void stm32l4_hwinitialize(FAR struct stm32l4_usbdev_s *priv)
|
||||
regval |= (OTGFS_GINT_OTG | OTGFS_GINT_SRQ);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
regval |= OTGFS_GINT_MMIS;
|
||||
#endif
|
||||
|
||||
@ -5709,7 +5700,7 @@ int usbdev_register(struct usbdevclass_driver_s *driver)
|
||||
|
||||
usbtrace(TRACE_DEVREGISTER, 0);
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!driver || !driver->ops->bind || !driver->ops->unbind ||
|
||||
!driver->ops->disconnect || !driver->ops->setup)
|
||||
{
|
||||
@ -5780,7 +5771,7 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
|
||||
|
||||
usbtrace(TRACE_DEVUNREGISTER, 0);
|
||||
|
||||
#ifdef CONFIG_DEBUG_USB
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (driver != priv->driver)
|
||||
{
|
||||
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_INVALIDPARMS), 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user