Linux MIPS Architecture development
 help / color / mirror / Atom feed
* USB on MIPS
@ 2003-12-18 14:28 samavarthy c
  2003-12-18 16:51 ` Pete Popov
  2003-12-18 17:43 ` Jun Sun
  0 siblings, 2 replies; 6+ messages in thread
From: samavarthy c @ 2003-12-18 14:28 UTC (permalink / raw)
  To: linux-mips

Hi,

I am working on a PDA based board which has a NEC MIPS VR4131
processor.
The board has a companion chip MediaQ 1132 which has OHCI support
builtin.
The kernel used is MontaVista HardHat 2.4.18. I am trying to configure
MQ1132 for USB Host support. It looks like the Host controller
(MQ1132) is initialized properly but not sure. When I plug in a USB
stick on to the USB port, I get the following messages.
-----------------------------------------------------------------
hub.c: USB new device connect on bus1/1, assigned device number 2
usb-ohci.c: unlink URB timeout
usb.c: USB device not accepting new address=2 (error=-145)

hub.c: USB new device connect on bus1/1, assigned device number 3
usb_control/bulk_msg: timeout
usb-ohci.c: unlink URB timeout
usb.c: USB device not accepting new address=3 (error=-145)
-------------------------------------------------------------------
Has anyone experienced the same out there. Could any one suggest how
to debug this error. What could be the problem?.

Thanks in advance.

Regards,
aks

_________________________________________________________________
Add glamour to your desktop. Let your screen sizzle. 
http://server1.msn.co.in/msnchannels/Entertainment/wallpaperhome.asp 
Download the hottest wallpapers.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USB on MIPS
  2003-12-18 14:28 USB on MIPS samavarthy c
@ 2003-12-18 16:51 ` Pete Popov
  2003-12-18 17:43 ` Jun Sun
  1 sibling, 0 replies; 6+ messages in thread
From: Pete Popov @ 2003-12-18 16:51 UTC (permalink / raw)
  To: samavarthy c; +Cc: linux-mips


I haven't worked with that board, but on the AMD/Alchemy boards, the 
same errors have typically been associated with improper setup of the 
usb controller -- usually the clock that is routed internally to the 
controller.

Pete

samavarthy c wrote:

> Hi,
>
> I am working on a PDA based board which has a NEC MIPS VR4131
> processor.
> The board has a companion chip MediaQ 1132 which has OHCI support
> builtin.
> The kernel used is MontaVista HardHat 2.4.18. I am trying to configure
> MQ1132 for USB Host support. It looks like the Host controller
> (MQ1132) is initialized properly but not sure. When I plug in a USB
> stick on to the USB port, I get the following messages.
> -----------------------------------------------------------------
> hub.c: USB new device connect on bus1/1, assigned device number 2
> usb-ohci.c: unlink URB timeout
> usb.c: USB device not accepting new address=2 (error=-145)
>
> hub.c: USB new device connect on bus1/1, assigned device number 3
> usb_control/bulk_msg: timeout
> usb-ohci.c: unlink URB timeout
> usb.c: USB device not accepting new address=3 (error=-145)
> -------------------------------------------------------------------
> Has anyone experienced the same out there. Could any one suggest how
> to debug this error. What could be the problem?.
>
> Thanks in advance.
>
> Regards,
> aks
>
> _________________________________________________________________
> Add glamour to your desktop. Let your screen sizzle. 
> http://server1.msn.co.in/msnchannels/Entertainment/wallpaperhome.asp 
> Download the hottest wallpapers.
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USB on MIPS
  2003-12-18 14:28 USB on MIPS samavarthy c
  2003-12-18 16:51 ` Pete Popov
@ 2003-12-18 17:43 ` Jun Sun
  2003-12-19  4:14   ` Kunihiko IMAI
  1 sibling, 1 reply; 6+ messages in thread
From: Jun Sun @ 2003-12-18 17:43 UTC (permalink / raw)
  To: samavarthy c; +Cc: linux-mips, jsun

On Thu, Dec 18, 2003 at 07:58:36PM +0530, samavarthy c wrote:
> Hi,
> 
> I am working on a PDA based board which has a NEC MIPS VR4131
> processor.
> The board has a companion chip MediaQ 1132 which has OHCI support
> builtin.
> The kernel used is MontaVista HardHat 2.4.18. I am trying to configure
> MQ1132 for USB Host support. It looks like the Host controller
> (MQ1132) is initialized properly but not sure. When I plug in a USB
> stick on to the USB port, I get the following messages.
> -----------------------------------------------------------------
> hub.c: USB new device connect on bus1/1, assigned device number 2
> usb-ohci.c: unlink URB timeout
> usb.c: USB device not accepting new address=2 (error=-145)
> 
> hub.c: USB new device connect on bus1/1, assigned device number 3
> usb_control/bulk_msg: timeout
> usb-ohci.c: unlink URB timeout
> usb.c: USB device not accepting new address=3 (error=-145)
> -------------------------------------------------------------------
> Has anyone experienced the same out there. Could any one suggest how
> to debug this error. What could be the problem?.
> 

Another possiblity (which is probably more likely) is the IRQ
number is not seupt correctly.  

Are you using Rokchopper II baseboard?  If so, single-function
PCI card should work properly w.r.t. IRQ.  If you are using other
backplan or using multi-function pci card, you need to some IRQ
fixup.

Jun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USB on MIPS
  2003-12-18 17:43 ` Jun Sun
@ 2003-12-19  4:14   ` Kunihiko IMAI
  0 siblings, 0 replies; 6+ messages in thread
From: Kunihiko IMAI @ 2003-12-19  4:14 UTC (permalink / raw)
  To: linux-mips

Hi,

At Thu, 18 Dec 2003 09:43:21 -0800,
Jun Sun wrote:
> 
> On Thu, Dec 18, 2003 at 07:58:36PM +0530, samavarthy c wrote:
> > Hi,
(snip)
> 
> Another possiblity (which is probably more likely) is the IRQ
> number is not seupt correctly.  

And another possibilities are:

	DMA cache coherency
		NEC VR4xxxs have no bus-snoop function. So
		cache-coherency must be maintaind by software.
		(or use KSEG1 access)

		But I remember linux-2.4.18 of usb-ohci.c doesn't have
		this problem.

	Read/write cycle order
		Read/write cycle order of CPU instruction level is
		guaranteed at bus level?
		( Or at assembler level, the sequent instruction is
		re-ordered ? )

		Newer version of usb-ohci.c has some wmb() funtions.
		It synchronizes read/write order.

I got similar errors on VR4181A with 2.4.18 kernel.  VR4181A has
built-in USB OHCI 1.1 host connected internal PCI bus.

To fix this problem, I compared newer usb-ohci.c and put wmb()
corresponded place. It is expaneded as subsequent NOPs. (VR4xxx has
real SYNC instruction.)

Thanks.
_._. __._  _ . ... _  .___ ._. _____ _... ._ _._ _.._. .____  _ . ... _

                                                          Kunihiko IMAI

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USB on MIPS
@ 2003-12-20  7:22 samavarthy c
  2003-12-20  8:58 ` Dimitri Torfs
  0 siblings, 1 reply; 6+ messages in thread
From: samavarthy c @ 2003-12-20  7:22 UTC (permalink / raw)
  To: jsun; +Cc: linux-mips

I have setup the clock properly.

The IRQ number is also setup. I have no PCI card at all. But the kernel has 
support for Rockhopper board.

I tried using the wmb (), but doesn't work.

Thank you all for the suggestions. I have given a brief explanation of what 
I am actually trying to acheive. May be this would help you to help me.

The MediaQ controller chip does not sit on the pci bus. The specification 
says that the chip address space ranges from xxx00000h to xxx80000h.

This address space is broken into three regions.

1. The lower 256 Kbyte region (xxx00000h to xxx40000h) maps to the 256 Kbyte 
internal SRAM and contains the graphics frame buffer.
2. The next region (xxx40000h to xxx42000h) is the 8 Kbyte register space, 
which is located just above the frame buffer.
3. The third region, (xxx42000h to xxx80000h) consisting of the remaining 
248 Kbyte of address space is also mapped to the upper 248 Kbyte of internal 
SRAM. This address space is used to access non-graphics frame buffer memory 
such as buffers for USB.

So The MediaQ is supposed to use the third region for storing the TD's and 
ED's basically its HCCA area. On MIPS VR4131 the start address of the third 
region would be 0xAA042000h. This is what I think I am supposed to fill in 
the HCCA register. Am I right?

Well now coming to the sources. The sources files that I have modified till 
now are usb-ohci.c, usb-ohci-nonpci.c. under the drivers/usb directory.

In "usb-ohci-nonpci.c" a function called "nonpci_ohci_init()" was modified 
as to initialize the MediaQ controller.
The segment of code below was commented in the function as I was getting an 
error "controller already in use". The ohci_base value passed was 0xAA040500 
which is where the Host controllers registers of MediaQ are mapped.
-----------------------------------------------------------------------------------------------------
if (!request_mem_region (ohci_base, ohci_len, "usb-ohci"))
	{
		dbg ("controller already in use");
		return -EBUSY;
	}
	mem_base = ioremap_nocache (ohci_base, ohci_len);

	if (!mem_base) {
		err("Error mapping OHCI memory");
		return -EFAULT;
	}
-------------------------------------------------------------------------------------------------
and so hardcoded mem_base as 0xAA040500.

In "usb-ohci.c" the function "hc_alloc_ohci ()" was modified. The following 
peice of code was commented because the address returned by 
"pci_alloc_consistent" was not in range of 0xAA042000h - 0xAA080000h.
----------------------------------------------------------------------------------------------------------
ohci->hcca = pci_alloc_consistent (dev, sizeof *ohci->hcca,
			&ohci->hcca_dma);

        if (!ohci->hcca)
		{
                kfree (ohci);
                return NULL;
      	}
------------------------------------------------------------------------------------------------------------

The value of "ohci->hcca_dma" is what that is actually written to the HCCA 
register.
And hence I hard coded the values of ohci->hcca and ohci->hcca_dma to 
0xAA042000h.
With these updations I am getting the errors

-----------------------------------------------------------------
hub.c: USB new device connect on bus1/1, assigned device number 2
usb-ohci.c: unlink URB timeout
usb.c: USB device not accepting new address=2 (error=-145)
hub.c: USB new device connect on bus1/1, assigned device number 3
usb_control/bulk_msg: timeout
usb-ohci.c: unlink URB timeout
usb.c: USB device not accepting new address=3 (error=-145)
-------------------------------------------------------------------

Also the file usb-ohci.h uses "pci_pool_create()",  "pci_pool_alloc ()" and 
such functions. Do I need to modify all these functions?. Let me know if I 
am doing something wrong. Are there any workarounds for this?.

Thank again,
aks


>From: Jun Sun <jsun@mvista.com>
>To: samavarthy c <samavarthy@hotmail.com>
>CC: linux-mips@linux-mips.org, jsun@mvista.com
>Subject: Re: USB on MIPS
>Date: Thu, 18 Dec 2003 09:43:21 -0800
>
>On Thu, Dec 18, 2003 at 07:58:36PM +0530, samavarthy c wrote:
> > Hi,
> >
> > I am working on a PDA based board which has a NEC MIPS VR4131
> > processor.
> > The board has a companion chip MediaQ 1132 which has OHCI support
> > builtin.
> > The kernel used is MontaVista HardHat 2.4.18. I am trying to configure
> > MQ1132 for USB Host support. It looks like the Host controller
> > (MQ1132) is initialized properly but not sure. When I plug in a USB
> > stick on to the USB port, I get the following messages.
> > -----------------------------------------------------------------
> > hub.c: USB new device connect on bus1/1, assigned device number 2
> > usb-ohci.c: unlink URB timeout
> > usb.c: USB device not accepting new address=2 (error=-145)
> >
> > hub.c: USB new device connect on bus1/1, assigned device number 3
> > usb_control/bulk_msg: timeout
> > usb-ohci.c: unlink URB timeout
> > usb.c: USB device not accepting new address=3 (error=-145)
> > -------------------------------------------------------------------
> > Has anyone experienced the same out there. Could any one suggest how
> > to debug this error. What could be the problem?.
> >
>
>Another possiblity (which is probably more likely) is the IRQ
>number is not seupt correctly.
>
>Are you using Rokchopper II baseboard?  If so, single-function
>PCI card should work properly w.r.t. IRQ.  If you are using other
>backplan or using multi-function pci card, you need to some IRQ
>fixup.
>
>Jun

_________________________________________________________________
Marriage? http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Join 
BharatMatrimony.com for free.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USB on MIPS
  2003-12-20  7:22 samavarthy c
@ 2003-12-20  8:58 ` Dimitri Torfs
  0 siblings, 0 replies; 6+ messages in thread
From: Dimitri Torfs @ 2003-12-20  8:58 UTC (permalink / raw)
  To: samavarthy c; +Cc: linux-mips

On Sat, Dec 20, 2003 at 12:52:49PM +0530, samavarthy c wrote:
> The MediaQ controller chip does not sit on the pci bus. The specification 
> says that the chip address space ranges from xxx00000h to xxx80000h.
> 
> This address space is broken into three regions.
> 
> 1. The lower 256 Kbyte region (xxx00000h to xxx40000h) maps to the 256 
> Kbyte internal SRAM and contains the graphics frame buffer.
> 2. The next region (xxx40000h to xxx42000h) is the 8 Kbyte register space, 
> which is located just above the frame buffer.
> 3. The third region, (xxx42000h to xxx80000h) consisting of the remaining 
> 248 Kbyte of address space is also mapped to the upper 248 Kbyte of 
> internal SRAM. This address space is used to access non-graphics frame 
> buffer memory such as buffers for USB.
> 
> So The MediaQ is supposed to use the third region for storing the TD's and 
> ED's basically its HCCA area. On MIPS VR4131 the start address of the third 
> region would be 0xAA042000h. This is what I think I am supposed to fill in 
> the HCCA register. Am I right?

Are you saying that this USB OHCI chip can only access its internal
SRAM ? In that case not only the HCCA area but all the TDs, EDs and
the data pointed to by the descriptors should be allocated there
(basically all data that would be normally accessed by the OHCI chip
as pci master).

> error "controller already in use". The ohci_base value passed was 
> 0xAA040500 which is where the Host controllers registers of MediaQ are 
> mapped.

Did you check the mapped address is correct (e.g. by reading the
revision field of the ohci_regs) ?

Dimitri

-- 
Dimitri Torfs             |  NSCE 
dimitri.torfs@sonycom.com |  Sint Stevens Woluwestraat 55
tel: +32 2 2908451        |  1130 Brussel
fax: +32 2 7262686        |  Belgium

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-12-20  8:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-18 14:28 USB on MIPS samavarthy c
2003-12-18 16:51 ` Pete Popov
2003-12-18 17:43 ` Jun Sun
2003-12-19  4:14   ` Kunihiko IMAI
  -- strict thread matches above, loose matches on Subject: below --
2003-12-20  7:22 samavarthy c
2003-12-20  8:58 ` Dimitri Torfs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox