devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lentin <jm@lentin.co.uk>
To: Arnd Bergmann <arnd@arndb.de>, Jason <jason@lakedaemon.net>
Cc: devicetree-discuss@lists.ozlabs.org,
	Jamie Lentin <jm@lentin.co.uk>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 4/5] ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt
Date: Tue, 27 Mar 2012 22:54:14 +0100	[thread overview]
Message-ID: <1332885255-8304-5-git-send-email-jm@lentin.co.uk> (raw)
In-Reply-To: <1332885255-8304-1-git-send-email-jm@lentin.co.uk>

Use devicetree to define NAND partitions. Use D-link partition scheme by
default, to be vaguely compatible with their userland.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
---
 arch/arm/boot/dts/kirkwood-dns320.dts |   35 +++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-dns325.dts |   35 +++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dnskw.c  |   31 -----------------------------
 3 files changed, 70 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts
index 78c834f..dc09a73 100644
--- a/arch/arm/boot/dts/kirkwood-dns320.dts
+++ b/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -25,5 +25,40 @@
 			clock-frequency = <166666667>;
 			status = "okay";
 		};
+
+		nand@3000000 {
+			status = "okay";
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0000000 0x100000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "uImage";
+				reg = <0x0100000 0x500000>;
+			};
+
+			partition@600000 {
+				label = "ramdisk";
+				reg = <0x0600000 0x500000>;
+			};
+
+			partition@b00000 {
+				label = "image";
+				reg = <0x0b00000 0x6600000>;
+			};
+
+			partition@7100000 {
+				label = "mini firmware";
+				reg = <0x7100000 0xa00000>;
+			};
+
+			partition@7b00000 {
+				label = "config";
+				reg = <0x7b00000 0x500000>;
+			};
+		};
 	};
 };
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
index 23241ab..c2a5562 100644
--- a/arch/arm/boot/dts/kirkwood-dns325.dts
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -20,5 +20,40 @@
 			clock-frequency = <200000000>;
 			status = "okay";
 		};
+
+		nand@3000000 {
+			status = "okay";
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0000000 0x100000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "uImage";
+				reg = <0x0100000 0x500000>;
+			};
+
+			partition@600000 {
+				label = "ramdisk";
+				reg = <0x0600000 0x500000>;
+			};
+
+			partition@b00000 {
+				label = "image";
+				reg = <0x0b00000 0x6600000>;
+			};
+
+			partition@7100000 {
+				label = "mini firmware";
+				reg = <0x7100000 0xa00000>;
+			};
+
+			partition@7b00000 {
+				label = "config";
+				reg = <0x7b00000 0x500000>;
+			};
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index 7cb7f6a..dc4e80a 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -23,7 +23,6 @@
 #include <linux/gpio_keys.h>
 #include <linux/gpio-fan.h>
 #include <linux/leds.h>
-#include <linux/mtd/physmap.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -32,35 +31,6 @@
 #include "common.h"
 #include "mpp.h"
 
-static struct mtd_partition dnskw_nand_parts[] = {
-	{
-		.name		= "u-boot",
-		.offset		= 0,
-		.size		= SZ_1M,
-		.mask_flags	= MTD_WRITEABLE
-	}, {
-		.name		= "uImage",
-		.offset		= MTDPART_OFS_NXTBLK,
-		.size		= 5 * SZ_1M
-	}, {
-		.name		= "ramdisk",
-		.offset		= MTDPART_OFS_NXTBLK,
-		.size		= 5 * SZ_1M
-	}, {
-		.name		= "image",
-		.offset		= MTDPART_OFS_NXTBLK,
-		.size		= 102 * SZ_1M
-	}, {
-		.name		= "mini firmware",
-		.offset		= MTDPART_OFS_NXTBLK,
-		.size		= 10 * SZ_1M
-	}, {
-		.name		= "config",
-		.offset		= MTDPART_OFS_NXTBLK,
-		.size		= 5 * SZ_1M
-	},
-};
-
 static struct mv643xx_eth_platform_data dnskw_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
 };
@@ -272,7 +242,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 void __init dnskw_init(void)
 {
 	kirkwood_mpp_conf(dnskw_mpp_config);
-	kirkwood_nand_init(ARRAY_AND_SIZE(dnskw_nand_parts), 25);
 
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dnskw_ge00_data);
-- 
1.7.9.1

  parent reply	other threads:[~2012-03-27 21:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 21:54 [PATCH V3 0/5] Add support for DNS-320 and DNS-325 using devicetree Jamie Lentin
2012-03-27 21:54 ` [PATCH V3 1/5] ARM: kirkwood: Basic support for DNS-320 and DNS-325 Jamie Lentin
     [not found]   ` <1332885255-8304-2-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-03-28  8:19     ` Arnd Bergmann
2012-04-06 23:43       ` Grant Likely
2012-04-09 14:09         ` Arnd Bergmann
     [not found]           ` <201204091409.04927.arnd-r2nGTMty4D4@public.gmane.org>
2012-04-09 14:20             ` Jamie Lentin
     [not found]               ` <alpine.DEB.2.00.1204091513250.23719-5X291BYdrx55rAo4AelP/Ydd74u8MsAO@public.gmane.org>
2012-04-09 15:01                 ` Arnd Bergmann
2012-03-31  1:30     ` Jason Cooper
2012-04-06 23:49   ` Grant Likely
2012-04-09 13:20     ` Jamie Lentin
     [not found]       ` <alpine.DEB.2.00.1204091418400.23719-5X291BYdrx55rAo4AelP/Ydd74u8MsAO@public.gmane.org>
2012-04-09 14:14         ` Arnd Bergmann
2012-04-11  0:43         ` Jason Cooper
     [not found]           ` <20120411004324.GB14790-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-04-11 13:32             ` Jamie Lentin
     [not found]               ` <op.wclrwkqi4cuzmg-x9DHNcFvAEtNwP/n92qj9LVCufUGDwFn@public.gmane.org>
2012-04-11 14:11                 ` Jason Cooper
     [not found]                   ` <20120411141118.GG14790-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-04-11 15:08                     ` Arnd Bergmann
2012-04-09 21:27     ` Russell King - ARM Linux
2012-04-11  0:35     ` Jason Cooper
2012-03-27 21:54 ` [PATCH V3 2/5] mtd: Add orion_nand devicetree bindings Jamie Lentin
2012-03-28 23:04   ` Grant Likely
     [not found] ` <1332885255-8304-1-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-03-27 21:54   ` [PATCH V3 3/5] ARM: kirkwood: Allow nand to be configured via. devicetree Jamie Lentin
2012-03-27 21:54 ` Jamie Lentin [this message]
2012-03-27 21:54 ` [PATCH V3 5/5] mtd: Move fdt partition documentation to a seperate file Jamie Lentin
2012-03-28  8:17   ` Arnd Bergmann
2012-03-28 23:08     ` Grant Likely
     [not found]   ` <1332885255-8304-6-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
2012-03-28 14:41     ` Jason Cooper

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=1332885255-8304-5-git-send-email-jm@lentin.co.uk \
    --to=jm@lentin.co.uk \
    --cc=arnd@arndb.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=jason@lakedaemon.net \
    --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).