AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20071017104412.5515795c@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<ralf@linux-mips.org>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	20071017133152.GA23639@linux-mips.org
X-Sylpheed-End-Special-Headers: 1
Date: Wed, 17 Oct 2007 10:49:40 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: paging problem with ide-cs driver
Message-ID: <20071017104940.4698511f@ripper.onstor.net>
In-Reply-To: <20071017133152.GA23639@linux-mips.org>
References: <20071009132657.64ec9158@ripper.onstor.net>
	<20071009220530.0416792b@the-village.bc.nu>
	<20071010112550.GA1780@linux-mips.org>
	<20071010075041.60350e8a@ripper.onstor.net>
	<20071010163032.GA10243@linux-mips.org>
	<20071012152321.580b6841@ripper.onstor.net>
	<20071012233848.GB10255@linux-mips.org>
	<20071014185844.2ea76a22@ripper.onstor.net>
	<20071017133152.GA23639@linux-mips.org>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Wed, 17 Oct 2007 14:31:52 +0100 Ralf Baechle <ralf@linux-mips.org>
wrote:

> On Sun, Oct 14, 2007 at 06:58:44PM -0700, Andrew Sharp wrote:
> 
> > diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c
> > index c1ac649..f1ab391 100644
> > --- a/arch/mips/pci/pci-sb1250.c
> > +++ b/arch/mips/pci/pci-sb1250.c
> > @@ -42,7 +42,7 @@
> >  
> >  #include <asm/sibyte/sb1250_defs.h>
> >  #include <asm/sibyte/sb1250_regs.h>
> > -#include <asm/sibyte/sb1250_scd.h>
> > +#include <asm/sibyte/sb1250.h>
> >  #include <asm/sibyte/board.h>
> >  
> >  /*
> > @@ -84,10 +84,12 @@ static inline void WRITECFG32(u32 addr, u32
> > data) *(u32 *) (cfg_space + (addr & ~3)) = data;
> >  }
> >  
> > +#ifdef CONFIG_SIBYTE_CFE
> >  int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> >  {
> >  	return dev->irq;
> >  }
> > +#endif
> 
> This one is curious.  It only works for CONFIG_SIBYTE_CFE under the
> assumption that CFE and Linux use the same interrupt numbering.  If
> you disable this, how does your kernel build at all?  I assume there
> must be more than what you have in your patch.  If you have a
> solution to properly assign PCI interrupts without reliance on CFE,
> I'd definately. be interested in your code.

No, I don't ~:^) It's just that for my platform, I have a
pcibios_map_irq function that is just a bit different, because we don't
have CFE and the irqs for PCI devices aren't set up at all, so I use
this function as a poor man's pci bios, at least for setting up irqs.

So, to answer your question, if you're lucky enough to have CFE, you're
good to go, otherwise you have to hack some more.

I can send you the whole patch, but I figured you would not be
interested in the platform specific stuff, it's quite boring.

Cheers,

a

Here is my pcibios_map_irq:



#define COUGAR_CF_IRQ	56

/*
 * paste in the irqs for the CF controller
 * these really should be probe-able
 */
 int __init
pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
	if ((dev->vendor == PCI_VENDOR_ID_TI) &&
		(dev->device == PCI_DEVICE_ID_TI_1520)) {

		/*
		 * the TI pcmcia bridge shows as two (multi)funcs 0 and 1, in slot 2
		 */
		return COUGAR_CF_IRQ + pin - 1;
	}

	return dev->irq;
}
