diff options
-rw-r--r-- | arch/arm/mach-mmp/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-mmp/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-mmp/gplugd.c | 189 | ||||
-rw-r--r-- | arch/arm/mach-mmp/include/mach/mfp-gplugd.h | 52 |
4 files changed, 249 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig index 67793a690272..56ef5f6c8116 100644 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig | |||
@@ -77,6 +77,13 @@ config MACH_TETON_BGA | |||
77 | Say 'Y' here if you want to support the Marvell PXA168-based | 77 | Say 'Y' here if you want to support the Marvell PXA168-based |
78 | Teton BGA Development Board. | 78 | Teton BGA Development Board. |
79 | 79 | ||
80 | config MACH_SHEEVAD | ||
81 | bool "Marvell's PXA168 GuruPlug Display (gplugD) Board" | ||
82 | select CPU_PXA168 | ||
83 | help | ||
84 | Say 'Y' here if you want to support the Marvell PXA168-based | ||
85 | GuruPlug Display (gplugD) Board | ||
86 | |||
80 | endmenu | 87 | endmenu |
81 | 88 | ||
82 | config CPU_PXA168 | 89 | config CPU_PXA168 |
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile index 5c68382141af..b0ac942327aa 100644 --- a/arch/arm/mach-mmp/Makefile +++ b/arch/arm/mach-mmp/Makefile | |||
@@ -19,3 +19,4 @@ obj-$(CONFIG_MACH_BROWNSTONE) += brownstone.o | |||
19 | obj-$(CONFIG_MACH_FLINT) += flint.o | 19 | obj-$(CONFIG_MACH_FLINT) += flint.o |
20 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o | 20 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o |
21 | obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o | 21 | obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o |
22 | obj-$(CONFIG_MACH_SHEEVAD) += gplugd.o | ||
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c new file mode 100644 index 000000000000..c070c24255f4 --- /dev/null +++ b/arch/arm/mach-mmp/gplugd.c | |||
@@ -0,0 +1,189 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/gplugd.c | ||
3 | * | ||
4 | * Support for the Marvell PXA168-based GuruPlug Display (gplugD) Platform. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * publishhed by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | |||
13 | #include <asm/mach/arch.h> | ||
14 | #include <asm/mach-types.h> | ||
15 | |||
16 | #include <mach/gpio.h> | ||
17 | #include <mach/pxa168.h> | ||
18 | #include <mach/mfp-pxa168.h> | ||
19 | #include <mach/mfp-gplugd.h> | ||
20 | |||
21 | #include "common.h" | ||
22 | |||
23 | static unsigned long gplugd_pin_config[] __initdata = { | ||
24 | /* UART3 */ | ||
25 | GPIO8_UART3_SOUT, | ||
26 | GPIO9_UART3_SIN, | ||
27 | GPI1O_UART3_CTS, | ||
28 | GPI11_UART3_RTS, | ||
29 | |||
30 | /* MMC2 */ | ||
31 | GPIO28_MMC2_CMD, | ||
32 | GPIO29_MMC2_CLK, | ||
33 | GPIO30_MMC2_DAT0, | ||
34 | GPIO31_MMC2_DAT1, | ||
35 | GPIO32_MMC2_DAT2, | ||
36 | GPIO33_MMC2_DAT3, | ||
37 | |||
38 | /* LCD & HDMI clock selection GPIO: 0: 74.176MHz, 1: 74.25 MHz */ | ||
39 | GPIO35_GPIO, | ||
40 | GPIO36_GPIO, /* CEC Interrupt */ | ||
41 | |||
42 | /* MMC1 */ | ||
43 | GPIO43_MMC1_CLK, | ||
44 | GPIO49_MMC1_CMD, | ||
45 | GPIO41_MMC1_DAT0, | ||
46 | GPIO40_MMC1_DAT1, | ||
47 | GPIO52_MMC1_DAT2, | ||
48 | GPIO51_MMC1_DAT3, | ||
49 | GPIO53_MMC1_CD, | ||
50 | |||
51 | /* LCD */ | ||
52 | GPIO56_LCD_FCLK_RD, | ||
53 | GPIO57_LCD_LCLK_A0, | ||
54 | GPIO58_LCD_PCLK_WR, | ||
55 | GPIO59_LCD_DENA_BIAS, | ||
56 | GPIO60_LCD_DD0, | ||
57 | GPIO61_LCD_DD1, | ||
58 | GPIO62_LCD_DD2, | ||
59 | GPIO63_LCD_DD3, | ||
60 | GPIO64_LCD_DD4, | ||
61 | GPIO65_LCD_DD5, | ||
62 | GPIO66_LCD_DD6, | ||
63 | GPIO67_LCD_DD7, | ||
64 | GPIO68_LCD_DD8, | ||
65 | GPIO69_LCD_DD9, | ||
66 | GPIO70_LCD_DD10, | ||
67 | GPIO71_LCD_DD11, | ||
68 | GPIO72_LCD_DD12, | ||
69 | GPIO73_LCD_DD13, | ||
70 | GPIO74_LCD_DD14, | ||
71 | GPIO75_LCD_DD15, | ||
72 | GPIO76_LCD_DD16, | ||
73 | GPIO77_LCD_DD17, | ||
74 | GPIO78_LCD_DD18, | ||
75 | GPIO79_LCD_DD19, | ||
76 | GPIO80_LCD_DD20, | ||
77 | GPIO81_LCD_DD21, | ||
78 | GPIO82_LCD_DD22, | ||
79 | GPIO83_LCD_DD23, | ||
80 | |||
81 | /* GPIO */ | ||
82 | GPIO84_GPIO, | ||
83 | GPIO85_GPIO, | ||
84 | |||
85 | /* Fast-Ethernet*/ | ||
86 | GPIO86_TX_CLK, | ||
87 | GPIO87_TX_EN, | ||
88 | GPIO88_TX_DQ3, | ||
89 | GPIO89_TX_DQ2, | ||
90 | GPIO90_TX_DQ1, | ||
91 | GPIO91_TX_DQ0, | ||
92 | GPIO92_MII_CRS, | ||
93 | GPIO93_MII_COL, | ||
94 | GPIO94_RX_CLK, | ||
95 | GPIO95_RX_ER, | ||
96 | GPIO96_RX_DQ3, | ||
97 | GPIO97_RX_DQ2, | ||
98 | GPIO98_RX_DQ1, | ||
99 | GPIO99_RX_DQ0, | ||
100 | GPIO100_MII_MDC, | ||
101 | GPIO101_MII_MDIO, | ||
102 | GPIO103_RX_DV, | ||
103 | GPIO104_GPIO, /* Reset PHY */ | ||
104 | |||
105 | /* RTC interrupt */ | ||
106 | GPIO102_GPIO, | ||
107 | |||
108 | /* I2C */ | ||
109 | GPIO105_CI2C_SDA, | ||
110 | GPIO106_CI2C_SCL, | ||
111 | |||
112 | /* Select JTAG */ | ||
113 | GPIO109_GPIO, | ||
114 | |||
115 | /* I2S */ | ||
116 | GPIO114_I2S_FRM, | ||
117 | GPIO115_I2S_BCLK, | ||
118 | GPIO116_I2S_TXD | ||
119 | }; | ||
120 | |||
121 | static struct i2c_board_info gplugd_i2c_board_info[] = { | ||
122 | { | ||
123 | .type = "isl1208", | ||
124 | .addr = 0x6F, | ||
125 | } | ||
126 | }; | ||
127 | |||
128 | /* Bring PHY out of reset by setting GPIO 104 */ | ||
129 | static int gplugd_eth_init(void) | ||
130 | { | ||
131 | if (unlikely(gpio_request(104, "ETH_RESET_N"))) { | ||
132 | printk(KERN_ERR "Can't get hold of GPIO 104 to bring Ethernet " | ||
133 | "PHY out of reset\n"); | ||
134 | return -EIO; | ||
135 | } | ||
136 | |||
137 | gpio_direction_output(104, 1); | ||
138 | gpio_free(104); | ||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | struct pxa168_eth_platform_data gplugd_eth_platform_data = { | ||
143 | .port_number = 0, | ||
144 | .phy_addr = 0, | ||
145 | .speed = 0, /* Autonagotiation */ | ||
146 | .init = gplugd_eth_init, | ||
147 | }; | ||
148 | |||
149 | static void __init select_disp_freq(void) | ||
150 | { | ||
151 | /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */ | ||
152 | if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) { | ||
153 | printk(KERN_ERR "Can't get hold of GPIO 35 to select display " | ||
154 | "frequency\n"); | ||
155 | } else { | ||
156 | gpio_direction_output(35, 1); | ||
157 | gpio_free(104); | ||
158 | } | ||
159 | |||
160 | if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) { | ||
161 | printk(KERN_ERR "Can't get hold of GPIO 85 to select display " | ||
162 | "frequency\n"); | ||
163 | } else { | ||
164 | gpio_direction_output(85, 0); | ||
165 | gpio_free(104); | ||
166 | } | ||
167 | } | ||
168 | |||
169 | static void __init gplugd_init(void) | ||
170 | { | ||
171 | mfp_config(ARRAY_AND_SIZE(gplugd_pin_config)); | ||
172 | |||
173 | select_disp_freq(); | ||
174 | |||
175 | /* on-chip devices */ | ||
176 | pxa168_add_uart(3); | ||
177 | pxa168_add_ssp(0); | ||
178 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info)); | ||
179 | |||
180 | pxa168_add_eth(&gplugd_eth_platform_data); | ||
181 | } | ||
182 | |||
183 | MACHINE_START(SHEEVAD, "PXA168-based GuruPlug Display (gplugD) Platform") | ||
184 | .map_io = mmp_map_io, | ||
185 | .nr_irqs = IRQ_BOARD_START, | ||
186 | .init_irq = pxa168_init_irq, | ||
187 | .timer = &pxa168_timer, | ||
188 | .init_machine = gplugd_init, | ||
189 | MACHINE_END | ||
diff --git a/arch/arm/mach-mmp/include/mach/mfp-gplugd.h b/arch/arm/mach-mmp/include/mach/mfp-gplugd.h new file mode 100644 index 000000000000..b8cf38d85600 --- /dev/null +++ b/arch/arm/mach-mmp/include/mach/mfp-gplugd.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/include/mach/mfp-gplugd.h | ||
3 | * | ||
4 | * MFP definitions used in gplugD | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_MFP_GPLUGD_H | ||
12 | #define __MACH_MFP_GPLUGD_H | ||
13 | |||
14 | #include <plat/mfp.h> | ||
15 | #include <mach/mfp.h> | ||
16 | |||
17 | /* UART3 */ | ||
18 | #define GPIO8_UART3_SOUT MFP_CFG(GPIO8, AF2) | ||
19 | #define GPIO9_UART3_SIN MFP_CFG(GPIO9, AF2) | ||
20 | #define GPI1O_UART3_CTS MFP_CFG(GPIO10, AF2) | ||
21 | #define GPI11_UART3_RTS MFP_CFG(GPIO11, AF2) | ||
22 | |||
23 | /* MMC2 */ | ||
24 | #define GPIO28_MMC2_CMD MFP_CFG_DRV(GPIO28, AF6, FAST) | ||
25 | #define GPIO29_MMC2_CLK MFP_CFG_DRV(GPIO29, AF6, FAST) | ||
26 | #define GPIO30_MMC2_DAT0 MFP_CFG_DRV(GPIO30, AF6, FAST) | ||
27 | #define GPIO31_MMC2_DAT1 MFP_CFG_DRV(GPIO31, AF6, FAST) | ||
28 | #define GPIO32_MMC2_DAT2 MFP_CFG_DRV(GPIO32, AF6, FAST) | ||
29 | #define GPIO33_MMC2_DAT3 MFP_CFG_DRV(GPIO33, AF6, FAST) | ||
30 | |||
31 | /* I2S */ | ||
32 | #undef GPIO114_I2S_FRM | ||
33 | #undef GPIO115_I2S_BCLK | ||
34 | |||
35 | #define GPIO114_I2S_FRM MFP_CFG_DRV(GPIO114, AF1, FAST) | ||
36 | #define GPIO115_I2S_BCLK MFP_CFG_DRV(GPIO115, AF1, FAST) | ||
37 | #define GPIO116_I2S_TXD MFP_CFG_DRV(GPIO116, AF1, FAST) | ||
38 | |||
39 | /* MMC4 */ | ||
40 | #define GPIO125_MMC4_DAT3 MFP_CFG_DRV(GPIO125, AF7, FAST) | ||
41 | #define GPIO126_MMC4_DAT2 MFP_CFG_DRV(GPIO126, AF7, FAST) | ||
42 | #define GPIO127_MMC4_DAT1 MFP_CFG_DRV(GPIO127, AF7, FAST) | ||
43 | #define GPIO0_2_MMC4_DAT0 MFP_CFG_DRV(GPIO0_2, AF7, FAST) | ||
44 | #define GPIO1_2_MMC4_CMD MFP_CFG_DRV(GPIO1_2, AF7, FAST) | ||
45 | #define GPIO2_2_MMC4_CLK MFP_CFG_DRV(GPIO2_2, AF7, FAST) | ||
46 | |||
47 | /* OTG GPIO */ | ||
48 | #define GPIO_USB_OTG_PEN 18 | ||
49 | #define GPIO_USB_OIDIR 20 | ||
50 | |||
51 | /* Other GPIOs are 35, 84, 85 */ | ||
52 | #endif /* __MACH_MFP_GPLUGD_H */ | ||