From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, Bruce_Leonard@selinc.com
Subject: Re: Question about combining a PCI driver with an OF driver
Date: Wed, 05 Jan 2011 08:05:57 +1100 [thread overview]
Message-ID: <1294175157.17779.120.camel@pasglop> (raw)
In-Reply-To: <20110104132317.006ead39@udp111988uds.am.freescale.net>
On Tue, 2011-01-04 at 13:23 -0600, Scott Wood wrote:
> On Tue, 4 Jan 2011 10:58:35 -0800
> <Bruce_Leonard@selinc.com> wrote:
>
> > Hi all,
> >
> > I'm working on a project with an MPC8347 and three ethernet ports. Because
> > of end of life issues we've had to replace the part we're using for the
> > third ethernet port and we decided rather than rely on a vendor who would
> > pull a part out from under us every two to three years we would do our own
> > MAC in an FPGA. In order to reduce driver work it was decided that we
> > would use the same hardware interface as the TSEC in the 8347 so we could
> > reuse the gianfar driver.
>
> Making a faithful clone of any reasonably complex device strikes me as
> more work than writing a new ethernet driver.
>
> The last thing you want to end up doing is...
>
> > And for speed sake it would go on the PCI bus.
> > (So much for letting HW make decisions regarding SW :) )
>
> ...hacking up the existing driver to deal with the quirks of the clone,
> and having to maintain those hacks. :-)
I definitely agree. You're up for more work and problems than just doing
a new design or getting an existing one off opencores or even buying an
IP block with its own driver.
> > So now I'm stuck with hacking the gianfar driver to work on PCI. However,
> > I think it would be a lot more elegant if I could wrap the gianfar driver
> > with a PCI interface. After all the idea is sound, with a HW interface
> > that looks like the TSEC I should be able to reuse the gianfar driver. But
> > the gianfar driver is an open firmware driver registered with a call to
> > of_register_platform_driver() and depending on the order in which the
> > busses are walked the PCI bus may not be enumerated and available when the
> > onboard TSECS are detected and the gianfar driver claims them.
>
> It shouldn't matter -- the way buses work in Linux, you should be able
> to add a platform device at any time, and the driver will receive a
> probe() callback. The driver never actively searches for devices to
> claim.
Cheers,
Ben.
> -Scott
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
prev parent reply other threads:[~2011-01-04 21:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 18:58 Question about combining a PCI driver with an OF driver Bruce_Leonard
2011-01-04 19:23 ` Scott Wood
2011-01-04 21:00 ` Bruce_Leonard
2011-01-04 21:20 ` Scott Wood
2011-01-04 22:03 ` Bruce_Leonard
2011-01-04 21:26 ` Sean MacLennan
2011-01-04 21:05 ` Benjamin Herrenschmidt [this message]
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=1294175157.17779.120.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=Bruce_Leonard@selinc.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.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