From: Piotr Ziecik Date: Mon, 17 Nov 2008 15:58:00 +0100 Subject: [U-Boot] [PATCH 3/3] ubi: Add proof-of-concept CFI flash support In-Reply-To: <1226933880-21440-1-git-send-email-kosmo@semihalf.com> References: <1226933880-21440-1-git-send-email-kosmo@semihalf.com> Message-ID: <1226933880-21440-4-git-send-email-kosmo@semihalf.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de With this patch UBI can be used on CFI flash chips. Signed-off-by: Piotr Ziecik --- For example to create UBI volume on empty flash partition (partition 0 on NOR device 0) use following commands: => setenv mtdids nor0=nor => mtdparts add nor0 8m at 32m nor-part => saveenv => ubi part nor nor0,0 => ubi create ubi-vol => ubi info layout common/cmd_ubi.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c index a656786..4217fa0 100644 --- a/common/cmd_ubi.c +++ b/common/cmd_ubi.c @@ -24,6 +24,7 @@ #define DEV_TYPE_NONE 0 #define DEV_TYPE_NAND 1 #define DEV_TYPE_ONENAND 2 +#define DEV_TYPE_NOR 3 /* Private own data */ static struct ubi_device *ubi; @@ -485,6 +486,11 @@ static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) ubi_dev.mtd_info = &nand_info[ubi_dev.nr]; } #endif + if (strcmp(argv[2], "nor") == 0) { + strcpy(ubi_dev.dev_name, "NOR"); + ubi_dev.type = DEV_TYPE_NOR; + ubi_dev.mtd_info = get_mtd_device_nm(CFI_MTD_DEV_NAME); + } #if defined(CONFIG_CMD_ONENAND) if (strcmp(argv[2], "onenand") == 0) { strcpy(ubi_dev.dev_name, "OneNAND"); @@ -606,7 +612,7 @@ static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) U_BOOT_CMD(ubi, 6, 1, do_ubi, "ubi - ubi commands\n", - "part [nand|onenand] [part]" + "part [nand|nor|onenand] [part]" " - Show or set current partition\n" "info [l[ayout]]" " - Display volume and ubi layout information\n" -- 1.5.6.1