Skip to content

Commit

Permalink
ARM: OMAP2+: GPMC: fix device size setup
Browse files Browse the repository at this point in the history
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>
Cc: stable@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Yegor Yefremov authored and Tony Lindgren committed Jan 26, 2012
1 parent dbc3982 commit 8ef5d84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm/mach-omap2/gpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,13 @@ int gpmc_cs_configure(int cs, int cmd, int wval)

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;

Expand Down

0 comments on commit 8ef5d84

Please sign in to comment.