@ -48,14 +48,18 @@ omap_irq_base: .word 0
ldr \ b a s e , =omap_irq_base @ irq base address
ldr \ b a s e , [ \ b a s e , #0 ] @ irq base value
cmp \ b a s e , #0 @ already configured?
bne 9 9 9 8 f @ nothing to do
bne 9 9 9 7 f @ nothing to do
mrc p15 , 0 , \ t m p , c0 , c0 , 0 @ get processor revision
and \ t m p , \ t m p , #0x000f0000 @ only check architecture
cmp \ t m p , #0x00060000 @ is v6?
beq 2 4 0 0 f @ found v6 so it's omap24xx
cmp \ t m p , #0x000f0000 @ is cortex?
beq 3 4 0 0 f @ found v7 so it's omap34xx
mrc p15 , 0 , \ t m p , c0 , c0 , 0 @ get processor revision
and \ t m p , \ t m p , #0x000000f0 @ check cortex 8 or 9
cmp \ t m p , #0x00000080 @ cortex A-8?
beq 3 4 0 0 f @ found A-8 so it's omap34xx
cmp \ t m p , #0x00000090 @ cortex A-9?
beq 4 4 0 0 f @ found A-9 so it's omap44xx
2400 : ldr \ b a s e , =OMAP2_IRQ_BASE
ldr \ t m p , =omap_irq_base
str \ b a s e , [ \ t m p , #0 ]
@ -64,23 +68,41 @@ omap_irq_base: .word 0
ldr \ t m p , =omap_irq_base
str \ b a s e , [ \ t m p , #0 ]
b 9 b
9998 :
4400 : ldr \ b a s e , =OMAP4_IRQ_BASE
ldr \ t m p , =omap_irq_base
str \ b a s e , [ \ t m p , #0 ]
b 9 b
9997 :
.endm
/* Check the pending interrupts. Note that base already set */
.macro get_ i r q n r _ a n d _ b a s e , i r q n r , i r q s t a t , b a s e , t m p
tst \ b a s e , #0x100 @ gic address?
bne 4 4 0 1 f @ found gic
/* Handle omap2 and omap3 */
ldr \ i r q n r , [ \ b a s e , #0x98 ] / * I R Q p e n d i n g r e g 1 * /
cmp \ i r q n r , #0x0
bne 9 9 9 9 f
bne 9 9 9 8 f
ldr \ i r q n r , [ \ b a s e , #0xb8 ] / * I R Q p e n d i n g r e g 2 * /
cmp \ i r q n r , #0x0
bne 9 9 9 9 f
bne 9 9 9 8 f
ldr \ i r q n r , [ \ b a s e , #0xd8 ] / * I R Q p e n d i n g r e g 3 * /
cmp \ i r q n r , #0x0
9999 :
9998 :
ldrne \ i r q n r , [ \ b a s e , #I N T C P S _ S I R _ I R Q _ O F F S E T ]
and \ i r q n r , \ i r q n r , #A C T I V E I R Q _ M A S K / * C l e a r s p u r i o u s b i t s * /
b 9 9 9 9 f
/* Handle omap4 */
4401 : ldr \ i r q s t a t , [ \ b a s e , #G I C _ C P U _ I N T A C K ]
ldr \ t m p , =1021
bic \ i r q n r , \ i r q s t a t , #0x1c00
cmp \ i r q n r , #29
cmpcc \ i r q n r , \ i r q n r
cmpne \ i r q n r , \ t m p
cmpcs \ i r q n r , \ i r q n r
9999 :
.endm