aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2014-11-03 20:45:01 -0500
committerTony Lindgren <tony@atomide.com>2014-11-03 20:45:01 -0500
commit8f5951172b6dbda75a9cdf5990650e1cf8b1dd22 (patch)
tree5d699b4e2fc6251f015169b6e584b855ac4fa5f3
parent9995772a6d70196ccf0295e4a1cfbb7e4c4a0ef1 (diff)
ARM: OMAP2+: Drop legacy code for gpmc-smc91x.c
This code was only used by 2430sdp, 3430sdp, and n900 development boards. The 2430sdp is already device tree only, and all the users of the 3430sdp and n900 development boards are already booting in device tree mode, so we can drop the legacy smc91x support. Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c28
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c29
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.c186
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.h42
5 files changed, 0 insertions, 288 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index d9e94122073e..3e824f8fec48 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -284,9 +284,6 @@ obj-y += $(onenand-m) $(onenand-y)
284nand-$(CONFIG_MTD_NAND_OMAP2) := gpmc-nand.o 284nand-$(CONFIG_MTD_NAND_OMAP2) := gpmc-nand.o
285obj-y += $(nand-m) $(nand-y) 285obj-y += $(nand-m) $(nand-y)
286 286
287smc91x-$(CONFIG_SMC91X) := gpmc-smc91x.o
288obj-y += $(smc91x-m) $(smc91x-y)
289
290smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o 287smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o
291obj-y += $(smsc911x-m) $(smsc911x-y) 288obj-y += $(smsc911x-m) $(smsc911x-y)
292ifneq ($(CONFIG_HWSPINLOCK_OMAP),) 289ifneq ($(CONFIG_HWSPINLOCK_OMAP),)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index d21a3048d06b..9857882c2f41 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -38,7 +38,6 @@
38#include <video/omap-panel-data.h> 38#include <video/omap-panel-data.h>
39 39
40#include "gpmc.h" 40#include "gpmc.h"
41#include "gpmc-smc91x.h"
42 41
43#include "soc.h" 42#include "soc.h"
44#include "board-flash.h" 43#include "board-flash.h"
@@ -407,32 +406,6 @@ static int __init omap3430_i2c_init(void)
407 return 0; 406 return 0;
408} 407}
409 408
410#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
411
412static struct omap_smc91x_platform_data board_smc91x_data = {
413 .cs = 3,
414 .flags = GPMC_MUX_ADD_DATA | GPMC_TIMINGS_SMC91C96 |
415 IORESOURCE_IRQ_LOWLEVEL,
416};
417
418static void __init board_smc91x_init(void)
419{
420 if (omap_rev() > OMAP3430_REV_ES1_0)
421 board_smc91x_data.gpio_irq = 6;
422 else
423 board_smc91x_data.gpio_irq = 29;
424
425 gpmc_smc91x_init(&board_smc91x_data);
426}
427
428#else
429
430static inline void board_smc91x_init(void)
431{
432}
433
434#endif
435
436static void enable_board_wakeup_source(void) 409static void enable_board_wakeup_source(void)
437{ 410{
438 /* T2 interrupt line (keypad) */ 411 /* T2 interrupt line (keypad) */
@@ -609,7 +582,6 @@ static void __init omap_3430sdp_init(void)
609 omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL); 582 omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
610 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 583 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
611 usb_musb_init(NULL); 584 usb_musb_init(NULL);
612 board_smc91x_init();
613 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); 585 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
614 sdp3430_display_init(); 586 sdp3430_display_init();
615 enable_board_wakeup_source(); 587 enable_board_wakeup_source();
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index ddfc8df83c6a..30e7d4ce7b8d 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -32,7 +32,6 @@
32 32
33#include "common.h" 33#include "common.h"
34#include <linux/omap-dma.h> 34#include <linux/omap-dma.h>
35#include "gpmc-smc91x.h"
36 35
37#include "board-rx51.h" 36#include "board-rx51.h"
38 37
@@ -1146,33 +1145,6 @@ static struct omap_onenand_platform_data board_onenand_data[] = {
1146}; 1145};
1147#endif 1146#endif
1148 1147
1149#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1150
1151static struct omap_smc91x_platform_data board_smc91x_data = {
1152 .cs = 1,
1153 .gpio_irq = 54,
1154 .gpio_pwrdwn = 86,
1155 .gpio_reset = 164,
1156 .flags = GPMC_TIMINGS_SMC91C96 | IORESOURCE_IRQ_HIGHLEVEL,
1157};
1158
1159static void __init board_smc91x_init(void)
1160{
1161 omap_mux_init_gpio(54, OMAP_PIN_INPUT_PULLDOWN);
1162 omap_mux_init_gpio(86, OMAP_PIN_OUTPUT);
1163 omap_mux_init_gpio(164, OMAP_PIN_OUTPUT);
1164
1165 gpmc_smc91x_init(&board_smc91x_data);
1166}
1167
1168#else
1169
1170static inline void board_smc91x_init(void)
1171{
1172}
1173
1174#endif
1175
1176static struct gpio rx51_wl1251_gpios[] __initdata = { 1148static struct gpio rx51_wl1251_gpios[] __initdata = {
1177 { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" }, 1149 { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" },
1178}; 1150};
@@ -1303,7 +1275,6 @@ void __init rx51_peripherals_init(void)
1303 rx51_i2c_init(); 1275 rx51_i2c_init();
1304 regulator_has_full_constraints(); 1276 regulator_has_full_constraints();
1305 gpmc_onenand_init(board_onenand_data); 1277 gpmc_onenand_init(board_onenand_data);
1306 board_smc91x_init();
1307 rx51_add_gpio_keys(); 1278 rx51_add_gpio_keys();
1308 rx51_init_wl1251(); 1279 rx51_init_wl1251();
1309 rx51_init_tsc2005(); 1280 rx51_init_tsc2005();
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c
deleted file mode 100644
index 61a063595e66..000000000000
--- a/arch/arm/mach-omap2/gpmc-smc91x.c
+++ /dev/null
@@ -1,186 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap2/gpmc-smc91x.c
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Contact: Tony Lindgren
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/platform_device.h>
14#include <linux/gpio.h>
15#include <linux/delay.h>
16#include <linux/interrupt.h>
17#include <linux/io.h>
18#include <linux/smc91x.h>
19
20#include "gpmc.h"
21#include "gpmc-smc91x.h"
22
23#include "soc.h"
24
25static struct omap_smc91x_platform_data *gpmc_cfg;
26
27static struct resource gpmc_smc91x_resources[] = {
28 [0] = {
29 .flags = IORESOURCE_MEM,
30 },
31 [1] = {
32 .flags = IORESOURCE_IRQ,
33 },
34};
35
36static struct smc91x_platdata gpmc_smc91x_info = {
37 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_IO_SHIFT_0,
38 .leda = RPC_LED_100_10,
39 .ledb = RPC_LED_TX_RX,
40};
41
42static struct platform_device gpmc_smc91x_device = {
43 .name = "smc91x",
44 .id = -1,
45 .dev = {
46 .platform_data = &gpmc_smc91x_info,
47 },
48 .num_resources = ARRAY_SIZE(gpmc_smc91x_resources),
49 .resource = gpmc_smc91x_resources,
50};
51
52static struct gpmc_settings smc91x_settings = {
53 .device_width = GPMC_DEVWIDTH_16BIT,
54};
55
56/*
57 * Set the gpmc timings for smc91c96. The timings are taken
58 * from the data sheet available at:
59 * http://www.smsc.com/main/catalog/lan91c96.html
60 * REVISIT: Level shifters can add at least to the access latency.
61 */
62static int smc91c96_gpmc_retime(void)
63{
64 struct gpmc_timings t;
65 struct gpmc_device_timings dev_t;
66 const int t3 = 10; /* Figure 12.2 read and 12.4 write */
67 const int t4_r = 20; /* Figure 12.2 read */
68 const int t4_w = 5; /* Figure 12.4 write */
69 const int t5 = 25; /* Figure 12.2 read */
70 const int t6 = 15; /* Figure 12.2 read */
71 const int t7 = 5; /* Figure 12.4 write */
72 const int t8 = 5; /* Figure 12.4 write */
73 const int t20 = 185; /* Figure 12.2 read and 12.4 write */
74
75 /*
76 * FIXME: Calculate the address and data bus muxed timings.
77 * Note that at least adv_rd_off needs to be changed according
78 * to omap3430 TRM Figure 11-11. Are the sdp boards using the
79 * FPGA in between smc91x and omap as the timings are different
80 * from above?
81 */
82 if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
83 return 0;
84
85 memset(&dev_t, 0, sizeof(dev_t));
86
87 dev_t.t_oeasu = t3 * 1000;
88 dev_t.t_oe = t5 * 1000;
89 dev_t.t_cez_r = t4_r * 1000;
90 dev_t.t_oez = t6 * 1000;
91 dev_t.t_rd_cycle = (t20 - t3) * 1000;
92
93 dev_t.t_weasu = t3 * 1000;
94 dev_t.t_wpl = t7 * 1000;
95 dev_t.t_wph = t8 * 1000;
96 dev_t.t_cez_w = t4_w * 1000;
97 dev_t.t_wr_cycle = (t20 - t3) * 1000;
98
99 gpmc_calc_timings(&t, &smc91x_settings, &dev_t);
100
101 return gpmc_cs_set_timings(gpmc_cfg->cs, &t);
102}
103
104/*
105 * Initialize smc91x device connected to the GPMC. Note that we
106 * assume that pin multiplexing is done in the board-*.c file,
107 * or in the bootloader.
108 */
109void __init gpmc_smc91x_init(struct omap_smc91x_platform_data *board_data)
110{
111 unsigned long cs_mem_base;
112 int ret;
113
114 gpmc_cfg = board_data;
115
116 if (gpmc_cfg->flags & GPMC_TIMINGS_SMC91C96)
117 gpmc_cfg->retime = smc91c96_gpmc_retime;
118
119 if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) {
120 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
121 return;
122 }
123
124 gpmc_smc91x_resources[0].start = cs_mem_base + 0x300;
125 gpmc_smc91x_resources[0].end = cs_mem_base + 0x30f;
126 gpmc_smc91x_resources[1].flags |= (gpmc_cfg->flags & IRQF_TRIGGER_MASK);
127
128 if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
129 smc91x_settings.mux_add_data = GPMC_MUX_AD;
130 if (gpmc_cfg->flags & GPMC_READ_MON)
131 smc91x_settings.wait_on_read = true;
132 if (gpmc_cfg->flags & GPMC_WRITE_MON)
133 smc91x_settings.wait_on_write = true;
134 if (gpmc_cfg->wait_pin)
135 smc91x_settings.wait_pin = gpmc_cfg->wait_pin;
136 ret = gpmc_cs_program_settings(gpmc_cfg->cs, &smc91x_settings);
137 if (ret < 0)
138 goto free1;
139
140 if (gpmc_cfg->retime) {
141 ret = gpmc_cfg->retime();
142 if (ret != 0)
143 goto free1;
144 }
145
146 if (gpio_request_one(gpmc_cfg->gpio_irq, GPIOF_IN, "SMC91X irq") < 0)
147 goto free1;
148
149 gpmc_smc91x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq);
150
151 if (gpmc_cfg->gpio_pwrdwn) {
152 ret = gpio_request_one(gpmc_cfg->gpio_pwrdwn,
153 GPIOF_OUT_INIT_LOW, "SMC91X powerdown");
154 if (ret)
155 goto free2;
156 }
157
158 if (gpmc_cfg->gpio_reset) {
159 ret = gpio_request_one(gpmc_cfg->gpio_reset,
160 GPIOF_OUT_INIT_LOW, "SMC91X reset");
161 if (ret)
162 goto free3;
163
164 gpio_set_value(gpmc_cfg->gpio_reset, 1);
165 msleep(100);
166 gpio_set_value(gpmc_cfg->gpio_reset, 0);
167 }
168
169 if (platform_device_register(&gpmc_smc91x_device) < 0) {
170 printk(KERN_ERR "Unable to register smc91x device\n");
171 gpio_free(gpmc_cfg->gpio_reset);
172 goto free3;
173 }
174
175 return;
176
177free3:
178 if (gpmc_cfg->gpio_pwrdwn)
179 gpio_free(gpmc_cfg->gpio_pwrdwn);
180free2:
181 gpio_free(gpmc_cfg->gpio_irq);
182free1:
183 gpmc_cs_free(gpmc_cfg->cs);
184
185 printk(KERN_ERR "Could not initialize smc91x\n");
186}
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.h b/arch/arm/mach-omap2/gpmc-smc91x.h
deleted file mode 100644
index b64fbee4d567..000000000000
--- a/arch/arm/mach-omap2/gpmc-smc91x.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/gpmc-smc91x.h
3 *
4 * Copyright (C) 2009 Nokia Corporation
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 __ASM_ARCH_OMAP_GPMC_SMC91X_H__
12
13#define GPMC_TIMINGS_SMC91C96 (1 << 4)
14#define GPMC_MUX_ADD_DATA (1 << 5) /* GPMC_CONFIG1_MUXADDDATA */
15#define GPMC_READ_MON (1 << 6) /* GPMC_CONFIG1_WAIT_READ_MON */
16#define GPMC_WRITE_MON (1 << 7) /* GPMC_CONFIG1_WAIT_WRITE_MON */
17
18struct omap_smc91x_platform_data {
19 int cs;
20 int gpio_irq;
21 int gpio_pwrdwn;
22 int gpio_reset;
23 int wait_pin; /* Optional GPMC_CONFIG1_WAITPINSELECT */
24 u32 flags;
25 int (*retime)(void);
26};
27
28#if defined(CONFIG_SMC91X) || \
29 defined(CONFIG_SMC91X_MODULE)
30
31extern void gpmc_smc91x_init(struct omap_smc91x_platform_data *d);
32
33#else
34
35#define board_smc91x_data NULL
36
37static inline void gpmc_smc91x_init(struct omap_smc91x_platform_data *d)
38{
39}
40
41#endif
42#endif