linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: linux-usb@vger.kernel.org, "Michael Büsch" <m@bues.ch>,
	"Rafał Miłecki" <zajec5@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: bcma USB Host driver
Date: Mon, 21 Nov 2011 22:56:41 +0100	[thread overview]
Message-ID: <4ECAC919.4080408@hauke-m.de> (raw)

Hi,

I am thinking on how to implement the usb host driver for the bcma bus
correctly. bcma is the driver for Broadcom's AMBA implementation (see
drivers/bcma/ ) and on SoCs it also provides a core with an USB Host
controller. This USB host controller has an OHCI and an EHCI interface
on different addresses, but it is on core on this bus, just with two
address spaces [0]. For the software developers point of view it is
pretty similar to Braodcoms SSB bus, for which I have the same problem.

The bcma bus driver exposes one device for this core which is
responsibility for EHCI and OHCI at the same time. Now I implemented a
driver for ehci and one for ohci but just one gets registered, because
only one is able to claim this device. I based my work on how it is done
for the ssb bus, which is similar to the bcma bus implementation and
there is already a ohci driver for ssb in the kernel (see
drivers/usb/host/ohci-ssb.c ), but no ehci driver (I want to add that
also, for now we only have some hacky think in OpenWrt).

The Broadcom hardware uses a standard ehci and ohci interface, there are
just some register reads and writes needed at startup to work around
some hardware bugs. In the Braodcom SDK they are registering the USB
core as two PCI device and are using the normal pci drivers.

To provide ehci and ohci at the same time I came up with some solutions:

1. The OHCI driver also initializes the EHCI driver, when it gets load
and is an USB 2.0 device. This is how it is done in OpenWrt and I do not
like it [1].
2. bcma provides two devices with different identification and there are
two independ drivers working with it.
3. bcma handles the usb registration directly and all code goes to
drivers/bcma/
4. Is there some way like a platform device with a memory address which
I could register and which is then handled by the usb system?

Are there any better approaches on how to do this? I do not think I am
the first person with such a problem.

Hauke

[0]:
https://github.com/hauke/openwrt/commit/43e4344b7b8b4d7fb5a6220066effde30cb00501#diff-4
[1]:
https://dev.openwrt.org/browser/trunk/target/linux/brcm47xx/patches-3.0/023-usb_ehci_ohci.patch

             reply	other threads:[~2011-11-21 21:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 21:56 Hauke Mehrtens [this message]
2011-11-22 11:50 ` bcma USB Host driver Arend van Spriel
2011-11-25 23:56   ` Hauke Mehrtens
2011-11-26  1:27     ` Alan Stern
2011-11-27  0:18       ` Hauke Mehrtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ECAC919.4080408@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=m@bues.ch \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).