From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by ozlabs.org (Postfix) with ESMTP id 7577CDDE07 for ; Tue, 31 Mar 2009 01:33:16 +1100 (EST) Received: by wf-out-1314.google.com with SMTP id 24so2325956wfg.15 for ; Mon, 30 Mar 2009 07:33:15 -0700 (PDT) Message-ID: <49d0d82a.09038e0a.585d.348b@mx.google.com> From: "sylvain louchez" To: Subject: using IRQ1 in mpc5121ads Date: Mon, 30 Mar 2009 10:33:11 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000F_01C9B122.EE172B30" Reply-To: sylvain.louchez@g4apps.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C9B122.EE172B30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, I'm a newbie looking for where the documentation and implementation model can be found. My custom driver is looking for an interrupt notification from the kernel - and it registers in the /proc/interrupts file as expected when installed, i.e. $insmod custom_driver.ko gps_irq= **Note - this part's OK, I see the instance in /proc/interrupts after I load it** On the hardware side the actual signal is a 1 Hz pulse (from GPS) routed to IRQ1 through the board's CPLD. This is the only interrupt on IRQ_1 so we can keep the logic simple i.e. on IRQ1 we can just jump to the service routine in a custom driver. I understand 2 things have to be done: 1. create an entry in the dts file; I think we've got this understood through advice already received - for example the new interrupt entry can be created in the dts file - something like: gps@0 { // there is no address so just make it 0 compatible = "gps_interrupt"; interrupts = <17 0x8>; // 17 is irq1, 8 is level low, see include/linux/irq.h for others interrupt-parent = < &ipic >; }; 2. but now we need to relate the actual interrupt to the virtual interrupt called in the driver... by invoking the function irq_of_parse_and_map - but we don't know how to do it - nor have we found how to do it in browsing through the open source documentation A secondary question: where to properly add this function call in the file system? Are we on the right track here? Is there sample/ tutorial code you could point us to? Thanks in advance for any pointers - documentation on these mechanisms, sample code. Sylvain Louchez ------=_NextPart_000_000F_01C9B122.EE172B30 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello, I’m a newbie looking for where the = documentation and implementation model can be = found…

 

My custom driver is looking for an interrupt = notification from the kernel - and it registers in the /proc/interrupts file as = expected when installed, i.e.

$insmod custom_driver.ko = gps_irq=3D<n>

**Note - this part's OK, I see the instance in /proc/interrupts after I load it**

 

On the hardware side the actual signal is a 1 Hz = pulse (from GPS) routed to IRQ1 through the board's CPLD. This is the only interrupt = on IRQ_1 so we can keep the logic simple i.e. on IRQ1 we can just jump to = the service routine in a custom driver.

 

I understand 2 things have to be = done:

 

1. create an entry in the dts file; I think we've got = this understood through advice already received - for example the new = interrupt entry can be created in the dts file - something = like:

 

gps@0 {      // there is no = address so just make it 0

    compatible =3D = "gps_interrupt";

    interrupts =3D <17 = 0x8>;         // 17 is irq1, = 8 is level low, see include/linux/irq.h for = others

    interrupt-parent =3D < = &ipic >;

};

 

2. but now we need to relate the actual interrupt to = the virtual interrupt called in the driver... by invoking the function irq_of_parse_and_map - but we don't know how to do it - nor have we = found how to do it in browsing through the open source = documentation

A secondary question: where to properly add this = function call in the file system?

 

Are we on the right track here? Is there sample/ = tutorial code you could point us to?

 

Thanks in advance for any pointers - documentation on = these mechanisms, sample code…

 

Sylvain Louchez

 

------=_NextPart_000_000F_01C9B122.EE172B30--