* pci32 code - early_*config* @ 2009-04-15 6:17 Kumar Gala 2009-04-17 7:25 ` Benjamin Herrenschmidt 0 siblings, 1 reply; 7+ messages in thread From: Kumar Gala @ 2009-04-15 6:17 UTC (permalink / raw) To: Benjamin Herrenschmidt; +Cc: Linuxppc-dev Development Ben, I was looking at what I need to get some additional bits of PCI code building w/your ppc64 booke patches. One thing it looks like we need is the early config cycle code. The question I have is do we think we still need the null_ops support? Also do we think we every get called with a NULL hose? This is fake_pci_bus() in arch/powerpc/kernel/pci_32.c - k ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pci32 code - early_*config* 2009-04-15 6:17 pci32 code - early_*config* Kumar Gala @ 2009-04-17 7:25 ` Benjamin Herrenschmidt 2009-04-17 8:03 ` Roderick Colenbrander 0 siblings, 1 reply; 7+ messages in thread From: Benjamin Herrenschmidt @ 2009-04-17 7:25 UTC (permalink / raw) To: Kumar Gala; +Cc: Linuxppc-dev Development On Wed, 2009-04-15 at 01:17 -0500, Kumar Gala wrote: > Ben, > > I was looking at what I need to get some additional bits of PCI code > building w/your ppc64 booke patches. One thing it looks like we need > is the early config cycle code. The question I have is do we think we > still need the null_ops support? Also do we think we every get called > with a NULL hose? > > This is fake_pci_bus() in arch/powerpc/kernel/pci_32.c Hrm. I'm not fan of the early config stuff, remind me why we need it ? Ben. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pci32 code - early_*config* 2009-04-17 7:25 ` Benjamin Herrenschmidt @ 2009-04-17 8:03 ` Roderick Colenbrander 2009-04-17 8:33 ` Benjamin Herrenschmidt 0 siblings, 1 reply; 7+ messages in thread From: Roderick Colenbrander @ 2009-04-17 8:03 UTC (permalink / raw) To: Benjamin Herrenschmidt; +Cc: Linuxppc-dev Development On Fri, Apr 17, 2009 at 9:25 AM, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote: > On Wed, 2009-04-15 at 01:17 -0500, Kumar Gala wrote: >> Ben, >> >> I was looking at what I need to get some additional bits of PCI code >> building w/your ppc64 booke patches. =A0One thing it looks like we need >> is the early config cycle code. =A0The question I have is do we think we >> still need the null_ops support? =A0Also do we think we every get called >> with a NULL hose? >> >> This is fake_pci_bus() in arch/powerpc/kernel/pci_32.c > > Hrm. > > I'm not fan of the early config stuff, remind me why we need it ? > > Ben. > > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev > There are cases when it is really needed (or you would have to access the address and data bus by hand). In my case I'm using a Xilinx PLB soft-core and if certain options in the configuration header aren't set (which aren't set by default) the soft-core is basically disabled. Cases like this look like valid cases in which early config should be used. Roderick Colenbrander ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pci32 code - early_*config* 2009-04-17 8:03 ` Roderick Colenbrander @ 2009-04-17 8:33 ` Benjamin Herrenschmidt 2009-04-17 14:08 ` Kumar Gala 0 siblings, 1 reply; 7+ messages in thread From: Benjamin Herrenschmidt @ 2009-04-17 8:33 UTC (permalink / raw) To: Roderick Colenbrander; +Cc: Linuxppc-dev Development On Fri, 2009-04-17 at 10:03 +0200, Roderick Colenbrander wrote: > > There are cases when it is really needed (or you would have to access > the address and data bus by hand). In my case I'm using a Xilinx PLB > soft-core and if certain options in the configuration header aren't > set (which aren't set by default) the soft-core is basically disabled. > Cases like this look like valid cases in which early config should be > used. I still wonder whether we could just setup the pci_controller data structure and use "normal" PCI config access routines... Cheers, Ben. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pci32 code - early_*config* 2009-04-17 8:33 ` Benjamin Herrenschmidt @ 2009-04-17 14:08 ` Kumar Gala 2009-04-17 17:05 ` Benjamin Herrenschmidt 0 siblings, 1 reply; 7+ messages in thread From: Kumar Gala @ 2009-04-17 14:08 UTC (permalink / raw) To: Benjamin Herrenschmidt; +Cc: Linuxppc-dev Development, Roderick Colenbrander On Apr 17, 2009, at 3:33 AM, Benjamin Herrenschmidt wrote: > On Fri, 2009-04-17 at 10:03 +0200, Roderick Colenbrander wrote: >> >> There are cases when it is really needed (or you would have to access >> the address and data bus by hand). In my case I'm using a Xilinx PLB >> soft-core and if certain options in the configuration header aren't >> set (which aren't set by default) the soft-core is basically >> disabled. >> Cases like this look like valid cases in which early config should be >> used. > > I still wonder whether we could just setup the pci_controller data > structure and use "normal" PCI config access routines... The problem is that the "normal" PCI config access routines need a pci_bus. However we don't have one yet and we need to do PCI config cycles to the PHB before we call the remainder of the setup code to get one. We could all call our own ops directly and provide a fake bus but this is pretty much what the early routines do for us in a common way. - k ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pci32 code - early_*config* 2009-04-17 14:08 ` Kumar Gala @ 2009-04-17 17:05 ` Benjamin Herrenschmidt 2009-04-17 17:38 ` Kumar Gala 0 siblings, 1 reply; 7+ messages in thread From: Benjamin Herrenschmidt @ 2009-04-17 17:05 UTC (permalink / raw) To: Kumar Gala; +Cc: Linuxppc-dev Development, Roderick Colenbrander On Fri, 2009-04-17 at 09:08 -0500, Kumar Gala wrote: > The problem is that the "normal" PCI config access routines need a > pci_bus. However we don't have one yet and we need to do PCI config > cycles to the PHB before we call the remainder of the setup code to > get one. > > We could all call our own ops directly and provide a fake bus but > this > is pretty much what the early routines do for us in a common way. Ah right, slipped out of my mind. Oh well, easy to make the code common, move it to pci-common.c Cheers, Ben. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: pci32 code - early_*config* 2009-04-17 17:05 ` Benjamin Herrenschmidt @ 2009-04-17 17:38 ` Kumar Gala 0 siblings, 0 replies; 7+ messages in thread From: Kumar Gala @ 2009-04-17 17:38 UTC (permalink / raw) To: Benjamin Herrenschmidt; +Cc: Linuxppc-dev Development, Roderick Colenbrander On Apr 17, 2009, at 12:05 PM, Benjamin Herrenschmidt wrote: > On Fri, 2009-04-17 at 09:08 -0500, Kumar Gala wrote: >> The problem is that the "normal" PCI config access routines need a >> pci_bus. However we don't have one yet and we need to do PCI config >> cycles to the PHB before we call the remainder of the setup code to >> get one. >> >> We could all call our own ops directly and provide a fake bus but >> this >> is pretty much what the early routines do for us in a common way. > > Ah right, slipped out of my mind. Oh well, easy to make the code > common, move it to pci-common.c Right, I can do that... In doing so I was wondering two things w/ regards to fake_pci_bus: 1. can we drop the hose == 0 check, it looks like there are 3 users of the early pci ops code (fsl, 4xx, pmac). The FSL one I can say passes a valid hose in and it looks like 4xx does as well. The pmac code is always a bit more trick so I figured you might know 2. Do we believe those hose->ops is always valid -- again FSL & 4xx it is, pmac?? static struct pci_bus * fake_pci_bus(struct pci_controller *hose, int busnr) { static struct pci_bus bus; if (hose == 0) { hose = pci_bus_to_hose(busnr); if (hose == 0) printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr); } bus.number = busnr; bus.sysdata = hose; bus.ops = hose? hose->ops: &null_pci_ops; return &bus; } ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-04-17 17:39 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-04-15 6:17 pci32 code - early_*config* Kumar Gala 2009-04-17 7:25 ` Benjamin Herrenschmidt 2009-04-17 8:03 ` Roderick Colenbrander 2009-04-17 8:33 ` Benjamin Herrenschmidt 2009-04-17 14:08 ` Kumar Gala 2009-04-17 17:05 ` Benjamin Herrenschmidt 2009-04-17 17:38 ` Kumar Gala
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).