devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lentin <jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Jason <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Jamie Lentin <jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: [PATCH V3 3/5] ARM: kirkwood: Allow nand to be configured via. devicetree
Date: Tue, 27 Mar 2012 22:54:13 +0100	[thread overview]
Message-ID: <1332885255-8304-4-git-send-email-jm@lentin.co.uk> (raw)
In-Reply-To: <1332885255-8304-1-git-send-email-jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>

Add default configuration for NAND, to be enabled in your board config. Ensure
clock gating is set appropriately when the NAND is enabled.

Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Signed-off-by: Jamie Lentin <jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org>
---
 arch/arm/boot/dts/kirkwood.dtsi |   15 ++++++++++++++-
 arch/arm/mach-kirkwood/common.c |   12 ++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 3474ef8..6b80374 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -5,7 +5,7 @@
 
 	ocp@f1000000 {
 		compatible = "simple-bus";
-		ranges = <0 0xf1000000 0x1000000>;
+		ranges = <0 0xf1000000 0x4000000>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 
@@ -32,5 +32,18 @@
 			reg = <0x10300 0x20>;
 			interrupts = <53>;
 		};
+
+		nand@3000000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			cle = <0>;
+			ale = <1>;
+			bank-width = <8>;
+			compatible = "mrvl,orion-nand";
+			reg = <0x3000000 0x400>;
+			chip-delay = <25>;
+			/* set partition map and/or chip-delay in board dts */
+			status = "disabled";
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index a02cae8..3ad0373 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
 #include <linux/ata_platform.h>
 #include <linux/mtd/nand.h>
 #include <linux/dma-mapping.h>
+#include <linux/of.h>
 #include <net/dsa.h>
 #include <asm/page.h>
 #include <asm/timex.h>
@@ -482,6 +483,9 @@ static int __init kirkwood_clock_gate(void)
 	unsigned int curr = readl(CLOCK_GATING_CTRL);
 	u32 dev, rev;
 
+#ifdef CONFIG_OF
+	struct device_node *np;
+#endif
 	kirkwood_pcie_id(&dev, &rev);
 	printk(KERN_DEBUG "Gating clock of unused units\n");
 	printk(KERN_DEBUG "before: 0x%08x\n", curr);
@@ -489,6 +493,14 @@ static int __init kirkwood_clock_gate(void)
 	/* Make sure those units are accessible */
 	writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
 
+#ifdef CONFIG_OF
+	np = of_find_compatible_node(NULL, NULL, "mrvl,orion-nand");
+	if (np && of_device_is_available(np)) {
+		kirkwood_clk_ctrl |= CGC_RUNIT;
+		of_node_put(np);
+	}
+#endif
+
 	/* For SATA: first shutdown the phy */
 	if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
 		/* Disable PLL and IVREF */
-- 
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   ` Jamie Lentin [this message]
2012-03-27 21:54 ` [PATCH V3 4/5] ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt Jamie Lentin
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-4-git-send-email-jm@lentin.co.uk \
    --to=jm-pj/hzkgeck7qxopxs62xeg@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.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).