Potential problem with USB_THREAD_SUSPEND()?

2009-06-29 Thread Sebastian Huber
Hi,

USB_THREAD_SUSPEND(p) is defined as {kproc|kthread}_suspend(p, 0).  This means
that it will wait until the corresponding thread recognizes its suspend request
and suspends itself.  It seems that {kproc|kthread}_suspend_check() will be
used nowhere in the USB system.  Thus the USB_THREAD_SUSPEND() will block
forever in most cases? It is only used in usb_proc_drain() during cold boot.

Have a nice day!

-- 
Sebastian Huber, Embedded Brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: CPU Cache and busdma usage in USB

2009-07-08 Thread Sebastian Huber
Hi!

The general approach for systems with no hardware cache coherence protocol
should be:

Memory to device DMA transfer of a buffer:

1. write all modified cache lines of the buffer back to memory (cache flush for
buffer)
2. start DMA transfer

Device to memory DMA transfer of a buffer:

1. invalidate the cache of the buffer, here you have to make sure that this
buffer does not share a cache line with other buffers (!)
2. start DMA transfer
3. all accesses to the buffer via the cache must wait until the DMA has finished

CU

-- 
Sebastian Huber, Embedded Brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


usb/140242: dev/usb/controller/ehci_ix4xx.c shortcomings

2009-11-03 Thread Sebastian Huber

>Number: 140242
>Category:   usb
>Synopsis:   dev/usb/controller/ehci_ix4xx.c shortcomings
>Confidential:   no
>Severity:   non-critical
>Priority:   low
>Responsible:freebsd-usb
>State:  open
>Quarter:
>Keywords:   
>Date-Required:
>Class:  sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 03 10:00:12 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Sebastian Huber
>Release:9-current
>Organization:
embedded brains GmbH
>Environment:
>Description:
In ehci_ixp_attach() setting of sc->sc_bus.usbrev is superfluous since this is 
also set in ehci_init().

Calling ehci_reset() without a valid sc->sc_offs value makes no sense.
>How-To-Repeat:

>Fix:
Index: ehci_ixp4xx.c   
===
--- ehci_ixp4xx.c   (revision 198848)  
+++ ehci_ixp4xx.c   (working copy) 
@@ -157,8 +157,6 @@
return (ENOMEM);   
}  
   
-   sc->sc_bus.usbrev = USB_REV_2_0;   
-  
/* NB: hints fix the memory location and irq */
   
rid = 0;   
@@ -230,7 +228,6 @@
 | EHCI_SCFLG_BIGEMMIO 
 | EHCI_SCFLG_NORESTERM
 ; 
-   (void) ehci_reset(sc); 
   
err = ehci_init(sc);   
if (!err) {

>Release-Note:
>Audit-Trail:
>Unformatted:
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/140242: dev/usb/controller/ehci_ix4xx.c shortcomings

2009-11-03 Thread Sebastian Huber
Hans Petter Selasky wrote:
[...]
>  What is the correct "sc->sc_offs" value? The sc_offs field is used by more 
>  than reset, and should be set correctly. I.E. The right solution is not to 
>  remove the ehci_reset() call.
[...]

The sc->sc_offs value is initialized early during ehci_init().  Afterwards a
ehci_reset() is ok, but before it is not good.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


umass.c question

2009-11-03 Thread Sebastian Huber
Hi!

In umass_attach() the sc->sc_mtx will be initialized.  This mutex will be
passed to cam_sim_alloc().  Who destroys this mutex?  I guess it should be
destroyed in umass_detach() right after the last unlock.

CU

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


How fast is the OHCI driver?

2010-03-16 Thread Sebastian Huber
Hi,

I work with an ARM9 based system on a LPC3250 evaluation board from Phytec.  It
has an integrated OHCI USB controller from NXP.  The vendor provides a Linux
system for this board and with this system I can read with 1MByte/s from an USB
stick (I can also read with 23MByte/s from this stick on another system with an
EHCI controller).  If I use the FreeBSD USB-stack (trunk revision 200101), then
I can only achieve a read performance of 70kByte/s.  Comparing the activity on
the USB data lines with an oscilloscope of the two systems shows that on the
Linux system the line is continuously busy while on the FreeBSD based system
there are huge gaps of inactivity.  Both systems operate with 12MHz.  The
FreeBSD based system is 65% of the time in the idle task, so it seems that it
waits a lot for something.

Has someone values from other FreeBSD based systems with an OHCI controller?

Have a nice day!
Sebastian Huber

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: How fast is the OHCI driver?

2010-03-19 Thread Sebastian Huber
On 03/16/2010 07:01 PM, Bernd Walter wrote:
> On Tue, Mar 16, 2010 at 04:46:19PM +0100, Sebastian Huber wrote:
[...]
>> Has someone values from other FreeBSD based systems with an OHCI controller?
> 
> I can easily get more with AT91RM9200 (also ARM9 with OHCI).
> A short test:
> [73]chipmunk.cicely.de# dd if=/dev/da0 bs=128k of=/dev/null count=100
> 100+0 records in
> 100+0 records out
> 13107200 bytes transferred in 16.762732 secs (781925 bytes/sec)
> 
> Speedwise the system is on the lowest end of ARM9 systems we support.
> 

Thank you for your reference values.  Actually my test setup on the FreeBSD
based system was bad.  I now have the following values:

TSZ:  Size of one transfer block in bytes
TIME: Time to transfer 1024 blocks in seconds
RATE: Bytes transfered per second

TSZ TIME   RATE
512   6.15   85250
   1024   7.17  146244
   2048   8.20  255750
   4096  10.24  409600
   8192  13.38  626951
  16384  21.50  780335
  32768  36.92  908841
  65536  67.92  988057
 131072 131.39 1021521
 262144 259.00 1036430
 524288 514.16 1044170
1048576 964.04 1048532

So it looks very good if you use the right transfer size.

Best regards,
    Sebastian Huber

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


usb/145455: USB debug support cannot be disabled

2010-04-07 Thread Sebastian Huber

>Number: 145455
>Category:   usb
>Synopsis:   USB debug support cannot be disabled
>Confidential:   no
>Severity:   non-critical
>Priority:   low
>Responsible:freebsd-usb
>State:  open
>Quarter:
>Keywords:   
>Date-Required:
>Class:  sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 07 12:50:05 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Sebastian Huber
>Release:9-current
>Organization:
embedded brains GmbH
>Environment:
>Description:
You cannot disable the USB debug support completely (USB_DEBUG define) due to 
an intermix of #if and #ifdef handling.  The header file usb_freebsd.h defines 
USB_DEBUG if it is undefined.  So the USB_DEBUG pre-processor symbol is always 
defined.  Thus you cannot use #ifdef and #ifndef to test if debugging support 
should be enabled or disabled.
>How-To-Repeat:

>Fix:
Please have a look at the attached patch.

Patch attached with submission follows:

Index: dev/usb/controller/at91dci.c
===
--- dev/usb/controller/at91dci.c(revision 206339)
+++ dev/usb/controller/at91dci.c(working copy)
@@ -89,7 +89,7 @@
 #defineAT9100_DCI_PC2SC(pc) \
AT9100_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
-#ifdef USB_DEBUG
+#if USB_DEBUG
 static int at91dcidebug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, at91dci, CTLFLAG_RW, 0, "USB at91dci");
Index: dev/usb/controller/atmegadci.c
===
--- dev/usb/controller/atmegadci.c  (revision 206339)
+++ dev/usb/controller/atmegadci.c  (working copy)
@@ -81,7 +81,7 @@
 #defineATMEGA_PC2SC(pc) \
ATMEGA_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
-#ifdef USB_DEBUG
+#if USB_DEBUG
 static int atmegadci_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW, 0, "USB ATMEGA DCI");
Index: dev/usb/controller/musb_otg.c
===
--- dev/usb/controller/musb_otg.c   (revision 206339)
+++ dev/usb/controller/musb_otg.c   (working copy)
@@ -83,7 +83,7 @@
 #defineMUSBOTG_PC2SC(pc) \
MUSBOTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
-#ifdef USB_DEBUG
+#if USB_DEBUG
 static int musbotgdebug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, musbotg, CTLFLAG_RW, 0, "USB musbotg");
Index: dev/usb/controller/uhci_pci.c
===
--- dev/usb/controller/uhci_pci.c   (revision 206339)
+++ dev/usb/controller/uhci_pci.c   (working copy)
@@ -372,7 +372,7 @@
 * that the BIOS won't touch the keyboard anymore if it is connected
 * to the ports of the root hub?
 */
-#ifdef USB_DEBUG
+#if USB_DEBUG
if (pci_read_config(self, PCI_LEGSUP, 2) != PCI_LEGSUP_USBPIRQDEN) {
device_printf(self, "LegSup = 0x%04x\n",
pci_read_config(self, PCI_LEGSUP, 2));
Index: dev/usb/controller/usb_controller.c
===
--- dev/usb/controller/usb_controller.c (revision 206339)
+++ dev/usb/controller/usb_controller.c (working copy)
@@ -72,7 +72,7 @@
 
 /* static variables */
 
-#ifdef USB_DEBUG
+#if USB_DEBUG
 static int usb_ctrl_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW, 0, "USB controller");
Index: dev/usb/controller/avr32dci.c
===
--- dev/usb/controller/avr32dci.c   (revision 206339)
+++ dev/usb/controller/avr32dci.c   (working copy)
@@ -81,7 +81,7 @@
 #defineAVR32_PC2SC(pc) \
AVR32_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
 
-#ifdef USB_DEBUG
+#if USB_DEBUG
 static int avr32dci_debug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, avr32dci, CTLFLAG_RW, 0, "USB AVR32 DCI");
Index: dev/usb/controller/ohci.c
===
--- dev/usb/controller/ohci.c   (revision 206339)
+++ dev/usb/controller/ohci.c   (working copy)
@@ -78,7 +78,7 @@
((ohci_softc_t *)(((uint8_t *)(bus)) - \
 ((uint8_t *)&(((ohci_softc_t *)0)->sc_bus
 
-#ifdef USB_DEBUG
+#if USB_DEBUG
 static int ohcidebug = 0;
 
 SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci");
@@ -228,7 +228,7 @@
device_printf(sc->sc_bus.bdev, "reset timeout\n");
return (USB_ERR_IOERROR);
}
-#ifdef USB_DEBUG
+#if USB_DEBUG
if (ohcidebug > 15) {
ohci_dumpregs(sc);
}
@@ -287,7 +287,7 @@
sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
}
 
-#ifdef USB_DEBUG
+#if USB_DEBUG
if (ohcidebug > 5) {
ohci_dumpregs(sc);
 

Re: usb/145455: USB debug support cannot be disabled

2010-04-07 Thread Sebastian Huber
Hi,

it looks good.  I am sorry that usb_freebsd.h was included in the patch.

Have a nice day!

On 04/07/2010 04:20 PM, Hans Petter Selasky wrote:
> The following reply was made to PR usb/145455; it has been noted by GNATS.
> 
> From: Hans Petter Selasky 
> To: freebsd-usb@freebsd.org
> Cc: Sebastian Huber ,
>  freebsd-gnats-sub...@freebsd.org
> Subject: Re: usb/145455: USB debug support cannot be disabled
> Date: Wed, 7 Apr 2010 16:16:18 +0200
> 
>  On Wednesday 07 April 2010 14:49:43 Sebastian Huber wrote:
>  > 145455
>  > 
>  
>  Hi,
>  
>  Your patch looks good and has been committed to USB P4.
>  
>  The patch to "usb_freebsd.h" was not committed, because we want to force 
>  debugging on by default until further unless you define USB_DEBUG=0 in your 
>  kernel config file.
>  
>  Please check and verify:
>  
>  http://p4db.freebsd.org/changeView.cgi?CH=176614&ignore=GO!
>  
>  --HPS
> ___
> freebsd-usb@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-usb
> To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


usb/153149: USB stick quirk regression

2010-12-14 Thread Sebastian Huber

>Number: 153149
>Category:   usb
>Synopsis:   USB stick quirk regression
>Confidential:   no
>Severity:   non-critical
>Priority:   low
>Responsible:freebsd-usb
>State:  open
>Quarter:
>Keywords:   
>Date-Required:
>Class:  sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 14 14:20:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Sebastian Huber
>Release:r216297
>Organization:
embedded brains GmbH
>Environment:
>Description:
There is a problem with the recent quirks:

umass0:  on usbus0

devctl: +umass0 at bus=1 hubaddr=1 port=0 devaddr=2 interface=0 vendor=0x058f
product=0x6387 devclass=0x00 devsubclass=0x00 sernum="BC2401F1" release=0x0101
intclass=0x08 intsubclass=0x06 on uhub0

Quirks that don't work (216297):
umass0:  SCSI over Bulk-Only; quirks = 0x4101

Quirks that work for this device (r213272):
umass0:  SCSI over Bulk-Only; quirks = 0x0100

The SCSI read capacity fails in the don't work case.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


[PATCH] dwc_otg: Reduce interrupt load

2015-10-30 Thread Sebastian Huber
Tested on an Altera Cyclone V development kit.  Here the controller has
16 host channels.  This change significantly reduced the time spent in
the dwc_otg_interrupt_poll_locked() function.
---
 sys/dev/usb/controller/dwc_otg.c | 21 -
 sys/dev/usb/controller/dwc_otg.h |  1 +
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/sys/dev/usb/controller/dwc_otg.c b/sys/dev/usb/controller/dwc_otg.c
index e018ab5..a57e064 100644
--- a/sys/dev/usb/controller/dwc_otg.c
+++ b/sys/dev/usb/controller/dwc_otg.c
@@ -270,8 +270,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc *sc, uint8_t mode)
memset(sc->sc_chan_state, 0, sizeof(sc->sc_chan_state));
 
/* enable all host channel interrupts */
-   DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK,
-   (1U << sc->sc_host_ch_max) - 1U);
+   DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, sc->sc_host_ch_mask);
}
 
if (mode == DWC_MODE_DEVICE) {
@@ -2559,7 +2558,8 @@ dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc)
uint32_t count;
uint32_t temp;
uint8_t got_rx_status;
-   uint8_t x;
+   uint32_t haint;
+   int x;
 
if (sc->sc_flags.status_device_mode == 0) {
/*
@@ -2576,13 +2576,14 @@ repeat:
return;
}
/* get all host channel interrupts */
-   for (x = 0; x != sc->sc_host_ch_max; x++) {
+   haint = DWC_OTG_READ_4(sc, DOTG_HAINT) & sc->sc_host_ch_mask;
+   while (haint != 0) {
+   x = ffs((int)haint) - 1;
temp = DWC_OTG_READ_4(sc, DOTG_HCINT(x));
-   if (temp != 0) {
-   DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), temp);
-   temp &= ~HCINT_SOFTWARE_ONLY;
-   sc->sc_chan_state[x].hcint |= temp;
-   }
+   DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), temp);
+   temp &= ~HCINT_SOFTWARE_ONLY;
+   sc->sc_chan_state[x].hcint |= temp;
+   haint &= ~(1U << x);
}
 
if (sc->sc_last_rx_status == 0) {
@@ -3845,6 +3846,8 @@ dwc_otg_init(struct dwc_otg_softc *sc)
if (sc->sc_host_ch_max > DWC_OTG_MAX_CHANNELS)
sc->sc_host_ch_max = DWC_OTG_MAX_CHANNELS;
 
+   sc->sc_host_ch_mask = (1U << sc->sc_host_ch_max) - 1U;
+
temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG4);
 
sc->sc_dev_in_ep_max = GHWCFG4_NUM_IN_EP_GET(temp);
diff --git a/sys/dev/usb/controller/dwc_otg.h b/sys/dev/usb/controller/dwc_otg.h
index f5e9887..6882e40 100644
--- a/sys/dev/usb/controller/dwc_otg.h
+++ b/sys/dev/usb/controller/dwc_otg.h
@@ -185,6 +185,7 @@ struct dwc_otg_softc {
uint32_t sc_tmr_val;
uint32_t sc_hprt_val;
uint32_t sc_xfer_complete;
+   uint32_t sc_host_ch_mask;
 
uint16_t sc_active_rx_ep;
uint16_t sc_last_frame_num;
-- 
1.8.4.5

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: [PATCH] dwc_otg: Reduce interrupt load

2015-11-02 Thread Sebastian Huber



On 30/10/15 15:53, Hans Petter Selasky wrote:

On 10/30/15 14:38, Sebastian Huber wrote:

Tested on an Altera Cyclone V development kit.  Here the controller has
16 host channels.  This change significantly reduced the time spent in
the dwc_otg_interrupt_poll_locked() function.


Hi,

Thank you for your optimisation patch:

https://svnweb.freebsd.org/changeset/base/290195


Thanks.




How does the DWC OTG driver from FreeBSD work with your setup? 


After an update of the USB stack from 9.3 to current it worked out of 
the box. Thanks a lot for your great USB stack!


It seems that this driver doesn't support DMA. I see a quite high CPU 
utilization in this area:


static void
dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc)
{
[...]
if (sc->sc_last_rx_status != 0) {
[...]
temp = GRXSTSRD_BCNT_GET(
sc->sc_last_rx_status);
ep_no = GRXSTSRD_CHNUM_GET(
sc->sc_last_rx_status);

/* receive data, if any */
if (temp != 0) {
DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no);
bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl,
DOTG_DFIFO(ep_no),
sc->sc_rx_bounce_buffer, (temp + 3) / 4);
}

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: [PATCH] dwc_otg: Reduce interrupt load

2015-11-10 Thread Sebastian Huber

Hello,

On 08/11/15 10:45, Hans Petter Selasky wrote:

On 11/02/15 13:41, Hans Petter Selasky wrote:

On 11/02/15 13:22, Sebastian Huber wrote:



On 30/10/15 15:53, Hans Petter Selasky wrote:

On 10/30/15 14:38, Sebastian Huber wrote:
Tested on an Altera Cyclone V development kit.  Here the 
controller has
16 host channels.  This change significantly reduced the time 
spent in

the dwc_otg_interrupt_poll_locked() function.


Hi,

Thank you for your optimisation patch:

https://svnweb.freebsd.org/changeset/base/290195




Hi Sebastian,

You maybe also want to port these two patches, and measure the CPU 
load again:


https://svnweb.freebsd.org/changeset/base/290489
https://svnweb.freebsd.org/changeset/base/290542


I didn't notice a big overall difference. Highest CPU load is now due to 
dwc_otg_read_fifo() instead of dwc_otg_interrupt_poll_locked().


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


dwc_otg: Problem with directly connected full/low speed devices

2016-01-04 Thread Sebastian Huber

Hello,

I use an Altera Cyclone V development kit which the dwc_otg driver from 
FreeBSD. The device enumeration of full/low speed devices directly 
connected to the root hub fails since split transactions are used. If I 
connect them via a hub it works fine. I used the following hack to get 
them working with a direct connection:


diff --git a/sys/dev/usb/controller/dwc_otg.c 
b/sys/dev/usb/controller/dwc_otg.c

index 2110b94..37cca8e 100644
--- a/sys/dev/usb/controller/dwc_otg.c
+++ b/sys/dev/usb/controller/dwc_otg.c
@@ -3340,7 +3340,7 @@ dwc_otg_setup_standard_chain(struct usb_xfer *xfer)
case USB_SPEED_FULL:
case USB_SPEED_LOW:
/* check if root HUB port is running High Speed */
-   if (xfer->xroot->udev->parent_hs_hub != NULL) {
+   if (xfer->xroot->udev->parent_hs_hub != NULL && 0) {
hcsplt = HCSPLT_SPLTENA |
(xfer->xroot->udev->hs_port_no <<
HCSPLT_PRTADDR_SHIFT) |

I am not sure how to fix this properly. Is this a specific problem with 
the Altera Cyclone V board or is this problem also present on other 
boards e.g. RPI2?


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"

Re: dwc_otg: Problem with directly connected full/low speed devices

2016-01-05 Thread Sebastian Huber

Hello Hans Petter,

On 05/01/16 09:27, Hans Petter Selasky wrote:


Does the attached patch solve your problem? 


yes, this patch solves the problem. Thanks for this extremely quick fix.

Kind regards,
Sebastian

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"

USB Host Driver for Atmel USB High-Speed Interface (USBHS)?

2016-08-05 Thread Sebastian Huber

Hello,

there are several Atmel USB controllers supported by FreeBSD. However, 
support for the Atmel USB High-Speed Interface (USBHS) module seems to 
be missing. This module can be found for example on the ATSAMV71Q21:


http://www.atmel.com/devices/ATSAMV71Q21.aspx

Does someone know if this module is supported (maybe out of tree) or is 
someone working on a driver already? If not, then in case someone is 
able to develop a FreeBSD driver for this module, then please contact me 
to potentially do this on a contract basis.


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"

Re: USB Host Driver for Atmel USB High-Speed Interface (USBHS)?

2016-08-05 Thread Sebastian Huber



On 05/08/16 11:11, Hans Petter Selasky wrote:

On 08/05/16 11:00, Sebastian Huber wrote:

Hello,

there are several Atmel USB controllers supported by FreeBSD. However,
support for the Atmel USB High-Speed Interface (USBHS) module seems to
be missing. This module can be found for example on the ATSAMV71Q21:

http://www.atmel.com/devices/ATSAMV71Q21.aspx

Does someone know if this module is supported (maybe out of tree) or is
someone working on a driver already? If not, then in case someone is
able to develop a FreeBSD driver for this module, then please contact me
to potentially do this on a contract basis.



Hi,

Can you check if you have a match with avr32dci.c in 
sys/dev/usb/controller ?


The register interface looks similar, but this is a device only driver? 
At least I don't find defines for the host registers. I need the host mode.


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"