Path: blob/master/arch/arm/mach-pnx4008/include/mach/entry-macro.S
10820 views
/*1* arch/arm/mach-pnx4008/include/mach/entry-macro.S2*3* Low-level IRQ helper macros for PNX4008-based platforms4*5* 2005-2006 (c) MontaVista Software, Inc.6* Author: Vitaly Wool <[email protected]>7* This file is licensed under the terms of the GNU General Public8* License version 2. This program is licensed "as is" without any9* warranty of any kind, whether express or implied.10*/1112#include "platform.h"1314#define IO_BASE 0xF000000015#define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE)1617#define INTRC_MASK 0x0018#define INTRC_RAW_STAT 0x0419#define INTRC_STAT 0x0820#define INTRC_POLAR 0x0C21#define INTRC_ACT_TYPE 0x1022#define INTRC_TYPE 0x142324#define SIC1_BASE_INT 3225#define SIC2_BASE_INT 642627.macro disable_fiq28.endm2930.macro get_irqnr_preamble, base, tmp31.endm3233.macro arch_ret_to_user, tmp1, tmp234.endm3536.macro get_irqnr_and_base, irqnr, irqstat, base, tmp37/* decode the MIC interrupt numbers */38ldr \base, =IO_ADDRESS(PNX4008_INTCTRLMIC_BASE)39ldr \irqstat, [\base, #INTRC_STAT]4041cmp \irqstat,#1<<1642movhs \irqnr,#1643movlo \irqnr,#044movhs \irqstat,\irqstat,lsr#1645cmp \irqstat,#1<<846addhs \irqnr,\irqnr,#847movhs \irqstat,\irqstat,lsr#848cmp \irqstat,#1<<449addhs \irqnr,\irqnr,#450movhs \irqstat,\irqstat,lsr#451cmp \irqstat,#1<<252addhs \irqnr,\irqnr,#253movhs \irqstat,\irqstat,lsr#254cmp \irqstat,#1<<155addhs \irqnr,\irqnr,#15657/* was there an interrupt ? if not then drop out with EQ status */58teq \irqstat,#059beq 1003f6061/* and now check for extended IRQ reasons */62cmp \irqnr,#163bls 1003f64cmp \irqnr,#3065blo 1002f6667/* IRQ 31,30 : High priority cascade IRQ handle */68/* read the correct SIC */69/* decoding status after compare : eq is 30 (SIC1) , ne is 31 (SIC2) */70/* set the base IRQ number */71ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)72moveq \irqnr,#SIC1_BASE_INT73ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)74movne \irqnr,#SIC2_BASE_INT75ldr \irqstat, [\base, #INTRC_STAT]76ldr \tmp, [\base, #INTRC_TYPE]77/* and with inverted mask : low priority interrupts */78and \irqstat,\irqstat,\tmp79b 1004f80811003:82/* IRQ 1,0 : Low priority cascade IRQ handle */83/* read the correct SIC */84/* decoding status after compare : eq is 1 (SIC2) , ne is 0 (SIC1)*/85/* read the correct SIC */86/* set the base IRQ number */87ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)88movne \irqnr,#SIC1_BASE_INT89ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)90moveq \irqnr,#SIC2_BASE_INT91ldr \irqstat, [\base, #INTRC_STAT]92ldr \tmp, [\base, #INTRC_TYPE]93/* and with inverted mask : low priority interrupts */94bic \irqstat,\irqstat,\tmp95961004:9798cmp \irqstat,#1<<1699addhs \irqnr,\irqnr,#16100movhs \irqstat,\irqstat,lsr#16101cmp \irqstat,#1<<8102addhs \irqnr,\irqnr,#8103movhs \irqstat,\irqstat,lsr#8104cmp \irqstat,#1<<4105addhs \irqnr,\irqnr,#4106movhs \irqstat,\irqstat,lsr#4107cmp \irqstat,#1<<2108addhs \irqnr,\irqnr,#2109movhs \irqstat,\irqstat,lsr#2110cmp \irqstat,#1<<1111addhs \irqnr,\irqnr,#1112113114/* is irqstat not zero */1151161002:117/* we assert that irqstat is not equal to zero and return ne status if true*/118teq \irqstat,#01191003:120.endm121122123.macro irq_prio_table124.endm125126127128129