pci.c 15.5 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10
/*
 * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org),
 *		      IBM Corp.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

11
#undef DEBUG
L
Linus Torvalds 已提交
12 13 14 15 16 17 18

#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/bootmem.h>
19
#include <linux/irq.h>
L
Linus Torvalds 已提交
20 21 22 23 24 25 26

#include <asm/sections.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/pci-bridge.h>
#include <asm/machdep.h>
#include <asm/iommu.h>
27
#include <asm/ppc-pci.h>
L
Linus Torvalds 已提交
28

29 30
#include "maple.h"

L
Linus Torvalds 已提交
31 32 33 34 35 36
#ifdef DEBUG
#define DBG(x...) printk(x)
#else
#define DBG(x...)
#endif

37
static struct pci_controller *u3_agp, *u3_ht, *u4_pcie;
L
Linus Torvalds 已提交
38 39 40 41

static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
{
	for (; node != 0;node = node->sibling) {
42 43
		const int *bus_range;
		const unsigned int *class_code;
L
Linus Torvalds 已提交
44 45 46
		int len;

		/* For PCI<->PCI bridges or CardBus bridges, we go down */
47
		class_code = of_get_property(node, "class-code", NULL);
L
Linus Torvalds 已提交
48 49 50
		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
			continue;
51
		bus_range = of_get_property(node, "bus-range", &len);
L
Linus Torvalds 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
		if (bus_range != NULL && len > 2 * sizeof(int)) {
			if (bus_range[1] > higher)
				higher = bus_range[1];
		}
		higher = fixup_one_level_bus_range(node->child, higher);
	}
	return higher;
}

/* This routine fixes the "bus-range" property of all bridges in the
 * system since they tend to have their "last" member wrong on macs
 *
 * Note that the bus numbers manipulated here are OF bus numbers, they
 * are not Linux bus numbers.
 */
static void __init fixup_bus_range(struct device_node *bridge)
{
69 70
	int *bus_range;
	struct property *prop;
L
Linus Torvalds 已提交
71 72 73
	int len;

	/* Lookup the "bus-range" property for the hose */
74 75
	prop = of_find_property(bridge, "bus-range", &len);
	if (prop == NULL  || prop->value == NULL || len < 2 * sizeof(int)) {
L
Linus Torvalds 已提交
76 77 78 79
		printk(KERN_WARNING "Can't get bus-range for %s\n",
			       bridge->full_name);
		return;
	}
80
	bus_range = prop->value;
L
Linus Torvalds 已提交
81 82 83 84
	bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
}


85 86 87 88 89 90
static unsigned long u3_agp_cfa0(u8 devfn, u8 off)
{
	return (1 << (unsigned long)PCI_SLOT(devfn)) |
		((unsigned long)PCI_FUNC(devfn) << 8) |
		((unsigned long)off & 0xFCUL);
}
L
Linus Torvalds 已提交
91

92 93 94 95 96 97 98
static unsigned long u3_agp_cfa1(u8 bus, u8 devfn, u8 off)
{
	return ((unsigned long)bus << 16) |
		((unsigned long)devfn << 8) |
		((unsigned long)off & 0xFCUL) |
		1UL;
}
L
Linus Torvalds 已提交
99

A
Al Viro 已提交
100
static volatile void __iomem *u3_agp_cfg_access(struct pci_controller* hose,
L
Linus Torvalds 已提交
101 102 103 104 105 106
				       u8 bus, u8 dev_fn, u8 offset)
{
	unsigned int caddr;

	if (bus == hose->first_busno) {
		if (dev_fn < (11 << 3))
A
Al Viro 已提交
107
			return NULL;
108
		caddr = u3_agp_cfa0(dev_fn, offset);
L
Linus Torvalds 已提交
109
	} else
110
		caddr = u3_agp_cfa1(bus, dev_fn, offset);
L
Linus Torvalds 已提交
111 112 113 114 115 116 117

	/* Uninorth will return garbage if we don't read back the value ! */
	do {
		out_le32(hose->cfg_addr, caddr);
	} while (in_le32(hose->cfg_addr) != caddr);

	offset &= 0x07;
A
Al Viro 已提交
118
	return hose->cfg_data + offset;
L
Linus Torvalds 已提交
119 120 121 122 123 124
}

static int u3_agp_read_config(struct pci_bus *bus, unsigned int devfn,
			      int offset, int len, u32 *val)
{
	struct pci_controller *hose;
A
Al Viro 已提交
125
	volatile void __iomem *addr;
L
Linus Torvalds 已提交
126 127 128 129 130 131 132 133 134 135 136 137 138 139

	hose = pci_bus_to_host(bus);
	if (hose == NULL)
		return PCIBIOS_DEVICE_NOT_FOUND;

	addr = u3_agp_cfg_access(hose, bus->number, devfn, offset);
	if (!addr)
		return PCIBIOS_DEVICE_NOT_FOUND;
	/*
	 * Note: the caller has already checked that offset is
	 * suitably aligned and that len is 1, 2 or 4.
	 */
	switch (len) {
	case 1:
A
Al Viro 已提交
140
		*val = in_8(addr);
L
Linus Torvalds 已提交
141 142
		break;
	case 2:
A
Al Viro 已提交
143
		*val = in_le16(addr);
L
Linus Torvalds 已提交
144 145
		break;
	default:
A
Al Viro 已提交
146
		*val = in_le32(addr);
L
Linus Torvalds 已提交
147 148 149 150 151 152 153 154 155
		break;
	}
	return PCIBIOS_SUCCESSFUL;
}

static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn,
			       int offset, int len, u32 val)
{
	struct pci_controller *hose;
A
Al Viro 已提交
156
	volatile void __iomem *addr;
L
Linus Torvalds 已提交
157 158 159 160 161 162 163 164 165 166 167 168 169 170

	hose = pci_bus_to_host(bus);
	if (hose == NULL)
		return PCIBIOS_DEVICE_NOT_FOUND;

	addr = u3_agp_cfg_access(hose, bus->number, devfn, offset);
	if (!addr)
		return PCIBIOS_DEVICE_NOT_FOUND;
	/*
	 * Note: the caller has already checked that offset is
	 * suitably aligned and that len is 1, 2 or 4.
	 */
	switch (len) {
	case 1:
A
Al Viro 已提交
171
		out_8(addr, val);
L
Linus Torvalds 已提交
172 173
		break;
	case 2:
A
Al Viro 已提交
174
		out_le16(addr, val);
L
Linus Torvalds 已提交
175 176
		break;
	default:
A
Al Viro 已提交
177
		out_le32(addr, val);
L
Linus Torvalds 已提交
178 179 180 181 182 183 184
		break;
	}
	return PCIBIOS_SUCCESSFUL;
}

static struct pci_ops u3_agp_pci_ops =
{
185 186
	.read = u3_agp_read_config,
	.write = u3_agp_write_config,
L
Linus Torvalds 已提交
187 188
};

189 190 191 192
static unsigned long u3_ht_cfa0(u8 devfn, u8 off)
{
	return (devfn << 8) | off;
}
L
Linus Torvalds 已提交
193

194 195 196 197
static unsigned long u3_ht_cfa1(u8 bus, u8 devfn, u8 off)
{
	return u3_ht_cfa0(devfn, off) + (bus << 16) + 0x01000000UL;
}
L
Linus Torvalds 已提交
198

A
Al Viro 已提交
199
static volatile void __iomem *u3_ht_cfg_access(struct pci_controller* hose,
L
Linus Torvalds 已提交
200 201 202 203
				      u8 bus, u8 devfn, u8 offset)
{
	if (bus == hose->first_busno) {
		if (PCI_SLOT(devfn) == 0)
A
Al Viro 已提交
204 205
			return NULL;
		return hose->cfg_data + u3_ht_cfa0(devfn, offset);
L
Linus Torvalds 已提交
206
	} else
A
Al Viro 已提交
207
		return hose->cfg_data + u3_ht_cfa1(bus, devfn, offset);
L
Linus Torvalds 已提交
208 209 210 211 212 213
}

static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
			     int offset, int len, u32 *val)
{
	struct pci_controller *hose;
A
Al Viro 已提交
214
	volatile void __iomem *addr;
L
Linus Torvalds 已提交
215 216 217 218 219

	hose = pci_bus_to_host(bus);
	if (hose == NULL)
		return PCIBIOS_DEVICE_NOT_FOUND;

220 221 222
	if (offset > 0xff)
		return PCIBIOS_BAD_REGISTER_NUMBER;

L
Linus Torvalds 已提交
223 224 225 226 227 228 229 230 231 232
	addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
	if (!addr)
		return PCIBIOS_DEVICE_NOT_FOUND;

	/*
	 * Note: the caller has already checked that offset is
	 * suitably aligned and that len is 1, 2 or 4.
	 */
	switch (len) {
	case 1:
A
Al Viro 已提交
233
		*val = in_8(addr);
L
Linus Torvalds 已提交
234 235
		break;
	case 2:
A
Al Viro 已提交
236
		*val = in_le16(addr);
L
Linus Torvalds 已提交
237 238
		break;
	default:
A
Al Viro 已提交
239
		*val = in_le32(addr);
L
Linus Torvalds 已提交
240 241 242 243 244 245 246 247 248
		break;
	}
	return PCIBIOS_SUCCESSFUL;
}

static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
			      int offset, int len, u32 val)
{
	struct pci_controller *hose;
A
Al Viro 已提交
249
	volatile void __iomem *addr;
L
Linus Torvalds 已提交
250 251 252 253 254

	hose = pci_bus_to_host(bus);
	if (hose == NULL)
		return PCIBIOS_DEVICE_NOT_FOUND;

255 256 257
	if (offset > 0xff)
		return PCIBIOS_BAD_REGISTER_NUMBER;

L
Linus Torvalds 已提交
258 259 260 261 262 263 264 265 266
	addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
	if (!addr)
		return PCIBIOS_DEVICE_NOT_FOUND;
	/*
	 * Note: the caller has already checked that offset is
	 * suitably aligned and that len is 1, 2 or 4.
	 */
	switch (len) {
	case 1:
A
Al Viro 已提交
267
		out_8(addr, val);
L
Linus Torvalds 已提交
268 269
		break;
	case 2:
A
Al Viro 已提交
270
		out_le16(addr, val);
L
Linus Torvalds 已提交
271 272
		break;
	default:
A
Al Viro 已提交
273
		out_le32(addr, val);
L
Linus Torvalds 已提交
274 275 276 277 278 279 280
		break;
	}
	return PCIBIOS_SUCCESSFUL;
}

static struct pci_ops u3_ht_pci_ops =
{
281 282
	.read = u3_ht_read_config,
	.write = u3_ht_write_config,
L
Linus Torvalds 已提交
283 284
};

285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off)
{
	return (1 << PCI_SLOT(devfn))	|
	       (PCI_FUNC(devfn) << 8)	|
	       ((off >> 8) << 28) 	|
	       (off & 0xfcu);
}

static unsigned int u4_pcie_cfa1(unsigned int bus, unsigned int devfn,
				 unsigned int off)
{
        return (bus << 16)		|
	       (devfn << 8)		|
	       ((off >> 8) << 28)	|
	       (off & 0xfcu)		| 1u;
}

static volatile void __iomem *u4_pcie_cfg_access(struct pci_controller* hose,
                                        u8 bus, u8 dev_fn, int offset)
{
        unsigned int caddr;

        if (bus == hose->first_busno)
                caddr = u4_pcie_cfa0(dev_fn, offset);
        else
                caddr = u4_pcie_cfa1(bus, dev_fn, offset);

        /* Uninorth will return garbage if we don't read back the value ! */
        do {
                out_le32(hose->cfg_addr, caddr);
        } while (in_le32(hose->cfg_addr) != caddr);

        offset &= 0x03;
        return hose->cfg_data + offset;
}

static int u4_pcie_read_config(struct pci_bus *bus, unsigned int devfn,
                               int offset, int len, u32 *val)
{
        struct pci_controller *hose;
        volatile void __iomem *addr;

        hose = pci_bus_to_host(bus);
        if (hose == NULL)
                return PCIBIOS_DEVICE_NOT_FOUND;
        if (offset >= 0x1000)
                return  PCIBIOS_BAD_REGISTER_NUMBER;
        addr = u4_pcie_cfg_access(hose, bus->number, devfn, offset);
        if (!addr)
                return PCIBIOS_DEVICE_NOT_FOUND;
        /*
         * Note: the caller has already checked that offset is
         * suitably aligned and that len is 1, 2 or 4.
         */
        switch (len) {
        case 1:
                *val = in_8(addr);
                break;
        case 2:
                *val = in_le16(addr);
                break;
        default:
                *val = in_le32(addr);
                break;
        }
        return PCIBIOS_SUCCESSFUL;
}
static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
                                int offset, int len, u32 val)
{
        struct pci_controller *hose;
        volatile void __iomem *addr;

        hose = pci_bus_to_host(bus);
        if (hose == NULL)
                return PCIBIOS_DEVICE_NOT_FOUND;
        if (offset >= 0x1000)
                return  PCIBIOS_BAD_REGISTER_NUMBER;
        addr = u4_pcie_cfg_access(hose, bus->number, devfn, offset);
        if (!addr)
                return PCIBIOS_DEVICE_NOT_FOUND;
        /*
         * Note: the caller has already checked that offset is
         * suitably aligned and that len is 1, 2 or 4.
         */
        switch (len) {
        case 1:
                out_8(addr, val);
                break;
        case 2:
                out_le16(addr, val);
                break;
        default:
                out_le32(addr, val);
                break;
        }
        return PCIBIOS_SUCCESSFUL;
}

static struct pci_ops u4_pcie_pci_ops =
{
386 387
	.read = u4_pcie_read_config,
	.write = u4_pcie_write_config,
388 389
};

L
Linus Torvalds 已提交
390 391 392 393
static void __init setup_u3_agp(struct pci_controller* hose)
{
	/* On G5, we move AGP up to high bus number so we don't need
	 * to reassign bus numbers for HT. If we ever have P2P bridges
394
	 * on AGP, we'll have to move pci_assign_all_buses to the
L
Linus Torvalds 已提交
395 396 397 398 399 400
	 * pci_controller structure so we enable it for AGP and not for
	 * HT childs.
	 * We hard code the address because of the different size of
	 * the reg address cell, we shall fix that by killing struct
	 * reg_property and using some accessor functions instead
	 */
A
Anton Blanchard 已提交
401
	hose->first_busno = 0xf0;
L
Linus Torvalds 已提交
402 403 404 405 406 407 408 409
	hose->last_busno = 0xff;
	hose->ops = &u3_agp_pci_ops;
	hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000);
	hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000);

	u3_agp = hose;
}

410 411 412 413 414 415 416 417 418 419 420 421
static void __init setup_u4_pcie(struct pci_controller* hose)
{
        /* We currently only implement the "non-atomic" config space, to
         * be optimised later.
         */
        hose->ops = &u4_pcie_pci_ops;
        hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000);
        hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000);

        u4_pcie = hose;
}

L
Linus Torvalds 已提交
422 423 424 425 426 427 428 429
static void __init setup_u3_ht(struct pci_controller* hose)
{
	hose->ops = &u3_ht_pci_ops;

	/* We hard code the address because of the different size of
	 * the reg address cell, we shall fix that by killing struct
	 * reg_property and using some accessor functions instead
	 */
A
Al Viro 已提交
430
	hose->cfg_data = ioremap(0xf2000000, 0x02000000);
L
Linus Torvalds 已提交
431 432 433 434 435 436 437

	hose->first_busno = 0;
	hose->last_busno = 0xef;

	u3_ht = hose;
}

438
static int __init maple_add_bridge(struct device_node *dev)
L
Linus Torvalds 已提交
439 440 441 442
{
	int len;
	struct pci_controller *hose;
	char* disp_name;
443
	const int *bus_range;
L
Linus Torvalds 已提交
444 445 446 447
	int primary = 1;

	DBG("Adding PCI host bridge %s\n", dev->full_name);

448
	bus_range = of_get_property(dev, "bus-range", &len);
A
Anton Blanchard 已提交
449 450 451 452
	if (bus_range == NULL || len < 2 * sizeof(int)) {
		printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0\n",
		dev->full_name);
	}
L
Linus Torvalds 已提交
453

454
	hose = pcibios_alloc_controller(dev);
L
Linus Torvalds 已提交
455 456
	if (hose == NULL)
		return -ENOMEM;
A
Anton Blanchard 已提交
457 458
	hose->first_busno = bus_range ? bus_range[0] : 0;
	hose->last_busno = bus_range ? bus_range[1] : 0xff;
L
Linus Torvalds 已提交
459 460

	disp_name = NULL;
461
	if (of_device_is_compatible(dev, "u3-agp")) {
A
Anton Blanchard 已提交
462 463 464
		setup_u3_agp(hose);
		disp_name = "U3-AGP";
		primary = 0;
465
	} else if (of_device_is_compatible(dev, "u3-ht")) {
A
Anton Blanchard 已提交
466 467 468
		setup_u3_ht(hose);
		disp_name = "U3-HT";
		primary = 1;
469
        } else if (of_device_is_compatible(dev, "u4-pcie")) {
470 471 472
                setup_u4_pcie(hose);
                disp_name = "U4-PCIE";
                primary = 0;
A
Anton Blanchard 已提交
473 474 475 476 477 478
	}
	printk(KERN_INFO "Found %s PCI host bridge. Firmware bus number: %d->%d\n",
		disp_name, hose->first_busno, hose->last_busno);

	/* Interpret the "ranges" property */
	/* This also maps the I/O region and sets isa_io/mem_base */
479
	pci_process_bridge_OF_ranges(hose, dev, primary);
L
Linus Torvalds 已提交
480

A
Anton Blanchard 已提交
481 482
	/* Fixup "bus-range" OF property */
	fixup_bus_range(dev);
L
Linus Torvalds 已提交
483

484 485 486
	/* Check for legacy IOs */
	isa_bridge_find_early(hose);

L
Linus Torvalds 已提交
487 488 489 490
	return 0;
}


491
void __devinit maple_pci_irq_fixup(struct pci_dev *dev)
L
Linus Torvalds 已提交
492
{
493 494 495 496 497 498 499 500 501 502
	DBG(" -> maple_pci_irq_fixup\n");

	/* Fixup IRQ for PCIe host */
	if (u4_pcie != NULL && dev->bus->number == 0 &&
	    pci_bus_to_host(dev->bus) == u4_pcie) {
		printk(KERN_DEBUG "Fixup U4 PCIe IRQ\n");
		dev->irq = irq_create_mapping(NULL, 1);
		if (dev->irq != NO_IRQ)
			set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
	}
503

504 505 506 507 508 509 510
	/* Hide AMD8111 IDE interrupt when in legacy mode so
	 * the driver calls pci_get_legacy_ide_irq()
	 */
	if (dev->vendor == PCI_VENDOR_ID_AMD &&
	    dev->device == PCI_DEVICE_ID_AMD_8111_IDE &&
	    (dev->class & 5) != 5) {
		dev->irq = NO_IRQ;
511
	}
L
Linus Torvalds 已提交
512

513
	DBG(" <- maple_pci_irq_fixup\n");
L
Linus Torvalds 已提交
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
}

void __init maple_pci_init(void)
{
	struct device_node *np, *root;
	struct device_node *ht = NULL;

	/* Probe root PCI hosts, that is on U3 the AGP host and the
	 * HyperTransport host. That one is actually "kept" around
	 * and actually added last as it's resource management relies
	 * on the AGP resources to have been setup first
	 */
	root = of_find_node_by_path("/");
	if (root == NULL) {
		printk(KERN_CRIT "maple_find_bridges: can't find root of device tree\n");
		return;
	}
	for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
532
		if (!np->type)
L
Linus Torvalds 已提交
533
			continue;
534 535
		if (strcmp(np->type, "pci") && strcmp(np->type, "ht"))
			continue;
536 537
		if ((of_device_is_compatible(np, "u4-pcie") ||
		     of_device_is_compatible(np, "u3-agp")) &&
538
		    maple_add_bridge(np) == 0)
539 540
			of_node_get(np);

541
		if (of_device_is_compatible(np, "u3-ht")) {
L
Linus Torvalds 已提交
542 543 544 545 546 547 548 549
			of_node_get(np);
			ht = np;
		}
	}
	of_node_put(root);

	/* Now setup the HyperTransport host if we found any
	 */
550
	if (ht && maple_add_bridge(ht) != 0)
L
Linus Torvalds 已提交
551 552 553 554 555 556 557 558 559 560
		of_node_put(ht);

	/* Setup the linkage between OF nodes and PHBs */ 
	pci_devs_phb_init();

	/* Fixup the PCI<->OF mapping for U3 AGP due to bus renumbering. We
	 * assume there is no P2P bridge on the AGP bus, which should be a
	 * safe assumptions hopefully.
	 */
	if (u3_agp) {
561
		struct device_node *np = u3_agp->dn;
562
		PCI_DN(np)->busno = 0xf0;
L
Linus Torvalds 已提交
563
		for (np = np->child; np; np = np->sibling)
564
			PCI_DN(np)->busno = 0xf0;
L
Linus Torvalds 已提交
565 566
	}

567 568
	/* Tell pci.c to not change any resource allocations.  */
	pci_probe_only = 1;
L
Linus Torvalds 已提交
569 570 571 572 573
}

int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
{
	struct device_node *np;
574 575
	unsigned int defirq = channel ? 15 : 14;
	unsigned int irq;
L
Linus Torvalds 已提交
576 577 578

	if (pdev->vendor != PCI_VENDOR_ID_AMD ||
	    pdev->device != PCI_DEVICE_ID_AMD_8111_IDE)
579
		return defirq;
L
Linus Torvalds 已提交
580 581

	np = pci_device_to_OF_node(pdev);
582 583 584
	if (np == NULL) {
		printk("Failed to locate OF node for IDE %s\n",
		       pci_name(pdev));
585
		return defirq;
586
	}
587 588 589 590 591 592 593
	irq = irq_of_parse_and_map(np, channel & 0x1);
	if (irq == NO_IRQ) {
		printk("Failed to map onboard IDE interrupt for channel %d\n",
		       channel);
		return defirq;
	}
	return irq;
L
Linus Torvalds 已提交
594
}
595 596 597 598 599 600 601 602 603 604 605 606 607 608

static void __devinit quirk_ipr_msi(struct pci_dev *dev)
{
	/* Something prevents MSIs from the IPR from working on Bimini,
	 * and the driver has no smarts to recover. So disable MSI
	 * on it for now. */

	if (machine_is(maple)) {
		dev->no_msi = 1;
		dev_info(&dev->dev, "Quirk disabled MSI\n");
	}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
			quirk_ipr_msi);