From: Luca Santini <luca.santini@spesonline.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] edosk7760 physmap-flash support
Date: Thu, 11 Sep 2008 10:21:34 +0000 [thread overview]
Message-ID: <48C8F12E.6080305@spesonline.com> (raw)
diff --git a/arch/sh/boards/board-edosk7760.c
b/arch/sh/boards/board-edosk7760.c
index 7cc5e11..14a09d4 100644
--- a/arch/sh/boards/board-edosk7760.c
+++ b/arch/sh/boards/board-edosk7760.c
@@ -24,6 +24,7 @@
#include <linux/smc91x.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
+#include <linux/mtd/physmap.h>
#include <asm/machvec.h>
#include <asm/io.h>
#include <asm/addrspace.h>
@@ -40,6 +41,53 @@
#define ETHERNET_IRQ 5
+/* NOR flash */
+static struct mtd_partition edosk7760_nor_flash_partitions[] = {
+ {
+ .name = "bootloader",
+ .offset = 0,
+ .size = (1 * 1024 * 1024), /*1MB*/
+ .mask_flags = MTD_WRITEABLE, /* Read-only */
+ }, {
+ .name = "kernel",
+ .offset = MTDPART_OFS_APPEND,
+ .size = (2 * 1024 * 1024), /*2MB*/
+ }, {
+ .name = "fs",
+ .offset = MTDPART_OFS_APPEND,
+ .size = (26 * 1024 * 1024),
+ }, {
+ .name = "other",
+ .offset = MTDPART_OFS_APPEND,
+ .size = MTDPART_SIZ_FULL,
+ },
+};
+
+
+static struct physmap_flash_data edosk7760_nor_flash_data = {
+ .width = 4,
+ .parts = edosk7760_nor_flash_partitions,
+ .nr_parts = ARRAY_SIZE(edosk7760_nor_flash_partitions),
+};
+
+static struct resource edosk7760_nor_flash_resources[] = {
+ [0] = {
+ .name = "NOR Flash",
+ .start = 0x00000000,
+ .end = (32 * 1024 * 1024) -1, /* 32MB*/
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct platform_device edosk7760_nor_flash_device = {
+ .name = "physmap-flash",
+ .resource = edosk7760_nor_flash_resources,
+ .num_resources = ARRAY_SIZE(edosk7760_nor_flash_resources),
+ .dev = {
+ .platform_data = &edosk7760_nor_flash_data,
+ },
+};
+
/* i2c initialization functions */
static struct sh7760_i2c_platdata i2c_pd = {
.speed_khz = 400,
@@ -121,9 +169,10 @@ static struct platform_device smc91x_dev = {
/* platform init code */
static struct platform_device *edosk7760_devices[] __initdata = {
+ &smc91x_dev,
+ &edosk7760_nor_flash_device,
&sh7760_i2c0_dev,
&sh7760_i2c1_dev,
- &smc91x_dev,
};
static int __init init_edosk7760_devices(void)
next reply other threads:[~2008-09-11 10:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-11 10:21 Luca Santini [this message]
2008-09-12 7:57 ` [PATCH] edosk7760 physmap-flash support Luca Santini
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=48C8F12E.6080305@spesonline.com \
--to=luca.santini@spesonline.com \
--cc=linux-sh@vger.kernel.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 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.