public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "George G. Davis" <gdavis@mvista.com>
To: davis_g@mvista.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: Add cmdlinepart and default static partition table support for ARM Integrator
Date: Wed, 06 Aug 2003 17:36:28 -0400	[thread overview]
Message-ID: <3F3174DC.3090609@mvista.com> (raw)
In-Reply-To: <3F317459.1060300@mvista.com>

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

Doh, patch is attached now...

George G. Davis wrote:
> Greetings,
> 
> The attached patch adds cmdlinepart and default static partition table 
> support
> to integrator-flash. I've tested this on an ARM Integrator/AP with CM920T
> core module. The patch is against recent MTD CVS checkout +/- 1 day. 
> I'ld like
> to get this committed to the MTD CVS repository. TIA!
> 
> -- 
> Regards,
> George
> 
> 
> 

[-- Attachment #2: integrator-flash.patch --]
[-- Type: text/plain, Size: 2461 bytes --]

Index: drivers/mtd/maps/integrator-flash.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/integrator-flash.c,v
retrieving revision 1.12
diff -u -r1.12 integrator-flash.c
--- drivers/mtd/maps/integrator-flash.c	20 May 2003 20:59:30 -0000	1.12
+++ drivers/mtd/maps/integrator-flash.c	6 Aug 2003 20:02:06 -0000
@@ -154,14 +154,43 @@
 
 static struct map_info armflash_map =
 {
-	.name =		"AFS",
+	.name =		"integrator-flash",
 	.set_vpp =	armflash_set_vpp,
 	.phys =		FLASH_BASE,
 };
 
+
+/*
+ * Default static MTD partition definition.
+ *
+ * See include/linux/mtd/partitions.h for definition of the mtd_partition
+ * structure.
+ */
+
+static struct mtd_partition integrator_partitions[] = {
+	{
+		.name		= "Kernel",
+		.size		= 0x00400000,
+		.offset		= 0,
+	}, {
+		.name		= "Root Filesystem",
+		.size		= 0x00c00000,
+		.offset		= MTDPART_OFS_APPEND,
+	}, {
+		.name		= "User Filesystem",
+		.size		= 0x00fc0000,
+		.offset		= MTDPART_OFS_APPEND,
+	}, {
+		.name		= "ARM Boot Monitor SIB",
+		.size		= 0x00040000,
+		.offset		= MTDPART_OFS_APPEND,
+		.mask_flags	= MTD_WRITEABLE,  /* force read-only */
+	}
+};
+
 static struct mtd_info *mtd;
 static struct mtd_partition *parts;
-static const char *probes[] = { "RedBoot", "afs", NULL };
+static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL };
 
 static int __init armflash_cfi_init(void *base, u_int size)
 {
@@ -180,9 +209,8 @@
 	simple_map_init(&armflash_map);
 
 	/*
-	 * Also, the CFI layer automatically works out what size
-	 * of chips we have, and does the necessary identification
-	 * for us automatically.
+	 * The CFI layer automatically works out what size chips we have
+	 * and does the necessary identification for us automatically.
 	 */
 	mtd = do_map_probe("cfi_probe", &armflash_map);
 	if (!mtd)
@@ -191,12 +219,17 @@
 	mtd->owner = THIS_MODULE;
 
 	ret = parse_mtd_partitions(mtd, probes, &parts, (void *)0);
-	if (ret > 0) {
-		ret = add_mtd_partitions(mtd, parts, ret);
-		if (ret)
-			printk(KERN_ERR "mtd partition registration "
-				"failed: %d\n", ret);
+	if (ret <= 0) {
+		/*
+		 * Use default static MTD partition definition:
+		 */
+		parts = integrator_partitions;
+		ret = ARRAY_SIZE(integrator_partitions);
 	}
+
+	ret = add_mtd_partitions(mtd, parts, ret);
+	if (ret)
+		printk(KERN_ERR "mtd partition registration failed: %d\n", ret);
 
 	/*
 	 * If we got an error, free all resources.

      reply	other threads:[~2003-08-06 21:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06 21:34 Add cmdlinepart and default static partition table support for ARM Integrator George G. Davis
2003-08-06 21:36 ` George G. Davis [this message]

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=3F3174DC.3090609@mvista.com \
    --to=gdavis@mvista.com \
    --cc=davis_g@mvista.com \
    --cc=linux-mtd@lists.infradead.org \
    /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