diff mbox

[2/5] ARM: OMAP2+: gpmc: Error out if timings fail in gpmc_probe_generic_child()

Message ID 1413895309-9152-3-git-send-email-rogerq@ti.com
State Accepted
Commit 7604baf365a3bd46007be6fbd2e43ac4a46ce928
Headers show

Commit Message

Roger Quadros Oct. 21, 2014, 12:41 p.m. UTC
gpmc_cs_set_timings() returns non-zero if there was
an error while setting the GPMC timings. e.g. Timing was too
large to be accomodated with current GPMC clock frequency and available
timing range. Fail in this case, else we risk operating a NOR device
with non compliant timings.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 arch/arm/mach-omap2/gpmc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Tony Lindgren Nov. 4, 2014, 1:14 a.m. UTC | #1
* Tony Lindgren <tony@atomide.com> [141103 16:48]:
> --- a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
> +++ b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
> +		gpmc,device-width = <1>;
> +		gpmc,burst-length = <4>;

I've left out the gpmc,burst-length as that produces now
warnings about not being used and does not seem to work if
enabled.

> --- a/arch/arm/boot/dts/omap3-sb-t35.dtsi
> +++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
> +		gpmc,device-width = <1>;
> +		gpmc,burst-length = <4>;

And here too.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Roger Quadros Nov. 4, 2014, 9:03 a.m. UTC | #2
On 11/04/2014 03:14 AM, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [141103 16:48]:
>> --- a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
>> +++ b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
>> +		gpmc,device-width = <1>;
>> +		gpmc,burst-length = <4>;
> 
> I've left out the gpmc,burst-length as that produces now
> warnings about not being used and does not seem to work if
> enabled.

OK. Seems like it must be used together with either 'gpmc,burst-read'
or/and 'gpmc,burst-write'

cheers,
-roger

> 
>> --- a/arch/arm/boot/dts/omap3-sb-t35.dtsi
>> +++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
>> +		gpmc,device-width = <1>;
>> +		gpmc,burst-length = <4>;
> 
> And here too.
> 
> Regards,
> 
> Tony
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren Nov. 4, 2014, 3:51 p.m. UTC | #3
* Roger Quadros <rogerq@ti.com> [141104 01:04]:
> On 11/04/2014 03:14 AM, Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [141103 16:48]:
> >> --- a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
> >> +++ b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi
> >> +		gpmc,device-width = <1>;
> >> +		gpmc,burst-length = <4>;
> > 
> > I've left out the gpmc,burst-length as that produces now
> > warnings about not being used and does not seem to work if
> > enabled.
> 
> OK. Seems like it must be used together with either 'gpmc,burst-read'
> or/and 'gpmc,burst-write'

Yes I did a quick test trying to enable both or one of those,
but that won't for smsc911x.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 45f680f..f5d9dd2 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1562,7 +1562,12 @@  static int gpmc_probe_generic_child(struct platform_device *pdev,
 		goto err;
 
 	gpmc_read_timings_dt(child, &gpmc_t);
-	gpmc_cs_set_timings(cs, &gpmc_t);
+	ret = gpmc_cs_set_timings(cs, &gpmc_t);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to set gpmc timings for: %s\n",
+			child->name);
+		goto err;
+	}
 
 no_timings:
 	if (of_platform_device_create(child, NULL, &pdev->dev))