public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] clps711x/ceiva: port to use physmap flash
@ 2011-06-02 11:54 Dmitry Eremin-Solenikov
  2011-06-02 11:54 ` [PATCH 2/2] mtd: drop ceiva map driver Dmitry Eremin-Solenikov
  2011-06-03  4:38 ` [PATCH 1/2] clps711x/ceiva: port to use physmap flash Artem Bityutskiy
  0 siblings, 2 replies; 13+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-02 11:54 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd
  Cc: Artem Bityutskiy, Russell King, David Woodhouse

Port ceiva machine to use physmap flash instead of custom mapping driver
(which even can't compile cleanly with current kernels). All info
is gathered from drivers/mtd/maps/ceiva.c. Compile tested only.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-clps711x/ceiva.c |   60 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
index 16481cf..00e3c45 100644
--- a/arch/arm/mach-clps711x/ceiva.c
+++ b/arch/arm/mach-clps711x/ceiva.c
@@ -26,6 +26,9 @@
 #include <asm/mach/arch.h>
 
 #include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <asm/page.h>
@@ -46,6 +49,56 @@ static struct map_desc ceiva_io_desc[] __initdata = {
 	}
 };
 
+/* Flash / Partition sizing */
+/* For the 28F8003, we use the block mapping to calcuate the sizes */
+#define MAX_SIZE_KiB                  (16 + 8 + 8 + 96 + (7*128))
+#define BOOT_PARTITION_SIZE_KiB       (16)
+#define PARAMS_PARTITION_SIZE_KiB     (8)
+#define KERNEL_PARTITION_SIZE_KiB     (4*128)
+/* Use both remaining portion of first flash, and all of second flash */
+#define ROOT_PARTITION_SIZE_KiB       ((3*128) + (8*128))
+
+static struct mtd_partition ceiva_partitions[] = {
+	{
+		.name = "Ceiva BOOT partition",
+		.size   = BOOT_PARTITION_SIZE_KiB*1024,
+		.offset = 0,
+
+	}, {
+		.name = "Ceiva parameters partition",
+		.size   = PARAMS_PARTITION_SIZE_KiB*1024,
+		.offset = (16 + 8) * 1024,
+	}, {
+		.name = "Ceiva kernel partition",
+		.size = (KERNEL_PARTITION_SIZE_KiB)*1024,
+		.offset = 0x20000,
+
+	}, {
+		.name = "Ceiva root filesystem partition",
+		.offset = MTDPART_OFS_APPEND,
+		.size = (ROOT_PARTITION_SIZE_KiB)*1024,
+	}
+};
+
+static struct physmap_flash_data __initdata ceiva_flash_data = {
+	.width		= CEIVA_FLASH_WIDTH,
+	.parts		= ceiva_partitions,
+	.nr_parts	= ARRAY_SIZE(ceiva_partitions),
+	.probe_type	= "jedec_probe",
+};
+
+static struct resource __initdata ceiva_flash_resouces[] = {
+	{
+		.start	= CS0_PHYS_BASE,
+		.end	= CS0_PHYS_BASE + SZ_32M,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= CS1_PHYS_BASE,
+		.end	= CS1_PHYS_BASE + SZ_32M,
+		.flags	= IORESOURCE_MEM,
+	}
+};
 
 static void __init ceiva_map_io(void)
 {
@@ -53,11 +106,18 @@ static void __init ceiva_map_io(void)
         iotable_init(ceiva_io_desc, ARRAY_SIZE(ceiva_io_desc));
 }
 
+static void __init ceiva_init(void)
+{
+	platform_device_register_resndata(NULL, "physmap-flash", -1,
+			ceiva_flash_resouces, ARRAY_SIZE(ceiva_flash_resouces),
+			&ceiva_flash_data, sizeof(ceiva_flash_data));
+}
 
 MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
 	/* Maintainer: Rob Scott */
 	.boot_params	= 0xc0000100,
 	.map_io		= ceiva_map_io,
 	.init_irq	= clps711x_init_irq,
+	.init_machine	= ceiva_init,
 	.timer		= &clps711x_timer,
 MACHINE_END
-- 
1.7.4.4

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

end of thread, other threads:[~2011-06-04  8:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-02 11:54 [PATCH 1/2] clps711x/ceiva: port to use physmap flash Dmitry Eremin-Solenikov
2011-06-02 11:54 ` [PATCH 2/2] mtd: drop ceiva map driver Dmitry Eremin-Solenikov
2011-06-03 15:49   ` Artem Bityutskiy
2011-06-04  8:23     ` Dmitry Eremin-Solenikov
2011-06-03  4:38 ` [PATCH 1/2] clps711x/ceiva: port to use physmap flash Artem Bityutskiy
2011-06-03  5:02   ` Dmitry Eremin-Solenikov
2011-06-03  5:10     ` Artem Bityutskiy
2011-06-03  5:17       ` Dmitry Eremin-Solenikov
2011-06-03  5:21         ` Artem Bityutskiy
2011-06-03  5:31         ` Artem Bityutskiy
2011-06-03  6:07           ` Dmitry Eremin-Solenikov
2011-06-03  7:54         ` Russell King - ARM Linux
2011-06-03  9:21           ` Dmitry Eremin-Solenikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox