FPGARelated.com
Forums

USB and AHB

Started by terabits November 15, 2006
Hi

I am very new to usb, I have some basic questions reagarding usb with
ahb .

Suppose i have a ahb structure like 2 masters and 2 slaves.
i want to have 2usb devices .....will this usb (usb 2.0 device) sit on
the slave side ?
what will be on the master side ? suppose one dma as a master i have
will the another master be arm processor or can it be some other usb
device ? if so what could it be ?
why at all usb has to interface with ahb ? only to interact with
memories and arm processors ?
can you give me a real time example like take a usb pen drive where
will ahb comes into picture when i am connecting it to the computer ?

regards

USB Pen drive = USB Device = Slave.
=> you have to control it with a USB HOST IP
=> this IP should be integrated on the AHB Bus as a ....Slave

To do list :
- integrate the USBHOSTSLAVE IP , host part ,  ( available at 
opencores.org ) . This IP  is Wishbone Slave
=> simple WB<-> AHB Bridge to be written (or maybe exists somewhere)
- add a USB PHY on your board (1 PHY IC is advised in the usbhostlave design 
package)
- make some tests (basic USB cmds => look in the USBHOSTSLAVE doc)
- go ahead (SW, driver,etc....)
You should make preliminary tests in simulation with a Slave USB model



"terabits" <tera.bits@gmail.com> wrote in message 
news:1163633657.029718.142070@f16g2000cwb.googlegroups.com...
> Hi > > I am very new to usb, I have some basic questions reagarding usb with > ahb . > > Suppose i have a ahb structure like 2 masters and 2 slaves. > i want to have 2usb devices .....will this usb (usb 2.0 device) sit on > the slave side ? > what will be on the master side ? suppose one dma as a master i have > will the another master be arm processor or can it be some other usb > device ? if so what could it be ? > why at all usb has to interface with ahb ? only to interact with > memories and arm processors ? > can you give me a real time example like take a usb pen drive where > will ahb comes into picture when i am connecting it to the computer ? > > regards >
terabits wrote:

> Hi > > I am very new to usb, I have some basic questions reagarding usb with > ahb . > > Suppose i have a ahb structure like 2 masters and 2 slaves. > i want to have 2usb devices .....will this usb (usb 2.0 device) sit on > the slave side ?
Unless you want to implement a lot of buffer memory on the device, it's probably more useful to integrate a DMA controller into the USB block and run it as a AHB master. But otherwise, yes, it could be a AHB slave.
> what will be on the master side ? suppose one dma as a master i have > will the another master be arm processor or can it be some other usb > device ? if so what could it be ? > why at all usb has to interface with ahb ? only to interact with > memories and arm processors ?
Yes. There would be no point having the USB device, unless you can move data to and from it.
> can you give me a real time example like take a usb pen drive where > will ahb comes into picture when i am connecting it to the computer ?
USB pen drives are simpler devices and unlikely to use a ARM processor. A typical ARM-with-USB-device application would be a MP3 player, like the iPod. A software stack on the processor would then use the USB device to implement the mass storage protocol. Kind regards, Iwo
Thanks a lot for your replies and clarifications...

so let me summarize what i have understood.

suppose i have a usb device with dma controller integrated that can sit
on ahb bus as a master and slave can be some memory device
or if it doesn't have any dma inside it it is still a slave and only
host controller can be master on it (with ahb interface)
right ?

>>>>>> USB Pen drive = USB Device = Slave. >>>>>>=> you have to control it with a USB HOST IP >>>>>>=> this IP should be integrated on the AHB Bus as a ....Slave
>>>>>>To do list :
->>>>>> integrate the USBHOSTSLAVE IP , host part , ( available at o>>>>>>pencores.org ) . This IP is Wishbone Slave Well in this above case let us think usb device is a slave then usb host ip has to be master right ? , are u saying some hoscontroller or some cpu which will be driving this "slave host ip" ???? on the bus..so host ip acts as both master and slave ? Regards On Nov 16, 7:20 am, Iwo Mergler <Iwo.Merg...@soton.sc.philips.com> wrote:
> terabits wrote: > > Hi > > > I am very new to usb, I have some basic questions reagarding usb with > > ahb . > > > Suppose i have a ahb structure like 2 masters and 2 slaves. > > i want to have 2usb devices .....will this usb (usb 2.0 device) sit on > > the slave side ?Unless you want to implement a lot of buffer memory on the > device, it's probably more useful to integrate a DMA controller > into the USB block and run it as a AHB master. > > But otherwise, yes, it could be a AHB slave. > > > what will be on the master side ? suppose one dma as a master i have > > will the another master be arm processor or can it be some other usb > > device ? if so what could it be ? > > why at all usb has to interface with ahb ? only to interact with > > memories and arm processors ?Yes. There would be no point having the USB device, unless you > can move data to and from it. > > > can you give me a real time example like take a usb pen drive where > > will ahb comes into picture when i am connecting it to the computer ?USB pen drives are simpler devices and unlikely to use > a ARM processor. A typical ARM-with-USB-device application > would be a MP3 player, like the iPod. > > A software stack on the processor would then use the USB > device to implement the mass storage protocol. > > Kind regards, > > Iwo
> Well in this above case let us think usb device is a slave then usb > host ip has to be master right ? > , are u saying some hoscontroller or some cpu which will be > driving this "slave host ip" ???? on the bus..so host ip acts as both > master and slave ?
Not exactly : i meant USB Host is slave on AMBA Bus and is connected to the USB Device via USB Cable , through a PHY (transceiver circuit) To control the USB device, "you" have to be Master on the AMBA Bus and access the memory range affected to the "USB Host AMBA Slave " (sic!) which in turn will control the USB Slave with USB Cmds. AMBA USB USB MASTER HOST IP **** PHY ***USB Cable********* DEVICE | | | | ==== AMBA BUS =========

thank you for that,so as i said im new..i may be having silly doubts.
so here it goes .let us think im connecting my camera to the computer
to download some stuff to the computer.
here my camera is a slave to computer.from outside world may be because
of its size or something.
but let us think camera has dma controller
so dma of host device (camera) will be master and will control the so
called host ip (usb host's memory) as a ahb master here   host is a
slave.
if above case is correct. i got it..and i am asking about the other
case..in what cases other than dma transfers (in this case it is host )
the devices will be as a USB slave and what kind of Master it needs ??
what will be the master. ??

regards



> Not exactly : i meant USB Host is slave on AMBA Bus and is connected to the > USB Device via USB Cable , through a PHY (transceiver circuit) > To control the USB device, "you" have to be Master on the AMBA Bus and > access the memory range affected to the "USB Host AMBA Slave " (sic!) > which in turn will control the USB Slave with USB Cmds. > > > AMBA USB > USB > MASTER HOST IP **** PHY ***USB Cable********* > DEVICE > | | > | | > ==== AMBA BUS =========
terabits wrote:

> > Thanks a lot for your replies and clarifications... > > so let me summarize what i have understood. > > suppose i have a usb device with dma controller integrated that can sit > on ahb bus as a master and slave can be some memory device > or if it doesn't have any dma inside it it is still a slave and only > host controller can be master on it (with ahb interface) > right ?
Any busmaster in the system can access it. Especially with a USB2.0 high speed device, you really don't want to move data with the processor. If the USB device is a AHB slave, you probably want to use the system's DMA controller as the master device for data transfer, not the processor. Kind regards, Iwo
thank you all for ur suggestions and clarifications, they helped me
alot.



> > right ?Any busmaster in the system can access it. Especially with > a USB2.0 high speed device, you really don't want to move > data with the processor. If the USB device is a AHB slave, > you probably want to use the system's DMA controller as > the master device for data transfer, not the processor. >