aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-10-14 14:31:44 -0400
committerTony Lindgren <tony@atomide.com>2013-10-18 13:24:33 -0400
commit97411608fd5f17735f51103da08a738be1f932d9 (patch)
tree4e266166be04da25eee1667988ed26934e112e0b /arch/arm/mach-omap2
parent95807689eab8441737572d1a9daaa1025429a908 (diff)
ARM: OMAP2+: Remove legacy support for zoom platforms
We now have pretty decent device tree based support for zoom platforms. It's not complete, but basics work for me so adding more features should be quite trivial. Looks like also 3630 sdp is zoom based, and looking at it's board file should also be trivial to support with the device tree based booting. Patches are welcome if people are still using these. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig20
-rw-r--r--arch/arm/mach-omap2/Makefile9
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c225
-rw-r--r--arch/arm/mach-omap2/board-ldp.c3
-rw-r--r--arch/arm/mach-omap2/board-zoom-debugboard.c139
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c71
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c360
-rw-r--r--arch/arm/mach-omap2/board-zoom.c159
-rw-r--r--arch/arm/mach-omap2/board-zoom.h10
9 files changed, 1 insertions, 995 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index fbd730d895cf..7a020c5f985c 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -310,20 +310,6 @@ config MACH_NOKIA_RX51
310 default y 310 default y
311 select OMAP_PACKAGE_CBB 311 select OMAP_PACKAGE_CBB
312 312
313config MACH_OMAP_ZOOM2
314 bool "OMAP3 Zoom2 board"
315 depends on ARCH_OMAP3
316 default y
317 select OMAP_PACKAGE_CBB
318 select REGULATOR_FIXED_VOLTAGE if REGULATOR
319
320config MACH_OMAP_ZOOM3
321 bool "OMAP3630 Zoom3 board"
322 depends on ARCH_OMAP3
323 default y
324 select OMAP_PACKAGE_CBP
325 select REGULATOR_FIXED_VOLTAGE if REGULATOR
326
327config MACH_CM_T35 313config MACH_CM_T35
328 bool "CompuLab CM-T35/CM-T3730 modules" 314 bool "CompuLab CM-T35/CM-T3730 modules"
329 depends on ARCH_OMAP3 315 depends on ARCH_OMAP3
@@ -359,12 +345,6 @@ config MACH_SBC3530
359 default y 345 default y
360 select OMAP_PACKAGE_CUS 346 select OMAP_PACKAGE_CUS
361 347
362config MACH_OMAP_3630SDP
363 bool "OMAP3630 SDP board"
364 depends on ARCH_OMAP3
365 default y
366 select OMAP_PACKAGE_CBP
367
368config MACH_TI8168EVM 348config MACH_TI8168EVM
369 bool "TI8168 Evaluation Module" 349 bool "TI8168 Evaluation Module"
370 depends on SOC_TI81XX 350 depends on SOC_TI81XX
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f8db40d1f1c2..449a174ab926 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -248,15 +248,6 @@ obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
248obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o sdram-nokia.o 248obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o sdram-nokia.o
249obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51-peripherals.o 249obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51-peripherals.o
250obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51-video.o 250obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51-video.o
251obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom.o board-zoom-peripherals.o
252obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom-display.o
253obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom-debugboard.o
254obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom.o board-zoom-peripherals.o
255obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom-display.o
256obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom-debugboard.o
257obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o
258obj-$(CONFIG_MACH_OMAP_3630SDP) += board-zoom-peripherals.o
259obj-$(CONFIG_MACH_OMAP_3630SDP) += board-zoom-display.o
260obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o 251obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o
261obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o 252obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o
262obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o 253obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
deleted file mode 100644
index 20d6d8189240..000000000000
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ /dev/null
@@ -1,225 +0,0 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/kernel.h>
10#include <linux/init.h>
11#include <linux/platform_device.h>
12#include <linux/input.h>
13#include <linux/gpio.h>
14#include <linux/mtd/nand.h>
15
16#include <asm/mach-types.h>
17#include <asm/mach/arch.h>
18
19#include "common.h"
20#include "gpmc-smc91x.h"
21
22#include "board-zoom.h"
23
24#include "board-flash.h"
25#include "mux.h"
26#include "sdram-hynix-h8mbx00u0mer-0em.h"
27
28#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
29
30static struct omap_smc91x_platform_data board_smc91x_data = {
31 .cs = 3,
32 .flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,
33};
34
35static void __init board_smc91x_init(void)
36{
37 board_smc91x_data.gpio_irq = 158;
38 gpmc_smc91x_init(&board_smc91x_data);
39}
40
41#else
42
43static inline void board_smc91x_init(void)
44{
45}
46
47#endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
48
49static void enable_board_wakeup_source(void)
50{
51 /* T2 interrupt line (keypad) */
52 omap_mux_init_signal("sys_nirq",
53 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
54}
55
56static struct usbhs_phy_data phy_data[] __initdata = {
57 {
58 .port = 1,
59 .reset_gpio = 126,
60 .vcc_gpio = -EINVAL,
61 },
62 {
63 .port = 2,
64 .reset_gpio = 61,
65 .vcc_gpio = -EINVAL,
66 },
67};
68
69static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
70
71 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
72 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
73};
74
75#ifdef CONFIG_OMAP_MUX
76static struct omap_board_mux board_mux[] __initdata = {
77 { .reg_offset = OMAP_MUX_TERMINATOR },
78};
79#endif
80
81/*
82 * SDP3630 CS organization
83 * See also the Switch S8 settings in the comments.
84 */
85static char chip_sel_sdp[][GPMC_CS_NUM] = {
86 {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
87 {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
88 {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
89};
90
91static struct mtd_partition sdp_nor_partitions[] = {
92 /* bootloader (U-Boot, etc) in first sector */
93 {
94 .name = "Bootloader-NOR",
95 .offset = 0,
96 .size = SZ_256K,
97 .mask_flags = MTD_WRITEABLE, /* force read-only */
98 },
99 /* bootloader params in the next sector */
100 {
101 .name = "Params-NOR",
102 .offset = MTDPART_OFS_APPEND,
103 .size = SZ_256K,
104 .mask_flags = 0,
105 },
106 /* kernel */
107 {
108 .name = "Kernel-NOR",
109 .offset = MTDPART_OFS_APPEND,
110 .size = SZ_2M,
111 .mask_flags = 0
112 },
113 /* file system */
114 {
115 .name = "Filesystem-NOR",
116 .offset = MTDPART_OFS_APPEND,
117 .size = MTDPART_SIZ_FULL,
118 .mask_flags = 0
119 }
120};
121
122static struct mtd_partition sdp_onenand_partitions[] = {
123 {
124 .name = "X-Loader-OneNAND",
125 .offset = 0,
126 .size = 4 * (64 * 2048),
127 .mask_flags = MTD_WRITEABLE /* force read-only */
128 },
129 {
130 .name = "U-Boot-OneNAND",
131 .offset = MTDPART_OFS_APPEND,
132 .size = 2 * (64 * 2048),
133 .mask_flags = MTD_WRITEABLE /* force read-only */
134 },
135 {
136 .name = "U-Boot Environment-OneNAND",
137 .offset = MTDPART_OFS_APPEND,
138 .size = 1 * (64 * 2048),
139 },
140 {
141 .name = "Kernel-OneNAND",
142 .offset = MTDPART_OFS_APPEND,
143 .size = 16 * (64 * 2048),
144 },
145 {
146 .name = "File System-OneNAND",
147 .offset = MTDPART_OFS_APPEND,
148 .size = MTDPART_SIZ_FULL,
149 },
150};
151
152static struct mtd_partition sdp_nand_partitions[] = {
153 /* All the partition sizes are listed in terms of NAND block size */
154 {
155 .name = "X-Loader-NAND",
156 .offset = 0,
157 .size = 4 * (64 * 2048),
158 .mask_flags = MTD_WRITEABLE, /* force read-only */
159 },
160 {
161 .name = "U-Boot-NAND",
162 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
163 .size = 10 * (64 * 2048),
164 .mask_flags = MTD_WRITEABLE, /* force read-only */
165 },
166 {
167 .name = "Boot Env-NAND",
168
169 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
170 .size = 6 * (64 * 2048),
171 },
172 {
173 .name = "Kernel-NAND",
174 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
175 .size = 40 * (64 * 2048),
176 },
177 {
178 .name = "File System - NAND",
179 .size = MTDPART_SIZ_FULL,
180 .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
181 },
182};
183
184static struct flash_partitions sdp_flash_partitions[] = {
185 {
186 .parts = sdp_nor_partitions,
187 .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
188 },
189 {
190 .parts = sdp_onenand_partitions,
191 .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
192 },
193 {
194 .parts = sdp_nand_partitions,
195 .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
196 },
197};
198
199static void __init omap_sdp_init(void)
200{
201 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
202 zoom_peripherals_init();
203 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
204 h8mbx00u0mer0em_sdrc_params);
205 zoom_display_init();
206 board_smc91x_init();
207 board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
208 enable_board_wakeup_source();
209
210 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
211 usbhs_init(&usbhs_bdata);
212}
213
214MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
215 .atag_offset = 0x100,
216 .reserve = omap_reserve,
217 .map_io = omap3_map_io,
218 .init_early = omap3630_init_early,
219 .init_irq = omap3_init_irq,
220 .handle_irq = omap3_intc_handle_irq,
221 .init_machine = omap_sdp_init,
222 .init_late = omap3630_init_late,
223 .init_time = omap3_sync32k_timer_init,
224 .restart = omap3xxx_restart,
225MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index dd8da2c5399f..4ec8d82b0492 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -36,7 +36,6 @@
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37 37
38#include "common.h" 38#include "common.h"
39#include "board-zoom.h"
40#include "gpmc.h" 39#include "gpmc.h"
41#include "gpmc-smsc911x.h" 40#include "gpmc-smsc911x.h"
42 41
@@ -406,7 +405,7 @@ static void __init omap_ldp_init(void)
406 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 405 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
407 usb_musb_init(NULL); 406 usb_musb_init(NULL);
408 board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions), 407 board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions),
409 ZOOM_NAND_CS, 0, nand_default_timings); 408 0, 0, nand_default_timings);
410 409
411 omap_hsmmc_init(mmc); 410 omap_hsmmc_init(mmc);
412 ldp_display_init(); 411 ldp_display_init();
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
deleted file mode 100644
index 42e5f231a799..000000000000
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ /dev/null
@@ -1,139 +0,0 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 * Mikkel Christensen <mlc@ti.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/gpio.h>
13#include <linux/serial_8250.h>
14#include <linux/smsc911x.h>
15#include <linux/interrupt.h>
16
17#include <linux/regulator/fixed.h>
18#include <linux/regulator/machine.h>
19
20#include "gpmc.h"
21#include "gpmc-smsc911x.h"
22
23#include "board-zoom.h"
24
25#include "soc.h"
26#include "common.h"
27
28#define ZOOM_SMSC911X_CS 7
29#define ZOOM_SMSC911X_GPIO 158
30#define ZOOM_QUADUART_CS 3
31#define ZOOM_QUADUART_GPIO 102
32#define ZOOM_QUADUART_RST_GPIO 152
33#define QUART_CLK 1843200
34#define DEBUG_BASE 0x08000000
35#define ZOOM_ETHR_START DEBUG_BASE
36
37static struct omap_smsc911x_platform_data zoom_smsc911x_cfg = {
38 .cs = ZOOM_SMSC911X_CS,
39 .gpio_irq = ZOOM_SMSC911X_GPIO,
40 .gpio_reset = -EINVAL,
41 .flags = SMSC911X_USE_32BIT,
42};
43
44static inline void __init zoom_init_smsc911x(void)
45{
46 gpmc_smsc911x_init(&zoom_smsc911x_cfg);
47}
48
49static struct plat_serial8250_port serial_platform_data[] = {
50 {
51 .mapbase = ZOOM_UART_BASE,
52 .flags = UPF_BOOT_AUTOCONF|UPF_IOREMAP|UPF_SHARE_IRQ,
53 .irqflags = IRQF_SHARED | IRQF_TRIGGER_RISING,
54 .iotype = UPIO_MEM,
55 .regshift = 1,
56 .uartclk = QUART_CLK,
57 }, {
58 .flags = 0
59 }
60};
61
62static struct platform_device zoom_debugboard_serial_device = {
63 .name = "serial8250",
64 .id = PLAT8250_DEV_PLATFORM,
65 .dev = {
66 .platform_data = serial_platform_data,
67 },
68};
69
70static inline void __init zoom_init_quaduart(void)
71{
72 int quart_cs;
73 unsigned long cs_mem_base;
74 int quart_gpio = 0;
75
76 if (gpio_request_one(ZOOM_QUADUART_RST_GPIO,
77 GPIOF_OUT_INIT_LOW,
78 "TL16CP754C GPIO") < 0) {
79 pr_err("Failed to request GPIO%d for TL16CP754C\n",
80 ZOOM_QUADUART_RST_GPIO);
81 return;
82 }
83
84 quart_cs = ZOOM_QUADUART_CS;
85
86 if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) {
87 pr_err("Failed to request GPMC mem for Quad UART(TL16CP754C)\n");
88 return;
89 }
90
91 quart_gpio = ZOOM_QUADUART_GPIO;
92
93 if (gpio_request_one(quart_gpio, GPIOF_IN, "TL16CP754C GPIO") < 0)
94 printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n",
95 quart_gpio);
96
97 serial_platform_data[0].irq = gpio_to_irq(102);
98}
99
100static inline int omap_zoom_debugboard_detect(void)
101{
102 int debug_board_detect = 0;
103 int ret = 1;
104
105 debug_board_detect = ZOOM_SMSC911X_GPIO;
106
107 if (gpio_request_one(debug_board_detect, GPIOF_IN,
108 "Zoom debug board detect") < 0) {
109 pr_err("Failed to request GPIO%d for Zoom debug board detect\n",
110 debug_board_detect);
111 return 0;
112 }
113
114 if (!gpio_get_value(debug_board_detect)) {
115 ret = 0;
116 }
117 gpio_free(debug_board_detect);
118 return ret;
119}
120
121static struct platform_device *zoom_devices[] __initdata = {
122 &zoom_debugboard_serial_device,
123};
124
125static struct regulator_consumer_supply dummy_supplies[] = {
126 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
127 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
128};
129
130int __init zoom_debugboard_init(void)
131{
132 if (!omap_zoom_debugboard_detect())
133 return 0;
134
135 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
136 zoom_init_smsc911x();
137 zoom_init_quaduart();
138 return platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));
139}
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
deleted file mode 100644
index 3d8ecc1e05bd..000000000000
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Inc.
3 *
4 * Modified from mach-omap2/board-zoom-peripherals.c
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#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/gpio.h>
15#include <linux/spi/spi.h>
16#include <linux/platform_data/spi-omap2-mcspi.h>
17#include <video/omapdss.h>
18#include <video/omap-panel-data.h>
19
20#include "board-zoom.h"
21#include "soc.h"
22#include "common.h"
23
24#define LCD_PANEL_RESET_GPIO_PROD 96
25#define LCD_PANEL_RESET_GPIO_PILOT 55
26#define LCD_PANEL_QVGA_GPIO 56
27
28static struct panel_nec_nl8048hl11_platform_data zoom_lcd_pdata = {
29 .name = "lcd",
30 .source = "dpi.0",
31
32 .data_lines = 24,
33
34 .res_gpio = -1, /* filled in code */
35 .qvga_gpio = LCD_PANEL_QVGA_GPIO,
36};
37
38static struct omap_dss_board_info zoom_dss_data = {
39 .default_display_name = "lcd",
40};
41
42static void __init zoom_lcd_panel_init(void)
43{
44 zoom_lcd_pdata.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
45 LCD_PANEL_RESET_GPIO_PROD :
46 LCD_PANEL_RESET_GPIO_PILOT;
47}
48
49static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
50 .turbo_mode = 1,
51};
52
53static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
54 [0] = {
55 .modalias = "panel-nec-nl8048hl11",
56 .bus_num = 1,
57 .chip_select = 2,
58 .max_speed_hz = 375000,
59 .controller_data = &dss_lcd_mcspi_config,
60 .platform_data = &zoom_lcd_pdata,
61 },
62};
63
64void __init zoom_display_init(void)
65{
66 omap_display_init(&zoom_dss_data);
67 zoom_lcd_panel_init();
68 spi_register_board_info(nec_8048_spi_board_info,
69 ARRAY_SIZE(nec_8048_spi_board_info));
70}
71
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
deleted file mode 100644
index a90375d5b2b6..000000000000
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ /dev/null
@@ -1,360 +0,0 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 *
4 * Modified from mach-omap2/board-zoom2.c
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#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/input.h>
15#include <linux/input/matrix_keypad.h>
16#include <linux/gpio.h>
17#include <linux/i2c/twl.h>
18#include <linux/regulator/machine.h>
19#include <linux/regulator/fixed.h>
20#include <linux/wl12xx.h>
21#include <linux/mmc/host.h>
22#include <linux/platform_data/gpio-omap.h>
23#include <linux/platform_data/omap-twl4030.h>
24#include <linux/usb/phy.h>
25#include <linux/pwm.h>
26#include <linux/leds_pwm.h>
27#include <linux/pwm_backlight.h>
28
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32
33#include "common.h"
34
35#include "board-zoom.h"
36
37#include "mux.h"
38#include "hsmmc.h"
39#include "common-board-devices.h"
40
41#define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
42#define OMAP_ZOOM_TSC2004_IRQ_GPIO (153)
43#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
44
45/* Zoom2 has Qwerty keyboard*/
46static uint32_t board_keymap[] = {
47 KEY(0, 0, KEY_E),
48 KEY(0, 1, KEY_R),
49 KEY(0, 2, KEY_T),
50 KEY(0, 3, KEY_HOME),
51 KEY(0, 6, KEY_I),
52 KEY(0, 7, KEY_LEFTSHIFT),
53 KEY(1, 0, KEY_D),
54 KEY(1, 1, KEY_F),
55 KEY(1, 2, KEY_G),
56 KEY(1, 3, KEY_SEND),
57 KEY(1, 6, KEY_K),
58 KEY(1, 7, KEY_ENTER),
59 KEY(2, 0, KEY_X),
60 KEY(2, 1, KEY_C),
61 KEY(2, 2, KEY_V),
62 KEY(2, 3, KEY_END),
63 KEY(2, 6, KEY_DOT),
64 KEY(2, 7, KEY_CAPSLOCK),
65 KEY(3, 0, KEY_Z),
66 KEY(3, 1, KEY_KPPLUS),
67 KEY(3, 2, KEY_B),
68 KEY(3, 3, KEY_F1),
69 KEY(3, 6, KEY_O),
70 KEY(3, 7, KEY_SPACE),
71 KEY(4, 0, KEY_W),
72 KEY(4, 1, KEY_Y),
73 KEY(4, 2, KEY_U),
74 KEY(4, 3, KEY_F2),
75 KEY(4, 4, KEY_VOLUMEUP),
76 KEY(4, 6, KEY_L),
77 KEY(4, 7, KEY_LEFT),
78 KEY(5, 0, KEY_S),
79 KEY(5, 1, KEY_H),
80 KEY(5, 2, KEY_J),
81 KEY(5, 3, KEY_F3),
82 KEY(5, 4, KEY_UNKNOWN),
83 KEY(5, 5, KEY_VOLUMEDOWN),
84 KEY(5, 6, KEY_M),
85 KEY(5, 7, KEY_RIGHT),
86 KEY(6, 0, KEY_Q),
87 KEY(6, 1, KEY_A),
88 KEY(6, 2, KEY_N),
89 KEY(6, 3, KEY_BACKSPACE),
90 KEY(6, 6, KEY_P),
91 KEY(6, 7, KEY_UP),
92 KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */
93 KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */
94 KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */
95 KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */
96 KEY(7, 6, KEY_SELECT),
97 KEY(7, 7, KEY_DOWN)
98};
99
100static struct matrix_keymap_data board_map_data = {
101 .keymap = board_keymap,
102 .keymap_size = ARRAY_SIZE(board_keymap),
103};
104
105static struct twl4030_keypad_data zoom_kp_twl4030_data = {
106 .keymap_data = &board_map_data,
107 .rows = 8,
108 .cols = 8,
109 .rep = 1,
110};
111
112static struct regulator_consumer_supply zoom_vmmc1_supply[] = {
113 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
114};
115
116static struct regulator_consumer_supply zoom_vsim_supply[] = {
117 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
118};
119
120static struct regulator_consumer_supply zoom_vmmc2_supply[] = {
121 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
122};
123
124static struct regulator_consumer_supply zoom_vmmc3_supply[] = {
125 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"),
126};
127
128/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
129static struct regulator_init_data zoom_vmmc1 = {
130 .constraints = {
131 .min_uV = 1850000,
132 .max_uV = 3150000,
133 .valid_modes_mask = REGULATOR_MODE_NORMAL
134 | REGULATOR_MODE_STANDBY,
135 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
136 | REGULATOR_CHANGE_MODE
137 | REGULATOR_CHANGE_STATUS,
138 },
139 .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc1_supply),
140 .consumer_supplies = zoom_vmmc1_supply,
141};
142
143/* VMMC2 for MMC2 card */
144static struct regulator_init_data zoom_vmmc2 = {
145 .constraints = {
146 .min_uV = 1850000,
147 .max_uV = 1850000,
148 .apply_uV = true,
149 .valid_modes_mask = REGULATOR_MODE_NORMAL
150 | REGULATOR_MODE_STANDBY,
151 .valid_ops_mask = REGULATOR_CHANGE_MODE
152 | REGULATOR_CHANGE_STATUS,
153 },
154 .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc2_supply),
155 .consumer_supplies = zoom_vmmc2_supply,
156};
157
158/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
159static struct regulator_init_data zoom_vsim = {
160 .constraints = {
161 .min_uV = 1800000,
162 .max_uV = 3000000,
163 .valid_modes_mask = REGULATOR_MODE_NORMAL
164 | REGULATOR_MODE_STANDBY,
165 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
166 | REGULATOR_CHANGE_MODE
167 | REGULATOR_CHANGE_STATUS,
168 },
169 .num_consumer_supplies = ARRAY_SIZE(zoom_vsim_supply),
170 .consumer_supplies = zoom_vsim_supply,
171};
172
173static struct regulator_init_data zoom_vmmc3 = {
174 .constraints = {
175 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
176 },
177 .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc3_supply),
178 .consumer_supplies = zoom_vmmc3_supply,
179};
180
181static struct fixed_voltage_config zoom_vwlan = {
182 .supply_name = "vwl1271",
183 .microvolts = 1800000, /* 1.8V */
184 .gpio = OMAP_ZOOM_WLAN_PMENA_GPIO,
185 .startup_delay = 70000, /* 70msec */
186 .enable_high = 1,
187 .enabled_at_boot = 0,
188 .init_data = &zoom_vmmc3,
189};
190
191static struct platform_device omap_vwlan_device = {
192 .name = "reg-fixed-voltage",
193 .id = 1,
194 .dev = {
195 .platform_data = &zoom_vwlan,
196 },
197};
198
199static struct pwm_lookup zoom_pwm_lookup[] = {
200 PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "zoom::keypad"),
201 PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", "backlight"),
202};
203
204static struct led_pwm zoom_pwm_leds[] = {
205 {
206 .name = "zoom::keypad",
207 .max_brightness = 127,
208 .pwm_period_ns = 7812500,
209 },
210};
211
212static struct led_pwm_platform_data zoom_pwm_data = {
213 .num_leds = ARRAY_SIZE(zoom_pwm_leds),
214 .leds = zoom_pwm_leds,
215};
216
217static struct platform_device zoom_leds_pwm = {
218 .name = "leds_pwm",
219 .id = -1,
220 .dev = {
221 .platform_data = &zoom_pwm_data,
222 },
223};
224
225static struct platform_pwm_backlight_data zoom_backlight_data = {
226 .pwm_id = 1,
227 .max_brightness = 127,
228 .dft_brightness = 127,
229 .pwm_period_ns = 7812500,
230};
231
232static struct platform_device zoom_backlight_pwm = {
233 .name = "pwm-backlight",
234 .id = -1,
235 .dev = {
236 .platform_data = &zoom_backlight_data,
237 },
238};
239
240static struct platform_device *zoom_devices[] __initdata = {
241 &omap_vwlan_device,
242 &zoom_leds_pwm,
243 &zoom_backlight_pwm,
244};
245
246static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
247 .board_ref_clock = WL12XX_REFCLOCK_26, /* 26 MHz */
248};
249
250static struct omap2_hsmmc_info mmc[] = {
251 {
252 .name = "external",
253 .mmc = 1,
254 .caps = MMC_CAP_4_BIT_DATA,
255 .gpio_wp = -EINVAL,
256 .power_saving = true,
257 .deferred = true,
258 },
259 {
260 .name = "internal",
261 .mmc = 2,
262 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
263 .gpio_cd = -EINVAL,
264 .gpio_wp = -EINVAL,
265 .nonremovable = true,
266 .power_saving = true,
267 },
268 {
269 .name = "wl1271",
270 .mmc = 3,
271 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
272 .gpio_wp = -EINVAL,
273 .gpio_cd = -EINVAL,
274 .nonremovable = true,
275 },
276 {} /* Terminator */
277};
278
279static struct omap_tw4030_pdata omap_twl4030_audio_data = {
280 .voice_connected = true,
281 .custom_routing = true,
282
283 .has_hs = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
284 .has_hf = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
285
286 .has_mainmic = true,
287 .has_submic = true,
288 .has_hsmic = true,
289 .has_linein = OMAP_TWL4030_LEFT | OMAP_TWL4030_RIGHT,
290};
291
292static int zoom_twl_gpio_setup(struct device *dev,
293 unsigned gpio, unsigned ngpio)
294{
295 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
296 mmc[0].gpio_cd = gpio + 0;
297 omap_hsmmc_late_init(mmc);
298
299 /* Audio setup */
300 omap_twl4030_audio_data.jack_detect = gpio + 2;
301 omap_twl4030_audio_init("Zoom2", &omap_twl4030_audio_data);
302
303 return 0;
304}
305
306static struct twl4030_gpio_platform_data zoom_gpio_data = {
307 .setup = zoom_twl_gpio_setup,
308};
309
310static struct twl4030_platform_data zoom_twldata = {
311 /* platform_data for children goes here */
312 .gpio = &zoom_gpio_data,
313 .keypad = &zoom_kp_twl4030_data,
314 .vmmc1 = &zoom_vmmc1,
315 .vmmc2 = &zoom_vmmc2,
316 .vsim = &zoom_vsim,
317};
318
319static int __init omap_i2c_init(void)
320{
321 omap3_pmic_get_config(&zoom_twldata,
322 TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
323 TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
324 TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
325
326 if (machine_is_omap_zoom2())
327 zoom_twldata.audio->codec->ramp_delay_value = 3; /* 161 ms */
328
329 omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata);
330 omap_register_i2c_bus(2, 400, NULL, 0);
331 omap_register_i2c_bus(3, 400, NULL, 0);
332 return 0;
333}
334
335static void enable_board_wakeup_source(void)
336{
337 /* T2 interrupt line (keypad) */
338 omap_mux_init_signal("sys_nirq",
339 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
340}
341
342void __init zoom_peripherals_init(void)
343{
344 int ret;
345
346 omap_zoom_wlan_data.irq = gpio_to_irq(OMAP_ZOOM_WLAN_IRQ_GPIO);
347 ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
348
349 if (ret)
350 pr_err("error setting wl12xx data: %d\n", ret);
351
352 omap_hsmmc_init(mmc);
353 omap_i2c_init();
354 pwm_add_table(zoom_pwm_lookup, ARRAY_SIZE(zoom_pwm_lookup));
355 platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));
356 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
357 usb_musb_init(NULL);
358 enable_board_wakeup_source();
359 omap_serial_init();
360}
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
deleted file mode 100644
index 1a3dd865d8eb..000000000000
--- a/arch/arm/mach-omap2/board-zoom.c
+++ /dev/null
@@ -1,159 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Texas Instruments Inc.
3 * Mikkel Christensen <mlc@ti.com>
4 * Felipe Balbi <balbi@ti.com>
5 *
6 * Modified from mach-omap2/board-ldp.c
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 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/input.h>
17#include <linux/gpio.h>
18#include <linux/i2c/twl.h>
19#include <linux/mtd/nand.h>
20
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23
24#include "common.h"
25
26#include "board-zoom.h"
27
28#include "board-flash.h"
29#include "mux.h"
30#include "sdram-micron-mt46h32m32lf-6.h"
31#include "sdram-hynix-h8mbx00u0mer-0em.h"
32
33#define ZOOM3_EHCI_RESET_GPIO 64
34
35#ifdef CONFIG_OMAP_MUX
36static struct omap_board_mux board_mux[] __initdata = {
37 /* WLAN IRQ - GPIO 162 */
38 OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
39 /* WLAN POWER ENABLE - GPIO 101 */
40 OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
41 /* WLAN SDIO: MMC3 CMD */
42 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
43 /* WLAN SDIO: MMC3 CLK */
44 OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
45 /* WLAN SDIO: MMC3 DAT[0-3] */
46 OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
47 OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
48 OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
49 OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
50 { .reg_offset = OMAP_MUX_TERMINATOR },
51};
52#endif
53
54static struct mtd_partition zoom_nand_partitions[] = {
55 /* All the partition sizes are listed in terms of NAND block size */
56 {
57 .name = "X-Loader-NAND",
58 .offset = 0,
59 .size = 4 * (64 * 2048), /* 512KB, 0x80000 */
60 .mask_flags = MTD_WRITEABLE, /* force read-only */
61 },
62 {
63 .name = "U-Boot-NAND",
64 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
65 .size = 10 * (64 * 2048), /* 1.25MB, 0x140000 */
66 .mask_flags = MTD_WRITEABLE, /* force read-only */
67 },
68 {
69 .name = "Boot Env-NAND",
70 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
71 .size = 2 * (64 * 2048), /* 256KB, 0x40000 */
72 },
73 {
74 .name = "Kernel-NAND",
75 .offset = MTDPART_OFS_APPEND, /* Offset = 0x0200000*/
76 .size = 240 * (64 * 2048), /* 30M, 0x1E00000 */
77 },
78 {
79 .name = "system",
80 .offset = MTDPART_OFS_APPEND, /* Offset = 0x2000000 */
81 .size = 3328 * (64 * 2048), /* 416M, 0x1A000000 */
82 },
83 {
84 .name = "userdata",
85 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1C000000*/
86 .size = 256 * (64 * 2048), /* 32M, 0x2000000 */
87 },
88 {
89 .name = "cache",
90 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1E000000*/
91 .size = 256 * (64 * 2048), /* 32M, 0x2000000 */
92 },
93};
94
95static struct usbhs_phy_data phy_data[] __initdata = {
96 {
97 .port = 2,
98 .reset_gpio = ZOOM3_EHCI_RESET_GPIO,
99 .vcc_gpio = -EINVAL,
100 },
101};
102
103static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
104 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
105};
106
107static void __init omap_zoom_init(void)
108{
109 if (machine_is_omap_zoom2()) {
110 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
111 } else if (machine_is_omap_zoom3()) {
112 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
113 omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT);
114
115 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
116 usbhs_init(&usbhs_bdata);
117 }
118
119 board_nand_init(zoom_nand_partitions,
120 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS,
121 NAND_BUSWIDTH_16, nand_default_timings);
122 zoom_debugboard_init();
123 zoom_peripherals_init();
124
125 if (machine_is_omap_zoom2())
126 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
127 mt46h32m32lf6_sdrc_params);
128 else if (machine_is_omap_zoom3())
129 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
130 h8mbx00u0mer0em_sdrc_params);
131
132 zoom_display_init();
133}
134
135MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
136 .atag_offset = 0x100,
137 .reserve = omap_reserve,
138 .map_io = omap3_map_io,
139 .init_early = omap3430_init_early,
140 .init_irq = omap3_init_irq,
141 .handle_irq = omap3_intc_handle_irq,
142 .init_machine = omap_zoom_init,
143 .init_late = omap3430_init_late,
144 .init_time = omap3_sync32k_timer_init,
145 .restart = omap3xxx_restart,
146MACHINE_END
147
148MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
149 .atag_offset = 0x100,
150 .reserve = omap_reserve,
151 .map_io = omap3_map_io,
152 .init_early = omap3630_init_early,
153 .init_irq = omap3_init_irq,
154 .handle_irq = omap3_intc_handle_irq,
155 .init_machine = omap_zoom_init,
156 .init_late = omap3630_init_late,
157 .init_time = omap3_sync32k_timer_init,
158 .restart = omap3xxx_restart,
159MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom.h b/arch/arm/mach-omap2/board-zoom.h
deleted file mode 100644
index 2e9486940ead..000000000000
--- a/arch/arm/mach-omap2/board-zoom.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * Defines for zoom boards
3 */
4#include <video/omapdss.h>
5
6#define ZOOM_NAND_CS 0
7
8extern int __init zoom_debugboard_init(void);
9extern void __init zoom_peripherals_init(void);
10extern void __init zoom_display_init(void);