Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
mpc52xx_pic.c File Reference
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/of.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/mpc52xx.h>

Go to the source code of this file.

Macros

#define MPC52xx_IRQ_L1_CRIT   (0)
 
#define MPC52xx_IRQ_L1_MAIN   (1)
 
#define MPC52xx_IRQ_L1_PERP   (2)
 
#define MPC52xx_IRQ_L1_SDMA   (3)
 
#define MPC52xx_IRQ_L1_OFFSET   (6)
 
#define MPC52xx_IRQ_L1_MASK   (0x00c0)
 
#define MPC52xx_IRQ_L2_MASK   (0x003f)
 
#define MPC52xx_IRQ_HIGHTESTHWIRQ   (0xd0)
 

Functions

void __init mpc52xx_init_irq (void)
 
unsigned int mpc52xx_get_irq (void)
 

Macro Definition Documentation

#define MPC52xx_IRQ_HIGHTESTHWIRQ   (0xd0)

Definition at line 118 of file mpc52xx_pic.c.

#define MPC52xx_IRQ_L1_CRIT   (0)

Definition at line 109 of file mpc52xx_pic.c.

#define MPC52xx_IRQ_L1_MAIN   (1)

Definition at line 110 of file mpc52xx_pic.c.

#define MPC52xx_IRQ_L1_MASK   (0x00c0)

Definition at line 115 of file mpc52xx_pic.c.

#define MPC52xx_IRQ_L1_OFFSET   (6)

Definition at line 114 of file mpc52xx_pic.c.

#define MPC52xx_IRQ_L1_PERP   (2)

Definition at line 111 of file mpc52xx_pic.c.

#define MPC52xx_IRQ_L1_SDMA   (3)

Definition at line 112 of file mpc52xx_pic.c.

#define MPC52xx_IRQ_L2_MASK   (0x003f)

Definition at line 116 of file mpc52xx_pic.c.

Function Documentation

unsigned int mpc52xx_get_irq ( void  )

mpc52xx_get_irq - Get pending interrupt number hook function

Called by the interrupt handler to determine what IRQ handler needs to be executed.

Status of pending interrupts is determined by reading the encoded status register. The encoded status register has three fields; one for each of the types of interrupts defined by the controller - 'critical', 'main' and 'peripheral'. This function reads the status register and returns the IRQ number associated with the highest priority pending interrupt. 'Critical' interrupts have the highest priority, followed by 'main' interrupts, and then 'peripheral'.

The mpc5200 interrupt controller can be configured to boost the priority of individual 'peripheral' interrupts. If this is the case then a special value will appear in either the crit or main fields indicating a high or medium priority peripheral irq has occurred.

This function checks each of the 3 irq request fields and returns the first pending interrupt that it finds.

This function also identifies a 4th type of interrupt; 'bestcomm'. Each bestcomm DMA task can raise the bestcomm peripheral interrupt. When this occurs at task-specific IRQ# is decoded so that each task can have its own IRQ handler.

Definition at line 487 of file mpc52xx_pic.c.

void __init mpc52xx_init_irq ( void  )

mpc52xx_init_irq - Initialize and register with the virq subsystem

Hook for setting up IRQs on an mpc5200 system. A pointer to this function is to be put into the machine definition structure.

This function searches the device tree for an MPC5200 interrupt controller, initializes it, and registers it with the virq subsystem.

Definition at line 402 of file mpc52xx_pic.c.