spi-topcliff-pch: supports a spi mode setup and bit order setup by IO control
[zen-stable.git] / arch / arm / mach-ks8695 / include / mach / entry-macro.S
blobb4fe0c11c6ce37e02bc7c79dc50be503f91bf2fc
1 /*
2  * arch/arm/mach-ks8695/include/mach/entry-macro.S
3  *
4  * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5  * Copyright (C) 2006 Simtec Electronics
6  *
7  * Low-level IRQ helper macros for KS8695
8  *
9  * This file is licensed under  the terms of the GNU General Public
10  * License version 2. This program is licensed "as is" without any
11  * warranty of any kind, whether express or implied.
14 #include <mach/hardware.h>
15 #include <mach/regs-irq.h>
17         .macro  disable_fiq
18         .endm
20         .macro  get_irqnr_preamble, base, tmp
21                 ldr     \base, =KS8695_IRQ_VA                   @ Base address of interrupt controller
22         .endm
24         .macro  arch_ret_to_user, tmp1, tmp2
25         .endm
27         .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
28                 ldr     \irqstat, [\base, #KS8695_INTMS]        @ Mask Status register
30                 teq     \irqstat, #0
31                 beq     1001f
33                 mov     \irqnr, #0
35                 tst     \irqstat, #0xff
36                 moveq   \irqstat, \irqstat, lsr #8
37                 addeq   \irqnr, \irqnr, #8
38                 tsteq   \irqstat, #0xff
39                 moveq   \irqstat, \irqstat, lsr #8
40                 addeq   \irqnr, \irqnr, #8
41                 tsteq   \irqstat, #0xff
42                 moveq   \irqstat, \irqstat, lsr #8
43                 addeq   \irqnr, \irqnr, #8
44                 tst     \irqstat, #0x0f
45                 moveq   \irqstat, \irqstat, lsr #4
46                 addeq   \irqnr, \irqnr, #4
47                 tst     \irqstat, #0x03
48                 moveq   \irqstat, \irqstat, lsr #2
49                 addeq   \irqnr, \irqnr, #2
50                 tst     \irqstat, #0x01
51                 addeqs  \irqnr, \irqnr, #1
52 1001:
53         .endm