Skip to contentSkip to conversation

ARM: OMAP: Clear GPMC bits when applying new setting

PATCH Superseded Mark Jackson 4 participants 4 messages Feb 6, 2013 – Mar 4, 2013

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP: Clear GPMC bits when applying new setting

When setting the GPMC device type, make sure any previous bits are cleared down, before applying the new setting.

---
 arch/arm/mach-omap2/gpmc.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-omap2/gpmc.c +4 -0
index 1adb2d4..026e786 100644
@@ -613,6 +613,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
 
 	case GPMC_CONFIG_DEV_TYPE:
 		regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+		/* clear 3 target bits */
+		regval &= ~(GPMC_CONFIG1_DEVICETYPE(3) |
+			    GPMC_CONFIG1_MUXADDDATA);
+		/* set the proper value */
 		regval |= GPMC_CONFIG1_DEVICETYPE(wval);
 		if (wval == GPMC_DEVICETYPE_NOR)
 			regval |= GPMC_CONFIG1_MUXADDDATA;
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#2 lore raw
In reply to Mark Jackson
Quoted 13 lines · Mark Jackson

When setting the GPMC device type, make sure any previous bits are cleared down, before applying the new setting.

---
 arch/arm/mach-omap2/gpmc.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-omap2/gpmc.c +0 -0
index 1adb2d4..026e786 100644

arch/arm/mach-omap2/gpmc.c int gpmc_cs_configure(int cs, int cmd, int wval) · line 618

Quoted 6 lines
arch/arm/mach-omap2/gpmc.c +3 -0
@@ -613,6 +613,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
 
 	case GPMC_CONFIG_DEV_TYPE:
 		regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+		/* clear 3 target bits */
+		regval &= ~(GPMC_CONFIG1_DEVICETYPE(3) |
+			    GPMC_CONFIG1_MUXADDDATA);

MUXADDDATA is actually a 2-bit field on current devices (OMAP4+ and AM335x). For OMAP2/3 devices it was only a one bit field. So it may be worth clearing both bits for all devices. For OMAP2 devices bit 8 is reserved but the TRM says to writes a 0, so clearing bit 8 on OMAP2/3 devices should not be a problem. In fact bit 8 should read as 0 on OMAP2/3.

arch/arm/mach-omap2/gpmc.c int gpmc_cs_configure(int cs, int cmd, int wval) · line 622

Quoted 5 lines
arch/arm/mach-omap2/gpmc.c +1 -0
+		/* set the proper value */
 		regval |= GPMC_CONFIG1_DEVICETYPE(wval);
 		if (wval == GPMC_DEVICETYPE_NOR)
 			regval |= GPMC_CONFIG1_MUXADDDATA;

Otherwise ...

Cheers
Jon

maintainer
#3 lore raw
Quoted 36 lines · Jon Hunter
Quoted 13 lines · Mark Jackson

When setting the GPMC device type, make sure any previous bits are cleared down, before applying the new setting.

---
 arch/arm/mach-omap2/gpmc.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-omap2/gpmc.c +0 -0
index 1adb2d4..026e786 100644

arch/arm/mach-omap2/gpmc.c int gpmc_cs_configure(int cs, int cmd, int wval) · line 618

Quoted 6 lines
arch/arm/mach-omap2/gpmc.c +3 -0
@@ -613,6 +613,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
 
 	case GPMC_CONFIG_DEV_TYPE:
 		regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+		/* clear 3 target bits */
+		regval &= ~(GPMC_CONFIG1_DEVICETYPE(3) |
+			    GPMC_CONFIG1_MUXADDDATA);

MUXADDDATA is actually a 2-bit field on current devices (OMAP4+ and AM335x). For OMAP2/3 devices it was only a one bit field. So it may be worth clearing both bits for all devices. For OMAP2 devices bit 8 is reserved but the TRM says to writes a 0, so clearing bit 8 on OMAP2/3 devices should not be a problem. In fact bit 8 should read as 0 on OMAP2/3.

arch/arm/mach-omap2/gpmc.c int gpmc_cs_configure(int cs, int cmd, int wval) · line 622

Quoted 5 lines
arch/arm/mach-omap2/gpmc.c +1 -0
+		/* set the proper value */
 		regval |= GPMC_CONFIG1_DEVICETYPE(wval);
 		if (wval == GPMC_DEVICETYPE_NOR)
 			regval |= GPMC_CONFIG1_MUXADDDATA;

Otherwise ...

Quoted 1 line

Mark, can you please repost this patch with Jon's comment addressed?

Thanks,

Tony