From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from snvl-smtp1.trimble.com (snvl-smtp1.trimble.com [155.63.64.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "snvl-smtp1.trimble.com", Issuer "Trimble CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6FC2CDE00E for ; Wed, 7 May 2008 03:39:56 +1000 (EST) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8AFA0.2D652C5D" Subject: porting pci driverfrom arch=ppc on kernel 2.6.16 to arch=powerpc on 2.6.24... Date: Tue, 6 May 2008 10:39:35 -0700 Message-ID: <161B3BAD77161449A144FF054231C3D6020D6A5D@uss-am-xch-01.am.trimblecorp.net> From: "Mike Timmons" To: List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is a multi-part message in MIME format. ------_=_NextPart_001_01C8AFA0.2D652C5D Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have a framebuffer driver for the Fujitsu CoralP that registers fine with the PCI bus and operates for my new arch=3Dpowerpc 2.6.24 build. = The only thing that failed when jumping from arch=3Dppc on my 2.6.16 kernel = to my new 2.6.24 kernel is the interrupt request. While testing other functionality I simply compiled-out the interrupt request because it is not always critical for basic frame buffer operation. I'm back to wanting the interrupt. =20 Specifically, I have a lite5200b-based board in both cases (2.6.14 and 2.6.24 kernels). Under the old ppc scheme I obtained irq=3D1 via a call = to =20 pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &irqnum). =20 Under my new powerpc kernel 2.6.24 I obtain irq=3D0 and the subsequent interrupt request fails. Also, a hard-coded irq=3D1 fails too. I know = this is an issue with NOT querying the device tree, but I'm not sure what to specify in lite5200b.dts, or what property I need to query to get the correct pci interrupt. =20 If anyone is familiar with lite5200b.dts, is all the info I need already in there, or do I need to add my pci device? I've done some mucking around in the dts file but I'm not a pci expert so I am a bit confused. ------_=_NextPart_001_01C8AFA0.2D652C5D Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I have a framebuffer driver for the Fujitsu CoralP that registers fine with the PCI bus and operates for my = new arch=3Dpowerpc 2.6.24 build. The only thing that failed when jumping from arch=3Dppc on = my 2.6.16 kernel to my new 2.6.24 kernel is the interrupt request. While = testing other functionality I simply compiled-out the interrupt request because = it is not always critical for basic frame buffer operation. I’m back to = wanting the interrupt.

 

Specifically, I have a = lite5200b-based board in both cases (2.6.14 and 2.6.24 kernels). Under the old ppc = scheme I obtained irq=3D1 via a call to

 

pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &irqnum).

 

Under my new powerpc kernel 2.6.24 = I obtain irq=3D0 and the subsequent interrupt request fails. Also, a = hard-coded irq=3D1 fails too. I know this is an issue with NOT querying the device = tree, but I’m not sure what to specify in lite5200b.dts, or what property I = need to query to get the correct pci interrupt.

 

If anyone is familiar with = lite5200b.dts, is all the info I need already in there, or do I need to add my pci = device? I’ve done some mucking around in the dts file but I’m not a pci expert = so I am a bit confused.

------_=_NextPart_001_01C8AFA0.2D652C5D-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id CBA01DDE28 for ; Wed, 7 May 2008 04:11:21 +1000 (EST) Message-ID: <48209F79.70506@freescale.com> Date: Tue, 06 May 2008 13:12:09 -0500 From: Scott Wood MIME-Version: 1.0 To: Mike Timmons Subject: Re: porting pci driverfrom arch=ppc on kernel 2.6.16 to arch=powerpc on 2.6.24... References: <161B3BAD77161449A144FF054231C3D6020D6A5D@uss-am-xch-01.am.trimblecorp.net> In-Reply-To: <161B3BAD77161449A144FF054231C3D6020D6A5D@uss-am-xch-01.am.trimblecorp.net> Content-Type: text/plain; charset=UTF-8; format=flowed Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mike Timmons wrote: > pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &irqnum). Don't do this; use pci_dev->irq instead. If that value doesn't work, check your interrupt-map in the pci node of the device tree. -Scott From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from snvl-smtp1.trimble.com (snvl-smtp1.trimble.com [155.63.64.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "snvl-smtp1.trimble.com", Issuer "Trimble CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 3DA0ADDF2B for ; Wed, 7 May 2008 05:27:42 +1000 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: porting pci driverfrom arch=ppc on kernel 2.6.16 to arch=powerpc on 2.6.24... Date: Tue, 6 May 2008 12:27:21 -0700 Message-ID: <161B3BAD77161449A144FF054231C3D6020D6B01@uss-am-xch-01.am.trimblecorp.net> References: <161B3BAD77161449A144FF054231C3D6020D6A5D@uss-am-xch-01.am.trimblecorp.net> <48209F79.70506@freescale.com> From: "Mike Timmons" To: List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Scott, Thanks for the quick answer. I did try this. I successfully get the interrupt (virq=3D16) but it then fires continuously, immedetely = following the request_irq call. My old ppc driver calls request_irq with flags SA_SHIRQ | SA_INTERRUPT (0x20000000 | 0x04000000 ). I can't find equivalencies in the new powerpc 2.6.24 kernel. The only flag I'm passing to request_irq under the new 2.6.24 is IRQF_SHARED. I'm wondering if some interrupt type setting is mucked up, hence the continuous interrupts. I only expect to receive this interrupt in response to an error on my coralP, so I shouldn't see the interrupt at all immediately following the interrupt request. Any ideas? Thanks again, Mike -----Original Message----- From: Scott Wood [mailto:scottwood@freescale.com]=20 Sent: Tuesday, May 06, 2008 1:12 PM To: Mike Timmons Cc: linuxppc-embedded@ozlabs.org Subject: Re: porting pci driverfrom arch=3Dppc on kernel 2.6.16 to arch=3Dpowerpc on 2.6.24... Mike Timmons wrote: > pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &irqnum). Don't do this; use pci_dev->irq instead. If that value doesn't work, check your interrupt-map in the pci node of=20 the device tree. -Scott From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from snvl-smtp1.trimble.com (snvl-smtp1.trimble.com [155.63.64.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "snvl-smtp1.trimble.com", Issuer "Trimble CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D7EB9DE1E2 for ; Wed, 7 May 2008 05:36:40 +1000 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: porting pci driverfrom arch=ppc on kernel 2.6.16 to arch=powerpc on 2.6.24... Date: Tue, 6 May 2008 12:36:19 -0700 Message-ID: <161B3BAD77161449A144FF054231C3D6020D6B08@uss-am-xch-01.am.trimblecorp.net> References: <161B3BAD77161449A144FF054231C3D6020D6A5D@uss-am-xch-01.am.trimblecorp.net> <48209F79.70506@freescale.com> From: "Mike Timmons" To: "Scott Wood" Cc: Mark Gibson , linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , If I'm not supposed to read the interrupt using config_read, should I also not be writing to the host register on the coral P to clear the interrupt? Should I instead be using some PCI helper functions?=20 I think I now have a valid interrupt, but seeing it fire continuously when I know when-and-how it is supposed to fire is the problem now. Obviously some of the code in the legacy driver for 2.6.16 ppc is not correct now. I suspect is it within the MB86290FB_WRITE_HOST_REGISTER() macros that are used to manipulate the interrupts mask register within the CoralP PCI graphics controller.=20 Please advise if there is some pci API I should be using to manipulate this and other registers under the 2.6.24 powerpc kernel. I do have a few books here with PCI examples but the interrupt information is sparse. Thanks again. -Mike From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 0D360DE36D for ; Wed, 7 May 2008 05:41:08 +1000 (EST) Message-ID: <4820B485.1020506@freescale.com> Date: Tue, 06 May 2008 14:41:57 -0500 From: Scott Wood MIME-Version: 1.0 To: Mike Timmons Subject: Re: porting pci driverfrom arch=ppc on kernel 2.6.16 to arch=powerpc on 2.6.24... References: <161B3BAD77161449A144FF054231C3D6020D6A5D@uss-am-xch-01.am.trimblecorp.net> <48209F79.70506@freescale.com> <161B3BAD77161449A144FF054231C3D6020D6B08@uss-am-xch-01.am.trimblecorp.net> In-Reply-To: <161B3BAD77161449A144FF054231C3D6020D6B08@uss-am-xch-01.am.trimblecorp.net> Content-Type: text/plain; charset=UTF-8; format=flowed Cc: Mark Gibson , linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mike Timmons wrote: > If I'm not supposed to read the interrupt using config_read, should I > also not be writing to the host register on the coral P to clear the > interrupt? > > Should I instead be using some PCI helper functions? No, clearing interrupts is device-specific. Have you verified that the device does not think it's generating an interrupt during the interrupt storm? Do other PCI cards work? -Scott