public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Add cmdlinepart and default static partition table support for ARM Integrator
@ 2003-08-06 21:34 George G. Davis
  2003-08-06 21:36 ` George G. Davis
  0 siblings, 1 reply; 2+ messages in thread
From: George G. Davis @ 2003-08-06 21:34 UTC (permalink / raw)
  To: linux-mtd

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Add cmdlinepart and default static partition table support for ARM Integrator
  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
  0 siblings, 0 replies; 2+ messages in thread
From: George G. Davis @ 2003-08-06 21:36 UTC (permalink / raw)
  To: davis_g; +Cc: linux-mtd

[-- 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-06 21:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox