summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-04-15 08:49:33 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-04-15 08:49:33 -0600
commit19b828c29a0ab876c85dbfed95689cba4c747bcf (patch)
tree20c5410a06008a69cec40e5d8c3b053909119f40 /nuttx/arch
parentd7801fc81490541ed55f94364085faf1595e58d7 (diff)
downloadpx4-nuttx-19b828c29a0ab876c85dbfed95689cba4c747bcf.tar.gz
px4-nuttx-19b828c29a0ab876c85dbfed95689cba4c747bcf.tar.bz2
px4-nuttx-19b828c29a0ab876c85dbfed95689cba4c747bcf.zip
Updates to the STM32 OTGFS host logic from Leo
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/arm/src/stm32/chip/stm32_otgfs.h5
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_otgfshost.c29
-rwxr-xr-xnuttx/arch/arm/src/stm32/stm32_usbhost.c2
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_usbhost.h2
4 files changed, 17 insertions, 21 deletions
diff --git a/nuttx/arch/arm/src/stm32/chip/stm32_otgfs.h b/nuttx/arch/arm/src/stm32/chip/stm32_otgfs.h
index b9ec9cfa8..d38989706 100644
--- a/nuttx/arch/arm/src/stm32/chip/stm32_otgfs.h
+++ b/nuttx/arch/arm/src/stm32/chip/stm32_otgfs.h
@@ -1,7 +1,7 @@
/****************************************************************************************************
* arch/arm/src/stm32/chip/stm32_otgfs.h
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -485,7 +485,8 @@
#define OTGFS_GINT_IEP (1 << 18) /* Bit 18: IN endpoint interrupt */
#define OTGFS_GINT_OEP (1 << 19) /* Bit 19: OUT endpoint interrupt */
#define OTGFS_GINT_IISOIXFR (1 << 20) /* Bit 20: Incomplete isochronous IN transfer */
-#define OTGFS_GINT_IISOOXFR (1 << 21) /* Bit 21: Incomplete isochronous OUT transfer */
+#define OTGFS_GINT_IISOOXFR (1 << 21) /* Bit 21: Incomplete isochronous OUT transfer (device) */
+#define OTGFS_GINT_IPXFR (1 << 21) /* Bit 21: Incomplete periodic transfer (host) */
/* Bits 22-23: Reserved, must be kept at reset value */
#define OTGFS_GINT_HPRT (1 << 24) /* Bit 24: Host port interrupt */
#define OTGFS_GINT_HC (1 << 25) /* Bit 25: Host channels interrupt */
diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
index e43e246a0..60733375d 100644
--- a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
+++ b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
@@ -135,11 +135,6 @@
# undef CONFIG_STM32_USBHOST_PKTDUMP
#endif
-#undef HAVE_USB_TRACE
-#if defined(CONFIG_USBHOST_TRACE) || (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB))
-# define HAVE_USB_TRACE 1
-#endif
-
/* HCD Setup *******************************************************************/
/* Hardware capabilities */
@@ -356,7 +351,7 @@ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv);
static inline void stm32_gint_hcisr(FAR struct stm32_usbhost_s *priv);
static inline void stm32_gint_hprtisr(FAR struct stm32_usbhost_s *priv);
static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv);
-static inline void stm32_gint_iisooxfrisr(FAR struct stm32_usbhost_s *priv);
+static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv);
/* First level, global interrupt handler */
@@ -726,7 +721,7 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx)
case OTGFS_EPTYPE_CTRL:
case OTGFS_EPTYPE_BULK:
{
-#ifdef HAVE_USB_TRACE
+#ifdef HAVE_USBHOST_TRACE_VERBOSE
uint16_t intrace;
uint16_t outtrace;
@@ -779,7 +774,7 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx)
priv->chan[chidx].epno);
regval |= OTGFS_HCINT_BBERR;
}
-#ifdef HAVE_USB_TRACE
+#ifdef HAVE_USBHOST_TRACE_VERBOSE
else
{
usbhost_vtrace2(OTGFS_VTRACE2_CHANCONF_INTR_OUT, chidx,
@@ -803,7 +798,7 @@ static void stm32_chan_configure(FAR struct stm32_usbhost_s *priv, int chidx)
priv->chan[chidx].epno);
regval |= (OTGFS_HCINT_TXERR | OTGFS_HCINT_BBERR);
}
-#ifdef HAVE_USB_TRACE
+#ifdef HAVE_USBHOST_TRACE_VERBOSE
else
{
usbhost_vtrace2(OTGFS_VTRACE2_CHANCONF_ISOC_OUT, chidx,
@@ -2781,14 +2776,14 @@ static inline void stm32_gint_discisr(FAR struct stm32_usbhost_s *priv)
}
/*******************************************************************************
- * Name: stm32_gint_iisooxfrisr
+ * Name: stm32_gint_ipxfrisr
*
* Description:
- * USB OTG FS incomplete isochronous interrupt handler
+ * USB OTG FS incomplete periodic interrupt handler
*
*******************************************************************************/
-static inline void stm32_gint_iisooxfrisr(FAR struct stm32_usbhost_s *priv)
+static inline void stm32_gint_ipxfrisr(FAR struct stm32_usbhost_s *priv)
{
uint32_t regval;
@@ -2802,7 +2797,7 @@ static inline void stm32_gint_iisooxfrisr(FAR struct stm32_usbhost_s *priv)
/* Clear the incomplete isochronous OUT interrupt */
- stm32_putreg(STM32_OTGFS_GINTSTS, OTGFS_GINT_IISOOXFR);
+ stm32_putreg(STM32_OTGFS_GINTSTS, OTGFS_GINT_IPXFR);
}
/*******************************************************************************
@@ -2911,12 +2906,12 @@ static int stm32_gint_isr(int irq, FAR void *context)
stm32_gint_discisr(priv);
}
- /* Handle the incomplete isochronous OUT transfer */
+ /* Handle the incomplete periodic transfer */
- if ((pending & OTGFS_GINT_IISOOXFR) != 0)
+ if ((pending & OTGFS_GINT_IPXFR) != 0)
{
usbhost_vtrace1(OTGFS_VTRACE1_GINT_IISOOXFR, 0);
- stm32_gint_iisooxfrisr(priv);
+ stm32_gint_ipxfrisr(priv);
}
}
@@ -3025,7 +3020,7 @@ static inline void stm32_hostinit_enable(void)
regval |= (OTGFS_GINT_SOF | OTGFS_GINT_RXFLVL | OTGFS_GINT_IISOOXFR |
OTGFS_GINT_HPRT | OTGFS_GINT_HC | OTGFS_GINT_DISC);
#else
- regval |= (OTGFS_GINT_RXFLVL | OTGFS_GINT_IISOOXFR | OTGFS_GINT_HPRT |
+ regval |= (OTGFS_GINT_RXFLVL | OTGFS_GINT_IPXFR | OTGFS_GINT_HPRT |
OTGFS_GINT_HC | OTGFS_GINT_DISC);
#endif
stm32_putreg(STM32_OTGFS_GINTMSK, regval);
diff --git a/nuttx/arch/arm/src/stm32/stm32_usbhost.c b/nuttx/arch/arm/src/stm32/stm32_usbhost.c
index 9f1f0f7ec..088fe3794 100755
--- a/nuttx/arch/arm/src/stm32/stm32_usbhost.c
+++ b/nuttx/arch/arm/src/stm32/stm32_usbhost.c
@@ -102,7 +102,7 @@ static const struct stm32_usbhost_trace_s g_trace1[TRACE1_NSTRINGS] =
TRENTRY(OTGFS_VTRACE1_GINT_HC, TR_FMT1, "OTGFS Handle the host channels interrupt.\n"),
TRENTRY(OTGFS_VTRACE1_GINT_HPRT, TR_FMT1, "OTGFS Handle the host port interrupt.\n"),
TRENTRY(OTGFS_VTRACE1_GINT_DISC, TR_FMT1, "OTGFS Handle the disconnect detected interrupt.\n"),
- TRENTRY(OTGFS_VTRACE1_GINT_IISOOXFR, TR_FMT1, "OTGFS Handle the incomplete isochronous OUT transfer.\n"),
+ TRENTRY(OTGFS_VTRACE1_GINT_IPXFR, TR_FMT1, "OTGFS Handle the incomplete periodic transfer.\n"),
# endif
#endif
diff --git a/nuttx/arch/arm/src/stm32/stm32_usbhost.h b/nuttx/arch/arm/src/stm32/stm32_usbhost.h
index 553a0d3ba..30df7ada6 100644
--- a/nuttx/arch/arm/src/stm32/stm32_usbhost.h
+++ b/nuttx/arch/arm/src/stm32/stm32_usbhost.h
@@ -75,7 +75,7 @@ enum usbhost_trace1codes_e
OTGFS_VTRACE1_GINT_HC, /* OTGFS Handle the host channels interrupt */
OTGFS_VTRACE1_GINT_HPRT, /* OTGFS Handle the host port interrupt */
OTGFS_VTRACE1_GINT_DISC, /* OTGFS Handle the disconnect detected interrupt */
- OTGFS_VTRACE1_GINT_IISOOXFR, /* OTGFS Handle the incomplete isochronous OUT transfer */
+ OTGFS_VTRACE1_GINT_IPXFR, /* OTGFS Handle the incomplete periodic transfer */
# endif
#endif