Re: [linux-sh:03326] new board for 2.6.8.1

Paul Mundt <[email protected]> Fri, 1 Oct 2004 15:37:29 +0300
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.ports.sh.general
Message-ID <[email protected]>
On Thu, Sep 30, 2004 at 03:54:23PM +0900, [email protected] wrote:
> I implemented the irq routing to arch/sh/drivers/pci/ops-sh03.c
>  as pcibios_map_platform_irq().
> Since CTP/PCI-SH03 uses dev->bus->number in the irq routing, 
> I added pci_dev *dev to the parameter of pcibios_map_platform_irq()
>  in #ifdef  CONFIG_SH_SH03.
> 
If you need the pdev, the better solution is to just do all of this as your own
fixup in arch/sh/drivers/pci/fixups-sh03.c. The way to do this would be to
implement your own pcibios_fixup_irqs() in the fixups-sh03.c which in turn does
the proper swizzling and irq routing (which in this case will get you access to
the pdev for free).

In order for this to work in the SH7751 case though, we need to make the
existing pcibios_fixup_irqs() in arch/sh/drivers/pci/pci-sh7751.c a weak symbol,
which can then be overloaded by the fixups-sh03.c definition.

So, please implement your routing in fixups-sh03.c, get rid of your changes
to pci-sh7751.c entirely, and try something like this:

--- orig/arch/sh/drivers/pci/pci-sh7751.c
+++ mod/arch/sh/drivers/pci/pci-sh7751.c
@@ -33,6 +33,8 @@
 static unsigned int pci_probe = PCI_PROBE_CONF1;
 extern int pci_fixup_pcic(void);
 
+void pcibios_fixup_irqs(void) __attribute__ ((weak));
+
 /*
  * Direct access to PCI hardware...
  */
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBXU+Jvfgmmv+NIDsRAhv1AJ91YjH2X+w6dBQQMYkoIFjqhUiDDgCfahGQ
aZEUZKQbQ16KM7kTonWjoPg=
=7x6m
-----END PGP SIGNATURE-----