Skip to contentSkip to conversation

memory: omap-gpmc: Fix debug output for access width

PATCH New Tony Lindgren 2 participants 4 messages May 5, 2017 – May 11, 2017

Subsystems (2)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

PATCH 1/1 memory: omap-gpmc: Fix debug output for access width

The width needs to be configured in bytes with 1 meaning 8-bit access and 2 meaning 16-bit access.

Cc Peter Ujfalusi <[email protected]>
Cc Roger Quadros <[email protected]>
---
 drivers/memory/omap-gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/omap-gpmc.c +1 -1
@@ -513,7 +513,7 @@ static void gpmc_cs_show_timings(int cs, const char *desc)
 	pr_info("gpmc cs%i access configuration:\n", cs);
 	GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1,  4,  4, "time-para-granularity");
 	GPMC_GET_RAW(GPMC_CS_CONFIG1,  8,  9, "mux-add-data");
-	GPMC_GET_RAW_MAX(GPMC_CS_CONFIG1, 12, 13,
+	GPMC_GET_RAW_SHIFT_MAX(GPMC_CS_CONFIG1, 12, 13, 1,
 			 GPMC_CONFIG1_DEVICESIZE_MAX, "device-width");
 	GPMC_GET_RAW(GPMC_CS_CONFIG1, 16, 17, "wait-pin");
 	GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1, 21, 21, "wait-on-write");
Signature · 1 line
2.12.2
#1 lore raw

PATCH 1/1 memory: omap-gpmc: Fix debug output for access width

Hi Tony,

Quoted 2 lines · Tony Lindgren

The width needs to be configured in bytes with 1 meaning 8-bit access and 2 meaning 16-bit access.

As per the TRM, for GPMC_CONFIG1.DEVICESIZE
0 means 8-bit
1 means 16-bit

Quoted 12 lines
Cc Peter Ujfalusi <[email protected]>
Cc Roger Quadros <[email protected]>
---
 drivers/memory/omap-gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/memory/omap-gpmc.c static void gpmc_cs_show_timings(int cs, const char *desc) · line 517

Quoted 6 lines
drivers/memory/omap-gpmc.c +1 -1
@@ -513,7 +513,7 @@ static void gpmc_cs_show_timings(int cs, const char *desc)
 	pr_info("gpmc cs%i access configuration:\n", cs);
 	GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1,  4,  4, "time-para-granularity");
 	GPMC_GET_RAW(GPMC_CS_CONFIG1,  8,  9, "mux-add-data");
-	GPMC_GET_RAW_MAX(GPMC_CS_CONFIG1, 12, 13,
+	GPMC_GET_RAW_SHIFT_MAX(GPMC_CS_CONFIG1, 12, 13, 1,
 			 GPMC_CONFIG1_DEVICESIZE_MAX, "device-width");

setting shift 1 means the value will be multiplied by 2 so this will read 0 for 8-bit and 2 for 16-bit.

Is this what we want?
I'd still prefer the old way of showing RAW values than interpreted ones.

Quoted 3 lines
drivers/memory/omap-gpmc.c +0 -0
 	GPMC_GET_RAW(GPMC_CS_CONFIG1, 16, 17, "wait-pin");
 	GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1, 21, 21, "wait-on-write");
Signature · 2 lines
cheers,
-roger
author maintainer
#2 lore raw

PATCH 1/1 memory: omap-gpmc: Fix debug output for access width

Quoted 32 lines · Roger Quadros

Hi Tony,

Quoted 2 lines · Tony Lindgren

The width needs to be configured in bytes with 1 meaning 8-bit access and 2 meaning 16-bit access.

As per the TRM, for GPMC_CONFIG1.DEVICESIZE
0 means 8-bit
1 means 16-bit

Quoted 12 lines
Cc Peter Ujfalusi <[email protected]>
Cc Roger Quadros <[email protected]>
---
 drivers/memory/omap-gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/memory/omap-gpmc.c static void gpmc_cs_show_timings(int cs, const char *desc) · line 517

Quoted 6 lines
drivers/memory/omap-gpmc.c +1 -1
@@ -513,7 +513,7 @@ static void gpmc_cs_show_timings(int cs, const char *desc)
 	pr_info("gpmc cs%i access configuration:\n", cs);
 	GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1,  4,  4, "time-para-granularity");
 	GPMC_GET_RAW(GPMC_CS_CONFIG1,  8,  9, "mux-add-data");
-	GPMC_GET_RAW_MAX(GPMC_CS_CONFIG1, 12, 13,
+	GPMC_GET_RAW_SHIFT_MAX(GPMC_CS_CONFIG1, 12, 13, 1,
 			 GPMC_CONFIG1_DEVICESIZE_MAX, "device-width");

setting shift 1 means the value will be multiplied by 2 so this will read 0 for 8-bit and 2 for 16-bit.

Quoted 1 line

Is this what we want?

Yeah we already have debug output that is supposed to be usable for configuring a new device based on debug output of the bootloader timings. And the configured parameters use bytes for device-width.

Quoted 1 line

I'd still prefer the old way of showing RAW values than interpreted ones.

We have that too in the debug output as the raw values of all the GPMC_CS_CONFIG registers.

Regards,

Tony

#3 lore raw

PATCH 1/1 memory: omap-gpmc: Fix debug output for access width

In reply to Tony Lindgren
Quoted 6 lines · Tony Lindgren

The width needs to be configured in bytes with 1 meaning 8-bit access and 2 meaning 16-bit access.

Cc Peter Ujfalusi <[email protected]>
Cc Roger Quadros <[email protected]>
Quoted 17 lines
---
 drivers/memory/omap-gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/omap-gpmc.c +1 -1
@@ -513,7 +513,7 @@ static void gpmc_cs_show_timings(int cs, const char *desc)
 	pr_info("gpmc cs%i access configuration:\n", cs);
 	GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1,  4,  4, "time-para-granularity");
 	GPMC_GET_RAW(GPMC_CS_CONFIG1,  8,  9, "mux-add-data");
-	GPMC_GET_RAW_MAX(GPMC_CS_CONFIG1, 12, 13,
+	GPMC_GET_RAW_SHIFT_MAX(GPMC_CS_CONFIG1, 12, 13, 1,
 			 GPMC_CONFIG1_DEVICESIZE_MAX, "device-width");
 	GPMC_GET_RAW(GPMC_CS_CONFIG1, 16, 17, "wait-pin");
 	GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1, 21, 21, "wait-on-write");
Signature · 2 lines
cheers,
-roger