diff options
Diffstat (limited to 'arch/arm/mach-mmp/pxa910.c')
-rw-r--r-- | arch/arm/mach-mmp/pxa910.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 4ebbfbba39f..3241a25784d 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/platform_device.h> | ||
15 | 16 | ||
16 | #include <asm/mach/time.h> | 17 | #include <asm/mach/time.h> |
17 | #include <mach/addr-map.h> | 18 | #include <mach/addr-map.h> |
@@ -19,7 +20,6 @@ | |||
19 | #include <mach/regs-apmu.h> | 20 | #include <mach/regs-apmu.h> |
20 | #include <mach/cputype.h> | 21 | #include <mach/cputype.h> |
21 | #include <mach/irqs.h> | 22 | #include <mach/irqs.h> |
22 | #include <mach/gpio-pxa.h> | ||
23 | #include <mach/dma.h> | 23 | #include <mach/dma.h> |
24 | #include <mach/mfp.h> | 24 | #include <mach/mfp.h> |
25 | #include <mach/devices.h> | 25 | #include <mach/devices.h> |
@@ -77,26 +77,9 @@ static struct mfp_addr_map pxa910_mfp_addr_map[] __initdata = | |||
77 | MFP_ADDR_END, | 77 | MFP_ADDR_END, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | #define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c) | ||
81 | |||
82 | static void __init pxa910_init_gpio(void) | ||
83 | { | ||
84 | int i; | ||
85 | |||
86 | /* enable GPIO clock */ | ||
87 | __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA910_GPIO); | ||
88 | |||
89 | /* unmask GPIO edge detection for all 4 banks - APMASKx */ | ||
90 | for (i = 0; i < 4; i++) | ||
91 | __raw_writel(0xffffffff, APMASK(i)); | ||
92 | |||
93 | pxa_init_gpio(IRQ_PXA910_AP_GPIO, 0, 127, NULL); | ||
94 | } | ||
95 | |||
96 | void __init pxa910_init_irq(void) | 80 | void __init pxa910_init_irq(void) |
97 | { | 81 | { |
98 | icu_init_irq(); | 82 | icu_init_irq(); |
99 | pxa910_init_gpio(); | ||
100 | } | 83 | } |
101 | 84 | ||
102 | /* APB peripheral clocks */ | 85 | /* APB peripheral clocks */ |
@@ -108,6 +91,7 @@ static APBC_CLK(pwm1, PXA910_PWM1, 1, 13000000); | |||
108 | static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); | 91 | static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); |
109 | static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); | 92 | static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); |
110 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); | 93 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); |
94 | static APBC_CLK(gpio, PXA910_GPIO, 0, 13000000); | ||
111 | 95 | ||
112 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | 96 | static APMU_CLK(nand, NAND, 0x19b, 156000000); |
113 | static APMU_CLK(u2o, USB, 0x1b, 480000000); | 97 | static APMU_CLK(u2o, USB, 0x1b, 480000000); |
@@ -123,6 +107,7 @@ static struct clk_lookup pxa910_clkregs[] = { | |||
123 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), | 107 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), |
124 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), | 108 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), |
125 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 109 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
110 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
126 | INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), | 111 | INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), |
127 | }; | 112 | }; |
128 | 113 | ||
@@ -179,3 +164,22 @@ PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10); | |||
179 | PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); | 164 | PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); |
180 | PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10); | 165 | PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10); |
181 | PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); | 166 | PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); |
167 | |||
168 | struct resource pxa910_resource_gpio[] = { | ||
169 | { | ||
170 | .start = 0xd4019000, | ||
171 | .end = 0xd4019fff, | ||
172 | .flags = IORESOURCE_MEM, | ||
173 | }, { | ||
174 | .start = IRQ_PXA910_AP_GPIO, | ||
175 | .end = IRQ_PXA910_AP_GPIO, | ||
176 | .flags = IORESOURCE_IRQ, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | struct platform_device pxa910_device_gpio = { | ||
181 | .name = "pxa-gpio", | ||
182 | .id = -1, | ||
183 | .num_resources = ARRAY_SIZE(pxa910_resource_gpio), | ||
184 | .resource = pxa910_resource_gpio, | ||
185 | }; | ||