* [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration
@ 2011-08-04 15:06 David Wagner
2011-08-04 15:06 ` [PATCH 2/2] Use existing GPMC macros instead of bit manipulation David Wagner
2011-08-11 15:00 ` [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration David Wagner
0 siblings, 2 replies; 4+ messages in thread
From: David Wagner @ 2011-08-04 15:06 UTC (permalink / raw)
To: Tony Lindgren; +Cc: David Wagner, LKML, linux-omap, Russell King
BASEADDRESS is located in the 6 lower bits of the CONFIG7 register.
See OMAP 35x Technical Reference Manual, p. 1169.
Signed-off-by: David Wagner <david.wagner@free-electrons.com>
---
arch/arm/plat-omap/include/plat/gpmc.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 1527929..154456d 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -72,6 +72,7 @@
#define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2))
#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))
#define GPMC_CONFIG7_CSVALID (1 << 6)
+#define GPMC_CONFIG7_BASEADDRESS(val) (val & 0x3F)
#define GPMC_DEVICETYPE_NOR 0
#define GPMC_DEVICETYPE_NAND 2
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] Use existing GPMC macros instead of bit manipulation
2011-08-04 15:06 [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration David Wagner
@ 2011-08-04 15:06 ` David Wagner
2011-08-04 15:15 ` David Wagner
2011-08-11 15:00 ` [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration David Wagner
1 sibling, 1 reply; 4+ messages in thread
From: David Wagner @ 2011-08-04 15:06 UTC (permalink / raw)
To: Tony Lindgren; +Cc: David Wagner, LKML, linux-omap, Russell King
---
arch/arm/mach-omap2/board-igep0020.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 35be778..f89573a 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -175,12 +175,12 @@ static void __init igep_flash_init(void)
ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
/* Check if NAND/oneNAND is configured */
- if ((ret & 0xC00) == 0x800)
+ if (GPMC_CONFIG1_DEVICETYPE(ret) == GPMC_DEVICETYPE_NAND)
/* NAND found */
pr_err("IGEP: Unsupported NAND found\n");
else {
ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
- if ((ret & 0x3F) == (ONENAND_MAP >> 24))
+ if (GPMC_CONFIG7_BASEADDRESS(ret) == (ONENAND_MAP >> 24))
/* ONENAND found */
onenandcs = cs;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] Use existing GPMC macros instead of bit manipulation
2011-08-04 15:06 ` [PATCH 2/2] Use existing GPMC macros instead of bit manipulation David Wagner
@ 2011-08-04 15:15 ` David Wagner
0 siblings, 0 replies; 4+ messages in thread
From: David Wagner @ 2011-08-04 15:15 UTC (permalink / raw)
To: Tony Lindgren; +Cc: David Wagner, linux-omap, Russell King
Signed-off-by: David Wagner <david.wagner@free-electrons.com>
---
erratum: added the missing s-o-b
arch/arm/mach-omap2/board-igep0020.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 35be778..f89573a 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -175,12 +175,12 @@ static void __init igep_flash_init(void)
ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
/* Check if NAND/oneNAND is configured */
- if ((ret & 0xC00) == 0x800)
+ if (GPMC_CONFIG1_DEVICETYPE(ret) == GPMC_DEVICETYPE_NAND)
/* NAND found */
pr_err("IGEP: Unsupported NAND found\n");
else {
ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
- if ((ret & 0x3F) == (ONENAND_MAP >> 24))
+ if (GPMC_CONFIG7_BASEADDRESS(ret) == (ONENAND_MAP >> 24))
/* ONENAND found */
onenandcs = cs;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration
2011-08-04 15:06 [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration David Wagner
2011-08-04 15:06 ` [PATCH 2/2] Use existing GPMC macros instead of bit manipulation David Wagner
@ 2011-08-11 15:00 ` David Wagner
1 sibling, 0 replies; 4+ messages in thread
From: David Wagner @ 2011-08-11 15:00 UTC (permalink / raw)
To: David Wagner; +Cc: Tony Lindgren, linux-omap, Russell King
Hi,
On 08/04/2011 05:06 PM, David Wagner wrote:
> BASEADDRESS is located in the 6 lower bits of the CONFIG7 register.
> See OMAP 35x Technical Reference Manual, p. 1169.
>
> Signed-off-by: David Wagner <david.wagner@free-electrons.com>
I'm not subscribed to the linux-omap mailing list but I saw no answer on
this patch and the next one in the archive.
The second one (replaces bitwise operations in board-igep0020.c with
GPMC macros) partly depends on the first one, but can be split so that
part of it can be standalone. Should I do so and resubmit or is it ok
like this ?
Regards,
David.
--
David Wagner, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-11 14:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-04 15:06 [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration David Wagner
2011-08-04 15:06 ` [PATCH 2/2] Use existing GPMC macros instead of bit manipulation David Wagner
2011-08-04 15:15 ` David Wagner
2011-08-11 15:00 ` [PATCH 1/2] Macro for getting the BASEADDRESS field in omap's gpmc configuration David Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox