Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/dwc2/dist Fix non-USB_DEBUG (and non-DWC2_D...
details: https://anonhg.NetBSD.org/src/rev/56687d0d6fb8
branches: trunk
changeset: 327923:56687d0d6fb8
user: skrll <skrll%NetBSD.org@localhost>
date: Fri Mar 21 09:19:10 2014 +0000
description:
Fix non-USB_DEBUG (and non-DWC2_DEBUG) build
diffstat:
sys/external/bsd/dwc2/dist/dwc2_core.c | 13 ++++-----
sys/external/bsd/dwc2/dist/dwc2_coreintr.c | 10 ++++---
sys/external/bsd/dwc2/dist/dwc2_hcd.c | 32 +++++++++++--------------
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c | 37 ++++++++++++-----------------
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c | 8 ++++--
5 files changed, 47 insertions(+), 53 deletions(-)
diffs (truncated from 355 to 300 lines):
diff -r 0fbaa133021d -r 56687d0d6fb8 sys/external/bsd/dwc2/dist/dwc2_core.c
--- a/sys/external/bsd/dwc2/dist/dwc2_core.c Fri Mar 21 02:25:05 2014 +0000
+++ b/sys/external/bsd/dwc2/dist/dwc2_core.c Fri Mar 21 09:19:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc2_core.c,v 1.4 2013/10/05 06:51:43 skrll Exp $ */
+/* $NetBSD: dwc2_core.c,v 1.5 2014/03/21 09:19:10 skrll Exp $ */
/*
* core.c - DesignWare HS OTG Controller common routines
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2_core.c,v 1.4 2013/10/05 06:51:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_core.c,v 1.5 2014/03/21 09:19:10 skrll Exp $");
#include <sys/types.h>
#include <sys/bus.h>
@@ -1695,7 +1695,7 @@
*/
void dwc2_dump_host_registers(struct dwc2_hsotg *hsotg)
{
-#ifdef DEBUG
+#ifdef DWC2_DEBUG
bus_size_t addr;
int i;
@@ -1767,7 +1767,7 @@
*/
void dwc2_dump_global_registers(struct dwc2_hsotg *hsotg)
{
-#ifdef DEBUG
+#ifdef DWC2_DEBUG
bus_size_t addr;
dev_dbg(hsotg->dev, "Core Global Registers\n");
@@ -2585,7 +2585,7 @@
{
struct dwc2_hw_params *hw = &hsotg->hw_params;
unsigned width;
- u32 hwcfg1, hwcfg2, hwcfg3, hwcfg4;
+ u32 hwcfg2, hwcfg3, hwcfg4;
u32 hptxfsiz, grxfsiz, gnptxfsiz;
u32 gusbcfg;
@@ -2607,14 +2607,13 @@
hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf,
hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid);
- hwcfg1 = DWC2_READ_4(hsotg, GHWCFG1);
hwcfg2 = DWC2_READ_4(hsotg, GHWCFG2);
hwcfg3 = DWC2_READ_4(hsotg, GHWCFG3);
hwcfg4 = DWC2_READ_4(hsotg, GHWCFG4);
gnptxfsiz = DWC2_READ_4(hsotg, GNPTXFSIZ);
grxfsiz = DWC2_READ_4(hsotg, GRXFSIZ);
- dev_dbg(hsotg->dev, "hwcfg1=%08x\n", hwcfg1);
+ dev_dbg(hsotg->dev, "hwcfg1=%08x\n", DWC2_READ_4(hsotg, GHWCFG1));
dev_dbg(hsotg->dev, "hwcfg2=%08x\n", hwcfg2);
dev_dbg(hsotg->dev, "hwcfg3=%08x\n", hwcfg3);
dev_dbg(hsotg->dev, "hwcfg4=%08x\n", hwcfg4);
diff -r 0fbaa133021d -r 56687d0d6fb8 sys/external/bsd/dwc2/dist/dwc2_coreintr.c
--- a/sys/external/bsd/dwc2/dist/dwc2_coreintr.c Fri Mar 21 02:25:05 2014 +0000
+++ b/sys/external/bsd/dwc2/dist/dwc2_coreintr.c Fri Mar 21 09:19:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc2_coreintr.c,v 1.5 2013/10/05 06:51:43 skrll Exp $ */
+/* $NetBSD: dwc2_coreintr.c,v 1.6 2014/03/21 09:19:10 skrll Exp $ */
/*
* core_intr.c - DesignWare HS OTG Controller common interrupt handling
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2_coreintr.c,v 1.5 2013/10/05 06:51:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_coreintr.c,v 1.6 2014/03/21 09:19:10 skrll Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -379,11 +379,12 @@
*/
static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
{
- u32 dsts;
-
dev_dbg(hsotg->dev, "USB SUSPEND\n");
if (dwc2_is_device_mode(hsotg)) {
+#ifdef DWC2_DEBUG
+ u32 dsts;
+
/*
* Check the Device status register to determine if the Suspend
* state is active
@@ -394,6 +395,7 @@
"DSTS.Suspend Status=%d HWCFG4.Power Optimize=%d\n",
!!(dsts & DSTS_SUSPSTS),
hsotg->hw_params.power_optimized);
+#endif
} else {
if (hsotg->op_state == OTG_STATE_A_PERIPHERAL) {
dev_dbg(hsotg->dev, "a_peripheral->a_host\n");
diff -r 0fbaa133021d -r 56687d0d6fb8 sys/external/bsd/dwc2/dist/dwc2_hcd.c
--- a/sys/external/bsd/dwc2/dist/dwc2_hcd.c Fri Mar 21 02:25:05 2014 +0000
+++ b/sys/external/bsd/dwc2/dist/dwc2_hcd.c Fri Mar 21 09:19:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc2_hcd.c,v 1.10 2014/01/02 15:54:10 skrll Exp $ */
+/* $NetBSD: dwc2_hcd.c,v 1.11 2014/03/21 09:19:10 skrll Exp $ */
/*
* hcd.c - DesignWare HS OTG Controller host-mode routines
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.10 2014/01/02 15:54:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcd.c,v 1.11 2014/03/21 09:19:10 skrll Exp $");
#include <sys/types.h>
#include <sys/kmem.h>
@@ -1795,7 +1795,7 @@
*/
void dwc2_hcd_dump_state(struct dwc2_hsotg *hsotg)
{
-#ifdef DEBUG
+#ifdef DWC2_DEBUG
struct dwc2_host_chan *chan;
struct dwc2_hcd_urb *urb;
struct dwc2_qtd *qtd;
@@ -1845,18 +1845,16 @@
dev_dbg(hsotg->dev, " qh: %p\n", chan->qh);
if (chan->xfer_started) {
- u32 hfnum, hcchar, hctsiz, hcint, hcintmsk;
-
- hfnum = DWC2_READ_4(hsotg, HFNUM);
- hcchar = DWC2_READ_4(hsotg, HCCHAR(i));
- hctsiz = DWC2_READ_4(hsotg, HCTSIZ(i));
- hcint = DWC2_READ_4(hsotg, HCINT(i));
- hcintmsk = DWC2_READ_4(hsotg, HCINTMSK(i));
- dev_dbg(hsotg->dev, " hfnum: 0x%08x\n", hfnum);
- dev_dbg(hsotg->dev, " hcchar: 0x%08x\n", hcchar);
- dev_dbg(hsotg->dev, " hctsiz: 0x%08x\n", hctsiz);
- dev_dbg(hsotg->dev, " hcint: 0x%08x\n", hcint);
- dev_dbg(hsotg->dev, " hcintmsk: 0x%08x\n", hcintmsk);
+ dev_dbg(hsotg->dev, " hfnum: 0x%08x\n",
+ DWC2_READ_4(hsotg, HFNUM));
+ dev_dbg(hsotg->dev, " hcchar: 0x%08x\n",
+ DWC2_READ_4(hsotg, HCCHAR(i)));
+ dev_dbg(hsotg->dev, " hctsiz: 0x%08x\n",
+ DWC2_READ_4(hsotg, HCTSIZ(i)));
+ dev_dbg(hsotg->dev, " hcint: 0x%08x\n",
+ DWC2_READ_4(hsotg, HCINT(i)));
+ dev_dbg(hsotg->dev, " hcintmsk: 0x%08x\n",
+ DWC2_READ_4(hsotg, HCINTMSK(i)));
}
if (!(chan->xfer_started && chan->qh))
@@ -2152,7 +2150,6 @@
const struct dwc2_core_params *params)
{
struct dwc2_host_chan *channel;
- u32 hcfg;
int i, num_channels;
int err, retval;
@@ -2166,8 +2163,7 @@
retval = -ENOMEM;
- hcfg = DWC2_READ_4(hsotg, HCFG);
- dev_dbg(hsotg->dev, "hcfg=%08x\n", hcfg);
+ dev_dbg(hsotg->dev, "hcfg=%08x\n", DWC2_READ_4(hsotg, HCFG));
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
hsotg->frame_num_array = kmem_zalloc(sizeof(*hsotg->frame_num_array) *
diff -r 0fbaa133021d -r 56687d0d6fb8 sys/external/bsd/dwc2/dist/dwc2_hcdintr.c
--- a/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c Fri Mar 21 02:25:05 2014 +0000
+++ b/sys/external/bsd/dwc2/dist/dwc2_hcdintr.c Fri Mar 21 09:19:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc2_hcdintr.c,v 1.6 2013/11/24 12:25:19 skrll Exp $ */
+/* $NetBSD: dwc2_hcdintr.c,v 1.7 2014/03/21 09:19:10 skrll Exp $ */
/*
* hcd_intr.c - DesignWare HS OTG Controller host-mode interrupt handling
@@ -40,7 +40,7 @@
* This file contains the interrupt handlers for Host mode
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdintr.c,v 1.6 2013/11/24 12:25:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdintr.c,v 1.7 2014/03/21 09:19:10 skrll Exp $");
#include <sys/types.h>
#include <sys/pool.h>
@@ -161,7 +161,7 @@
*/
static void dwc2_rx_fifo_level_intr(struct dwc2_hsotg *hsotg)
{
- u32 grxsts, chnum, bcnt, dpid, pktsts;
+ u32 grxsts, chnum, bcnt, pktsts;
struct dwc2_host_chan *chan;
if (dbg_perio())
@@ -176,14 +176,14 @@
}
bcnt = (grxsts & GRXSTS_BYTECNT_MASK) >> GRXSTS_BYTECNT_SHIFT;
- dpid = (grxsts & GRXSTS_DPID_MASK) >> GRXSTS_DPID_SHIFT;
pktsts = (grxsts & GRXSTS_PKTSTS_MASK) >> GRXSTS_PKTSTS_SHIFT;
/* Packet Status */
if (dbg_perio()) {
dev_vdbg(hsotg->dev, " Ch num = %d\n", chnum);
dev_vdbg(hsotg->dev, " Count = %d\n", bcnt);
- dev_vdbg(hsotg->dev, " DPID = %d, chan.dpid = %d\n", dpid,
+ dev_vdbg(hsotg->dev, " DPID = %d, chan.dpid = %d\n",
+ (grxsts & GRXSTS_DPID_MASK) >> GRXSTS_DPID_SHIFT,
chan->data_pid_start);
dev_vdbg(hsotg->dev, " PStatus = %d\n", pktsts);
}
@@ -462,7 +462,6 @@
struct dwc2_hcd_urb *urb,
struct dwc2_qtd *qtd)
{
- u32 hctsiz;
int xfer_done = 0;
int short_read = 0;
int xfer_length = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
@@ -497,12 +496,11 @@
urb->status = 0;
}
- hctsiz = DWC2_READ_4(hsotg, HCTSIZ(chnum));
dev_vdbg(hsotg->dev, "DWC_otg: %s: %s, channel %d\n",
__func__, (chan->ep_is_in ? "IN" : "OUT"), chnum);
dev_vdbg(hsotg->dev, " chan->xfer_len %d\n", chan->xfer_len);
dev_vdbg(hsotg->dev, " hctsiz.xfersize %d\n",
- (hctsiz & TSIZ_XFERSIZE_MASK) >> TSIZ_XFERSIZE_SHIFT);
+ (DWC2_READ_4(hsotg, HCTSIZ(chnum)) & TSIZ_XFERSIZE_MASK) >> TSIZ_XFERSIZE_SHIFT);
dev_vdbg(hsotg->dev, " urb->transfer_buffer_length %d\n", urb->length);
dev_vdbg(hsotg->dev, " urb->actual_length %d\n", urb->actual_length);
dev_vdbg(hsotg->dev, " short_read %d, xfer_done %d\n", short_read,
@@ -1164,7 +1162,6 @@
{
u32 xfer_length = dwc2_get_actual_xfer_length(hsotg, chan, chnum,
qtd, halt_status, NULL);
- u32 hctsiz;
if (urb->actual_length + xfer_length > urb->length) {
dev_warn(hsotg->dev, "%s(): trimming xfer length\n", __func__);
@@ -1182,13 +1179,12 @@
urb->actual_length += xfer_length;
- hctsiz = DWC2_READ_4(hsotg, HCTSIZ(chnum));
dev_vdbg(hsotg->dev, "DWC_otg: %s: %s, channel %d\n",
__func__, (chan->ep_is_in ? "IN" : "OUT"), chnum);
dev_vdbg(hsotg->dev, " chan->start_pkt_count %d\n",
chan->start_pkt_count);
dev_vdbg(hsotg->dev, " hctsiz.pktcnt %d\n",
- (hctsiz & TSIZ_PKTCNT_MASK) >> TSIZ_PKTCNT_SHIFT);
+ (DWC2_READ_4(hsotg, HCTSIZ(chnum)) & TSIZ_PKTCNT_MASK) >> TSIZ_PKTCNT_SHIFT);
dev_vdbg(hsotg->dev, " chan->max_packet %d\n", chan->max_packet);
dev_vdbg(hsotg->dev, " bytes_transferred %d\n",
xfer_length);
@@ -1479,11 +1475,6 @@
struct dwc2_qtd *qtd)
{
struct dwc2_hcd_urb *urb = qtd->urb;
- const char *pipetype, *speed;
- u32 hcchar;
- u32 hcsplt;
- u32 hctsiz;
- u32 hc_dma;
dev_dbg(hsotg->dev, "--Host Channel %d Interrupt: AHB Error--\n",
chnum);
@@ -1493,10 +1484,13 @@
// dwc2_hc_handle_tt_clear(hsotg, chan, qtd);
- hcchar = DWC2_READ_4(hsotg, HCCHAR(chnum));
- hcsplt = DWC2_READ_4(hsotg, HCSPLT(chnum));
- hctsiz = DWC2_READ_4(hsotg, HCTSIZ(chnum));
- hc_dma = DWC2_READ_4(hsotg, HCDMA(chnum));
+#ifdef DWC2_DEBUG
+ const char *pipetype, *speed;
+
+ u32 hcchar = DWC2_READ_4(hsotg, HCCHAR(chnum));
+ u32 hcsplt = DWC2_READ_4(hsotg, HCSPLT(chnum));
+ u32 hctsiz = DWC2_READ_4(hsotg, HCTSIZ(chnum));
+ u32 hc_dma = DWC2_READ_4(hsotg, HCDMA(chnum));
dev_err(hsotg->dev, "AHB ERROR, Channel %d\n", chnum);
dev_err(hsotg->dev, " hcchar 0x%08x, hcsplt 0x%08x\n", hcchar, hcsplt);
@@ -1552,6 +1546,7 @@
dev_err(hsotg->dev, " Setup buffer: %p, Setup DMA: %08lx\n",
urb->setup_packet, (unsigned long)urb->setup_dma);
dev_err(hsotg->dev, " Interval: %d\n", urb->interval);
+#endif
Home |
Main Index |
Thread Index |
Old Index