diff options
author | Dale Farnsworth <dale@farnsworth.org> | 2008-04-07 18:09:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-15 07:21:24 -0400 |
commit | a05ce88ab3e8a022ee17d89ecf86f6929c89c50e (patch) | |
tree | e7c84d274436248ef60ca14edf0a639c5fd2b079 /arch | |
parent | a1810b44c2d52392cd63e17fc208783cf6be6215 (diff) |
[POWERPC] mv64x60: Remove device tree absolute path references
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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/boot/mv64x60.c | 4 | ||||
-rw-r--r-- | arch/powerpc/boot/mv64x60_i2c.c | 2 | ||||
-rw-r--r-- | arch/powerpc/boot/prpmc2800.c | 23 |
3 files changed, 15 insertions, 14 deletions
diff --git a/arch/powerpc/boot/mv64x60.c b/arch/powerpc/boot/mv64x60.c index b43259455d4b..d9bb302b91d2 100644 --- a/arch/powerpc/boot/mv64x60.c +++ b/arch/powerpc/boot/mv64x60.c | |||
@@ -535,7 +535,7 @@ u8 *mv64x60_get_bridge_pbase(void) | |||
535 | u32 v[2]; | 535 | u32 v[2]; |
536 | void *devp; | 536 | void *devp; |
537 | 537 | ||
538 | devp = finddevice("/mv64x60"); | 538 | devp = find_node_by_compatible(NULL, "marvell,mv64360"); |
539 | if (devp == NULL) | 539 | if (devp == NULL) |
540 | goto err_out; | 540 | goto err_out; |
541 | if (getprop(devp, "reg", v, sizeof(v)) != sizeof(v)) | 541 | if (getprop(devp, "reg", v, sizeof(v)) != sizeof(v)) |
@@ -553,7 +553,7 @@ u8 *mv64x60_get_bridge_base(void) | |||
553 | u32 v; | 553 | u32 v; |
554 | void *devp; | 554 | void *devp; |
555 | 555 | ||
556 | devp = finddevice("/mv64x60"); | 556 | devp = find_node_by_compatible(NULL, "marvell,mv64360"); |
557 | if (devp == NULL) | 557 | if (devp == NULL) |
558 | goto err_out; | 558 | goto err_out; |
559 | if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v)) | 559 | 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 d085377be3bc..52a3212b6638 100644 --- a/arch/powerpc/boot/mv64x60_i2c.c +++ b/arch/powerpc/boot/mv64x60_i2c.c | |||
@@ -185,7 +185,7 @@ int mv64x60_i2c_open(void) | |||
185 | u32 v; | 185 | u32 v; |
186 | void *devp; | 186 | void *devp; |
187 | 187 | ||
188 | devp = finddevice("/mv64x60/i2c"); | 188 | devp = find_node_by_compatible(NULL, "marvell,mv64360-i2c"); |
189 | if (devp == NULL) | 189 | if (devp == NULL) |
190 | goto err_out; | 190 | goto err_out; |
191 | if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v)) | 191 | 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 05c3245b30d7..da31d6030482 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) | |||
344 | acc_bits); | 344 | acc_bits); |
345 | 345 | ||
346 | /* Get the cpu -> pci i/o & mem mappings from the device tree */ | 346 | /* Get the cpu -> pci i/o & mem mappings from the device tree */ |
347 | devp = finddevice("/mv64x60/pci@80000000"); | 347 | devp = find_node_by_compatible(NULL, "marvell,mv64360-pci"); |
348 | if (devp == NULL) | 348 | if (devp == NULL) |
349 | fatal("Error: Missing /mv64x60/pci@80000000" | 349 | fatal("Error: Missing marvell,mv64360-pci" |
350 | " device tree node\n\r"); | 350 | " device tree node\n\r"); |
351 | 351 | ||
352 | rc = getprop(devp, "ranges", v, sizeof(v)); | 352 | rc = getprop(devp, "ranges", v, sizeof(v)); |
353 | if (rc != sizeof(v)) | 353 | if (rc != sizeof(v)) |
354 | fatal("Error: Can't find /mv64x60/pci@80000000/ranges" | 354 | fatal("Error: Can't find marvell,mv64360-pci ranges" |
355 | " property\n\r"); | 355 | " property\n\r"); |
356 | 356 | ||
357 | /* Get the cpu -> pci i/o & mem mappings from the device tree */ | 357 | /* Get the cpu -> pci i/o & mem mappings from the device tree */ |
358 | devp = finddevice("/mv64x60"); | 358 | devp = find_node_by_compatible(NULL, "marvell,mv64360"); |
359 | if (devp == NULL) | 359 | if (devp == NULL) |
360 | fatal("Error: Missing /mv64x60 device tree node\n\r"); | 360 | fatal("Error: Missing marvell,mv64360 device tree node\n\r"); |
361 | 361 | ||
362 | enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE)); | 362 | enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE)); |
363 | enables |= 0x0007fe00; /* Disable all cpu->pci windows */ | 363 | enables |= 0x0007fe00; /* Disable all cpu->pci windows */ |
@@ -429,9 +429,9 @@ static void prpmc2800_fixups(void) | |||
429 | setprop(devp, "model", model, l); | 429 | setprop(devp, "model", model, l); |
430 | 430 | ||
431 | /* Set /cpus/PowerPC,7447/clock-frequency */ | 431 | /* Set /cpus/PowerPC,7447/clock-frequency */ |
432 | devp = finddevice("/cpus/PowerPC,7447"); | 432 | devp = find_node_by_prop_value_str(NULL, "device_type", "cpu"); |
433 | if (devp == NULL) | 433 | if (devp == NULL) |
434 | fatal("Error: Missing proper /cpus device tree node\n\r"); | 434 | fatal("Error: Missing proper cpu device tree node\n\r"); |
435 | v[0] = bip->core_speed; | 435 | v[0] = bip->core_speed; |
436 | setprop(devp, "clock-frequency", &v[0], sizeof(v[0])); | 436 | setprop(devp, "clock-frequency", &v[0], sizeof(v[0])); |
437 | 437 | ||
@@ -443,16 +443,17 @@ static void prpmc2800_fixups(void) | |||
443 | v[1] = bip->mem_size; | 443 | v[1] = bip->mem_size; |
444 | setprop(devp, "reg", v, sizeof(v)); | 444 | setprop(devp, "reg", v, sizeof(v)); |
445 | 445 | ||
446 | /* Update /mv64x60/model, if this is a mv64362 */ | 446 | /* Update model, if this is a mv64362 */ |
447 | if (bip->bridge_type == BRIDGE_TYPE_MV64362) { | 447 | if (bip->bridge_type == BRIDGE_TYPE_MV64362) { |
448 | devp = finddevice("/mv64x60"); | 448 | devp = find_node_by_compatible(NULL, "marvell,mv64360"); |
449 | if (devp == NULL) | 449 | if (devp == NULL) |
450 | fatal("Error: Missing /mv64x60 device tree node\n\r"); | 450 | fatal("Error: Missing marvell,mv64360" |
451 | " device tree node\n\r"); | ||
451 | setprop(devp, "model", "mv64362", strlen("mv64362") + 1); | 452 | setprop(devp, "model", "mv64362", strlen("mv64362") + 1); |
452 | } | 453 | } |
453 | 454 | ||
454 | /* Set User FLASH size */ | 455 | /* Set User FLASH size */ |
455 | devp = finddevice("/mv64x60/flash@a0000000"); | 456 | devp = find_node_by_compatible(NULL, "direct-mapped"); |
456 | if (devp == NULL) | 457 | if (devp == NULL) |
457 | fatal("Error: Missing User FLASH device tree node\n\r"); | 458 | fatal("Error: Missing User FLASH device tree node\n\r"); |
458 | rc = getprop(devp, "reg", v, sizeof(v)); | 459 | rc = getprop(devp, "reg", v, sizeof(v)); |