aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/gpmc-nand.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-04 15:31:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-04 15:31:18 -0400
commit6fa52ed33bea997374a88dbacbba5bf8c7ac4fef (patch)
treea0904b78d66c9b99d6acf944cf58bcaa0cffc511 /arch/arm/mach-omap2/gpmc-nand.c
parent1db772216f48978d5146b858586f6178433aad38 (diff)
parentbc8fd900c4d460b4e4bf785bb48bfced0ac9941b (diff)
Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver changes from Olof Johansson: "This is a rather large set of patches for device drivers that for one reason or another the subsystem maintainer preferred to get merged through the arm-soc tree. There are both new drivers as well as existing drivers that are getting converted from platform-specific code into standalone drivers using the appropriate subsystem specific interfaces. In particular, we can now have pinctrl, clk, clksource and irqchip drivers in one file per driver, without the need to call into platform specific interface, or to get called from platform specific code, as long as all information about the hardware is provided through a device tree. Most of the drivers we touch this time are for clocksource. Since now most of them are part of drivers/clocksource, I expect that we won't have to touch these again from arm-soc and can let the clocksource maintainers take care of these in the future. Another larger part of this series is specific to the exynos platform, which is seeing some significant effort in upstreaming and modernization of its device drivers this time around, which unfortunately is also the cause for the churn and a lot of the merge conflicts. There is one new subsystem that gets merged as part of this series: the reset controller interface, which is a very simple interface for taking devices on the SoC out of reset or back into reset. Patches to use this interface on i.MX follow later in this merge window, and we are going to have other platforms (at least tegra and sirf) get converted in 3.11. This will let us get rid of platform specific callbacks in a number of platform independent device drivers." * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (256 commits) irqchip: s3c24xx: add missing __init annotations ARM: dts: Disable the RTC by default on exynos5 clk: exynos5250: Fix parent clock for sclk_mmc{0,1,2,3} ARM: exynos: restore mach/regs-clock.h for exynos5 clocksource: exynos_mct: fix build error on non-DT pinctrl: vt8500: wmt: Fix checking return value of pinctrl_register() irqchip: vt8500: Convert arch-vt8500 to new irqchip infrastructure reset: NULL deref on allocation failure reset: Add reset controller API dt: describe base reset signal binding ARM: EXYNOS: Add arm-pmu DT binding for exynos421x ARM: EXYNOS: Add arm-pmu DT binding for exynos5250 ARM: EXYNOS: Enable PMUs for exynos4 irqchip: exynos-combiner: Correct combined IRQs for exynos4 irqchip: exynos-combiner: Add set_irq_affinity function for combiner_irq ARM: EXYNOS: fix compilation error introduced due to common clock migration clk: exynos5250: Fix divider values for sclk_mmc{0,1,2,3} clk: exynos4: export clocks required for fimc-is clk: samsung: Fix compilation error clk: tegra: fix enum tegra114_clk to match binding ...
Diffstat (limited to 'arch/arm/mach-omap2/gpmc-nand.c')
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index afc1e8c32d6c..d9c27195caf0 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -74,14 +74,6 @@ static int omap2_nand_gpmc_retime(
74 t.cs_wr_off = gpmc_t->cs_wr_off; 74 t.cs_wr_off = gpmc_t->cs_wr_off;
75 t.wr_cycle = gpmc_t->wr_cycle; 75 t.wr_cycle = gpmc_t->wr_cycle;
76 76
77 /* Configure GPMC */
78 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
79 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
80 else
81 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
82 gpmc_cs_configure(gpmc_nand_data->cs,
83 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
84 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
85 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); 77 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
86 if (err) 78 if (err)
87 return err; 79 return err;
@@ -115,14 +107,18 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
115 struct gpmc_timings *gpmc_t) 107 struct gpmc_timings *gpmc_t)
116{ 108{
117 int err = 0; 109 int err = 0;
110 struct gpmc_settings s;
118 struct device *dev = &gpmc_nand_device.dev; 111 struct device *dev = &gpmc_nand_device.dev;
119 112
113 memset(&s, 0, sizeof(struct gpmc_settings));
114
120 gpmc_nand_device.dev.platform_data = gpmc_nand_data; 115 gpmc_nand_device.dev.platform_data = gpmc_nand_data;
121 116
122 err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, 117 err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE,
123 (unsigned long *)&gpmc_nand_resource[0].start); 118 (unsigned long *)&gpmc_nand_resource[0].start);
124 if (err < 0) { 119 if (err < 0) {
125 dev_err(dev, "Cannot request GPMC CS\n"); 120 dev_err(dev, "Cannot request GPMC CS %d, error %d\n",
121 gpmc_nand_data->cs, err);
126 return err; 122 return err;
127 } 123 }
128 124
@@ -140,11 +136,31 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
140 dev_err(dev, "Unable to set gpmc timings: %d\n", err); 136 dev_err(dev, "Unable to set gpmc timings: %d\n", err);
141 return err; 137 return err;
142 } 138 }
143 }
144 139
145 /* Enable RD PIN Monitoring Reg */ 140 if (gpmc_nand_data->of_node) {
146 if (gpmc_nand_data->dev_ready) { 141 gpmc_read_settings_dt(gpmc_nand_data->of_node, &s);
147 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1); 142 } else {
143 s.device_nand = true;
144
145 /* Enable RD PIN Monitoring Reg */
146 if (gpmc_nand_data->dev_ready) {
147 s.wait_on_read = true;
148 s.wait_on_write = true;
149 }
150 }
151
152 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
153 s.device_width = GPMC_DEVWIDTH_16BIT;
154 else
155 s.device_width = GPMC_DEVWIDTH_8BIT;
156
157 err = gpmc_cs_program_settings(gpmc_nand_data->cs, &s);
158 if (err < 0)
159 goto out_free_cs;
160
161 err = gpmc_configure(GPMC_CONFIG_WP, 0);
162 if (err < 0)
163 goto out_free_cs;
148 } 164 }
149 165
150 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs); 166 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);