From: dbaryshkov@gmail.com (Dmitry Eremin-Solenikov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] clps711x/ceiva: port to use physmap flash
Date: Thu, 2 Jun 2011 15:54:07 +0400 [thread overview]
Message-ID: <1307015648-17505-1-git-send-email-dbaryshkov@gmail.com> (raw)
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
next reply other threads:[~2011-06-02 11:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-02 11:54 Dmitry Eremin-Solenikov [this message]
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
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=1307015648-17505-1-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).