summaryrefslogtreecommitdiffstats
path: root/patches/linux-3.8.13/0484-ARM-OMAP2-Convert-SMC91x-to-use-gpmc_cs_program_sett.patch
diff options
context:
space:
mode:
authorJan Luebbe <jlu@pengutronix.de>2013-07-20 19:51:52 +0200
committerJan Luebbe <jlu@pengutronix.de>2013-07-20 19:51:52 +0200
commita8106e82041f2d471d5ceeee76c463d38147e8db (patch)
treebed3635f65b1ae482f19358fc14a9aad94b397e6 /patches/linux-3.8.13/0484-ARM-OMAP2-Convert-SMC91x-to-use-gpmc_cs_program_sett.patch
parent918a7a71f5d31f0315efaad88ec6475d407db2a4 (diff)
downloadplatform-pengutronix-beaglebone-a8106e82041f2d471d5ceeee76c463d38147e8db.tar.gz
platform-pengutronix-beaglebone-a8106e82041f2d471d5ceeee76c463d38147e8db.tar.xz
kernel: update to 3.8.14
Thanks to Koen Kooi for maintaining the patch stack. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Diffstat (limited to 'patches/linux-3.8.13/0484-ARM-OMAP2-Convert-SMC91x-to-use-gpmc_cs_program_sett.patch')
-rw-r--r--patches/linux-3.8.13/0484-ARM-OMAP2-Convert-SMC91x-to-use-gpmc_cs_program_sett.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/patches/linux-3.8.13/0484-ARM-OMAP2-Convert-SMC91x-to-use-gpmc_cs_program_sett.patch b/patches/linux-3.8.13/0484-ARM-OMAP2-Convert-SMC91x-to-use-gpmc_cs_program_sett.patch
new file mode 100644
index 0000000..08043f1
--- /dev/null
+++ b/patches/linux-3.8.13/0484-ARM-OMAP2-Convert-SMC91x-to-use-gpmc_cs_program_sett.patch
@@ -0,0 +1,81 @@
+From: Jon Hunter <jon-hunter@ti.com>
+Date: Thu, 21 Feb 2013 13:01:37 -0600
+Subject: [PATCH] ARM: OMAP2+: Convert SMC91x to use
+ gpmc_cs_program_settings()
+
+Convert the OMAP2+ SMC91x code to use the gpmc_cs_program_settings()
+function for configuring the various GPMC options instead of directly
+programming the CONFIG1 register.
+
+Move configuration of the GPMC settings outside retime function and
+this does not need to be done if the timings are changed dynamically
+at runtime.
+
+Signed-off-by: Jon Hunter <jon-hunter@ti.com>
+Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
+---
+ arch/arm/mach-omap2/gpmc-smc91x.c | 30 +++++++++++++++++-------------
+ 1 file changed, 17 insertions(+), 13 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c
+index 4b78338..61a0635 100644
+--- a/arch/arm/mach-omap2/gpmc-smc91x.c
++++ b/arch/arm/mach-omap2/gpmc-smc91x.c
+@@ -49,6 +49,10 @@ static struct platform_device gpmc_smc91x_device = {
+ .resource = gpmc_smc91x_resources,
+ };
+
++static struct gpmc_settings smc91x_settings = {
++ .device_width = GPMC_DEVWIDTH_16BIT,
++};
++
+ /*
+ * Set the gpmc timings for smc91c96. The timings are taken
+ * from the data sheet available at:
+@@ -67,18 +71,6 @@ static int smc91c96_gpmc_retime(void)
+ const int t7 = 5; /* Figure 12.4 write */
+ const int t8 = 5; /* Figure 12.4 write */
+ const int t20 = 185; /* Figure 12.2 read and 12.4 write */
+- u32 l;
+-
+- l = GPMC_CONFIG1_DEVICESIZE_16;
+- if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
+- l |= GPMC_CONFIG1_MUXADDDATA;
+- if (gpmc_cfg->flags & GPMC_READ_MON)
+- l |= GPMC_CONFIG1_WAIT_READ_MON;
+- if (gpmc_cfg->flags & GPMC_WRITE_MON)
+- l |= GPMC_CONFIG1_WAIT_WRITE_MON;
+- if (gpmc_cfg->wait_pin)
+- l |= GPMC_CONFIG1_WAIT_PIN_SEL(gpmc_cfg->wait_pin);
+- gpmc_cs_write_reg(gpmc_cfg->cs, GPMC_CS_CONFIG1, l);
+
+ /*
+ * FIXME: Calculate the address and data bus muxed timings.
+@@ -104,7 +96,7 @@ static int smc91c96_gpmc_retime(void)
+ dev_t.t_cez_w = t4_w * 1000;
+ dev_t.t_wr_cycle = (t20 - t3) * 1000;
+
+- gpmc_calc_timings(&t, NULL, &dev_t);
++ gpmc_calc_timings(&t, &smc91x_settings, &dev_t);
+
+ return gpmc_cs_set_timings(gpmc_cfg->cs, &t);
+ }
+@@ -133,6 +125,18 @@ void __init gpmc_smc91x_init(struct omap_smc91x_platform_data *board_data)
+ gpmc_smc91x_resources[0].end = cs_mem_base + 0x30f;
+ gpmc_smc91x_resources[1].flags |= (gpmc_cfg->flags & IRQF_TRIGGER_MASK);
+
++ if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
++ smc91x_settings.mux_add_data = GPMC_MUX_AD;
++ if (gpmc_cfg->flags & GPMC_READ_MON)
++ smc91x_settings.wait_on_read = true;
++ if (gpmc_cfg->flags & GPMC_WRITE_MON)
++ smc91x_settings.wait_on_write = true;
++ if (gpmc_cfg->wait_pin)
++ smc91x_settings.wait_pin = gpmc_cfg->wait_pin;
++ ret = gpmc_cs_program_settings(gpmc_cfg->cs, &smc91x_settings);
++ if (ret < 0)
++ goto free1;
++
+ if (gpmc_cfg->retime) {
+ ret = gpmc_cfg->retime();
+ if (ret != 0)