aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/macio_asic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/macio_asic.c')
-rw-r--r--drivers/macintosh/macio_asic.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 0137ff239f13..2a545ceb523b 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -256,42 +256,42 @@ static int macio_resource_quirks(struct device_node *np, struct resource *res,
256{ 256{
257 if (res->flags & IORESOURCE_MEM) { 257 if (res->flags & IORESOURCE_MEM) {
258 /* Grand Central has too large resource 0 on some machines */ 258 /* Grand Central has too large resource 0 on some machines */
259 if (index == 0 && !strcmp(np->name, "gc")) { 259 if (index == 0 && !strcmp(np->name, "gc"))
260 np->addrs[0].size = 0x20000;
261 res->end = res->start + 0x1ffff; 260 res->end = res->start + 0x1ffff;
262 } 261
263 /* Airport has bogus resource 2 */ 262 /* Airport has bogus resource 2 */
264 if (index >= 2 && !strcmp(np->name, "radio")) 263 if (index >= 2 && !strcmp(np->name, "radio"))
265 return 1; 264 return 1;
265
266#ifndef CONFIG_PPC64
266 /* DBDMAs may have bogus sizes */ 267 /* DBDMAs may have bogus sizes */
267 if ((res->start & 0x0001f000) == 0x00008000) { 268 if ((res->start & 0x0001f000) == 0x00008000)
268 np->addrs[index].size = 0x100;
269 res->end = res->start + 0xff; 269 res->end = res->start + 0xff;
270 } 270#endif /* CONFIG_PPC64 */
271
271 /* ESCC parent eats child resources. We could have added a 272 /* ESCC parent eats child resources. We could have added a
272 * level of hierarchy, but I don't really feel the need 273 * level of hierarchy, but I don't really feel the need
273 * for it 274 * for it
274 */ 275 */
275 if (!strcmp(np->name, "escc")) 276 if (!strcmp(np->name, "escc"))
276 return 1; 277 return 1;
278
277 /* ESCC has bogus resources >= 3 */ 279 /* ESCC has bogus resources >= 3 */
278 if (index >= 3 && !(strcmp(np->name, "ch-a") && 280 if (index >= 3 && !(strcmp(np->name, "ch-a") &&
279 strcmp(np->name, "ch-b"))) 281 strcmp(np->name, "ch-b")))
280 return 1; 282 return 1;
283
281 /* Media bay has too many resources, keep only first one */ 284 /* Media bay has too many resources, keep only first one */
282 if (index > 0 && !strcmp(np->name, "media-bay")) 285 if (index > 0 && !strcmp(np->name, "media-bay"))
283 return 1; 286 return 1;
287
284 /* Some older IDE resources have bogus sizes */ 288 /* Some older IDE resources have bogus sizes */
285 if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") && 289 if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") &&
286 strcmp(np->type, "ide") && strcmp(np->type, "ata"))) { 290 strcmp(np->type, "ide") && strcmp(np->type, "ata"))) {
287 if (index == 0 && np->addrs[0].size > 0x1000) { 291 if (index == 0 && (res->end - res->start) > 0xfff)
288 np->addrs[0].size = 0x1000;
289 res->end = res->start + 0xfff; 292 res->end = res->start + 0xfff;
290 } 293 if (index == 1 && (res->end - res->start) > 0xff)
291 if (index == 1 && np->addrs[1].size > 0x100) {
292 np->addrs[1].size = 0x100;
293 res->end = res->start + 0xff; 294 res->end = res->start + 0xff;
294 }
295 } 295 }
296 } 296 }
297 return 0; 297 return 0;
@@ -349,7 +349,7 @@ static void macio_setup_resources(struct macio_dev *dev,
349 /* Currently, we consider failure as harmless, this may 349 /* Currently, we consider failure as harmless, this may
350 * change in the future, once I've found all the device 350 * change in the future, once I've found all the device
351 * tree bugs in older machines & worked around them 351 * tree bugs in older machines & worked around them
352l */ 352 */
353 if (insert_resource(parent_res, res)) { 353 if (insert_resource(parent_res, res)) {
354 printk(KERN_WARNING "Can't request resource " 354 printk(KERN_WARNING "Can't request resource "
355 "%d for MacIO device %s\n", 355 "%d for MacIO device %s\n",