Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Steve Brown <sbrown@cortland.com>
To: linux-mips <linux-mips@linux-mips.org>
Subject: SSB Bus: Need advice representing 2 devices in a core (BCM5354 USB2.0 core)
Date: Sun, 09 Dec 2007 17:55:12 -0800	[thread overview]
Message-ID: <475C9C80.4030708@cortland.com> (raw)

I'm posting to this list because I think this is basically a ssb bus 
issue. If it doesn't belong here, where should I go?

The USB 2.0 core in the BCM5354 is both a OHCI & EHCI device. I now have 
a OHCI & EHCI driver. The former is essentially the current ohci-ssb.c 
w/ a dma mask fix and the latter I derived from ohci-ssb and ehci-pci. 
Either one, but not both, will attach to the USB 2.0 core and mostly work.

1. Multiple devices per core

The ssb bus code seems to expect only one device per core. I modified 
drivers/ssb/scan.c to add an additional identical device in the case of 
the USB 2.0 core.  However, once a driver binds to one device, the other 
seems to no longer be available either. When the second driver loads, 
ssb_bus_match never sees the second device. I haven't figured out what's 
happening yet.

I also considered modifying drivers/ssb/scan.c to add a phony additional 
core/device for SSB_DEV_USB20_HOST and then add that phony core to the 
OHCI device list. But, this seems really ugly.

2. Avoiding multiple core initializations

I also need a way to determine if the core is already enabled, as I 
can't initialize it more than once. The initialization gets done in the 
probe code in ohci-ssb and ehci-ssb.  The first one loaded does that and 
the second driver needs to skip the initialization. Does the following 
look like a safe test for a reset core?

(ssb_read32(dev, SSB_TMSLOW) & SSB_TMSLOW_RESET)

As ssb_enable always first resets the core, maybe this test isn't always 
reliable. If it isn't, should I just add a flag to the ssb_device 
structure that follows ssb_enable/ssb_disable?

Any suggestions are appreciated. As I'm probably less than qualified to 
be doing this, I'll accept that as advice as well.

Steve

                 reply	other threads:[~2007-12-10  1:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=475C9C80.4030708@cortland.com \
    --to=sbrown@cortland.com \
    --cc=linux-mips@linux-mips.org \
    /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