public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Dale Farnsworth <dale@farnsworth•org>
To: paulus@samba•org
Cc: linuxppc-dev@ozlabs•org
Subject: [PATCH 5/9] [POWERPC] mv64x60: remove device tree absolute path references
Date: Fri, 28 Mar 2008 16:48:00 -0700	[thread overview]
Message-ID: <20080328234800.GE30214@farnsworth.org> (raw)
In-Reply-To: <20080328233954.GA29499@farnsworth.org>

From: Dale Farnsworth <dale@farnsworth•org>

Replace several device node absolute path lookups in the mv64x60
bootwrapper code with lookups by compatible or device_type
properties.

Signed-off-by: Dale Farnsworth <dale@farnsworth•org>
Acked-by: Mark A. Greer <mgreer@mvista•com>

--- a/arch/powerpc/boot/mv64x60.c
+++ b/arch/powerpc/boot/mv64x60.c
@@ -535,7 +535,7 @@ u8 *mv64x60_get_bridge_pbase(void)
 	u32 v[2];
 	void *devp;
 
-	devp = finddevice("/mv64x60");
+	devp = find_node_by_compatible(NULL, "mrvl,mv64360");
 	if (devp == NULL)
 		goto err_out;
 	if (getprop(devp, "reg", v, sizeof(v)) != sizeof(v))
@@ -553,7 +553,7 @@ u8 *mv64x60_get_bridge_base(void)
 	u32 v;
 	void *devp;
 
-	devp = finddevice("/mv64x60");
+	devp = find_node_by_compatible(NULL, "mrvl,mv64360");
 	if (devp == NULL)
 		goto err_out;
 	if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
diff --git a/arch/powerpc/boot/mv64x60_i2c.c b/arch/powerpc/boot/mv64x60_i2c.c
index d085377..a69cd7a 100644
--- a/arch/powerpc/boot/mv64x60_i2c.c
+++ b/arch/powerpc/boot/mv64x60_i2c.c
@@ -185,7 +185,7 @@ int mv64x60_i2c_open(void)
 	u32 v;
 	void *devp;
 
-	devp = finddevice("/mv64x60/i2c");
+	devp = find_node_by_compatible(NULL, "mrvl,mv64360-i2c");
 	if (devp == NULL)
 		goto err_out;
 	if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index 05c3245..f74b2cf 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -344,20 +344,20 @@ static void prpmc2800_bridge_setup(u32 mem_size)
 			acc_bits);
 
 	/* Get the cpu -> pci i/o & mem mappings from the device tree */
-	devp = finddevice("/mv64x60/pci@80000000");
+	devp = find_node_by_compatible(NULL, "mrvl,mv64360-pci");
 	if (devp == NULL)
-		fatal("Error: Missing /mv64x60/pci@80000000"
+		fatal("Error: Missing mrvl,mv64360-pci"
 				" device tree node\n\r");
 
 	rc = getprop(devp, "ranges", v, sizeof(v));
 	if (rc != sizeof(v))
-		fatal("Error: Can't find /mv64x60/pci@80000000/ranges"
+		fatal("Error: Can't find mrvl,mv64360-pci ranges"
 				" property\n\r");
 
 	/* Get the cpu -> pci i/o & mem mappings from the device tree */
-	devp = finddevice("/mv64x60");
+	devp = find_node_by_compatible(NULL, "mrvl,mv64360");
 	if (devp == NULL)
-		fatal("Error: Missing /mv64x60 device tree node\n\r");
+		fatal("Error: Missing mrvl,mv64360 device tree node\n\r");
 
 	enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE));
 	enables |= 0x0007fe00; /* Disable all cpu->pci windows */
@@ -429,9 +429,9 @@ static void prpmc2800_fixups(void)
 	setprop(devp, "model", model, l);
 
 	/* Set /cpus/PowerPC,7447/clock-frequency */
-	devp = finddevice("/cpus/PowerPC,7447");
+	devp = find_node_by_prop_value_str(NULL, "device_type", "cpu");
 	if (devp == NULL)
-		fatal("Error: Missing proper /cpus device tree node\n\r");
+		fatal("Error: Missing proper cpu device tree node\n\r");
 	v[0] = bip->core_speed;
 	setprop(devp, "clock-frequency", &v[0], sizeof(v[0]));
 
@@ -443,16 +443,17 @@ static void prpmc2800_fixups(void)
 	v[1] = bip->mem_size;
 	setprop(devp, "reg", v, sizeof(v));
 
-	/* Update /mv64x60/model, if this is a mv64362 */
+	/* Update model, if this is a mv64362 */
 	if (bip->bridge_type == BRIDGE_TYPE_MV64362) {
-		devp = finddevice("/mv64x60");
+		devp = find_node_by_compatible(NULL, "mrvl,mv64360");
 		if (devp == NULL)
-			fatal("Error: Missing /mv64x60 device tree node\n\r");
+			fatal("Error: Missing mrvl,mv64360"
+					" device tree node\n\r");
 		setprop(devp, "model", "mv64362", strlen("mv64362") + 1);
 	}
 
 	/* Set User FLASH size */
-	devp = finddevice("/mv64x60/flash@a0000000");
+	devp = find_node_by_compatible(NULL, "direct-mapped");
 	if (devp == NULL)
 		fatal("Error: Missing User FLASH device tree node\n\r");
 	rc = getprop(devp, "reg", v, sizeof(v));

  parent reply	other threads:[~2008-03-28 23:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 23:39 [PATCH 0/9] powerpc: mv64x60 and prpmc2800 DTS cleanups Dale Farnsworth
2008-03-28 23:42 ` [PATCH 1/9] [POWERPC] mv64x60: change FDT compatible prefix to mrvl Dale Farnsworth
2008-03-28 23:47   ` Grant Likely
2008-03-29  0:00     ` Dale Farnsworth
2008-03-29  0:12       ` Grant Likely
2008-03-30 23:44     ` David Gibson
2008-03-31 16:56       ` Dale Farnsworth
2008-04-01  1:53         ` David Gibson
2008-03-28 23:44 ` [PATCH 2/9] [POWERPC] prpmc2800: convert DTS to v1 and add labels Dale Farnsworth
2008-03-28 23:45 ` [PATCH 3/9] [POWERPC] prpmc2800: fix frequencies in prpmc2800.dts Dale Farnsworth
2008-03-28 23:47 ` [PATCH 4/9] [POWERPC] mv64x60: Fix FDT compatible names: mv64x60 => mv64360 Dale Farnsworth
2008-03-29 21:57   ` Olof Johansson
2008-03-30 19:20     ` Segher Boessenkool
2008-03-31 16:33     ` Dale Farnsworth
2008-03-28 23:48 ` Dale Farnsworth [this message]
2008-03-28 23:49 ` [PATCH 6/9] [POWERPC] prpmc2800: clean up dts properties Dale Farnsworth
2008-03-29 21:59   ` Olof Johansson
2008-03-30 10:11     ` David Gibson
2008-03-31 16:43       ` Dale Farnsworth
2008-04-01  1:17         ` Segher Boessenkool
2008-04-01  2:22         ` David Gibson
2008-03-28 23:50 ` [PATCH 7/9] [POWERPC] mv643xx_eth: prepare to support multiple silicon blocks Dale Farnsworth
2008-03-28 23:51 ` [PATCH 8/9] [POWERPC] Document the mv64x60 device tree bindings Dale Farnsworth
2008-03-28 23:52 ` [PATCH 9/9] [POWERPC] prpmc2800 needs a dtbImage Dale Farnsworth
2008-03-28 23:56   ` Grant Likely

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=20080328234800.GE30214@farnsworth.org \
    --to=dale@farnsworth$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=paulus@samba$(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