aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@gmail.com>2010-01-25 06:03:54 -0500
committerEric Miao <eric.y.miao@gmail.com>2010-03-01 18:40:56 -0500
commit16144bfb83bb8319c07c18b57eac15368708d02c (patch)
tree3544731005719bd1b2f9ba70efcb2233cf9437cf /arch/arm/mach-mmp
parent247b4592f385622774de877f568fc30eb37dc831 (diff)
[ARM] mmp2: add gpio initialization
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r--arch/arm/mach-mmp/common.h1
-rw-r--r--arch/arm/mach-mmp/irq-mmp2.c2
-rw-r--r--arch/arm/mach-mmp/mmp2.c23
3 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
index 85bf1245143..18c037f8bb0 100644
--- a/arch/arm/mach-mmp/common.h
+++ b/arch/arm/mach-mmp/common.h
@@ -9,6 +9,7 @@ extern struct sys_timer pxa910_timer;
9extern struct sys_timer mmp2_timer; 9extern struct sys_timer mmp2_timer;
10extern void __init pxa168_init_irq(void); 10extern void __init pxa168_init_irq(void);
11extern void __init pxa910_init_irq(void); 11extern void __init pxa910_init_irq(void);
12extern void __init mmp2_init_icu(void);
12extern void __init mmp2_init_irq(void); 13extern void __init mmp2_init_irq(void);
13 14
14extern void __init icu_init_irq(void); 15extern void __init icu_init_irq(void);
diff --git a/arch/arm/mach-mmp/irq-mmp2.c b/arch/arm/mach-mmp/irq-mmp2.c
index ddebde84231..3ae1c543707 100644
--- a/arch/arm/mach-mmp/irq-mmp2.c
+++ b/arch/arm/mach-mmp/irq-mmp2.c
@@ -104,7 +104,7 @@ static void init_mux_irq(struct irq_chip *chip, int start, int num)
104 } 104 }
105} 105}
106 106
107void __init mmp2_init_irq(void) 107void __init mmp2_init_icu(void)
108{ 108{
109 int irq; 109 int irq;
110 110
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
index 561194d3bb4..0f1c441cc89 100644
--- a/arch/arm/mach-mmp/mmp2.c
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -21,6 +21,7 @@
21#include <mach/cputype.h> 21#include <mach/cputype.h>
22#include <mach/irqs.h> 22#include <mach/irqs.h>
23#include <mach/mfp.h> 23#include <mach/mfp.h>
24#include <mach/gpio.h>
24#include <mach/devices.h> 25#include <mach/devices.h>
25 26
26#include "common.h" 27#include "common.h"
@@ -28,12 +29,34 @@
28 29
29#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) 30#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
30 31
32#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c)
33
31static struct mfp_addr_map mmp2_addr_map[] __initdata = { 34static struct mfp_addr_map mmp2_addr_map[] __initdata = {
32 MFP_ADDR(PMIC_INT, 0x2c4), 35 MFP_ADDR(PMIC_INT, 0x2c4),
33 36
34 MFP_ADDR_END, 37 MFP_ADDR_END,
35}; 38};
36 39
40static void __init mmp2_init_gpio(void)
41{
42 int i;
43
44 /* enable GPIO clock */
45 __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_MMP2_GPIO);
46
47 /* unmask GPIO edge detection for all 6 banks -- APMASKx */
48 for (i = 0; i < 6; i++)
49 __raw_writel(0xffffffff, APMASK(i));
50
51 pxa_init_gpio(IRQ_MMP2_GPIO, 0, 167, NULL);
52}
53
54void __init mmp2_init_irq(void)
55{
56 mmp2_init_icu();
57 mmp2_init_gpio();
58}
59
37/* APB peripheral clocks */ 60/* APB peripheral clocks */
38static APBC_CLK(uart1, MMP2_UART1, 1, 26000000); 61static APBC_CLK(uart1, MMP2_UART1, 1, 26000000);
39static APBC_CLK(uart2, MMP2_UART2, 1, 26000000); 62static APBC_CLK(uart2, MMP2_UART2, 1, 26000000);