All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-04-04 18:36 ` Javier Martinez Canillas
  0 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-04 18:36 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Russell King, Enric Balletbò i Serra, linux-omap,
	linaro-kernel, linux-arm-kernel, linaro-dev, patches,
	Javier Martinez Canillas

board_onenand_init() and board_nand_init() initialization functions are
used to initialize OneNAND and NAND memories respectively. But only
board_nand_init() was visible to be used from board code. This patch makes
possible to initialize a OneNAND flash memory within platform code.

Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
---
 arch/arm/mach-omap2/board-flash.c |    4 ++--
 arch/arm/mach-omap2/board-flash.h |   11 +++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 0349fd2..70a81f9 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
 	.dma_channel	= -1,   /* disable DMA in OMAP OneNAND driver */
 };
 
-static void
+void
 __init board_onenand_init(struct mtd_partition *onenand_parts,
 				u8 nr_parts, u8 cs)
 {
@@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
 	gpmc_onenand_init(&board_onenand_data);
 }
 #else
-static void
+void
 __init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
 {
 }
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
index d25503a..c44b70d 100644
--- a/arch/arm/mach-omap2/board-flash.h
+++ b/arch/arm/mach-omap2/board-flash.h
@@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts,
 {
 }
 #endif
+
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
+		defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+extern void board_onenand_init(struct mtd_partition *nand_parts,
+					u8 nr_parts, u8 cs);
+#else
+static inline void board_onenand_init(struct mtd_partition *nand_parts,
+					u8 nr_parts, u8 cs)
+{
+}
+#endif
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-04-04 18:36 ` Javier Martinez Canillas
  0 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-04 18:36 UTC (permalink / raw)
  To: linux-arm-kernel

board_onenand_init() and board_nand_init() initialization functions are
used to initialize OneNAND and NAND memories respectively. But only
board_nand_init() was visible to be used from board code. This patch makes
possible to initialize a OneNAND flash memory within platform code.

Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
---
 arch/arm/mach-omap2/board-flash.c |    4 ++--
 arch/arm/mach-omap2/board-flash.h |   11 +++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 0349fd2..70a81f9 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
 	.dma_channel	= -1,   /* disable DMA in OMAP OneNAND driver */
 };
 
-static void
+void
 __init board_onenand_init(struct mtd_partition *onenand_parts,
 				u8 nr_parts, u8 cs)
 {
@@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
 	gpmc_onenand_init(&board_onenand_data);
 }
 #else
-static void
+void
 __init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
 {
 }
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
index d25503a..c44b70d 100644
--- a/arch/arm/mach-omap2/board-flash.h
+++ b/arch/arm/mach-omap2/board-flash.h
@@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts,
 {
 }
 #endif
+
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
+		defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+extern void board_onenand_init(struct mtd_partition *nand_parts,
+					u8 nr_parts, u8 cs);
+#else
+static inline void board_onenand_init(struct mtd_partition *nand_parts,
+					u8 nr_parts, u8 cs)
+{
+}
+#endif
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
  2012-04-04 18:36 ` Javier Martinez Canillas
@ 2012-04-04 18:36   ` Javier Martinez Canillas
  -1 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-04 18:36 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Russell King, Enric Balletbò i Serra, linux-omap,
	linaro-kernel, linux-arm-kernel, linaro-dev, patches,
	Javier Martinez Canillas

IGEP-based boards can have two different flash memories, a OneNAND or
a NAND device. The boot configuration pins (sys_boot) are used to
specify which memory is available.

Also, this patch removes unnecesary code for registering the OneNAND.

Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
---
 arch/arm/mach-omap2/board-igep0020.c |   75 ++++++++++++++--------------------
 1 files changed, 31 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 930c0d3..4af615a 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -24,6 +24,8 @@
 #include <linux/i2c/twl.h>
 #include <linux/mmc/host.h>
 
+#include <linux/mtd/nand.h>
+
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -39,6 +41,8 @@
 #include "hsmmc.h"
 #include "sdram-numonyx-m65kxxxxam.h"
 #include "common-board-devices.h"
+#include "board-flash.h"
+#include "control.h"
 
 #define IGEP2_SMSC911X_CS       5
 #define IGEP2_SMSC911X_GPIO     176
@@ -60,6 +64,10 @@
 #define IGEP3_GPIO_LED1_RED	16
 #define IGEP3_GPIO_USBH_NRESET  183
 
+#define IGEP_SYSBOOT_MASK           0x1f
+#define IGEP_SYSBOOT_NAND           0x0f
+#define IGEP_SYSBOOT_ONENAND        0x10
+
 /*
  * IGEP2 Hardware Revision Table
  *
@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
 	gpio_free(IGEP2_GPIO_LED1_RED);
 }
 
-#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
-	defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+#if defined(CONFIG_MTD_ONENAND_OMAP2) ||		\
+	defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) ||	\
+	defined(CONFIG_MTD_NAND_OMAP2) ||		\
+	defined(CONFIG_MTD_NAND_OMAP2_MODULE)
 
 #define ONENAND_MAP             0x20000000
 
@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
  * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
  */
 
-static struct mtd_partition igep_onenand_partitions[] = {
+static struct mtd_partition igep_flash_partitions[] = {
 	{
 		.name           = "X-Loader",
 		.offset         = 0,
@@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = {
 	},
 };
 
-static struct omap_onenand_platform_data igep_onenand_data = {
-	.parts = igep_onenand_partitions,
-	.nr_parts = ARRAY_SIZE(igep_onenand_partitions),
-	.dma_channel	= -1,	/* disable DMA in OMAP OneNAND driver */
-};
-
-static struct platform_device igep_onenand_device = {
-	.name		= "omap2-onenand",
-	.id		= -1,
-	.dev = {
-		.platform_data = &igep_onenand_data,
-	},
-};
+static inline u32 igep_get_sysboot_value(void)
+{
+	return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
+}
 
 static void __init igep_flash_init(void)
 {
-	u8 cs = 0;
-	u8 onenandcs = GPMC_CS_NUM + 1;
-
-	for (cs = 0; cs < GPMC_CS_NUM; cs++) {
-		u32 ret;
-		ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-
-		/* Check if NAND/oneNAND is configured */
-		if ((ret & 0xC00) == 0x800)
-			/* 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))
-				/* ONENAND found */
-				onenandcs = cs;
-		}
-	}
-
-	if (onenandcs > GPMC_CS_NUM) {
-		pr_err("IGEP: Unable to find configuration in GPMC\n");
-		return;
-	}
-
-	igep_onenand_data.cs = onenandcs;
-
-	if (platform_device_register(&igep_onenand_device) < 0)
-		pr_err("IGEP: Unable to register OneNAND device\n");
+	u32 mux;
+	mux = igep_get_sysboot_value();
+
+	if (mux == IGEP_SYSBOOT_NAND) {
+		pr_info("IGEP: initializing NAND memory device\n");
+		board_nand_init(igep_flash_partitions,
+				ARRAY_SIZE(igep_flash_partitions),
+				0, NAND_BUSWIDTH_16);
+	} else if (mux == IGEP_SYSBOOT_ONENAND) {
+		pr_info("IGEP: initializing OneNAND memory device\n");
+		board_onenand_init(igep_flash_partitions,
+				   ARRAY_SIZE(igep_flash_partitions), 0);
+	} else
+		pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
 }
 
 #else
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
@ 2012-04-04 18:36   ` Javier Martinez Canillas
  0 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-04 18:36 UTC (permalink / raw)
  To: linux-arm-kernel

IGEP-based boards can have two different flash memories, a OneNAND or
a NAND device. The boot configuration pins (sys_boot) are used to
specify which memory is available.

Also, this patch removes unnecesary code for registering the OneNAND.

Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
---
 arch/arm/mach-omap2/board-igep0020.c |   75 ++++++++++++++--------------------
 1 files changed, 31 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 930c0d3..4af615a 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -24,6 +24,8 @@
 #include <linux/i2c/twl.h>
 #include <linux/mmc/host.h>
 
+#include <linux/mtd/nand.h>
+
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -39,6 +41,8 @@
 #include "hsmmc.h"
 #include "sdram-numonyx-m65kxxxxam.h"
 #include "common-board-devices.h"
+#include "board-flash.h"
+#include "control.h"
 
 #define IGEP2_SMSC911X_CS       5
 #define IGEP2_SMSC911X_GPIO     176
@@ -60,6 +64,10 @@
 #define IGEP3_GPIO_LED1_RED	16
 #define IGEP3_GPIO_USBH_NRESET  183
 
+#define IGEP_SYSBOOT_MASK           0x1f
+#define IGEP_SYSBOOT_NAND           0x0f
+#define IGEP_SYSBOOT_ONENAND        0x10
+
 /*
  * IGEP2 Hardware Revision Table
  *
@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
 	gpio_free(IGEP2_GPIO_LED1_RED);
 }
 
-#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
-	defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+#if defined(CONFIG_MTD_ONENAND_OMAP2) ||		\
+	defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) ||	\
+	defined(CONFIG_MTD_NAND_OMAP2) ||		\
+	defined(CONFIG_MTD_NAND_OMAP2_MODULE)
 
 #define ONENAND_MAP             0x20000000
 
@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
  * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
  */
 
-static struct mtd_partition igep_onenand_partitions[] = {
+static struct mtd_partition igep_flash_partitions[] = {
 	{
 		.name           = "X-Loader",
 		.offset         = 0,
@@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = {
 	},
 };
 
-static struct omap_onenand_platform_data igep_onenand_data = {
-	.parts = igep_onenand_partitions,
-	.nr_parts = ARRAY_SIZE(igep_onenand_partitions),
-	.dma_channel	= -1,	/* disable DMA in OMAP OneNAND driver */
-};
-
-static struct platform_device igep_onenand_device = {
-	.name		= "omap2-onenand",
-	.id		= -1,
-	.dev = {
-		.platform_data = &igep_onenand_data,
-	},
-};
+static inline u32 igep_get_sysboot_value(void)
+{
+	return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
+}
 
 static void __init igep_flash_init(void)
 {
-	u8 cs = 0;
-	u8 onenandcs = GPMC_CS_NUM + 1;
-
-	for (cs = 0; cs < GPMC_CS_NUM; cs++) {
-		u32 ret;
-		ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-
-		/* Check if NAND/oneNAND is configured */
-		if ((ret & 0xC00) == 0x800)
-			/* 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))
-				/* ONENAND found */
-				onenandcs = cs;
-		}
-	}
-
-	if (onenandcs > GPMC_CS_NUM) {
-		pr_err("IGEP: Unable to find configuration in GPMC\n");
-		return;
-	}
-
-	igep_onenand_data.cs = onenandcs;
-
-	if (platform_device_register(&igep_onenand_device) < 0)
-		pr_err("IGEP: Unable to register OneNAND device\n");
+	u32 mux;
+	mux = igep_get_sysboot_value();
+
+	if (mux == IGEP_SYSBOOT_NAND) {
+		pr_info("IGEP: initializing NAND memory device\n");
+		board_nand_init(igep_flash_partitions,
+				ARRAY_SIZE(igep_flash_partitions),
+				0, NAND_BUSWIDTH_16);
+	} else if (mux == IGEP_SYSBOOT_ONENAND) {
+		pr_info("IGEP: initializing OneNAND memory device\n");
+		board_onenand_init(igep_flash_partitions,
+				   ARRAY_SIZE(igep_flash_partitions), 0);
+	} else
+		pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
 }
 
 #else
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-04-04 18:36 ` Javier Martinez Canillas
@ 2012-04-25  7:59   ` Enric Balletbò i Serra
  -1 siblings, 0 replies; 24+ messages in thread
From: Enric Balletbò i Serra @ 2012-04-25  7:59 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Tony Lindgren, Russell King, linux-omap, linaro-kernel,
	linux-arm-kernel, linaro-dev, patches

2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
> board_onenand_init() and board_nand_init() initialization functions are
> used to initialize OneNAND and NAND memories respectively. But only
> board_nand_init() was visible to be used from board code. This patch makes
> possible to initialize a OneNAND flash memory within platform code.
>
> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
> ---
>  arch/arm/mach-omap2/board-flash.c |    4 ++--
>  arch/arm/mach-omap2/board-flash.h |   11 +++++++++++
>  2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
> index 0349fd2..70a81f9 100644
> --- a/arch/arm/mach-omap2/board-flash.c
> +++ b/arch/arm/mach-omap2/board-flash.c
> @@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
>        .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
>  };
>
> -static void
> +void
>  __init board_onenand_init(struct mtd_partition *onenand_parts,
>                                u8 nr_parts, u8 cs)
>  {
> @@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
>        gpmc_onenand_init(&board_onenand_data);
>  }
>  #else
> -static void
> +void
>  __init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
>  {
>  }
> diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
> index d25503a..c44b70d 100644
> --- a/arch/arm/mach-omap2/board-flash.h
> +++ b/arch/arm/mach-omap2/board-flash.h
> @@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts,
>  {
>  }
>  #endif
> +
> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
> +               defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
> +extern void board_onenand_init(struct mtd_partition *nand_parts,
> +                                       u8 nr_parts, u8 cs);
> +#else
> +static inline void board_onenand_init(struct mtd_partition *nand_parts,
> +                                       u8 nr_parts, u8 cs)
> +{
> +}
> +#endif
> --
> 1.7.7.6
>

Seems good to me.

Tony, as this is a fix ,may be included ?

Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>

Cheers,
    Enric
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-04-25  7:59   ` Enric Balletbò i Serra
  0 siblings, 0 replies; 24+ messages in thread
From: Enric Balletbò i Serra @ 2012-04-25  7:59 UTC (permalink / raw)
  To: linux-arm-kernel

2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
> board_onenand_init() and board_nand_init() initialization functions are
> used to initialize OneNAND and NAND memories respectively. But only
> board_nand_init() was visible to be used from board code. This patch makes
> possible to initialize a OneNAND flash memory within platform code.
>
> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
> ---
> ?arch/arm/mach-omap2/board-flash.c | ? ?4 ++--
> ?arch/arm/mach-omap2/board-flash.h | ? 11 +++++++++++
> ?2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
> index 0349fd2..70a81f9 100644
> --- a/arch/arm/mach-omap2/board-flash.c
> +++ b/arch/arm/mach-omap2/board-flash.c
> @@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
> ? ? ? ?.dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */
> ?};
>
> -static void
> +void
> ?__init board_onenand_init(struct mtd_partition *onenand_parts,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?u8 nr_parts, u8 cs)
> ?{
> @@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
> ? ? ? ?gpmc_onenand_init(&board_onenand_data);
> ?}
> ?#else
> -static void
> +void
> ?__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
> ?{
> ?}
> diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
> index d25503a..c44b70d 100644
> --- a/arch/arm/mach-omap2/board-flash.h
> +++ b/arch/arm/mach-omap2/board-flash.h
> @@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts,
> ?{
> ?}
> ?#endif
> +
> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
> + ? ? ? ? ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
> +extern void board_onenand_init(struct mtd_partition *nand_parts,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs);
> +#else
> +static inline void board_onenand_init(struct mtd_partition *nand_parts,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs)
> +{
> +}
> +#endif
> --
> 1.7.7.6
>

Seems good to me.

Tony, as this is a fix ,may be included ?

Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>

Cheers,
    Enric

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
  2012-04-04 18:36   ` Javier Martinez Canillas
@ 2012-04-25  8:00     ` Enric Balletbò i Serra
  -1 siblings, 0 replies; 24+ messages in thread
From: Enric Balletbò i Serra @ 2012-04-25  8:00 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Tony Lindgren, Russell King, linux-omap, linaro-kernel,
	linux-arm-kernel, linaro-dev, patches

2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
> IGEP-based boards can have two different flash memories, a OneNAND or
> a NAND device. The boot configuration pins (sys_boot) are used to
> specify which memory is available.
>
> Also, this patch removes unnecesary code for registering the OneNAND.
>
> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
> ---
>  arch/arm/mach-omap2/board-igep0020.c |   75 ++++++++++++++--------------------
>  1 files changed, 31 insertions(+), 44 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 930c0d3..4af615a 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -24,6 +24,8 @@
>  #include <linux/i2c/twl.h>
>  #include <linux/mmc/host.h>
>
> +#include <linux/mtd/nand.h>
> +
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
>
> @@ -39,6 +41,8 @@
>  #include "hsmmc.h"
>  #include "sdram-numonyx-m65kxxxxam.h"
>  #include "common-board-devices.h"
> +#include "board-flash.h"
> +#include "control.h"
>
>  #define IGEP2_SMSC911X_CS       5
>  #define IGEP2_SMSC911X_GPIO     176
> @@ -60,6 +64,10 @@
>  #define IGEP3_GPIO_LED1_RED    16
>  #define IGEP3_GPIO_USBH_NRESET  183
>
> +#define IGEP_SYSBOOT_MASK           0x1f
> +#define IGEP_SYSBOOT_NAND           0x0f
> +#define IGEP_SYSBOOT_ONENAND        0x10
> +
>  /*
>  * IGEP2 Hardware Revision Table
>  *
> @@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
>        gpio_free(IGEP2_GPIO_LED1_RED);
>  }
>
> -#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
> -       defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
> +#if defined(CONFIG_MTD_ONENAND_OMAP2) ||               \
> +       defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) ||     \
> +       defined(CONFIG_MTD_NAND_OMAP2) ||               \
> +       defined(CONFIG_MTD_NAND_OMAP2_MODULE)
>
>  #define ONENAND_MAP             0x20000000
>
> @@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
>  * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
>  */
>
> -static struct mtd_partition igep_onenand_partitions[] = {
> +static struct mtd_partition igep_flash_partitions[] = {
>        {
>                .name           = "X-Loader",
>                .offset         = 0,
> @@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = {
>        },
>  };
>
> -static struct omap_onenand_platform_data igep_onenand_data = {
> -       .parts = igep_onenand_partitions,
> -       .nr_parts = ARRAY_SIZE(igep_onenand_partitions),
> -       .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
> -};
> -
> -static struct platform_device igep_onenand_device = {
> -       .name           = "omap2-onenand",
> -       .id             = -1,
> -       .dev = {
> -               .platform_data = &igep_onenand_data,
> -       },
> -};
> +static inline u32 igep_get_sysboot_value(void)
> +{
> +       return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
> +}
>
>  static void __init igep_flash_init(void)
>  {
> -       u8 cs = 0;
> -       u8 onenandcs = GPMC_CS_NUM + 1;
> -
> -       for (cs = 0; cs < GPMC_CS_NUM; cs++) {
> -               u32 ret;
> -               ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
> -
> -               /* Check if NAND/oneNAND is configured */
> -               if ((ret & 0xC00) == 0x800)
> -                       /* 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))
> -                               /* ONENAND found */
> -                               onenandcs = cs;
> -               }
> -       }
> -
> -       if (onenandcs > GPMC_CS_NUM) {
> -               pr_err("IGEP: Unable to find configuration in GPMC\n");
> -               return;
> -       }
> -
> -       igep_onenand_data.cs = onenandcs;
> -
> -       if (platform_device_register(&igep_onenand_device) < 0)
> -               pr_err("IGEP: Unable to register OneNAND device\n");
> +       u32 mux;
> +       mux = igep_get_sysboot_value();
> +
> +       if (mux == IGEP_SYSBOOT_NAND) {
> +               pr_info("IGEP: initializing NAND memory device\n");
> +               board_nand_init(igep_flash_partitions,
> +                               ARRAY_SIZE(igep_flash_partitions),
> +                               0, NAND_BUSWIDTH_16);
> +       } else if (mux == IGEP_SYSBOOT_ONENAND) {
> +               pr_info("IGEP: initializing OneNAND memory device\n");
> +               board_onenand_init(igep_flash_partitions,
> +                                  ARRAY_SIZE(igep_flash_partitions), 0);
> +       } else
> +               pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
>  }
>
>  #else
> --
> 1.7.7.6
>

Seems good to me.

Tony, as this is a fix ,may be included ?

Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>

Cheers,
    Enric
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
@ 2012-04-25  8:00     ` Enric Balletbò i Serra
  0 siblings, 0 replies; 24+ messages in thread
From: Enric Balletbò i Serra @ 2012-04-25  8:00 UTC (permalink / raw)
  To: linux-arm-kernel

2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
> IGEP-based boards can have two different flash memories, a OneNAND or
> a NAND device. The boot configuration pins (sys_boot) are used to
> specify which memory is available.
>
> Also, this patch removes unnecesary code for registering the OneNAND.
>
> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
> ---
> ?arch/arm/mach-omap2/board-igep0020.c | ? 75 ++++++++++++++--------------------
> ?1 files changed, 31 insertions(+), 44 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 930c0d3..4af615a 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -24,6 +24,8 @@
> ?#include <linux/i2c/twl.h>
> ?#include <linux/mmc/host.h>
>
> +#include <linux/mtd/nand.h>
> +
> ?#include <asm/mach-types.h>
> ?#include <asm/mach/arch.h>
>
> @@ -39,6 +41,8 @@
> ?#include "hsmmc.h"
> ?#include "sdram-numonyx-m65kxxxxam.h"
> ?#include "common-board-devices.h"
> +#include "board-flash.h"
> +#include "control.h"
>
> ?#define IGEP2_SMSC911X_CS ? ? ? 5
> ?#define IGEP2_SMSC911X_GPIO ? ? 176
> @@ -60,6 +64,10 @@
> ?#define IGEP3_GPIO_LED1_RED ? ?16
> ?#define IGEP3_GPIO_USBH_NRESET ?183
>
> +#define IGEP_SYSBOOT_MASK ? ? ? ? ? 0x1f
> +#define IGEP_SYSBOOT_NAND ? ? ? ? ? 0x0f
> +#define IGEP_SYSBOOT_ONENAND ? ? ? ?0x10
> +
> ?/*
> ?* IGEP2 Hardware Revision Table
> ?*
> @@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
> ? ? ? ?gpio_free(IGEP2_GPIO_LED1_RED);
> ?}
>
> -#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
> - ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || ? ? ? ? ? ? ? \
> + ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || ? ? \
> + ? ? ? defined(CONFIG_MTD_NAND_OMAP2) || ? ? ? ? ? ? ? \
> + ? ? ? defined(CONFIG_MTD_NAND_OMAP2_MODULE)
>
> ?#define ONENAND_MAP ? ? ? ? ? ? 0x20000000
>
> @@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
> ?* So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
> ?*/
>
> -static struct mtd_partition igep_onenand_partitions[] = {
> +static struct mtd_partition igep_flash_partitions[] = {
> ? ? ? ?{
> ? ? ? ? ? ? ? ?.name ? ? ? ? ? = "X-Loader",
> ? ? ? ? ? ? ? ?.offset ? ? ? ? = 0,
> @@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = {
> ? ? ? ?},
> ?};
>
> -static struct omap_onenand_platform_data igep_onenand_data = {
> - ? ? ? .parts = igep_onenand_partitions,
> - ? ? ? .nr_parts = ARRAY_SIZE(igep_onenand_partitions),
> - ? ? ? .dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */
> -};
> -
> -static struct platform_device igep_onenand_device = {
> - ? ? ? .name ? ? ? ? ? = "omap2-onenand",
> - ? ? ? .id ? ? ? ? ? ? = -1,
> - ? ? ? .dev = {
> - ? ? ? ? ? ? ? .platform_data = &igep_onenand_data,
> - ? ? ? },
> -};
> +static inline u32 igep_get_sysboot_value(void)
> +{
> + ? ? ? return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
> +}
>
> ?static void __init igep_flash_init(void)
> ?{
> - ? ? ? u8 cs = 0;
> - ? ? ? u8 onenandcs = GPMC_CS_NUM + 1;
> -
> - ? ? ? for (cs = 0; cs < GPMC_CS_NUM; cs++) {
> - ? ? ? ? ? ? ? u32 ret;
> - ? ? ? ? ? ? ? ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
> -
> - ? ? ? ? ? ? ? /* Check if NAND/oneNAND is configured */
> - ? ? ? ? ? ? ? if ((ret & 0xC00) == 0x800)
> - ? ? ? ? ? ? ? ? ? ? ? /* 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))
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* ONENAND found */
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? onenandcs = cs;
> - ? ? ? ? ? ? ? }
> - ? ? ? }
> -
> - ? ? ? if (onenandcs > GPMC_CS_NUM) {
> - ? ? ? ? ? ? ? pr_err("IGEP: Unable to find configuration in GPMC\n");
> - ? ? ? ? ? ? ? return;
> - ? ? ? }
> -
> - ? ? ? igep_onenand_data.cs = onenandcs;
> -
> - ? ? ? if (platform_device_register(&igep_onenand_device) < 0)
> - ? ? ? ? ? ? ? pr_err("IGEP: Unable to register OneNAND device\n");
> + ? ? ? u32 mux;
> + ? ? ? mux = igep_get_sysboot_value();
> +
> + ? ? ? if (mux == IGEP_SYSBOOT_NAND) {
> + ? ? ? ? ? ? ? pr_info("IGEP: initializing NAND memory device\n");
> + ? ? ? ? ? ? ? board_nand_init(igep_flash_partitions,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(igep_flash_partitions),
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0, NAND_BUSWIDTH_16);
> + ? ? ? } else if (mux == IGEP_SYSBOOT_ONENAND) {
> + ? ? ? ? ? ? ? pr_info("IGEP: initializing OneNAND memory device\n");
> + ? ? ? ? ? ? ? board_onenand_init(igep_flash_partitions,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(igep_flash_partitions), 0);
> + ? ? ? } else
> + ? ? ? ? ? ? ? pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
> ?}
>
> ?#else
> --
> 1.7.7.6
>

Seems good to me.

Tony, as this is a fix ,may be included ?

Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>

Cheers,
    Enric

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-04-25  7:59   ` Enric Balletbò i Serra
@ 2012-04-27  9:30     ` Javier Martinez Canillas
  -1 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-27  9:30 UTC (permalink / raw)
  To: Enric Balletbò i Serra
  Cc: Tony Lindgren, Russell King, linux-omap, linaro-kernel,
	linux-arm-kernel, linaro-dev, patches

On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletbò i Serra
<eballetbo@gmail.com> wrote:
> 2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
>> board_onenand_init() and board_nand_init() initialization functions are
>> used to initialize OneNAND and NAND memories respectively. But only
>> board_nand_init() was visible to be used from board code. This patch makes
>> possible to initialize a OneNAND flash memory within platform code.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
>> ---
>>  arch/arm/mach-omap2/board-flash.c |    4 ++--
>>  arch/arm/mach-omap2/board-flash.h |   11 +++++++++++
>>  2 files changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
>> index 0349fd2..70a81f9 100644
>> --- a/arch/arm/mach-omap2/board-flash.c
>> +++ b/arch/arm/mach-omap2/board-flash.c
>> @@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
>>        .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
>>  };
>>
>> -static void
>> +void
>>  __init board_onenand_init(struct mtd_partition *onenand_parts,
>>                                u8 nr_parts, u8 cs)
>>  {
>> @@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
>>        gpmc_onenand_init(&board_onenand_data);
>>  }
>>  #else
>> -static void
>> +void
>>  __init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
>>  {
>>  }
>> diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
>> index d25503a..c44b70d 100644
>> --- a/arch/arm/mach-omap2/board-flash.h
>> +++ b/arch/arm/mach-omap2/board-flash.h
>> @@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts,
>>  {
>>  }
>>  #endif
>> +
>> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
>> +               defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
>> +extern void board_onenand_init(struct mtd_partition *nand_parts,
>> +                                       u8 nr_parts, u8 cs);
>> +#else
>> +static inline void board_onenand_init(struct mtd_partition *nand_parts,
>> +                                       u8 nr_parts, u8 cs)
>> +{
>> +}
>> +#endif
>> --
>> 1.7.7.6
>>
>
> Seems good to me.
>
> Tony, as this is a fix ,may be included ?
>
> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>
> Cheers,
>    Enric

Hi Tony, Russel:

This patch is a requirement for patch:

[RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
storage memory

which is really important since newer IGEPv2 boards have changed their
flash memory from OneNAND to NAND.

This patch-set is necessary to make the board work, otherwise it
doesn't even boot.

Could we please include these patches?

Thanks a lot and best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-04-27  9:30     ` Javier Martinez Canillas
  0 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-27  9:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletb? i Serra
<eballetbo@gmail.com> wrote:
> 2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
>> board_onenand_init() and board_nand_init() initialization functions are
>> used to initialize OneNAND and NAND memories respectively. But only
>> board_nand_init() was visible to be used from board code. This patch makes
>> possible to initialize a OneNAND flash memory within platform code.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
>> ---
>> ?arch/arm/mach-omap2/board-flash.c | ? ?4 ++--
>> ?arch/arm/mach-omap2/board-flash.h | ? 11 +++++++++++
>> ?2 files changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
>> index 0349fd2..70a81f9 100644
>> --- a/arch/arm/mach-omap2/board-flash.c
>> +++ b/arch/arm/mach-omap2/board-flash.c
>> @@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
>> ? ? ? ?.dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */
>> ?};
>>
>> -static void
>> +void
>> ?__init board_onenand_init(struct mtd_partition *onenand_parts,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?u8 nr_parts, u8 cs)
>> ?{
>> @@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
>> ? ? ? ?gpmc_onenand_init(&board_onenand_data);
>> ?}
>> ?#else
>> -static void
>> +void
>> ?__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
>> ?{
>> ?}
>> diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
>> index d25503a..c44b70d 100644
>> --- a/arch/arm/mach-omap2/board-flash.h
>> +++ b/arch/arm/mach-omap2/board-flash.h
>> @@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts,
>> ?{
>> ?}
>> ?#endif
>> +
>> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
>> + ? ? ? ? ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
>> +extern void board_onenand_init(struct mtd_partition *nand_parts,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs);
>> +#else
>> +static inline void board_onenand_init(struct mtd_partition *nand_parts,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs)
>> +{
>> +}
>> +#endif
>> --
>> 1.7.7.6
>>
>
> Seems good to me.
>
> Tony, as this is a fix ,may be included ?
>
> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>
> Cheers,
> ? ?Enric

Hi Tony, Russel:

This patch is a requirement for patch:

[RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
storage memory

which is really important since newer IGEPv2 boards have changed their
flash memory from OneNAND to NAND.

This patch-set is necessary to make the board work, otherwise it
doesn't even boot.

Could we please include these patches?

Thanks a lot and best regards,
Javier

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
  2012-04-25  8:00     ` Enric Balletbò i Serra
@ 2012-04-30 16:52       ` Javier Martinez Canillas
  -1 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-30 16:52 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Javier Martinez Canillas, Enric Balletbò i Serra,
	Russell King, linux-omap, linaro-kernel, linux-arm-kernel,
	linaro-dev, patches

On Wed, Apr 25, 2012 at 10:00 AM, Enric Balletbò i Serra
<eballetbo@gmail.com> wrote:
> 2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
>> IGEP-based boards can have two different flash memories, a OneNAND or
>> a NAND device. The boot configuration pins (sys_boot) are used to
>> specify which memory is available.
>>
>> Also, this patch removes unnecesary code for registering the OneNAND.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
>> ---
>>  arch/arm/mach-omap2/board-igep0020.c |   75 ++++++++++++++--------------------
>>  1 files changed, 31 insertions(+), 44 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
>> index 930c0d3..4af615a 100644
>> --- a/arch/arm/mach-omap2/board-igep0020.c
>> +++ b/arch/arm/mach-omap2/board-igep0020.c
>> @@ -24,6 +24,8 @@
>>  #include <linux/i2c/twl.h>
>>  #include <linux/mmc/host.h>
>>
>> +#include <linux/mtd/nand.h>
>> +
>>  #include <asm/mach-types.h>
>>  #include <asm/mach/arch.h>
>>
>> @@ -39,6 +41,8 @@
>>  #include "hsmmc.h"
>>  #include "sdram-numonyx-m65kxxxxam.h"
>>  #include "common-board-devices.h"
>> +#include "board-flash.h"
>> +#include "control.h"
>>
>>  #define IGEP2_SMSC911X_CS       5
>>  #define IGEP2_SMSC911X_GPIO     176
>> @@ -60,6 +64,10 @@
>>  #define IGEP3_GPIO_LED1_RED    16
>>  #define IGEP3_GPIO_USBH_NRESET  183
>>
>> +#define IGEP_SYSBOOT_MASK           0x1f
>> +#define IGEP_SYSBOOT_NAND           0x0f
>> +#define IGEP_SYSBOOT_ONENAND        0x10
>> +
>>  /*
>>  * IGEP2 Hardware Revision Table
>>  *
>> @@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
>>        gpio_free(IGEP2_GPIO_LED1_RED);
>>  }
>>
>> -#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
>> -       defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
>> +#if defined(CONFIG_MTD_ONENAND_OMAP2) ||               \
>> +       defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) ||     \
>> +       defined(CONFIG_MTD_NAND_OMAP2) ||               \
>> +       defined(CONFIG_MTD_NAND_OMAP2_MODULE)
>>
>>  #define ONENAND_MAP             0x20000000
>>
>> @@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
>>  * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
>>  */
>>
>> -static struct mtd_partition igep_onenand_partitions[] = {
>> +static struct mtd_partition igep_flash_partitions[] = {
>>        {
>>                .name           = "X-Loader",
>>                .offset         = 0,
>> @@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = {
>>        },
>>  };
>>
>> -static struct omap_onenand_platform_data igep_onenand_data = {
>> -       .parts = igep_onenand_partitions,
>> -       .nr_parts = ARRAY_SIZE(igep_onenand_partitions),
>> -       .dma_channel    = -1,   /* disable DMA in OMAP OneNAND driver */
>> -};
>> -
>> -static struct platform_device igep_onenand_device = {
>> -       .name           = "omap2-onenand",
>> -       .id             = -1,
>> -       .dev = {
>> -               .platform_data = &igep_onenand_data,
>> -       },
>> -};
>> +static inline u32 igep_get_sysboot_value(void)
>> +{
>> +       return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
>> +}
>>
>>  static void __init igep_flash_init(void)
>>  {
>> -       u8 cs = 0;
>> -       u8 onenandcs = GPMC_CS_NUM + 1;
>> -
>> -       for (cs = 0; cs < GPMC_CS_NUM; cs++) {
>> -               u32 ret;
>> -               ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
>> -
>> -               /* Check if NAND/oneNAND is configured */
>> -               if ((ret & 0xC00) == 0x800)
>> -                       /* 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))
>> -                               /* ONENAND found */
>> -                               onenandcs = cs;
>> -               }
>> -       }
>> -
>> -       if (onenandcs > GPMC_CS_NUM) {
>> -               pr_err("IGEP: Unable to find configuration in GPMC\n");
>> -               return;
>> -       }
>> -
>> -       igep_onenand_data.cs = onenandcs;
>> -
>> -       if (platform_device_register(&igep_onenand_device) < 0)
>> -               pr_err("IGEP: Unable to register OneNAND device\n");
>> +       u32 mux;
>> +       mux = igep_get_sysboot_value();
>> +
>> +       if (mux == IGEP_SYSBOOT_NAND) {
>> +               pr_info("IGEP: initializing NAND memory device\n");
>> +               board_nand_init(igep_flash_partitions,
>> +                               ARRAY_SIZE(igep_flash_partitions),
>> +                               0, NAND_BUSWIDTH_16);
>> +       } else if (mux == IGEP_SYSBOOT_ONENAND) {
>> +               pr_info("IGEP: initializing OneNAND memory device\n");
>> +               board_onenand_init(igep_flash_partitions,
>> +                                  ARRAY_SIZE(igep_flash_partitions), 0);
>> +       } else
>> +               pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
>>  }
>>
>>  #else
>> --
>> 1.7.7.6
>>
>
> Seems good to me.
>
> Tony, as this is a fix ,may be included ?
>
> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>
> Cheers,
>    Enric
> --

Tony,

Can you please merge this patch and:

[RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init()
visible to board code

I've sent this two patches several times and no one is against them. I
also had positive feedback such as Enric's acked-by

These two patches are a fix and needed to boot newer versions of the
IGEPv2 board. Without the patches the board doesn't even boot.

Please tell me if you need me to resend the patches.

Best regards,

-- 
Javier Martínez Canillas
(+34) 682 39 81 69
Barcelona, Spain
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
@ 2012-04-30 16:52       ` Javier Martinez Canillas
  0 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-04-30 16:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 25, 2012 at 10:00 AM, Enric Balletb? i Serra
<eballetbo@gmail.com> wrote:
> 2012/4/4 Javier Martinez Canillas <javier@dowhile0.org>:
>> IGEP-based boards can have two different flash memories, a OneNAND or
>> a NAND device. The boot configuration pins (sys_boot) are used to
>> specify which memory is available.
>>
>> Also, this patch removes unnecesary code for registering the OneNAND.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
>> ---
>> ?arch/arm/mach-omap2/board-igep0020.c | ? 75 ++++++++++++++--------------------
>> ?1 files changed, 31 insertions(+), 44 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
>> index 930c0d3..4af615a 100644
>> --- a/arch/arm/mach-omap2/board-igep0020.c
>> +++ b/arch/arm/mach-omap2/board-igep0020.c
>> @@ -24,6 +24,8 @@
>> ?#include <linux/i2c/twl.h>
>> ?#include <linux/mmc/host.h>
>>
>> +#include <linux/mtd/nand.h>
>> +
>> ?#include <asm/mach-types.h>
>> ?#include <asm/mach/arch.h>
>>
>> @@ -39,6 +41,8 @@
>> ?#include "hsmmc.h"
>> ?#include "sdram-numonyx-m65kxxxxam.h"
>> ?#include "common-board-devices.h"
>> +#include "board-flash.h"
>> +#include "control.h"
>>
>> ?#define IGEP2_SMSC911X_CS ? ? ? 5
>> ?#define IGEP2_SMSC911X_GPIO ? ? 176
>> @@ -60,6 +64,10 @@
>> ?#define IGEP3_GPIO_LED1_RED ? ?16
>> ?#define IGEP3_GPIO_USBH_NRESET ?183
>>
>> +#define IGEP_SYSBOOT_MASK ? ? ? ? ? 0x1f
>> +#define IGEP_SYSBOOT_NAND ? ? ? ? ? 0x0f
>> +#define IGEP_SYSBOOT_ONENAND ? ? ? ?0x10
>> +
>> ?/*
>> ?* IGEP2 Hardware Revision Table
>> ?*
>> @@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
>> ? ? ? ?gpio_free(IGEP2_GPIO_LED1_RED);
>> ?}
>>
>> -#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
>> - ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
>> +#if defined(CONFIG_MTD_ONENAND_OMAP2) || ? ? ? ? ? ? ? \
>> + ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || ? ? \
>> + ? ? ? defined(CONFIG_MTD_NAND_OMAP2) || ? ? ? ? ? ? ? \
>> + ? ? ? defined(CONFIG_MTD_NAND_OMAP2_MODULE)
>>
>> ?#define ONENAND_MAP ? ? ? ? ? ? 0x20000000
>>
>> @@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
>> ?* So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
>> ?*/
>>
>> -static struct mtd_partition igep_onenand_partitions[] = {
>> +static struct mtd_partition igep_flash_partitions[] = {
>> ? ? ? ?{
>> ? ? ? ? ? ? ? ?.name ? ? ? ? ? = "X-Loader",
>> ? ? ? ? ? ? ? ?.offset ? ? ? ? = 0,
>> @@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = {
>> ? ? ? ?},
>> ?};
>>
>> -static struct omap_onenand_platform_data igep_onenand_data = {
>> - ? ? ? .parts = igep_onenand_partitions,
>> - ? ? ? .nr_parts = ARRAY_SIZE(igep_onenand_partitions),
>> - ? ? ? .dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */
>> -};
>> -
>> -static struct platform_device igep_onenand_device = {
>> - ? ? ? .name ? ? ? ? ? = "omap2-onenand",
>> - ? ? ? .id ? ? ? ? ? ? = -1,
>> - ? ? ? .dev = {
>> - ? ? ? ? ? ? ? .platform_data = &igep_onenand_data,
>> - ? ? ? },
>> -};
>> +static inline u32 igep_get_sysboot_value(void)
>> +{
>> + ? ? ? return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
>> +}
>>
>> ?static void __init igep_flash_init(void)
>> ?{
>> - ? ? ? u8 cs = 0;
>> - ? ? ? u8 onenandcs = GPMC_CS_NUM + 1;
>> -
>> - ? ? ? for (cs = 0; cs < GPMC_CS_NUM; cs++) {
>> - ? ? ? ? ? ? ? u32 ret;
>> - ? ? ? ? ? ? ? ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
>> -
>> - ? ? ? ? ? ? ? /* Check if NAND/oneNAND is configured */
>> - ? ? ? ? ? ? ? if ((ret & 0xC00) == 0x800)
>> - ? ? ? ? ? ? ? ? ? ? ? /* 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))
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* ONENAND found */
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? onenandcs = cs;
>> - ? ? ? ? ? ? ? }
>> - ? ? ? }
>> -
>> - ? ? ? if (onenandcs > GPMC_CS_NUM) {
>> - ? ? ? ? ? ? ? pr_err("IGEP: Unable to find configuration in GPMC\n");
>> - ? ? ? ? ? ? ? return;
>> - ? ? ? }
>> -
>> - ? ? ? igep_onenand_data.cs = onenandcs;
>> -
>> - ? ? ? if (platform_device_register(&igep_onenand_device) < 0)
>> - ? ? ? ? ? ? ? pr_err("IGEP: Unable to register OneNAND device\n");
>> + ? ? ? u32 mux;
>> + ? ? ? mux = igep_get_sysboot_value();
>> +
>> + ? ? ? if (mux == IGEP_SYSBOOT_NAND) {
>> + ? ? ? ? ? ? ? pr_info("IGEP: initializing NAND memory device\n");
>> + ? ? ? ? ? ? ? board_nand_init(igep_flash_partitions,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(igep_flash_partitions),
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0, NAND_BUSWIDTH_16);
>> + ? ? ? } else if (mux == IGEP_SYSBOOT_ONENAND) {
>> + ? ? ? ? ? ? ? pr_info("IGEP: initializing OneNAND memory device\n");
>> + ? ? ? ? ? ? ? board_onenand_init(igep_flash_partitions,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(igep_flash_partitions), 0);
>> + ? ? ? } else
>> + ? ? ? ? ? ? ? pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
>> ?}
>>
>> ?#else
>> --
>> 1.7.7.6
>>
>
> Seems good to me.
>
> Tony, as this is a fix ,may be included ?
>
> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>
> Cheers,
> ? ?Enric
> --

Tony,

Can you please merge this patch and:

[RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init()
visible to board code

I've sent this two patches several times and no one is against them. I
also had positive feedback such as Enric's acked-by

These two patches are a fix and needed to boot newer versions of the
IGEPv2 board. Without the patches the board doesn't even boot.

Please tell me if you need me to resend the patches.

Best regards,

-- 
Javier Mart?nez Canillas
(+34) 682 39 81 69
Barcelona, Spain

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-04-27  9:30     ` Javier Martinez Canillas
@ 2012-05-08 23:16       ` Tony Lindgren
  -1 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2012-05-08 23:16 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Enric Balletbò i Serra, Russell King, linux-omap,
	linaro-kernel, linux-arm-kernel, linaro-dev, patches

* Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletbò i Serra
> <eballetbo@gmail.com> wrote:
> >
> > Tony, as this is a fix ,may be included ?
> >
> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >
> > Cheers,
> >    Enric
> 
> Hi Tony, Russel:
> 
> This patch is a requirement for patch:
> 
> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
> storage memory
> 
> which is really important since newer IGEPv2 boards have changed their
> flash memory from OneNAND to NAND.
> 
> This patch-set is necessary to make the board work, otherwise it
> doesn't even boot.
> 
> Could we please include these patches?

Thanks for the patience, applying now into board branch finally.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-05-08 23:16       ` Tony Lindgren
  0 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2012-05-08 23:16 UTC (permalink / raw)
  To: linux-arm-kernel

* Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletb? i Serra
> <eballetbo@gmail.com> wrote:
> >
> > Tony, as this is a fix ,may be included ?
> >
> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >
> > Cheers,
> > ? ?Enric
> 
> Hi Tony, Russel:
> 
> This patch is a requirement for patch:
> 
> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
> storage memory
> 
> which is really important since newer IGEPv2 boards have changed their
> flash memory from OneNAND to NAND.
> 
> This patch-set is necessary to make the board work, otherwise it
> doesn't even boot.
> 
> Could we please include these patches?

Thanks for the patience, applying now into board branch finally.

Regards,

Tony

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-05-08 23:16       ` Tony Lindgren
@ 2012-05-09 13:30         ` Javier Martinez Canillas
  -1 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-05-09 13:30 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Javier Martinez Canillas, Enric Balletbò i Serra,
	Russell King, linux-omap, linaro-kernel, linux-arm-kernel,
	linaro-dev, patches

On Wed, May 9, 2012 at 1:16 AM, Tony Lindgren <tony@atomide.com> wrote:
> * Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
>> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletbò i Serra
>> <eballetbo@gmail.com> wrote:
>> >
>> > Tony, as this is a fix ,may be included ?
>> >
>> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> >
>> > Cheers,
>> >    Enric
>>
>> Hi Tony, Russel:
>>
>> This patch is a requirement for patch:
>>
>> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
>> storage memory
>>
>> which is really important since newer IGEPv2 boards have changed their
>> flash memory from OneNAND to NAND.
>>
>> This patch-set is necessary to make the board work, otherwise it
>> doesn't even boot.
>>
>> Could we please include these patches?
>
> Thanks for the patience, applying now into board branch finally.
>
> Regards,
>
> Tony
> --

Hi Tony,

Thanks a lot for applying these patches.

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-05-09 13:30         ` Javier Martinez Canillas
  0 siblings, 0 replies; 24+ messages in thread
From: Javier Martinez Canillas @ 2012-05-09 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 9, 2012 at 1:16 AM, Tony Lindgren <tony@atomide.com> wrote:
> * Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
>> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletb? i Serra
>> <eballetbo@gmail.com> wrote:
>> >
>> > Tony, as this is a fix ,may be included ?
>> >
>> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> >
>> > Cheers,
>> > ? ?Enric
>>
>> Hi Tony, Russel:
>>
>> This patch is a requirement for patch:
>>
>> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
>> storage memory
>>
>> which is really important since newer IGEPv2 boards have changed their
>> flash memory from OneNAND to NAND.
>>
>> This patch-set is necessary to make the board work, otherwise it
>> doesn't even boot.
>>
>> Could we please include these patches?
>
> Thanks for the patience, applying now into board branch finally.
>
> Regards,
>
> Tony
> --

Hi Tony,

Thanks a lot for applying these patches.

Best regards,
Javier

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-05-08 23:16       ` Tony Lindgren
@ 2012-05-15 18:13         ` Kevin Hilman
  -1 siblings, 0 replies; 24+ messages in thread
From: Kevin Hilman @ 2012-05-15 18:13 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Javier Martinez Canillas, Enric Balletbò i Serra,
	Russell King, linux-omap, linaro-kernel, linux-arm-kernel,
	linaro-dev, patches

Tony Lindgren <tony@atomide.com> writes:

> * Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
>> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletbò i Serra
>> <eballetbo@gmail.com> wrote:
>> >
>> > Tony, as this is a fix ,may be included ?
>> >
>> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> >
>> > Cheers,
>> >    Enric
>> 
>> Hi Tony, Russel:
>> 
>> This patch is a requirement for patch:
>> 
>> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
>> storage memory
>> 
>> which is really important since newer IGEPv2 boards have changed their
>> flash memory from OneNAND to NAND.
>> 
>> This patch-set is necessary to make the board work, otherwise it
>> doesn't even boot.
>> 
>> Could we please include these patches?
>
> Thanks for the patience, applying now into board branch finally.

This patch breaks the build for platforms that don't use ONENAND.
Using omap2plus_defconfig, set CONFIG_MTD_ONENAND_OMAP2=n and you'll get
the build error below[1]

By removing the static, there is now duplicate definitions in the .c and
.h files.

The solution is to remove the dummy definition from the .c file.  

Tony, feel free to fold the diff below[2] into the original patch to fix
this compile problem.

Kevin


[1]
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init'
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here
make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/mach-omap2] Error 2
make: *** [sub-make] Error 2

[2]
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 70a81f9..53c39d2 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
 
 	gpmc_onenand_init(&board_onenand_data);
 }
-#else
-void
-__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
-{
-}
 #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
 
 #if defined(CONFIG_MTD_NAND_OMAP2) || \
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-05-15 18:13         ` Kevin Hilman
  0 siblings, 0 replies; 24+ messages in thread
From: Kevin Hilman @ 2012-05-15 18:13 UTC (permalink / raw)
  To: linux-arm-kernel

Tony Lindgren <tony@atomide.com> writes:

> * Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
>> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletb? i Serra
>> <eballetbo@gmail.com> wrote:
>> >
>> > Tony, as this is a fix ,may be included ?
>> >
>> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> >
>> > Cheers,
>> > ? ?Enric
>> 
>> Hi Tony, Russel:
>> 
>> This patch is a requirement for patch:
>> 
>> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
>> storage memory
>> 
>> which is really important since newer IGEPv2 boards have changed their
>> flash memory from OneNAND to NAND.
>> 
>> This patch-set is necessary to make the board work, otherwise it
>> doesn't even boot.
>> 
>> Could we please include these patches?
>
> Thanks for the patience, applying now into board branch finally.

This patch breaks the build for platforms that don't use ONENAND.
Using omap2plus_defconfig, set CONFIG_MTD_ONENAND_OMAP2=n and you'll get
the build error below[1]

By removing the static, there is now duplicate definitions in the .c and
.h files.

The solution is to remove the dummy definition from the .c file.  

Tony, feel free to fold the diff below[2] into the original patch to fix
this compile problem.

Kevin


[1]
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init'
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here
make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/mach-omap2] Error 2
make: *** [sub-make] Error 2

[2]
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 70a81f9..53c39d2 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
 
 	gpmc_onenand_init(&board_onenand_data);
 }
-#else
-void
-__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
-{
-}
 #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
 
 #if defined(CONFIG_MTD_NAND_OMAP2) || \

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-05-15 18:13         ` Kevin Hilman
@ 2012-05-15 19:58           ` Tony Lindgren
  -1 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2012-05-15 19:58 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Javier Martinez Canillas, Enric Balletbò i Serra,
	Russell King, linux-omap, linaro-kernel, linux-arm-kernel,
	linaro-dev, patches

* Kevin Hilman <khilman@ti.com> [120515 11:17]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> > * Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
> >> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletbò i Serra
> >> <eballetbo@gmail.com> wrote:
> >> >
> >> > Tony, as this is a fix ,may be included ?
> >> >
> >> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >> >
> >> > Cheers,
> >> >    Enric
> >> 
> >> Hi Tony, Russel:
> >> 
> >> This patch is a requirement for patch:
> >> 
> >> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
> >> storage memory
> >> 
> >> which is really important since newer IGEPv2 boards have changed their
> >> flash memory from OneNAND to NAND.
> >> 
> >> This patch-set is necessary to make the board work, otherwise it
> >> doesn't even boot.
> >> 
> >> Could we please include these patches?
> >
> > Thanks for the patience, applying now into board branch finally.
> 
> This patch breaks the build for platforms that don't use ONENAND.
> Using omap2plus_defconfig, set CONFIG_MTD_ONENAND_OMAP2=n and you'll get
> the build error below[1]

Thanks for catching that.
 
> By removing the static, there is now duplicate definitions in the .c and
> .h files.
> 
> The solution is to remove the dummy definition from the .c file.  
> 
> Tony, feel free to fold the diff below[2] into the original patch to fix
> this compile problem.

That's already merged as 8259573b (ARM: OMAP2+: nand: Make board_onenand_init()
visible to board code) so we need to apply it as a fix.

Can you do a fix with your Signed-off-by or at least reply with that
so I can apply it?

Thanks,

Tony

 
> [1]
> /work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init'
> /work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here
> make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [arch/arm/mach-omap2] Error 2
> make: *** [sub-make] Error 2
> 
> [2]
> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
> index 70a81f9..53c39d2 100644
> --- a/arch/arm/mach-omap2/board-flash.c
> +++ b/arch/arm/mach-omap2/board-flash.c
> @@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
>  
>  	gpmc_onenand_init(&board_onenand_data);
>  }
> -#else
> -void
> -__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
> -{
> -}
>  #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
>  
>  #if defined(CONFIG_MTD_NAND_OMAP2) || \
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-05-15 19:58           ` Tony Lindgren
  0 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2012-05-15 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

* Kevin Hilman <khilman@ti.com> [120515 11:17]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> > * Javier Martinez Canillas <javier@dowhile0.org> [120427 02:33]:
> >> On Wed, Apr 25, 2012 at 9:59 AM, Enric Balletb? i Serra
> >> <eballetbo@gmail.com> wrote:
> >> >
> >> > Tony, as this is a fix ,may be included ?
> >> >
> >> > Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >> > Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >> >
> >> > Cheers,
> >> > ? ?Enric
> >> 
> >> Hi Tony, Russel:
> >> 
> >> This patch is a requirement for patch:
> >> 
> >> [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash
> >> storage memory
> >> 
> >> which is really important since newer IGEPv2 boards have changed their
> >> flash memory from OneNAND to NAND.
> >> 
> >> This patch-set is necessary to make the board work, otherwise it
> >> doesn't even boot.
> >> 
> >> Could we please include these patches?
> >
> > Thanks for the patience, applying now into board branch finally.
> 
> This patch breaks the build for platforms that don't use ONENAND.
> Using omap2plus_defconfig, set CONFIG_MTD_ONENAND_OMAP2=n and you'll get
> the build error below[1]

Thanks for catching that.
 
> By removing the static, there is now duplicate definitions in the .c and
> .h files.
> 
> The solution is to remove the dummy definition from the .c file.  
> 
> Tony, feel free to fold the diff below[2] into the original patch to fix
> this compile problem.

That's already merged as 8259573b (ARM: OMAP2+: nand: Make board_onenand_init()
visible to board code) so we need to apply it as a fix.

Can you do a fix with your Signed-off-by or at least reply with that
so I can apply it?

Thanks,

Tony

 
> [1]
> /work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init'
> /work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here
> make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [arch/arm/mach-omap2] Error 2
> make: *** [sub-make] Error 2
> 
> [2]
> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
> index 70a81f9..53c39d2 100644
> --- a/arch/arm/mach-omap2/board-flash.c
> +++ b/arch/arm/mach-omap2/board-flash.c
> @@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
>  
>  	gpmc_onenand_init(&board_onenand_data);
>  }
> -#else
> -void
> -__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
> -{
> -}
>  #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
>  
>  #if defined(CONFIG_MTD_NAND_OMAP2) || \

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-05-15 19:58           ` Tony Lindgren
@ 2012-05-15 20:13             ` Kevin Hilman
  -1 siblings, 0 replies; 24+ messages in thread
From: Kevin Hilman @ 2012-05-15 20:13 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Javier Martinez Canillas, Enric Balletbò i Serra,
	Russell King, linux-omap, linaro-kernel, linux-arm-kernel,
	linaro-dev, patches

Tony Lindgren <tony@atomide.com> writes:

[...]

> That's already merged as 8259573b (ARM: OMAP2+: nand: Make board_onenand_init()
> visible to board code) so we need to apply it as a fix.
>
> Can you do a fix with your Signed-off-by or at least reply with that
> so I can apply it?

Here you go.  Applies to your 'board' branch.

Kevin



From f4f2c35de0e67e3b8185059ffd78be67f7096d8a Mon Sep 17 00:00:00 2001
From: Kevin Hilman <khilman@ti.com>
Date: Tue, 15 May 2012 13:07:20 -0700
Subject: [PATCH] ARM: OMAP2+: nand: fix build error when
 CONFIG_MTD_ONENAND_OMAP2=n
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

commit 8259573b (ARM: OMAP2+: nand: Make board_onenand_init() visible
to board code) broke the build for configs with OneNAND disabled.  By
removing the static in the header file, it created a duplicate definition
in the .c and the .h files, resuling in a build error:

/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init'
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here
make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/mach-omap2] Error 2
make: *** [sub-make] Error 2

Fix this by removing the duplicate dummy entry from the C file.

Cc: Enric Balletbò i Serra <eballetbo@gmail.com>
Cc: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/board-flash.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 70a81f9..53c39d2 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
 
 	gpmc_onenand_init(&board_onenand_data);
 }
-#else
-void
-__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
-{
-}
 #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
 
 #if defined(CONFIG_MTD_NAND_OMAP2) || \
-- 
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-05-15 20:13             ` Kevin Hilman
  0 siblings, 0 replies; 24+ messages in thread
From: Kevin Hilman @ 2012-05-15 20:13 UTC (permalink / raw)
  To: linux-arm-kernel

Tony Lindgren <tony@atomide.com> writes:

[...]

> That's already merged as 8259573b (ARM: OMAP2+: nand: Make board_onenand_init()
> visible to board code) so we need to apply it as a fix.
>
> Can you do a fix with your Signed-off-by or at least reply with that
> so I can apply it?

Here you go.  Applies to your 'board' branch.

Kevin



>From f4f2c35de0e67e3b8185059ffd78be67f7096d8a Mon Sep 17 00:00:00 2001
From: Kevin Hilman <khilman@ti.com>
Date: Tue, 15 May 2012 13:07:20 -0700
Subject: [PATCH] ARM: OMAP2+: nand: fix build error when
 CONFIG_MTD_ONENAND_OMAP2=n
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

commit 8259573b (ARM: OMAP2+: nand: Make board_onenand_init() visible
to board code) broke the build for configs with OneNAND disabled.  By
removing the static in the header file, it created a duplicate definition
in the .c and the .h files, resuling in a build error:

/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init'
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here
make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/mach-omap2] Error 2
make: *** [sub-make] Error 2

Fix this by removing the duplicate dummy entry from the C file.

Cc: Enric Balletb? i Serra <eballetbo@gmail.com>
Cc: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/board-flash.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 70a81f9..53c39d2 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
 
 	gpmc_onenand_init(&board_onenand_data);
 }
-#else
-void
-__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
-{
-}
 #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
 
 #if defined(CONFIG_MTD_NAND_OMAP2) || \
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
  2012-05-15 20:13             ` Kevin Hilman
@ 2012-05-15 20:31               ` Tony Lindgren
  -1 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2012-05-15 20:31 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Javier Martinez Canillas, Enric Balletbò i Serra,
	Russell King, linux-omap, linaro-kernel, linux-arm-kernel,
	linaro-dev, patches

* Kevin Hilman <khilman@ti.com> [120515 13:17]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> [...]
> 
> > That's already merged as 8259573b (ARM: OMAP2+: nand: Make board_onenand_init()
> > visible to board code) so we need to apply it as a fix.
> >
> > Can you do a fix with your Signed-off-by or at least reply with that
> > so I can apply it?
> 
> Here you go.  Applies to your 'board' branch.

Thanks applying into fixes-board branch.

Tony

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
@ 2012-05-15 20:31               ` Tony Lindgren
  0 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2012-05-15 20:31 UTC (permalink / raw)
  To: linux-arm-kernel

* Kevin Hilman <khilman@ti.com> [120515 13:17]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> [...]
> 
> > That's already merged as 8259573b (ARM: OMAP2+: nand: Make board_onenand_init()
> > visible to board code) so we need to apply it as a fix.
> >
> > Can you do a fix with your Signed-off-by or at least reply with that
> > so I can apply it?
> 
> Here you go.  Applies to your 'board' branch.

Thanks applying into fixes-board branch.

Tony

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-05-15 20:31 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04 18:36 [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code Javier Martinez Canillas
2012-04-04 18:36 ` Javier Martinez Canillas
2012-04-04 18:36 ` [RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory Javier Martinez Canillas
2012-04-04 18:36   ` Javier Martinez Canillas
2012-04-25  8:00   ` Enric Balletbò i Serra
2012-04-25  8:00     ` Enric Balletbò i Serra
2012-04-30 16:52     ` Javier Martinez Canillas
2012-04-30 16:52       ` Javier Martinez Canillas
2012-04-25  7:59 ` [RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code Enric Balletbò i Serra
2012-04-25  7:59   ` Enric Balletbò i Serra
2012-04-27  9:30   ` Javier Martinez Canillas
2012-04-27  9:30     ` Javier Martinez Canillas
2012-05-08 23:16     ` Tony Lindgren
2012-05-08 23:16       ` Tony Lindgren
2012-05-09 13:30       ` Javier Martinez Canillas
2012-05-09 13:30         ` Javier Martinez Canillas
2012-05-15 18:13       ` Kevin Hilman
2012-05-15 18:13         ` Kevin Hilman
2012-05-15 19:58         ` Tony Lindgren
2012-05-15 19:58           ` Tony Lindgren
2012-05-15 20:13           ` Kevin Hilman
2012-05-15 20:13             ` Kevin Hilman
2012-05-15 20:31             ` Tony Lindgren
2012-05-15 20:31               ` 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.