diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-27 10:47:03 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-27 10:47:03 -0600 |
commit | 995317acc23b22d72562d72dadf2cee0a6aeba5e (patch) | |
tree | 885d7eb7fc487c2cb325ffb7f6587d4c4bafe22e /nuttx | |
parent | 00d8ac3ba4966f96483d6d971aba88ffd97bb3d4 (diff) | |
download | px4-nuttx-995317acc23b22d72562d72dadf2cee0a6aeba5e.tar.gz px4-nuttx-995317acc23b22d72562d72dadf2cee0a6aeba5e.tar.bz2 px4-nuttx-995317acc23b22d72562d72dadf2cee0a6aeba5e.zip |
SAMV7 Ethernet+USB Updates
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/arch/arm/src/samv7/sam_emac.c | 5 | ||||
-rw-r--r-- | nuttx/arch/arm/src/samv7/sam_usbdevhs.c | 15 | ||||
-rw-r--r-- | nuttx/configs/samv71-xult/README.txt | 26 |
3 files changed, 34 insertions, 12 deletions
diff --git a/nuttx/arch/arm/src/samv7/sam_emac.c b/nuttx/arch/arm/src/samv7/sam_emac.c index f1955f14c..4a34bb6d8 100644 --- a/nuttx/arch/arm/src/samv7/sam_emac.c +++ b/nuttx/arch/arm/src/samv7/sam_emac.c @@ -1041,7 +1041,7 @@ static int sam_buffer_allocate(struct sam_emac_s *priv) priv->xfrq[0].txdesc = priv->attr->tx0desc; priv->xfrq[0].ntxbuffers = priv->attr->ntxbuffers; priv->xfrq[0].rxdesc = priv->attr->rx0desc; - priv->xfrq[0].nrxbuffers = priv->attr->rtxbuffers; + priv->xfrq[0].nrxbuffers = priv->attr->nrxbuffers; priv->xfrq[0].txbuffer = priv->attr->tx0buffer; priv->xfrq[0].txbufsize = EMAC_TX_UNITSIZE; @@ -1602,7 +1602,7 @@ static int sam_recvframe(struct sam_emac_s *priv, int qid) { if (rxndx == priv->xfrq[qid].rxndx) { - nllvdbg("ERROR: No EOF (Invalid of buffers too small)\n"); + nllvdbg("ERROR: No EOF (Invalid or buffers too small)\n"); do { /* Give ownership back to the EMAC */ @@ -1624,6 +1624,7 @@ static int sam_recvframe(struct sam_emac_s *priv, int qid) } } while (rxndx != priv->xfrq[qid].rxndx); + return -EIO; } diff --git a/nuttx/arch/arm/src/samv7/sam_usbdevhs.c b/nuttx/arch/arm/src/samv7/sam_usbdevhs.c index 7dc7c9a1b..a957b3fa2 100644 --- a/nuttx/arch/arm/src/samv7/sam_usbdevhs.c +++ b/nuttx/arch/arm/src/samv7/sam_usbdevhs.c @@ -4209,7 +4209,7 @@ static int sam_pullup(FAR struct usbdev_s *dev, bool enable) { /* DETACH=1: USBHS is detached, UTMI transceiver is suspended. */ - regval = sam_getreg(SAM_USBHS_DEVCTRL); + regval = sam_getreg(SAM_USBHS_DEVCTRL); regval |= USBHS_DEVCTRL_DETACH; sam_putreg(regval, SAM_USBHS_DEVCTRL); @@ -4533,13 +4533,20 @@ static void sam_hw_shutdown(struct sam_usbdev_s *priv) sam_putreg(USBHS_DEVINT_ALL, SAM_USBHS_DEVICR); - /* Disconnect the device */ + /* DETACH=1: USBHS is detached, UTMI transceiver is suspended. */ - sam_pullup(&priv->usbdev, false); + regval = sam_getreg(SAM_USBHS_DEVCTRL); + regval |= USBHS_DEVCTRL_DETACH; + sam_putreg(regval, SAM_USBHS_DEVCTRL); + + /* Freeze clocking */ + + regval = sam_getreg(SAM_USBHS_CTRL); + regval |= USBHS_CTRL_FRZCLK; + sam_putreg(regval, SAM_USBHS_CTRL); /* Disable USB hardware */ - regval = sam_getreg(SAM_USBHS_CTRL); regval &= ~USBHS_CTRL_USBE; sam_putreg(regval, SAM_USBHS_CTRL); diff --git a/nuttx/configs/samv71-xult/README.txt b/nuttx/configs/samv71-xult/README.txt index a52fe1ee1..6870cbefa 100644 --- a/nuttx/configs/samv71-xult/README.txt +++ b/nuttx/configs/samv71-xult/README.txt @@ -83,15 +83,25 @@ The BASIC nsh configuration is fully function (as desribed below under (of course with appropriate mounting and unmounting). I all not sure of this and need to do more testing to characterize if the issue. - 5. There is not yet any support for the following board features: QSPI, USB, - EMAC, AT24, or WM8904 nor for any non-board features). Most of these - drivers will port easily from either the SAM3/4 or from the SAMA5Dx. + 5. There is not yet any support for the following board features: QSPI or WM8904. + Many drivers will port easily from either the SAM3/4 or from the SAMA5Dx. So there is still plenty to be done. 6. There has been a quick'n'dirty port of the SAMA5D4-EK Ethernet logic - for the SAMV71-XULT. There are still some cache-related issues to - be verified. No testing has yet been performed and so the driver should - be considered non-functional. + for the SAMV71-XULT. It does not work properly. Data on the line + appears to be corrupted, probably at the level of the PHY. + + 7. The USBHS device controller driver (DCD) is complete but non-functional. + At this point, work has stopped because I am stuck. The problem is that + bus events are not occurring: Nothing is detected by the USBHS when the + host is connected; no activity is seen on the bus by a USB analyzer when + the host is connected. Possibilities: (1) the pullups on DM and DP are + not working. This would prevent the host from detecting the presence of + the device. the DETACH bit is, however, being correctly cleared or (2) + some issue with clocking or configuration of the UTMI. I see nothing + wrong this this case. I have done extensive comparison of the Atmel + sample code and study of the data sheet, but I have not found the key to + solving this. Serial Console ============== @@ -926,3 +936,7 @@ Configuration sub-directories # CONFIG_ARMV7M_ITCM is not set : Support not yet in place # CONFIG_ARMV7M_DTCM is not set : Support not yet in place + + Stack sizes are also large to simplify the bring-up and should be + tuned for better memory usages. + |