* GPMC: fix device size setup
@ 2012-01-20 16:02 Yegor Yefremov
2012-01-20 16:25 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Yegor Yefremov @ 2012-01-20 16:02 UTC (permalink / raw)
To: linux-omap@vger.kernel.org; +Cc: Tony Lindgren
following statement can only change device size from 8-bit(0) to 16-bit(1),
but not vice versa:
regval |= GPMC_CONFIG1_DEVICESIZE(wval);
so as this field has 1 reserved bit, that could be used in future,
just clear both bits and then OR with the desired value
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
arch/arm/mach-omap2/gpmc.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: b/arch/arm/mach-omap2/gpmc.c
===================================================================
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -528,7 +528,13 @@
case GPMC_CONFIG_DEV_SIZE:
regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+ /* clear 2 target bits */
+ regval &= ~GPMC_CONFIG1_DEVICESIZE(3);
+
+ /* set the proper value */
regval |= GPMC_CONFIG1_DEVICESIZE(wval);
+
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
break;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GPMC: fix device size setup
2012-01-20 16:02 GPMC: fix device size setup Yegor Yefremov
@ 2012-01-20 16:25 ` Tony Lindgren
0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2012-01-20 16:25 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: linux-omap@vger.kernel.org
* Yegor Yefremov <yegor_sub1@visionsystems.de> [120120 07:29]:
> following statement can only change device size from 8-bit(0) to 16-bit(1),
> but not vice versa:
>
> regval |= GPMC_CONFIG1_DEVICESIZE(wval);
>
> so as this field has 1 reserved bit, that could be used in future,
> just clear both bits and then OR with the desired value
Looks like a valid fix to me. Care to repost it with linux-arm-kernel
mailing list also Cc'd so I can apply it into my fixes branch?
Thanks,
Tony
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> arch/arm/mach-omap2/gpmc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> Index: b/arch/arm/mach-omap2/gpmc.c
> ===================================================================
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -528,7 +528,13 @@
>
> case GPMC_CONFIG_DEV_SIZE:
> regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
> +
> + /* clear 2 target bits */
> + regval &= ~GPMC_CONFIG1_DEVICESIZE(3);
> +
> + /* set the proper value */
> regval |= GPMC_CONFIG1_DEVICESIZE(wval);
> +
> gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
> break;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-20 16:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-20 16:02 GPMC: fix device size setup Yegor Yefremov
2012-01-20 16:25 ` Tony Lindgren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.