[U-Boot] onenand and nand together

Hello.
I am working to merge support for a board (Nomadik 8815) that includes both Nand and OneNand. The plan is to have both devices online, while the configuration selects which one to use for environment and boot.
Unfortunately, jffs2 code in head complains if both CONFIG_CMD_NAND and CONFIG_CMD_ONENAND are defined.
This trivial one-liner seems to fix one of the problems (although it introduces a warning if neither one is defined), but there's a bigger issue with "struct nand_bbt_descr" which is defined in two different places, and I see no clean solution to that.
Any suggestion to have both devices online with the same boot loader?
thanks /alessandro
From 45a1bb5e2b1eb61450a1b14db6a3382cf19dc051 Mon Sep 17 00:00:00 2001
From: Alessandro Rubini rubini@unipv.it Date: Thu, 30 Oct 2008 08:49:15 +0100 Subject: [PATCH] Allow onenand and nand to cohexist in put_fl_mem
If a board has both CONFIG_CMD_NAND and CONFIG_CMD_ONENAND, put_fl_mem would define "id" twice. This, however, introduces a warning if neither NAND type is selected. --- fs/jffs2/jffs2_1pass.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index 0177268..986d6d2 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -449,16 +449,15 @@ static inline void *get_node_mem(u32 off)
static inline void put_fl_mem(void *buf) { + struct mtdids *id = current_part->dev->id; #if defined(CONFIG_JFFS2_NAND) && \ defined(CONFIG_CMD_NAND) - struct mtdids *id = current_part->dev->id;
if (id->type == MTD_DEV_TYPE_NAND) return put_fl_mem_nand(buf); #endif
#if defined(CONFIG_CMD_ONENAND) - struct mtdids *id = current_part->dev->id;
if (id->type == MTD_DEV_TYPE_ONENAND) return put_fl_mem_onenand(buf);

On Thu, Oct 30, 2008 at 08:55:22AM +0100, Alessandro Rubini wrote:
Unfortunately, jffs2 code in head complains if both CONFIG_CMD_NAND and CONFIG_CMD_ONENAND are defined.
This trivial one-liner seems to fix one of the problems (although it introduces a warning if neither one is defined),
Patch coming that fixes it without a warning.
but there's a bigger issue with "struct nand_bbt_descr" which is defined in two different places, and I see no clean solution to that.
That problem seems to come from upstream Linux. The duplicated definitions in nand.h should be removed, and nand.h should include bbm.h.
-Scott
participants (2)
-
Alessandro Rubini
-
Scott Wood