All of lore.kernel.org
 help / color / mirror / Atom feed
* Add cmdlinepart and default static partition table support for ARM Integrator - resend
@ 2003-08-07  1:17 George G. Davis
  0 siblings, 0 replies; only message in thread
From: George G. Davis @ 2003-08-07  1:17 UTC (permalink / raw)
  To: linux-mtd

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

Ok, hopefully I'm using the correct e-mail account for list postings now. So
here is a repost with the patch attached this time!

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-07  1:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-07  1:17 Add cmdlinepart and default static partition table support for ARM Integrator - resend George G. Davis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.