public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Domen Puncer <domen.puncer@telargo•com>
To: Grant Likely <grant.likely@secretlab•ca>
Cc: linuxppc-embedded@ozlabs•org
Subject: [PATCH v2] lite5200b: flash definition in dts
Date: Tue, 7 Aug 2007 09:02:30 +0200	[thread overview]
Message-ID: <20070807070229.GP4529@moe.telargo.com> (raw)
In-Reply-To: <fa686aa40708012323p2eca4b05pd47acac635cf6370@mail.gmail.com>

Add flash definition for in lite5200b dts, and while at it
fix "ranges" for soc node.


Signed-off-by: Domen Puncer <domen.puncer@telargo•com>

---
OK.

Then how about something like this?

# ls /sys/devices/
total 0
drwxr-xr-x 34 root root 0 Dec  9  1993 f0000000.soc5200
drwxr-xr-x  3 root root 0 Dec  9  1993 fe000000.flash
drwxr-xr-x  3 root root 0 Dec  9  1993 ff000000.flash
drwxr-xr-x  4 root root 0 Dec  9  1993 pci0000:00
drwxr-xr-x  5 root root 0 Dec  9  1993 platform
drwxr-xr-x  6 root root 0 Aug  7 08:39 system

# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 01000000 00020000 "data0"
mtd1: 00f00000 00020000 "data1"
mtd2: 00100000 00020000 "u-boot"


	Domen

 arch/powerpc/boot/dts/lite5200b.dts          |   23 ++++++++++++++++++++++-
 arch/powerpc/platforms/52xx/mpc52xx_common.c |   15 +++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

Index: clean-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
===================================================================
--- clean-powerpc.git.orig/arch/powerpc/boot/dts/lite5200b.dts
+++ clean-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
@@ -52,7 +52,7 @@
 		revision = "";			// from bootloader
 		#interrupt-cells = <3>;
 		device_type = "soc";
-		ranges = <0 f0000000 f0010000>;
+		ranges = <00000000 f0000000 00010000>;
 		reg = <f0000000 00010000>;
 		bus-frequency = <0>;		// from bootloader
 		system-frequency = <0>;		// from bootloader
@@ -345,4 +345,25 @@
 			reg = <8000 4000>;
 		};
 	};
+
+	flash@fe000000 {
+		device_type = "rom";
+		compatible = "direct-mapped";
+		probe-type = "CFI";
+		reg = <fe000000 01000000>;
+		bank-width = <1>;
+		partitions = <00000000 01000000>;
+		partition-names = "data0";
+	};
+
+	flash@ff000000 {
+		device_type = "rom";
+		compatible = "direct-mapped";
+		probe-type = "CFI";
+		reg = <ff000000 01000000>;
+		bank-width = <1>;
+		partitions = <00000000 00f00000
+			      00f00000 00100000>;
+		partition-names = "data1", "u-boot";
+	};
 };
Index: clean-powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_common.c
===================================================================
--- clean-powerpc.git.orig/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ clean-powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -119,9 +119,24 @@ unmap_regs:
 void __init
 mpc52xx_declare_of_platform_devices(void)
 {
+	struct device_node *root, *child;
+	static const struct of_device_id matches[] = {
+		{ .type = "rom", .compatible = "direct-mapped", },
+		{}
+	};
+
 	/* Find every child of the SOC node and add it to of_platform */
 	if (of_platform_bus_probe(NULL, NULL, NULL))
 		printk(KERN_ERR __FILE__ ": "
 			"Error while probing of_platform bus\n");
+
+	/* add flash chips */
+	root = of_find_node_by_path("/");
+	child = NULL;
+	while ((child = of_get_next_child(root, child))) {
+		if (of_match_node(matches, child))
+			of_platform_device_create(child, NULL, NULL);
+	}
+	of_node_put(root);
 }
 

      parent reply	other threads:[~2007-08-07  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19  9:54 [PATCH] lite5200b: flash definition in dts Domen Puncer
2007-08-01  6:52 ` Domen Puncer
2007-08-01 12:41   ` Grant Likely
2007-08-02  5:58     ` Domen Puncer
2007-08-02  6:23       ` Grant Likely
2007-08-02 16:56         ` Scott Wood
2007-08-07  7:02         ` Domen Puncer [this message]

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=20070807070229.GP4529@moe.telargo.com \
    --to=domen.puncer@telargo$(echo .)com \
    --cc=grant.likely@secretlab$(echo .)ca \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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