[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201104191546.49632.arnd@arndb.de>
Date: Tue, 19 Apr 2011 15:46:49 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Rafał Miłecki <zajec5@...il.com>
Cc: George Kashperko <george@...u.edu.ua>,
Hauke Mehrtens <hauke@...ke-m.de>,
Russell King <rmk@....linux.org.uk>,
linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Arend van Spriel <arend@...adcom.com>,
Jonas Gorski <jonas.gorski@...il.com>,
b43-dev@...ts.infradead.org, Greg KH <greg@...ah.com>,
Andy Botting <andy@...ybotting.com>,
Larry Finger <Larry.Finger@...inger.net>
Subject: Re: Could I (ab)use bus (struct bus_type) for virtual Broadcom bus?
On Monday 18 April 2011, Rafał Miłecki wrote:
> W dniu 18 kwietnia 2011 16:19 użytkownik Arnd Bergmann <arnd@...db.de> napisał:
> > You mean the hardware has two sets of registers containing the same
> > information, one of them the standard registers, and one with broadcom
> > specific ones?
> >
> > Why don't you just use the standard ones then?
>
> No. Did you read my first mail in this thread?
I'm sorry, but I found the information in this thread and the related ones
highly confusing and sometimes contradictory. Thanks for clarifying it
once more.
> There is pair of cores for every device. First is AMBA-specific called
> agent/wrapper and second one is Broadcom-specific.
>
> AMBA specific core called agent/wrapper has AMBA specific registers:
> CID and PID. However we do not ever read that in Broadcom driver,
> because that are useless for us. On AMBA specific core we use only
> some Broadcom specific registers to manage (enable/disable) second
> (Broadcom-specific) core.
Ideally, we should model the devices along the IP blocks and how they
fit together. If I understand correctly what you are saying, your hardware
looks like
pci_dev
|
+---------+-----------+ ...
| | |
amba_dev amba_dev amba_dev
| | |
bcm_dev bcm_dev bcm_dev
In that case, you would need three bus types (pci_bus, amba_bus and
your own bcm_bus) and at least seven devices to represent all of it
using the device model. This is possible, but it seems you are also
saying that you don't need the complexity of this, e.g. because you
don't care about the amba device at all.
The easiest shortcut would be to not represent the AMBA devices
at all, and I guess that is fine. Introducing your own bus_type
for the broadcom devices sounds like a correct way to use the
linux driver model, especially if the devices on that bus are
totally independent from one another. I think you should do that
if you have e.g. a PCI card containing a single PCI function with
multiple IP blocks that do completely unrelated things (wifi,
bluetooth, ethernet, ...).
You could also just use platform_devices if you don't want to
introduce your own bus, and there is not much commonality between
the devices in terms of probing them.
However, I would not use the device model if the IP blocks in your
device are just responsible for different aspects of one logical
device, e.g. PHY, power management and DMA within a single network
adapter. If that is what you have, don't use a Linux device for
each of those blocks at all, but instead do a "library" module
for each block: export some interfaces from the module that can
be used by multiple drivers, and create the data structure from
the main driver, filled out with the data describing the IP
block (memory ranges, interrupts, etc).
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists