public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Piotr Ziecik <kosmo@semihalf.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] ubi: Add proof-of-concept CFI flash support
Date: Mon, 17 Nov 2008 15:58:00 +0100	[thread overview]
Message-ID: <1226933880-21440-4-git-send-email-kosmo@semihalf.com> (raw)
In-Reply-To: <1226933880-21440-1-git-send-email-kosmo@semihalf.com>

With this patch UBI can be used on CFI flash chips.

Signed-off-by: Piotr Ziecik <kosmo@semihalf.com>
---
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

  parent reply	other threads:[~2008-11-17 14:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 14:57 [U-Boot] Export CFI Flash to the MTD and support it in UBI Piotr Ziecik
2008-11-17 14:57 ` [U-Boot] [PATCH 1/3] cfi-mtd: Add cfi-mtd driver Piotr Ziecik
2008-11-24 10:09   ` Stefan Roese
2008-11-17 14:57 ` [U-Boot] [PATCH 2/3] mtd: Remove a printf() from add_mtd_device() Piotr Ziecik
2008-11-24 10:35   ` Stefan Roese
2008-11-17 14:58 ` Piotr Ziecik [this message]
2008-11-24 10:35   ` [U-Boot] [PATCH 3/3] ubi: Add proof-of-concept CFI flash support Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226933880-21440-4-git-send-email-kosmo@semihalf.com \
    --to=kosmo@semihalf.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox