public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2 v2] cramfs: make cramfs usable on non NOR flash
Date: Wed, 27 Jan 2010 08:30:38 +0100	[thread overview]
Message-ID: <4B5FEB9E.3040908@denx.de> (raw)
In-Reply-To: <4B5FE9EC.6090909@denx.de>

[PATCH 1/2] cramfs: make cramfs usable without a NOR flash

Signed-off-by: Heiko Schocher <hs@denx.de>
---

- changes since v1:
  added comments from Wolfgang Denk:
  get rid of flash_info_t define in board config
  (to get this working patch 1/2 is introduced/needed)

 common/cmd_cramfs.c |   12 +++++++++++-
 fs/cramfs/cramfs.c  |    4 ++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/common/cmd_cramfs.c b/common/cmd_cramfs.c
index 55e2d36..9e92163 100644
--- a/common/cmd_cramfs.c
+++ b/common/cmd_cramfs.c
@@ -43,7 +43,9 @@
 #endif

 #ifdef CONFIG_CRAMFS_CMDLINE
-flash_info_t flash_info[1];
+#if !defined(CONFIG_SYS_NO_FLASH)
+extern flash_info_t flash_info[];
+#endif

 #ifndef CONFIG_CMD_JFFS2
 #include <linux/stat.h>
@@ -119,7 +121,11 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif

 	/* pre-set Boot file name */
 	if ((filename = getenv("bootfile")) == NULL) {
@@ -182,7 +188,11 @@ int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	dev.id = &id;
 	part.dev = &dev;
 	/* fake the address offset */
+#if !defined(CONFIG_SYS_NO_FLASH)
 	part.offset = addr - flash_info[id.num].start[0];
+#else
+	part.offset = addr;
+#endif

 	if (argc == 2)
 		filename = argv[1];
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 2956d39..910955d 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -41,8 +41,12 @@ struct cramfs_super super;

 /* CPU address space offset calculation macro, struct part_info offset is
  * device address space offset, so we need to shift it by a device start address. */
+#if !defined(CONFIG_SYS_NO_FLASH)
 extern flash_info_t flash_info[];
 #define PART_OFFSET(x)	(x->offset + flash_info[x->dev->id->num].start[0])
+#else
+#define PART_OFFSET(x)	(x->offset)
+#endif

 static int cramfs_read_super (struct part_info *info)
 {
-- 
1.6.2.5
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2010-01-27  7:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07  7:56 [U-Boot] arm: suen3, suen3_v1, mgcoge2_arm_p1a support Heiko Schocher
2010-01-17 23:51 ` Wolfgang Denk
2010-01-18  8:34   ` Heiko Schocher
2010-01-18  9:31     ` Stefan Roese
2010-01-27  7:23   ` Heiko Schocher
2010-01-27  7:30     ` Heiko Schocher [this message]
2010-01-27 19:28       ` [U-Boot] [PATCH 1/2 v2] cramfs: make cramfs usable on non NOR flash Wolfgang Denk
2010-01-28  7:30         ` Heiko Schocher
2010-01-28 10:15           ` Wolfgang Denk
2010-01-28 11:02             ` Heiko Schocher
2010-01-27  7:31     ` [U-Boot] [PATCH 2/2 v2] arm: suen3, suen3_v1, mgcoge2_arm_p1a support Heiko Schocher
2010-01-27 13:50       ` Tom
2010-01-27 14:43         ` Heiko Schocher
2010-01-28 13:54           ` Tom
2010-01-27 19:49       ` Wolfgang Denk
2010-02-01  7:37       ` [U-Boot] [PATCH 2/2 v3] " Heiko Schocher
2010-02-02 18:07         ` Prafulla Wadaskar
2010-02-03  6:42           ` Wolfgang Denk
2010-02-03 15:52           ` Heiko Schocher
2010-02-03 16:53             ` Stefan Roese
2010-02-03 22:32             ` Scott Wood
2010-02-04  7:24               ` Heiko Schocher
2010-02-08 19:23                 ` Scott Wood
2010-02-10  7:09             ` Heiko Schocher
2010-02-10  7:41               ` Prafulla Wadaskar
2010-02-10  9:27                 ` Heiko Schocher

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=4B5FEB9E.3040908@denx.de \
    --to=hs@denx.de \
    --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