aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-30 00:57:28 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:51:26 -0500
commitd2dd482bc17c3bc240045f80a7c4b4d5cea5e29c (patch)
tree9c40a9ab9a04839f2d578f9d47985b399074ce58 /drivers/macintosh
parentbb6b9b28d6847bc71f910e2e82c9040ff4b97ec0 (diff)
[PATCH] powerpc: Update OF address parsers
This updates the OF address parsers to return the IO flags indicating the type of address obtained. It also adds a PCI call for converting physical addresses that hit IO space into into IO tokens, and add routines that return the translated addresses into struct resource Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/macio_asic.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index f14c744a94ef..0137ff239f13 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -332,18 +332,14 @@ static void macio_setup_resources(struct macio_dev *dev,
332 struct resource *parent_res) 332 struct resource *parent_res)
333{ 333{
334 struct device_node *np = dev->ofdev.node; 334 struct device_node *np = dev->ofdev.node;
335 u32 *addr; 335 struct resource r;
336 u64 size;
337 int index; 336 int index;
338 337
339 for (index = 0; (addr = of_get_address(np, index, &size)) != NULL; 338 for (index = 0; of_address_to_resource(np, index, &r) == 0; index++) {
340 index++) {
341 struct resource *res = &dev->resource[index]; 339 struct resource *res = &dev->resource[index];
342 if (index >= MACIO_DEV_COUNT_RESOURCES) 340 if (index >= MACIO_DEV_COUNT_RESOURCES)
343 break; 341 break;
344 res->start = of_translate_address(np, addr); 342 *res = r;
345 res->end = res->start + (unsigned long)size - 1;
346 res->flags = IORESOURCE_MEM;
347 res->name = dev->ofdev.dev.bus_id; 343 res->name = dev->ofdev.dev.bus_id;
348 344
349 if (macio_resource_quirks(np, res, index)) { 345 if (macio_resource_quirks(np, res, index)) {
@@ -353,7 +349,7 @@ static void macio_setup_resources(struct macio_dev *dev,
353 /* Currently, we consider failure as harmless, this may 349 /* Currently, we consider failure as harmless, this may
354 * change in the future, once I've found all the device 350 * change in the future, once I've found all the device
355 * tree bugs in older machines & worked around them 351 * tree bugs in older machines & worked around them
356 */ 352l */
357 if (insert_resource(parent_res, res)) { 353 if (insert_resource(parent_res, res)) {
358 printk(KERN_WARNING "Can't request resource " 354 printk(KERN_WARNING "Can't request resource "
359 "%d for MacIO device %s\n", 355 "%d for MacIO device %s\n",