Re: External interrupt on 460EX

2008-10-16 Thread Stefan Roese
Felix,

On Wednesday 15 October 2008, Felix Radensky wrote:
  The interrupt is connected to GPIO 45. U-Boot (1.3.4) configures this
  pin as external interrupt 12 (interrupt 20 in UIC 3). I've added the
  following
  entry to board device tree (in opb section)
 
  [EMAIL PROTECTED],0 {
  device_type = cpld;
  interrupts = 20 1;
 
  Is this interrupt active on rising edge? This is what you have configured
  here. When you need level, active low, then you need to write:
 
   interrupts = 20 8;
 
  And be careful which dts version you are using. Is this 20 decimal or
  hex?

 The interrupt is indeed level, active low. Where can I find information
 on UIC
 interrupt settings for device tree ?

Not sure if this is really documented. Those values are from 
include/asm-ppc/irq.h:

#define IRQ_TYPE_NONE   0x  /* Default, unspecified type 
*/
#define IRQ_TYPE_EDGE_RISING0x0001  /* Edge rising type */
#define IRQ_TYPE_EDGE_FALLING   0x0002  /* Edge falling type */
#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
#define IRQ_TYPE_LEVEL_HIGH 0x0004  /* Level high type */
#define IRQ_TYPE_LEVEL_LOW  0x0008  /* Level low type */

 I'm using dtc 1.2.0, 20 is decimal. 
 Is it ok ?

This doesn't really depend on the dtc version but on the version of the dts 
file itself. Is your dts a v1 dts file? Do you have this in your dts:

/dts-v1/;

?

If yes, then you have a v1 dts file and all number without 0x are decimal 
numbers. Then the 20 is correct for ext IRQ 12. If not then this number is 
hex and you should write 14 instead.

  interrupt-parent = UIC3;
  };
 
  In my driver I do the following:
 
  /* Find CPLD node in device tree */
  np = of_find_node_by_type(NULL, cpld);
  if (!np) {
  printk(KERN_INFO No CPLD found in device tree\n);
  return -1;
  }
 
  /* Get and map irq number from device tree */
  cpld_irq = irq_of_parse_and_map(np, 0);
  if (cpld_irq == NO_IRQ) {
  printk(KERN_ERR irq_of_parse_and_map failed\n);
  of_node_put(np);
  return -ENODEV;
  }
 
  /* Register CPLD interrupt handler */
  rc = request_irq(cpld_irq, cpld_interrupt,
   IRQF_TRIGGER_LOW, CPLD, NULL);
 
  And I see this interrupt in /proc/interrups after loading
  the driver. However interrupt handler is never invoked,
  although hardware guys see that GPIO line goes down
  when interrupt is generated.
 
  What am I doing wrong ?
 
  Another idea is that you didn't configure the pin multiplexing correctly.
  Most external IRQ's are shared with other functions and/or GPIO's. You
  need to configure the multiplexing correctly for external IRQ
  functionality. This is usually done in U-Boot with the
  CFG_4xx_GPIO_TABLE.
 
  I suggest you check here first.

 I've checked that, here's the relevant line from u-boot:
 {GPIO1_BASE, GPIO_IN , GPIO_ALT3, GPIO_OUT_0}, /* GPIO45 CS(5)
 EOT/TC1 IRQ(12)*/

 If I understand this code correctly, u-boot configures this line as ALT3
 (which is external IRQ 12)

Yes, this seems to be correct.

Best regards,
Stefan
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External interrupt on 460EX

2008-10-16 Thread Felix Radensky

Hi, Stefan

Stefan Roese wrote:

Felix,

On Wednesday 15 October 2008, Felix Radensky wrote:
  

The interrupt is connected to GPIO 45. U-Boot (1.3.4) configures this
pin as external interrupt 12 (interrupt 20 in UIC 3). I've added the
following
entry to board device tree (in opb section)

[EMAIL PROTECTED],0 {
device_type = cpld;
interrupts = 20 1;


Is this interrupt active on rising edge? This is what you have configured
here. When you need level, active low, then you need to write:

 interrupts = 20 8;

And be careful which dts version you are using. Is this 20 decimal or
hex?
  

The interrupt is indeed level, active low. Where can I find information
on UIC
interrupt settings for device tree ?



Not sure if this is really documented. Those values are from 
include/asm-ppc/irq.h:


#define IRQ_TYPE_NONE   0x  /* Default, unspecified type 
*/

#define IRQ_TYPE_EDGE_RISING0x0001  /* Edge rising type */
#define IRQ_TYPE_EDGE_FALLING   0x0002  /* Edge falling type */
#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
#define IRQ_TYPE_LEVEL_HIGH 0x0004  /* Level high type */
#define IRQ_TYPE_LEVEL_LOW  0x0008  /* Level low type */

  
Thanks for clarification. I was looking at booting-without-of.txt and 
took my number

from there.
I'm using dtc 1.2.0, 20 is decimal. 
Is it ok ?



This doesn't really depend on the dtc version but on the version of the dts 
file itself. Is your dts a v1 dts file? Do you have this in your dts:


/dts-v1/;

?

If yes, then you have a v1 dts file and all number without 0x are decimal 
numbers. Then the 20 is correct for ext IRQ 12. If not then this number is 
hex and you should write 14 instead.


  
Bingo !!! That was my problem. I've started getting interrupts  after 
changing the irq

number to 14.

Thanks a lot !!! Your answers are great as always.

Felix.
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


External interrupt on 460EX

2008-10-15 Thread Felix Radensky

Hi,

I'm running Linux 2.6.26 on custom board based on AMCC 460EX.
I'm trying to catch interrupt generated by CPLD, but without any luck.

The interrupt is connected to GPIO 45. U-Boot (1.3.4) configures this
pin as external interrupt 12 (interrupt 20 in UIC 3). I've added the 
following

entry to board device tree (in opb section)

[EMAIL PROTECTED],0 {
   device_type = cpld;
   interrupts = 20 1;
   interrupt-parent = UIC3;
};

In my driver I do the following:

   /* Find CPLD node in device tree */
   np = of_find_node_by_type(NULL, cpld);
   if (!np) {
   printk(KERN_INFO No CPLD found in device tree\n);
   return -1;
   }

   /* Get and map irq number from device tree */
   cpld_irq = irq_of_parse_and_map(np, 0);
   if (cpld_irq == NO_IRQ) {
   printk(KERN_ERR irq_of_parse_and_map failed\n);
   of_node_put(np);
   return -ENODEV;
   }

   /* Register CPLD interrupt handler */
   rc = request_irq(cpld_irq, cpld_interrupt,
IRQF_TRIGGER_LOW, CPLD, NULL);

And I see this interrupt in /proc/interrups after loading
the driver. However interrupt handler is never invoked,
although hardware guys see that GPIO line goes down
when interrupt is generated.

What am I doing wrong ?

Thanks a lot in advance ?

Felix.




___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External interrupt on 460EX

2008-10-15 Thread Stefan Roese
Felix,

On Wednesday 15 October 2008, Felix Radensky wrote:
 I'm running Linux 2.6.26 on custom board based on AMCC 460EX.
 I'm trying to catch interrupt generated by CPLD, but without any luck.

 The interrupt is connected to GPIO 45. U-Boot (1.3.4) configures this
 pin as external interrupt 12 (interrupt 20 in UIC 3). I've added the
 following
 entry to board device tree (in opb section)

 [EMAIL PROTECTED],0 {
 device_type = cpld;
 interrupts = 20 1;

Is this interrupt active on rising edge? This is what you have configured 
here. When you need level, active low, then you need to write:

 interrupts = 20 8;

And be careful which dts version you are using. Is this 20 decimal or hex?

 interrupt-parent = UIC3;
 };

 In my driver I do the following:

 /* Find CPLD node in device tree */
 np = of_find_node_by_type(NULL, cpld);
 if (!np) {
 printk(KERN_INFO No CPLD found in device tree\n);
 return -1;
 }

 /* Get and map irq number from device tree */
 cpld_irq = irq_of_parse_and_map(np, 0);
 if (cpld_irq == NO_IRQ) {
 printk(KERN_ERR irq_of_parse_and_map failed\n);
 of_node_put(np);
 return -ENODEV;
 }

 /* Register CPLD interrupt handler */
 rc = request_irq(cpld_irq, cpld_interrupt,
  IRQF_TRIGGER_LOW, CPLD, NULL);

 And I see this interrupt in /proc/interrups after loading
 the driver. However interrupt handler is never invoked,
 although hardware guys see that GPIO line goes down
 when interrupt is generated.

 What am I doing wrong ?

Another idea is that you didn't configure the pin multiplexing correctly. Most 
external IRQ's are shared with other functions and/or GPIO's. You need to 
configure the multiplexing correctly for external IRQ functionality. This is 
usually done in U-Boot with the CFG_4xx_GPIO_TABLE. 

I suggest you check here first.

Best regards,
Stefan
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External interrupt on 460EX

2008-10-15 Thread Felix Radensky

Hi, Stefan

Stefan Roese wrote:

Felix,

On Wednesday 15 October 2008, Felix Radensky wrote:
  

I'm running Linux 2.6.26 on custom board based on AMCC 460EX.
I'm trying to catch interrupt generated by CPLD, but without any luck.

The interrupt is connected to GPIO 45. U-Boot (1.3.4) configures this
pin as external interrupt 12 (interrupt 20 in UIC 3). I've added the
following
entry to board device tree (in opb section)

[EMAIL PROTECTED],0 {
device_type = cpld;
interrupts = 20 1;



Is this interrupt active on rising edge? This is what you have configured 
here. When you need level, active low, then you need to write:


 interrupts = 20 8;

And be careful which dts version you are using. Is this 20 decimal or hex?

  
The interrupt is indeed level, active low. Where can I find information 
on UIC
interrupt settings for device tree ? I'm using dtc 1.2.0, 20 is decimal. 
Is it ok ?

interrupt-parent = UIC3;
};

In my driver I do the following:

/* Find CPLD node in device tree */
np = of_find_node_by_type(NULL, cpld);
if (!np) {
printk(KERN_INFO No CPLD found in device tree\n);
return -1;
}

/* Get and map irq number from device tree */
cpld_irq = irq_of_parse_and_map(np, 0);
if (cpld_irq == NO_IRQ) {
printk(KERN_ERR irq_of_parse_and_map failed\n);
of_node_put(np);
return -ENODEV;
}

/* Register CPLD interrupt handler */
rc = request_irq(cpld_irq, cpld_interrupt,
 IRQF_TRIGGER_LOW, CPLD, NULL);

And I see this interrupt in /proc/interrups after loading
the driver. However interrupt handler is never invoked,
although hardware guys see that GPIO line goes down
when interrupt is generated.

What am I doing wrong ?



Another idea is that you didn't configure the pin multiplexing correctly. Most 
external IRQ's are shared with other functions and/or GPIO's. You need to 
configure the multiplexing correctly for external IRQ functionality. This is 
usually done in U-Boot with the CFG_4xx_GPIO_TABLE. 


I suggest you check here first.
  

I've checked that, here's the relevant line from u-boot:
{GPIO1_BASE, GPIO_IN , GPIO_ALT3, GPIO_OUT_0}, /* GPIO45 CS(5)  
EOT/TC1 IRQ(12)*/


If I understand this code correctly, u-boot configures this line as ALT3 
(which is external IRQ 12)


Thanks.

Felix.
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External interrupt type?

2008-03-15 Thread Kári Davíðsson
A quick fix with very limited testing is included
Someone might want to try this out or at least read it over :)
But as they say.. it works for me...

Index: arch/powerpc/platforms/52xx/mpc52xx_pic.c
===
--- arch/powerpc/platforms/52xx/mpc52xx_pic.c   (revision 172)
+++ arch/powerpc/platforms/52xx/mpc52xx_pic.c   (working copy)
@@ -97,11 +97,28 @@
io_be_setbit(intr-ctrl, 27-l2irq);
 }
 
+static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int
type)
+{
+   int irq;
+   u32 ctrl_reg;
+
+   irq = irq_map[virq].hwirq;
+
+   ctrl_reg = in_be32(intr-ctrl);
+   ctrl_reg = ~(0x3  (22 - irq * 2)); /* Clear the old type */
+   ctrl_reg |= (type  0x3)  (22 -irq * 2);
+
+   out_be32(intr-ctrl, ctrl_reg);
+
+   return 0;
+}
+
 static struct irq_chip mpc52xx_extirq_irqchip = {
.typename =  MPC52xx IRQ[0-3] ,
.mask = mpc52xx_extirq_mask,
.unmask = mpc52xx_extirq_unmask,
.ack = mpc52xx_extirq_ack,
+   .set_type = mpc52xx_extirq_set_type,
 };
 
 /*


rg
kd

On Fri, 2008-03-14 at 19:05 +, Kári Davíðsson wrote:
 Hello,
 
 I am dealing with external interrupts on an custom board of the
 mpc5200b. Kernel is 2.6.24 from kernel.org.
 
 I can declare the interrupt in the dts for the board and the
 control register is set correctly, i.e. the correct external interrupt
 is enabled.
 
 On the other hand the type is ignored and is always level interrupt
 active low.
 
 Is this intended behaviour?
 How can I pass in the interrupt type from the dts to the kernel?
 
 I need to have the interrupt as edge interrupt, rising edge type?
 
 rg
 kd
 
 
 ___
 Linuxppc-embedded mailing list
 Linuxppc-embedded@ozlabs.org
 https://ozlabs.org/mailman/listinfo/linuxppc-embedded
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

External interrupt type?

2008-03-14 Thread Kári Davíðsson
Hello,

I am dealing with external interrupts on an custom board of the
mpc5200b. Kernel is 2.6.24 from kernel.org.

I can declare the interrupt in the dts for the board and the 
control register is set correctly, i.e. the correct external interrupt
is enabled.

On the other hand the type is ignored and is always level interrupt
active low.

Is this intended behaviour?
How can I pass in the interrupt type from the dts to the kernel?

I need to have the interrupt as edge interrupt, rising edge type?

rg
kd
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

AW: External Interrupt

2008-02-01 Thread Lehmann, Hans (Ritter Elektronik)
Marco,

ASFAIK there where some changes and you have to get the irq with 
irq_create_mapping() or irq_of_parse_and_map()

Kindly regards

Hans
 


Mit freundlichen Grüßen

Hans Lehmann
Dipl.-Ing. Elektrotechnik



RITTER Elektronik GmbH
Leverkuser Strasse 65
D-42897 Remscheid

Tel.+49 (0) 2191 - 67 32 40
Fax +49 (0) 2191 - 67 14 29
Email   [EMAIL PROTECTED]
Homepage  www.ritter-elektronik.de

Geschäftsführer: Manfred A. Wagner, Dr. Uwe Baader
Sitz der Gesellschaft: Oberhausen
HRB 17168 DuisburgUSt-ID DE 814009849


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Marco Stornelli
Gesendet: Freitag, 1. Februar 2008 09:11
An: Linuxppc Embedded Mailing List
Betreff: External Interrupt

Hi,

I used the linux kernel 2.6.10 with a processor MPC8548E. I wrote a driver for 
a device connected with the local bus. This device has an external interrupt. 
In the local bus driver I have used the macro MPC85xx_IRQ_EXTX to get the 
interrupt number and pass it to the driver and after that register the ISR. Now 
with a kernel 2.6.21 this macro isn't available because in the header file 
irq.h there is the option CONFIG_PPC_MERGE that disable those options. I think 
this problem is related to the migration of ppc code towards powerpc. I know 
that now there is the new device tree source file where I can add a device and 
its interrupt number  but I think in this file I should describe only the 
platform device, and this device is not a platform device. Then, how can I get 
now this  value? Is there some function to call? How can I perform this 
operation?

Thanks in advance.

Marco
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External Interrupt

2008-02-01 Thread Sergei Shtylyov
Marco Stornelli wrote:
 Hi,
 
 I used the linux kernel 2.6.10 with a processor MPC8548E. I wrote a
 driver for a device connected with the local bus. This device has an
 external interrupt. In the local bus driver I have used the macro
 MPC85xx_IRQ_EXTX to get the interrupt number and pass it to the
 driver and after that register the ISR. Now with a kernel 2.6.21 this
 macro isn't available because in the header file irq.h there is the
 option CONFIG_PPC_MERGE that disable those options. I think this
 problem is related to the migration of ppc code towards powerpc. I
 know that now there is the new device tree source file where I can add
 a device and its interrupt number  but I think in this file I should
 describe only the platform device, and this device is not a platform
 device.

How comes that it's not platform device if it hangs off the local bus?

 Then, how can I get now this  value? Is there some function to
 call? How can I perform this operation?

Probably irq_alloc_virt()...
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External Interrupt

2008-02-01 Thread Sergei Shtylyov
Hello.

Marco Stornelli wrote:

 I used the linux kernel 2.6.10 with a processor MPC8548E. I wrote a
 driver for a device connected with the local bus. This device has an
 external interrupt. In the local bus driver I have used the macro
 MPC85xx_IRQ_EXTX to get the interrupt number and pass it to the
 driver and after that register the ISR. Now with a kernel 2.6.21 this
 macro isn't available because in the header file irq.h there is the
 option CONFIG_PPC_MERGE that disable those options. I think this
 problem is related to the migration of ppc code towards powerpc. I
 know that now there is the new device tree source file where I can add
 a device and its interrupt number  but I think in this file I should
 describe only the platform device, and this device is not a platform
 device.

How comes that it's not platform device if it hangs off the local bus?

 Then, how can I get now this  value? Is there some function to
 call? How can I perform this operation?

Probably irq_alloc_virt()...

WBR, Sergei
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External Interrupt

2008-02-01 Thread Marco Stornelli
Sergei Shtylyov ha scritto:
 Marco Stornelli wrote:
 Hi,

 I used the linux kernel 2.6.10 with a processor MPC8548E. I wrote a
 driver for a device connected with the local bus. This device has an
 external interrupt. In the local bus driver I have used the macro
 MPC85xx_IRQ_EXTX to get the interrupt number and pass it to the
 driver and after that register the ISR. Now with a kernel 2.6.21 this
 macro isn't available because in the header file irq.h there is the
 option CONFIG_PPC_MERGE that disable those options. I think this
 problem is related to the migration of ppc code towards powerpc. I
 know that now there is the new device tree source file where I can add
 a device and its interrupt number  but I think in this file I should
 describe only the platform device, and this device is not a platform
 device.
 
How comes that it's not platform device if it hangs off the local bus?


In SoC system generally the platform device are (more or less) the
microprocessor controller like i2c, pci, local bus itself and so on. I
think is like if you consider a PCI board a platform device only because
it hangs off the PCI link.

 
 Then, how can I get now this  value? Is there some function to
 call? How can I perform this operation?
 
Probably irq_alloc_virt()...
 

___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External Interrupt

2008-02-01 Thread Sergei Shtylyov
Marco Stornelli wrote:

I used the linux kernel 2.6.10 with a processor MPC8548E. I wrote a
driver for a device connected with the local bus. This device has an
external interrupt. In the local bus driver I have used the macro
MPC85xx_IRQ_EXTX to get the interrupt number and pass it to the
driver and after that register the ISR. Now with a kernel 2.6.21 this
macro isn't available because in the header file irq.h there is the
option CONFIG_PPC_MERGE that disable those options. I think this
problem is related to the migration of ppc code towards powerpc. I
know that now there is the new device tree source file where I can add
a device and its interrupt number  but I think in this file I should
describe only the platform device, and this device is not a platform
device.

   How comes that it's not platform device if it hangs off the local bus?

 In SoC system generally the platform device are (more or less) the
 microprocessor controller like i2c, pci, local bus itself and so on.

That's SoC devices but the notion of the platform device is not limited to 
SoC device only, rather to all the on-board devices.

 I think is like if you consider a PCI board a platform device only because
 it hangs off the PCI link.

No. PCI devices are detectable/configurable by kernel -- even if they are 
on-board chips, they can be found by PCI bus scan (and finally presented as 
the device nodes as well), while local bus devices (most probably) not.  An 
example (that comes to mind) of a device hanging off the local bus and yet 
described by the device tree are the flash chips.

WBR, Sergei

___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External Interrupt

2008-02-01 Thread Marco Stornelli
Sergei Shtylyov ha scritto:
 Marco Stornelli wrote:
 
 I used the linux kernel 2.6.10 with a processor MPC8548E. I wrote a
 driver for a device connected with the local bus. This device has an
 external interrupt. In the local bus driver I have used the macro
 MPC85xx_IRQ_EXTX to get the interrupt number and pass it to the
 driver and after that register the ISR. Now with a kernel 2.6.21 this
 macro isn't available because in the header file irq.h there is the
 option CONFIG_PPC_MERGE that disable those options. I think this
 problem is related to the migration of ppc code towards powerpc. I
 know that now there is the new device tree source file where I can add
 a device and its interrupt number  but I think in this file I should
 describe only the platform device, and this device is not a platform
 device.
 
   How comes that it's not platform device if it hangs off the local bus?
 
 In SoC system generally the platform device are (more or less) the
 microprocessor controller like i2c, pci, local bus itself and so on.
 
 That's SoC devices but the notion of the platform device is not limited 
 to 
 SoC device only, rather to all the on-board devices.
 
 I think is like if you consider a PCI board a platform device only because
 it hangs off the PCI link.
 
 No. PCI devices are detectable/configurable by kernel -- even if they are 
 on-board chips, they can be found by PCI bus scan (and finally presented as 
 the device nodes as well), while local bus devices (most probably) not.  An 
 example (that comes to mind) of a device hanging off the local bus and yet 
 described by the device tree are the flash chips.

Yes you are right. The local bus is like i2c, but I've never seen a
device connected with i2c and described with a sub-node of i2c node in
the dts file, however I think it's only philosophy, the most important
thing is that there is a way to get the irq number :)

Thanks for your response.

Regards.

Marco

 
 WBR, Sergei
 
 ___
 Linuxppc-embedded mailing list
 Linuxppc-embedded@ozlabs.org
 https://ozlabs.org/mailman/listinfo/linuxppc-embedded
 

___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: External Interrupt

2008-02-01 Thread Scott Wood
Marco Stornelli wrote:
 Yes you are right. The local bus is like i2c, but I've never seen a
 device connected with i2c and described with a sub-node of i2c node in
 the dts file,

Grep the dts directory for [EMAIL PROTECTED].

-Scott
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: 440SP External Interrupt IRQ

2006-10-06 Thread Jeff Stevens
I'm sorry if this is an easy question, but how do my
schematics tell me that pint IRQ0 uses IRQ 48 in my
board specific PCI IRQ lookup table, where it is
matching up the idsel lines to an irq number?  For
instance, in arch/ppc/platforms/4xx/luan.c it maps PCI
interrupts like:

static inline int
luan_map_irq(struct pci_dev *dev, unsigned char idsel,
unsigned char pin)
{
struct pci_controller *hose =
pci_bus_to_hose(dev-bus-number);

/* PCIX0 in adapter mode, no host interrupt routing
*/

/* PCIX1 */
if (hose-index == 0) {
static char pci_irq_table[][4] =
/*
 *  PCI IDSEL/INTPIN-INTLINE
 *A   B   C   D
 */
{
{ 49, 49, 49, 49 }, /* IDSEL 1 - PCIX1 Slot 0 */
{ 49, 49, 49, 49 }, /* IDSEL 2 - PCIX1 Slot 1 */
{ 49, 49, 49, 49 }, /* IDSEL 3 - PCIX1 Slot 2 */
{ 49, 49, 49, 49 }, /* IDSEL 4 - PCIX1 Slot 3 */
};
const long min_idsel = 1, max_idsel = 4,
irqs_per_slot = 4;
return PCI_IRQ_TABLE_LOOKUP;
/* PCIX2 */
} else if (hose-index == 1) {
static char pci_irq_table[][4] =
/*
 *  PCI IDSEL/INTPIN-INTLINE
 *A   B   C   D
 */
{
{ 50, 50, 50, 50 }, /* IDSEL 1 - PCIX2 Slot 0 */
{ 50, 50, 50, 50 }, /* IDSEL 2 - PCIX2 Slot 1 */
{ 50, 50, 50, 50 }, /* IDSEL 3 - PCIX2 Slot 2 */
{ 50, 50, 50, 50 }, /* IDSEL 4 - PCIX2 Slot 3 */
};
const long min_idsel = 1, max_idsel = 4,
irqs_per_slot = 4;
return PCI_IRQ_TABLE_LOOKUP;
}
return -1;
}

Based on their schematics, I assume:
IRQ Line  IRQ#
  IRQ048
  IRQ149
  IRQ250
  IRQ351
  IRQ452
  IRQ553

I just hate assuming, and would like to understand how
they come up with the IRQ offset for the external
interrups.

-Jeff

--- Stefan Roese [EMAIL PROTECTED] wrote:

 Jeff,
 
 On Friday 06 October 2006 05:49, Jeff Stevens wrote:
  I am trying to figure out the PCI IRQ mapping on a
  440SP processor in linux-2.6.17.9.  I have a board
  that is based off of the Luan development board,
 and I
  am not sure which IRQ corresponds to each external
  IRQ[0:5] pins on the processor.  Where can I find
 this
  information?
 
 In your schematics. Sorry but it's that simple.
 
 Best regards,
 Stefan
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: 440SP External Interrupt IRQ

2006-10-06 Thread Eugene Surovegin
On Fri, Oct 06, 2006 at 03:27:38AM -0700, Jeff Stevens wrote:

[snip]

 Based on their schematics, I assume:
 IRQ Line  IRQ#
   IRQ048
   IRQ149
   IRQ250
   IRQ351
   IRQ452
   IRQ553

No, this mapping doesn't depend on board shematics. This is fixed, see 
Universal Interrupt controller chapter in user manual.

What is not fixed is mapping between IDSEL line which selects your PCI 
device and INTx# line from that PCI device to IRQx line in 440SP.

-- 
Eugene
 
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


440SP External Interrupt IRQ

2006-10-05 Thread Jeff Stevens
I am trying to figure out the PCI IRQ mapping on a
440SP processor in linux-2.6.17.9.  I have a board
that is based off of the Luan development board, and I
am not sure which IRQ corresponds to each external
IRQ[0:5] pins on the processor.  Where can I find this
information?

Thanks,
   Jeff Stevens

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: 440SP External Interrupt IRQ

2006-10-05 Thread Stefan Roese
Jeff,

On Friday 06 October 2006 05:49, Jeff Stevens wrote:
 I am trying to figure out the PCI IRQ mapping on a
 440SP processor in linux-2.6.17.9.  I have a board
 that is based off of the Luan development board, and I
 am not sure which IRQ corresponds to each external
 IRQ[0:5] pins on the processor.  Where can I find this
 information?

In your schematics. Sorry but it's that simple.

Best regards,
Stefan
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Adding an external interrupt controller

2006-06-21 Thread Laurent Pinchart
Hi everybody,

I'm trying to write a driver for a custom extension bus mapped in my MPC8248 
memory space.

The bus has 32 interrupt lines which are handled by an interrupt controller 
connected to a single external interrupt on the MPC8248.

I've had a look at the Linux interrupt management code, but haven't found any 
easy API to add an external interrupt controller. Could someone give me a few 
pointers regarding how to proceed ? I would like to register the interrupt 
controller with the interrupt management core, so that 
request_irq()/free_irq() could be used with the extra interrupts.

Thanks in advance for your help.

Best regards,

Laurent Pinchart

PS: If this is not architecture-specific and should be asked on the 
linux-kernel mailing list, please let me know.



Adding an external interrupt controller

2006-06-21 Thread Liu Dave-r63238


 -Original Message-
 Hi everybody,
 
 I'm trying to write a driver for a custom extension bus 
 mapped in my MPC8248 
 memory space.
 
 The bus has 32 interrupt lines which are handled by an 
 interrupt controller 
 connected to a single external interrupt on the MPC8248.
 
 I've had a look at the Linux interrupt management code, but 
 haven't found any 
 easy API to add an external interrupt controller. Could 

No, the linux kernel has this feature.

 someone give me a few 
 pointers regarding how to proceed ? I would like to 
 register the interrupt 
 controller with the interrupt management core, so that 
 request_irq()/free_irq() could be used with the extra interrupts.
 
Need define the struct hw_interrupt_type your_interrupt_controller
and the struct irqaction your_irqaction, and 
implement member function and hook your interrupt controller to
The interrupt controller of MPC8248 with setup_irq.

-Dave



Adding an external interrupt controller

2006-06-21 Thread Laurent Pinchart
Hi,

  I'm trying to write a driver for a custom extension bus
  mapped in my MPC8248
  memory space.
 
  The bus has 32 interrupt lines which are handled by an
  interrupt controller
  connected to a single external interrupt on the MPC8248.
 
  I've had a look at the Linux interrupt management code, but
  haven't found any
  easy API to add an external interrupt controller. Could

 No, the linux kernel has this feature.

  someone give me a few
  pointers regarding how to proceed ? I would like to
  register the interrupt
  controller with the interrupt management core, so that
  request_irq()/free_irq() could be used with the extra interrupts.

 Need define the struct hw_interrupt_type your_interrupt_controller
 and the struct irqaction your_irqaction, and
 implement member function and hook your interrupt controller to
 The interrupt controller of MPC8248 with setup_irq.

I've had a deeper look at that approach and things are, if not entirely clear, 
at least clear enough to try coding a simple interrupt controller.

There is, though, something that bothers me. My interrupt controller has 32 
IRQ lines. If I hook up my interrupt controller using the ppc_md.init_IRQ and 
ppc_md.get_irq callbacks, only one interrupt will be processed at a time. The 
interrupt handler acks the interrupt at source, but other interrupts which 
are already flagged will reinterrupt the CPU as soon as the interrupt handler 
returns. This is clearly sub-optimal. I noticed that some people call 
__do_IRQ reintrantly (in arch/ppc/syslib/m82xx_pic.c for instance). Could I 
do that as well, or is that discouraged ? Any problem regarding the stack 
size ?

Thanks for your help.

Best regards,

Laurent Pinchart



[RESEND][PATCH] ppc32: Fix MPC83xx IPIC external interrupt pending register offset

2005-06-26 Thread Kumar Gala
(I think this got lost by linus in the shuffle)

The pending registers for IRQ1-IRQ7 were pointing to the interrupt pending
register instead of the external one.

Signed-off-by: Tony Li Tony.Li at freescale.com
Signed-off-by: Kumar Gala kumar.gala at freescale.com

---
commit 7ada9b1e61d5af4c75f32bfc1f7aabca435024ed
tree 44de45c386a0f22584344494bfe1eb453dffa16c
parent e3f1d172ca1cfd1ac2dd907c31fb2521bfe21689
author Kumar K. Gala kumar.gala at freescale.com Thu, 23 Jun 2005 22:49:39 
-0500
committer Kumar K. Gala kumar.gala at freescale.com Thu, 23 Jun 2005 22:49:39 
-0500

 arch/ppc/syslib/ipic.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/ppc/syslib/ipic.c b/arch/ppc/syslib/ipic.c
--- a/arch/ppc/syslib/ipic.c
+++ b/arch/ppc/syslib/ipic.c
@@ -79,7 +79,7 @@ static struct ipic_info ipic_info[] = {
.prio_mask = 7,
},
[17] = {
-   .pend   = IPIC_SIPNR_H,
+   .pend   = IPIC_SEPNR,
.mask   = IPIC_SEMSR,
.prio   = IPIC_SMPRR_A,
.force  = IPIC_SEFCR,
@@ -87,7 +87,7 @@ static struct ipic_info ipic_info[] = {
.prio_mask = 5,
},
[18] = {
-   .pend   = IPIC_SIPNR_H,
+   .pend   = IPIC_SEPNR,
.mask   = IPIC_SEMSR,
.prio   = IPIC_SMPRR_A,
.force  = IPIC_SEFCR,
@@ -95,7 +95,7 @@ static struct ipic_info ipic_info[] = {
.prio_mask = 6,
},
[19] = {
-   .pend   = IPIC_SIPNR_H,
+   .pend   = IPIC_SEPNR,
.mask   = IPIC_SEMSR,
.prio   = IPIC_SMPRR_A,
.force  = IPIC_SEFCR,
@@ -103,7 +103,7 @@ static struct ipic_info ipic_info[] = {
.prio_mask = 7,
},
[20] = {
-   .pend   = IPIC_SIPNR_H,
+   .pend   = IPIC_SEPNR,
.mask   = IPIC_SEMSR,
.prio   = IPIC_SMPRR_B,
.force  = IPIC_SEFCR,
@@ -111,7 +111,7 @@ static struct ipic_info ipic_info[] = {
.prio_mask = 4,
},
[21] = {
-   .pend   = IPIC_SIPNR_H,
+   .pend   = IPIC_SEPNR,
.mask   = IPIC_SEMSR,
.prio   = IPIC_SMPRR_B,
.force  = IPIC_SEFCR,
@@ -119,7 +119,7 @@ static struct ipic_info ipic_info[] = {
.prio_mask = 5,
},
[22] = {
-   .pend   = IPIC_SIPNR_H,
+   .pend   = IPIC_SEPNR,
.mask   = IPIC_SEMSR,
.prio   = IPIC_SMPRR_B,
.force  = IPIC_SEFCR,
@@ -127,7 +127,7 @@ static struct ipic_info ipic_info[] = {
.prio_mask = 6,
},
[23] = {
-   .pend   = IPIC_SIPNR_H,
+   .pend   = IPIC_SEPNR,
.mask   = IPIC_SEMSR,
.prio   = IPIC_SMPRR_B,
.force  = IPIC_SEFCR,



I2C external interrupt

2002-02-20 Thread Pergola, Michael

All,

OK, I have successfully implemented an I2C I/F on my
Embedded Planet MPC823e platform (Linux kernel
2.2.14 HHL). Now what I'd like to do is interrupt the 823e
causing the PPC to initiate an I2C Write/Read transfer. I
notice that the I2C driver already installs its interrupt
handler using cpm_install_handler with an irq. Since a device
driver can not have more than 1 associated irq(?), has anyone
attempted to do something of this sort or have any
meaningful suggestions for me?

Regards,
 Michael Pergola
 Software Engineer
 Baltimore, MD  21236 (410) 931-6778 x4259


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/