summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndreas Huber <andreas.huber@keymile.com>2009-04-02 17:15:34 +0200
committerWolfgang Denk <wd@denx.de>2009-04-04 23:25:40 +0200
commitc203ef5db0476a8c4f6dd86b2e9e9db0ea973f84 (patch)
tree6f9801c677d06f6bdb76f4698d847798f41b2c9d /drivers
parent6b6bb02f27fcabfb37ea717fb7e243248e1e2acf (diff)
downloadu-boot-imx-c203ef5db0476a8c4f6dd86b2e9e9db0ea973f84.zip
u-boot-imx-c203ef5db0476a8c4f6dd86b2e9e9db0ea973f84.tar.gz
u-boot-imx-c203ef5db0476a8c4f6dd86b2e9e9db0ea973f84.tar.bz2
UBI/cfi-mtd: Fix mtd name for multiple chips
On platforms with multiple NOR chips, currently only the first one can be selected using the "ubi part" command. This patch fixes this problem by using different names for the NOR "mtd devices". It also changes the name of the NOR MTD device from "cfi-mtd" to "norX" (X indexing the device numer) to better match the mtdparts defaults. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/cfi_mtd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
index cf82d92..9ac1c86 100644
--- a/drivers/mtd/cfi_mtd.c
+++ b/drivers/mtd/cfi_mtd.c
@@ -32,6 +32,7 @@
extern flash_info_t flash_info[];
static struct mtd_info cfi_mtd_info[CONFIG_SYS_MAX_FLASH_BANKS];
+static char cfi_mtd_names[CONFIG_SYS_MAX_FLASH_BANKS][16];
static int cfi_mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
{
@@ -180,7 +181,8 @@ int cfi_mtd_init(void)
if (error)
continue;
- mtd->name = CFI_MTD_DEV_NAME;
+ sprintf(cfi_mtd_names[i], "nor%d", i);
+ mtd->name = cfi_mtd_names[i];
mtd->type = MTD_NORFLASH;
mtd->flags = MTD_CAP_NORFLASH;
mtd->size = fi->size;