diff options
Diffstat (limited to 'arch/arm/mach-mmp/flint.c')
-rw-r--r-- | arch/arm/mach-mmp/flint.c | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c new file mode 100644 index 000000000000..4ec7709a3462 --- /dev/null +++ b/arch/arm/mach-mmp/flint.c | |||
@@ -0,0 +1,123 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/flint.c | ||
3 | * | ||
4 | * Support for the Marvell Flint Development Platform. | ||
5 | * | ||
6 | * Copyright (C) 2009 Marvell International Ltd. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * publishhed by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/smc91x.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <linux/gpio.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <mach/addr-map.h> | ||
23 | #include <mach/mfp-mmp2.h> | ||
24 | #include <mach/mmp2.h> | ||
25 | |||
26 | #include "common.h" | ||
27 | |||
28 | static unsigned long flint_pin_config[] __initdata = { | ||
29 | /* UART1 */ | ||
30 | GPIO45_UART1_RXD, | ||
31 | GPIO46_UART1_TXD, | ||
32 | |||
33 | /* UART2 */ | ||
34 | GPIO47_UART2_RXD, | ||
35 | GPIO48_UART2_TXD, | ||
36 | |||
37 | /* SMC */ | ||
38 | GPIO151_SMC_SCLK, | ||
39 | GPIO145_SMC_nCS0, | ||
40 | GPIO146_SMC_nCS1, | ||
41 | GPIO152_SMC_BE0, | ||
42 | GPIO153_SMC_BE1, | ||
43 | GPIO154_SMC_IRQ, | ||
44 | GPIO113_SMC_RDY, | ||
45 | |||
46 | /*Ethernet*/ | ||
47 | GPIO155_GPIO155, | ||
48 | |||
49 | /* DFI */ | ||
50 | GPIO168_DFI_D0, | ||
51 | GPIO167_DFI_D1, | ||
52 | GPIO166_DFI_D2, | ||
53 | GPIO165_DFI_D3, | ||
54 | GPIO107_DFI_D4, | ||
55 | GPIO106_DFI_D5, | ||
56 | GPIO105_DFI_D6, | ||
57 | GPIO104_DFI_D7, | ||
58 | GPIO111_DFI_D8, | ||
59 | GPIO164_DFI_D9, | ||
60 | GPIO163_DFI_D10, | ||
61 | GPIO162_DFI_D11, | ||
62 | GPIO161_DFI_D12, | ||
63 | GPIO110_DFI_D13, | ||
64 | GPIO109_DFI_D14, | ||
65 | GPIO108_DFI_D15, | ||
66 | GPIO143_ND_nCS0, | ||
67 | GPIO144_ND_nCS1, | ||
68 | GPIO147_ND_nWE, | ||
69 | GPIO148_ND_nRE, | ||
70 | GPIO150_ND_ALE, | ||
71 | GPIO149_ND_CLE, | ||
72 | GPIO112_ND_RDY0, | ||
73 | GPIO160_ND_RDY1, | ||
74 | }; | ||
75 | |||
76 | static struct smc91x_platdata flint_smc91x_info = { | ||
77 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, | ||
78 | }; | ||
79 | |||
80 | static struct resource smc91x_resources[] = { | ||
81 | [0] = { | ||
82 | .start = SMC_CS1_PHYS_BASE + 0x300, | ||
83 | .end = SMC_CS1_PHYS_BASE + 0xfffff, | ||
84 | .flags = IORESOURCE_MEM, | ||
85 | }, | ||
86 | [1] = { | ||
87 | .start = gpio_to_irq(155), | ||
88 | .end = gpio_to_irq(155), | ||
89 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | ||
90 | } | ||
91 | }; | ||
92 | |||
93 | static struct platform_device smc91x_device = { | ||
94 | .name = "smc91x", | ||
95 | .id = 0, | ||
96 | .dev = { | ||
97 | .platform_data = &flint_smc91x_info, | ||
98 | }, | ||
99 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
100 | .resource = smc91x_resources, | ||
101 | }; | ||
102 | |||
103 | static void __init flint_init(void) | ||
104 | { | ||
105 | mfp_config(ARRAY_AND_SIZE(flint_pin_config)); | ||
106 | |||
107 | /* on-chip devices */ | ||
108 | mmp2_add_uart(1); | ||
109 | mmp2_add_uart(2); | ||
110 | |||
111 | /* off-chip devices */ | ||
112 | platform_device_register(&smc91x_device); | ||
113 | } | ||
114 | |||
115 | MACHINE_START(FLINT, "Flint Development Platform") | ||
116 | .phys_io = APB_PHYS_BASE, | ||
117 | .boot_params = 0x00000100, | ||
118 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, | ||
119 | .map_io = pxa_map_io, | ||
120 | .init_irq = mmp2_init_irq, | ||
121 | .timer = &mmp2_timer, | ||
122 | .init_machine = flint_init, | ||
123 | MACHINE_END | ||