public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Felix Radensky <felix@embedded-sol•com>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>,
	linuxppc-dev@ozlabs•org
Subject: Re: MPC8536 PCI rescan to discover FPGA
Date: Wed, 30 Sep 2009 09:06:25 +0200	[thread overview]
Message-ID: <4AC30371.80509@embedded-sol.com> (raw)
In-Reply-To: <1253604183.7103.213.camel@pasglop>

Hi, Benjamin

Benjamin Herrenschmidt wrote:
> Right. However, in case it's a bit too much work to get
> hotswap implemented on the machine, you may still be able
> to do something simpler from your platform code, after you've
> finished loading the FPGA. I assume the FPGA doesn't contain a
> P2P bridge that would require probing further below the FPGA
> itself.
>
> The basic idea is to call pci_scan_slot() on the devfn where
> the FPGA is supposed to respond.
>
> Then you need to also do some fixup. First you need to call
> pcibios_setup_bus_devices(). This will wire up the device
> to an OF node if you have one, setup some default DMA ops,
> etc...
>
> Note that this function will walk over all devices on that bus
> which is interesting since some of those may have already been
> fully setup initially. Hopefully that isn't a problem. If it
> was to become one, we would have to figure out a way to skip
> devices that have already been "setup".
>
> And finally you call pcibios_finish_adding_to_bus() which will
> do the resource allocation pass on all new devices on the bus
> and register them with the core device layer.
>
> Cheers,
> Ben.
>
>   
Thanks for the advice. This approach worked well for me, with some minor
modifications. First I had to clear PPC_INDIRECT_TYPE_NO_PCIE_LINK
in hose->indirect_type, otherwise reads from configuration space fail. And
second, I had to call pci_assign_resource() to complete the assignment 
of FPGA
memory. The memory range is 0x0 - 0x7fffff, and PCI code doesn't like 
resources
starting at 0.

Again, thanks a lot for your help, much appreciated.

Felix.

      reply	other threads:[~2009-09-30  7:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21 15:35 MPC8536 PCI rescan to discover FPGA Felix Radensky
2009-09-21 16:04 ` David Hawkins
2009-09-22  7:23   ` Benjamin Herrenschmidt
2009-09-30  7:06     ` Felix Radensky [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=4AC30371.80509@embedded-sol.com \
    --to=felix@embedded-sol$(echo .)com \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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