diff options
Diffstat (limited to 'arch/arm/mach-mmp/pxa168.c')
-rw-r--r-- | arch/arm/mach-mmp/pxa168.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 13f23867a86a..7bc17eaa12eb 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
16 | #include <linux/platform_device.h> | ||
16 | 17 | ||
17 | #include <asm/mach/time.h> | 18 | #include <asm/mach/time.h> |
18 | #include <mach/addr-map.h> | 19 | #include <mach/addr-map.h> |
@@ -20,7 +21,6 @@ | |||
20 | #include <mach/regs-apbc.h> | 21 | #include <mach/regs-apbc.h> |
21 | #include <mach/regs-apmu.h> | 22 | #include <mach/regs-apmu.h> |
22 | #include <mach/irqs.h> | 23 | #include <mach/irqs.h> |
23 | #include <mach/gpio-pxa.h> | ||
24 | #include <mach/dma.h> | 24 | #include <mach/dma.h> |
25 | #include <mach/devices.h> | 25 | #include <mach/devices.h> |
26 | #include <mach/mfp.h> | 26 | #include <mach/mfp.h> |
@@ -43,26 +43,9 @@ static struct mfp_addr_map pxa168_mfp_addr_map[] __initdata = | |||
43 | MFP_ADDR_END, | 43 | MFP_ADDR_END, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c) | ||
47 | |||
48 | static void __init pxa168_init_gpio(void) | ||
49 | { | ||
50 | int i; | ||
51 | |||
52 | /* enable GPIO clock */ | ||
53 | __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA168_GPIO); | ||
54 | |||
55 | /* unmask GPIO edge detection for all 4 banks - APMASKx */ | ||
56 | for (i = 0; i < 4; i++) | ||
57 | __raw_writel(0xffffffff, APMASK(i)); | ||
58 | |||
59 | pxa_init_gpio(IRQ_PXA168_GPIOX, 0, 127, NULL); | ||
60 | } | ||
61 | |||
62 | void __init pxa168_init_irq(void) | 46 | void __init pxa168_init_irq(void) |
63 | { | 47 | { |
64 | icu_init_irq(); | 48 | icu_init_irq(); |
65 | pxa168_init_gpio(); | ||
66 | } | 49 | } |
67 | 50 | ||
68 | /* APB peripheral clocks */ | 51 | /* APB peripheral clocks */ |
@@ -80,6 +63,7 @@ static APBC_CLK(ssp2, PXA168_SSP2, 4, 0); | |||
80 | static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); | 63 | static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); |
81 | static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); | 64 | static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); |
82 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); | 65 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); |
66 | static APBC_CLK(gpio, PXA168_GPIO, 0, 13000000); | ||
83 | static APBC_CLK(keypad, PXA168_KPC, 0, 32000); | 67 | static APBC_CLK(keypad, PXA168_KPC, 0, 32000); |
84 | 68 | ||
85 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | 69 | static APMU_CLK(nand, NAND, 0x19b, 156000000); |
@@ -105,6 +89,7 @@ static struct clk_lookup pxa168_clkregs[] = { | |||
105 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), | 89 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), |
106 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 90 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
107 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), | 91 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), |
92 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
108 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), | 93 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), |
109 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), | 94 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), |
110 | INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), | 95 | INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), |
@@ -174,6 +159,25 @@ PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); | |||
174 | PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); | 159 | PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); |
175 | PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff); | 160 | PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff); |
176 | 161 | ||
162 | struct resource pxa168_resource_gpio[] = { | ||
163 | { | ||
164 | .start = 0xd4019000, | ||
165 | .end = 0xd4019fff, | ||
166 | .flags = IORESOURCE_MEM, | ||
167 | }, { | ||
168 | .start = IRQ_PXA168_GPIOX, | ||
169 | .end = IRQ_PXA168_GPIOX, | ||
170 | .flags = IORESOURCE_IRQ, | ||
171 | }, | ||
172 | }; | ||
173 | |||
174 | struct platform_device pxa168_device_gpio = { | ||
175 | .name = "pxa-gpio", | ||
176 | .id = -1, | ||
177 | .num_resources = ARRAY_SIZE(pxa168_resource_gpio), | ||
178 | .resource = pxa168_resource_gpio, | ||
179 | }; | ||
180 | |||
177 | struct resource pxa168_usb_host_resources[] = { | 181 | struct resource pxa168_usb_host_resources[] = { |
178 | /* USB Host conroller register base */ | 182 | /* USB Host conroller register base */ |
179 | [0] = { | 183 | [0] = { |