views:

106

answers:

4

Hi,

I m bit confused by the following statement in linux device drivers book. http://www.linuxdriver.co.il/ldd3/

13.2. USB and Sysfs To help understand what this long device path means, we describe how the kernel labels the USB devices. The first USB device is a root hub. This is the USB controller, usually contained in a PCI device. The controller is so named because it controls the whole USB bus connected to it. The controller is a bridge between the PCI bus and the USB bus, as well as being the first USB device on that bus.

Especially the statement "The controller is a bridge between the PCI bus and the USB bus"

Is it so? I m under the impression that PCI and USB are both distinct Buses. Please clarify.

+2  A: 

The USB controller communicates both USB and PCI. USB does not directly talk to the CPU, but rather across the PCI bus first.

Daniel A. White
" USB does not directly talk to the CPU, but rather across the PCI bus first."Is that mean we cannot "only have USB controller" in our machine.Is it always mandatory to have PCI bus in order to use USB devices.I m puzzled?
kumar
there might be implementations that do that, but i am not sure.
Daniel A. White
+1  A: 

Two very simple flow diagrams:

Userspace -> Kernel -> PCI -> USB Controller -> USB Device

USB Device -> USB Controller -> PCI -> Kernel -> Userspace

Or, better put:

Userspace -> Kernel -> [CARD_ARCHITECTURE] -> USB Controller -> USB Device

USB Device -> USB Controller -> [CARD_ARCHITECTURE] -> Kernel -> Userspace

... as you see, PCI is rather incidental. Are you writing a device driver?

Tim Post
seems you are correct !http://en.wikipedia.org/wiki/Universal_Serial_BusI have not seen any mention about PCI here :(
kumar
@kumar, PCI is kind of incidental here ... it could be a number of other architectures too. I have seen primitive USB cards built on MCA.
Tim Post
+1  A: 

They are indeed distinct busses, which is why you need a bridge between them so the CPU can, over PCI, through the bridge, communicate with stuff on the USB bus.

CPU ---(front-side bus)----  PCI controller ----(PCI-bus)-+--   USB controller ----(USB-bus)--+-- USB mouse
                                                          |                                   +--- USB printer
                                                          +--   SATA controller
Wim
Is that mean PCI controller and pci bus is always required for a usb device to function ??
kumar
From a hardware point of view: yes. From the software side, all PCI stuff will be handled for you at another layer, you only need to wory about USB function calls.
Wim
+2  A: 

The "Controller" refer to above is a piece of Hardware. It houses functionality to "bridge" communications between a USB interface and a PCI interface.

By "bridging" it is meant that USB protocol packets are transferred to/from the CPU / USB ports but usually through a PCI "bus".

The reasons a hop through a PCI bus is used probably comes down to 2:

  • 1 interface is better than two (cost & complexity wise)
  • USB is much slower speed than PCI (certainly PCI-Express): it is easy just to "encapsulate" USB protocol packets onto PCI for shuttling those around the motherboard.

Note: there is often confusion when it comes to naming hardware chips. For efficient (read $$) reasons, it is quite common to have chips that house multiple functions. It is not because the main function of a chip is "PCI bridge" that it must be limited to perform "PCI bridging".

jldupont
hmm....but why a PCI controller needs to worry about USB controller / device.PCI controller for pci deviceUSB controller for usb deviceWhy there is a requirement to bridge USB interface and a PCI interface?USB is faster than PCI ( my understanding)By connecting USB to PCI we may reduce the speed of USB ... I m wrong??
kumar
Look at it from another angle: the piece of Hardware on the board houses lots of functionality including (but maybe not limited to) PCI bridging, PCI-USB bridging etc.
jldupont
A USB *controller* is actually a PCI *device* at the same time...! (see my picture in the other answer: it connects to PCI at the left side, being a slave their, and is master for the USB bus at the right side)
Wim
@Wim: yes from a **packaging** point of view but from a functional point of view, a PCI device is a **different** thing than a USB device.
jldupont