2 * Sonics Silicon Backplane
3 * Broadcom PCI-core driver
5 * Copyright 2005, Broadcom Corporation
6 * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de>
8 * Licensed under the GNU/GPL. See COPYING for details.
11 #include <linux/ssb/ssb.h>
12 #include <linux/pci.h>
13 #include <linux/delay.h>
14 #include <linux/ssb/ssb_embedded.h>
16 #include "ssb_private.h"
18 static u32
ssb_pcie_read(struct ssb_pcicore
*pc
, u32 address
);
19 static void ssb_pcie_write(struct ssb_pcicore
*pc
, u32 address
, u32 data
);
20 static u16
ssb_pcie_mdio_read(struct ssb_pcicore
*pc
, u8 device
, u8 address
);
21 static void ssb_pcie_mdio_write(struct ssb_pcicore
*pc
, u8 device
,
22 u8 address
, u16 data
);
24 static void ssb_commit_settings(struct ssb_bus
*bus
);
27 u32
pcicore_read32(struct ssb_pcicore
*pc
, u16 offset
)
29 return ssb_read32(pc
->dev
, offset
);
33 void pcicore_write32(struct ssb_pcicore
*pc
, u16 offset
, u32 value
)
35 ssb_write32(pc
->dev
, offset
, value
);
39 u16
pcicore_read16(struct ssb_pcicore
*pc
, u16 offset
)
41 return ssb_read16(pc
->dev
, offset
);
45 void pcicore_write16(struct ssb_pcicore
*pc
, u16 offset
, u16 value
)
47 ssb_write16(pc
->dev
, offset
, value
);
50 /**************************************************
51 * Code for hostmode operation.
52 **************************************************/
54 #ifdef CONFIG_SSB_PCICORE_HOSTMODE
56 #include <asm/paccess.h>
57 /* Probe a 32bit value on the bus and catch bus exceptions.
58 * Returns nonzero on a bus exception.
59 * This is MIPS specific */
60 #define mips_busprobe32(val, addr) get_dbe((val), ((u32 *)(addr)))
62 /* Assume one-hot slot wiring */
63 #define SSB_PCI_SLOT_MAX 16
65 /* Global lock is OK, as we won't have more than one extpci anyway. */
66 static DEFINE_SPINLOCK(cfgspace_lock
);
67 /* Core to access the external PCI config space. Can only have one. */
68 static struct ssb_pcicore
*extpci_core
;
71 static u32
get_cfgspace_addr(struct ssb_pcicore
*pc
,
72 unsigned int bus
, unsigned int dev
,
73 unsigned int func
, unsigned int off
)
78 /* We do only have one cardbus device behind the bridge. */
79 if (pc
->cardbusmode
&& (dev
>= 1))
83 /* Type 0 transaction */
84 if (unlikely(dev
>= SSB_PCI_SLOT_MAX
))
86 /* Slide the window */
87 tmp
= SSB_PCICORE_SBTOPCI_CFG0
;
88 tmp
|= ((1 << (dev
+ 16)) & SSB_PCICORE_SBTOPCI1_MASK
);
89 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI1
, tmp
);
90 /* Calculate the address */
92 addr
|= ((1 << (dev
+ 16)) & ~SSB_PCICORE_SBTOPCI1_MASK
);
96 /* Type 1 transaction */
97 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI1
,
98 SSB_PCICORE_SBTOPCI_CFG1
);
99 /* Calculate the address */
110 static int ssb_extpci_read_config(struct ssb_pcicore
*pc
,
111 unsigned int bus
, unsigned int dev
,
112 unsigned int func
, unsigned int off
,
119 SSB_WARN_ON(!pc
->hostmode
);
120 if (unlikely(len
!= 1 && len
!= 2 && len
!= 4))
122 addr
= get_cfgspace_addr(pc
, bus
, dev
, func
, off
);
126 mmio
= ioremap_nocache(addr
, len
);
130 if (mips_busprobe32(val
, mmio
)) {
136 val
>>= (8 * (off
& 3));
140 *((u8
*)buf
) = (u8
)val
;
143 *((u16
*)buf
) = (u16
)val
;
146 *((u32
*)buf
) = (u32
)val
;
156 static int ssb_extpci_write_config(struct ssb_pcicore
*pc
,
157 unsigned int bus
, unsigned int dev
,
158 unsigned int func
, unsigned int off
,
159 const void *buf
, int len
)
165 SSB_WARN_ON(!pc
->hostmode
);
166 if (unlikely(len
!= 1 && len
!= 2 && len
!= 4))
168 addr
= get_cfgspace_addr(pc
, bus
, dev
, func
, off
);
172 mmio
= ioremap_nocache(addr
, len
);
176 if (mips_busprobe32(val
, mmio
)) {
184 val
&= ~(0xFF << (8 * (off
& 3)));
185 val
|= *((const u8
*)buf
) << (8 * (off
& 3));
189 val
&= ~(0xFFFF << (8 * (off
& 3)));
190 val
|= *((const u16
*)buf
) << (8 * (off
& 3));
193 val
= *((const u32
*)buf
);
205 static int ssb_pcicore_read_config(struct pci_bus
*bus
, unsigned int devfn
,
206 int reg
, int size
, u32
*val
)
211 spin_lock_irqsave(&cfgspace_lock
, flags
);
212 err
= ssb_extpci_read_config(extpci_core
, bus
->number
, PCI_SLOT(devfn
),
213 PCI_FUNC(devfn
), reg
, val
, size
);
214 spin_unlock_irqrestore(&cfgspace_lock
, flags
);
216 return err
? PCIBIOS_DEVICE_NOT_FOUND
: PCIBIOS_SUCCESSFUL
;
219 static int ssb_pcicore_write_config(struct pci_bus
*bus
, unsigned int devfn
,
220 int reg
, int size
, u32 val
)
225 spin_lock_irqsave(&cfgspace_lock
, flags
);
226 err
= ssb_extpci_write_config(extpci_core
, bus
->number
, PCI_SLOT(devfn
),
227 PCI_FUNC(devfn
), reg
, &val
, size
);
228 spin_unlock_irqrestore(&cfgspace_lock
, flags
);
230 return err
? PCIBIOS_DEVICE_NOT_FOUND
: PCIBIOS_SUCCESSFUL
;
233 static struct pci_ops ssb_pcicore_pciops
= {
234 .read
= ssb_pcicore_read_config
,
235 .write
= ssb_pcicore_write_config
,
238 static struct resource ssb_pcicore_mem_resource
= {
239 .name
= "SSB PCIcore external memory",
240 .start
= SSB_PCI_DMA
,
241 .end
= SSB_PCI_DMA
+ SSB_PCI_DMA_SZ
- 1,
242 .flags
= IORESOURCE_MEM
| IORESOURCE_PCI_FIXED
,
245 static struct resource ssb_pcicore_io_resource
= {
246 .name
= "SSB PCIcore external I/O",
249 .flags
= IORESOURCE_IO
| IORESOURCE_PCI_FIXED
,
252 static struct pci_controller ssb_pcicore_controller
= {
253 .pci_ops
= &ssb_pcicore_pciops
,
254 .io_resource
= &ssb_pcicore_io_resource
,
255 .mem_resource
= &ssb_pcicore_mem_resource
,
258 /* This function is called when doing a pci_enable_device().
259 * We must first check if the device is a device on the PCI-core bridge. */
260 int ssb_pcicore_plat_dev_init(struct pci_dev
*d
)
262 if (d
->bus
->ops
!= &ssb_pcicore_pciops
) {
263 /* This is not a device on the PCI-core bridge. */
267 ssb_printk(KERN_INFO
"PCI: Fixing up device %s\n",
270 /* Fix up interrupt lines */
271 d
->irq
= ssb_mips_irq(extpci_core
->dev
) + 2;
272 pci_write_config_byte(d
, PCI_INTERRUPT_LINE
, d
->irq
);
277 /* Early PCI fixup for a device on the PCI-core bridge. */
278 static void ssb_pcicore_fixup_pcibridge(struct pci_dev
*dev
)
282 if (dev
->bus
->ops
!= &ssb_pcicore_pciops
) {
283 /* This is not a device on the PCI-core bridge. */
286 if (dev
->bus
->number
!= 0 || PCI_SLOT(dev
->devfn
) != 0)
289 ssb_printk(KERN_INFO
"PCI: Fixing up bridge %s\n", pci_name(dev
));
291 /* Enable PCI bridge bus mastering and memory space */
293 if (pcibios_enable_device(dev
, ~0) < 0) {
294 ssb_printk(KERN_ERR
"PCI: SSB bridge enable failed\n");
298 /* Enable PCI bridge BAR1 prefetch and burst */
299 pci_write_config_dword(dev
, SSB_BAR1_CONTROL
, 3);
301 /* Make sure our latency is high enough to handle the devices behind us */
303 ssb_printk(KERN_INFO
"PCI: Fixing latency timer of device %s to %u\n",
305 pci_write_config_byte(dev
, PCI_LATENCY_TIMER
, lat
);
307 DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID
, PCI_ANY_ID
, ssb_pcicore_fixup_pcibridge
);
309 /* PCI device IRQ mapping. */
310 int ssb_pcicore_pcibios_map_irq(const struct pci_dev
*dev
, u8 slot
, u8 pin
)
312 if (dev
->bus
->ops
!= &ssb_pcicore_pciops
) {
313 /* This is not a device on the PCI-core bridge. */
316 return ssb_mips_irq(extpci_core
->dev
) + 2;
319 static void ssb_pcicore_init_hostmode(struct ssb_pcicore
*pc
)
323 if (WARN_ON(extpci_core
))
327 ssb_dprintk(KERN_INFO PFX
"PCIcore in host mode found\n");
328 /* Reset devices on the external PCI bus */
329 val
= SSB_PCICORE_CTL_RST_OE
;
330 val
|= SSB_PCICORE_CTL_CLK_OE
;
331 pcicore_write32(pc
, SSB_PCICORE_CTL
, val
);
332 val
|= SSB_PCICORE_CTL_CLK
; /* Clock on */
333 pcicore_write32(pc
, SSB_PCICORE_CTL
, val
);
334 udelay(150); /* Assertion time demanded by the PCI standard */
335 val
|= SSB_PCICORE_CTL_RST
; /* Deassert RST# */
336 pcicore_write32(pc
, SSB_PCICORE_CTL
, val
);
337 val
= SSB_PCICORE_ARBCTL_INTERN
;
338 pcicore_write32(pc
, SSB_PCICORE_ARBCTL
, val
);
339 udelay(1); /* Assertion time demanded by the PCI standard */
341 if (pc
->dev
->bus
->has_cardbus_slot
) {
342 ssb_dprintk(KERN_INFO PFX
"CardBus slot detected\n");
344 /* GPIO 1 resets the bridge */
345 ssb_gpio_out(pc
->dev
->bus
, 1, 1);
346 ssb_gpio_outen(pc
->dev
->bus
, 1, 1);
347 pcicore_write16(pc
, SSB_PCICORE_SPROM(0),
348 pcicore_read16(pc
, SSB_PCICORE_SPROM(0))
352 /* 64MB I/O window */
353 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI0
,
354 SSB_PCICORE_SBTOPCI_IO
);
355 /* 64MB config space */
356 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI1
,
357 SSB_PCICORE_SBTOPCI_CFG0
);
358 /* 1GB memory window */
359 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI2
,
360 SSB_PCICORE_SBTOPCI_MEM
| SSB_PCI_DMA
);
362 /* Enable PCI bridge BAR0 prefetch and burst */
363 val
= PCI_COMMAND_MASTER
| PCI_COMMAND_MEMORY
;
364 ssb_extpci_write_config(pc
, 0, 0, 0, PCI_COMMAND
, &val
, 2);
365 /* Clear error conditions */
367 ssb_extpci_write_config(pc
, 0, 0, 0, PCI_STATUS
, &val
, 2);
369 /* Enable PCI interrupts */
370 pcicore_write32(pc
, SSB_PCICORE_IMASK
,
371 SSB_PCICORE_IMASK_INTA
);
373 /* Ok, ready to run, register it to the system.
374 * The following needs change, if we want to port hostmode
375 * to non-MIPS platform. */
376 ssb_pcicore_controller
.io_map_base
= (unsigned long)ioremap_nocache(SSB_PCI_MEM
, 0x04000000);
377 set_io_port_base(ssb_pcicore_controller
.io_map_base
);
378 /* Give some time to the PCI controller to configure itself with the new
379 * values. Not waiting at this point causes crashes of the machine. */
381 register_pci_controller(&ssb_pcicore_controller
);
384 static int pcicore_is_in_hostmode(struct ssb_pcicore
*pc
)
386 struct ssb_bus
*bus
= pc
->dev
->bus
;
390 chipid_top
= (bus
->chip_id
& 0xFF00);
391 if (chipid_top
!= 0x4700 &&
392 chipid_top
!= 0x5300)
395 if (bus
->sprom
.boardflags_lo
& SSB_PCICORE_BFL_NOPCI
)
398 /* The 200-pin BCM4712 package does not bond out PCI. Even when
399 * PCI is bonded out, some boards may leave the pins floating. */
400 if (bus
->chip_id
== 0x4712) {
401 if (bus
->chip_package
== SSB_CHIPPACK_BCM4712S
)
403 if (bus
->chip_package
== SSB_CHIPPACK_BCM4712M
)
406 if (bus
->chip_id
== 0x5350)
409 return !mips_busprobe32(tmp
, (bus
->mmio
+ (pc
->dev
->core_index
* SSB_CORE_SIZE
)));
411 #endif /* CONFIG_SSB_PCICORE_HOSTMODE */
413 /**************************************************
415 **************************************************/
417 static void ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore
*pc
)
419 u16 tmp
= pcicore_read16(pc
, SSB_PCICORE_SPROM(0));
420 if (((tmp
& 0xF000) >> 12) != pc
->dev
->core_index
) {
422 tmp
|= (pc
->dev
->core_index
<< 12);
423 pcicore_write16(pc
, SSB_PCICORE_SPROM(0), tmp
);
427 static u8
ssb_pcicore_polarity_workaround(struct ssb_pcicore
*pc
)
429 return (ssb_pcie_read(pc
, 0x204) & 0x10) ? 0xC0 : 0x80;
432 static void ssb_pcicore_serdes_workaround(struct ssb_pcicore
*pc
)
434 const u8 serdes_pll_device
= 0x1D;
435 const u8 serdes_rx_device
= 0x1F;
438 ssb_pcie_mdio_write(pc
, serdes_rx_device
, 1 /* Control */,
439 ssb_pcicore_polarity_workaround(pc
));
440 tmp
= ssb_pcie_mdio_read(pc
, serdes_pll_device
, 1 /* Control */);
442 ssb_pcie_mdio_write(pc
, serdes_pll_device
, 1, tmp
& ~0x4000);
445 static void ssb_pcicore_pci_setup_workarounds(struct ssb_pcicore
*pc
)
447 struct ssb_device
*pdev
= pc
->dev
;
448 struct ssb_bus
*bus
= pdev
->bus
;
451 tmp
= pcicore_read32(pc
, SSB_PCICORE_SBTOPCI2
);
452 tmp
|= SSB_PCICORE_SBTOPCI_PREF
;
453 tmp
|= SSB_PCICORE_SBTOPCI_BURST
;
454 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI2
, tmp
);
456 if (pdev
->id
.revision
< 5) {
457 tmp
= ssb_read32(pdev
, SSB_IMCFGLO
);
458 tmp
&= ~SSB_IMCFGLO_SERTO
;
460 tmp
&= ~SSB_IMCFGLO_REQTO
;
461 tmp
|= 3 << SSB_IMCFGLO_REQTO_SHIFT
;
462 ssb_write32(pdev
, SSB_IMCFGLO
, tmp
);
463 ssb_commit_settings(bus
);
464 } else if (pdev
->id
.revision
>= 11) {
465 tmp
= pcicore_read32(pc
, SSB_PCICORE_SBTOPCI2
);
466 tmp
|= SSB_PCICORE_SBTOPCI_MRM
;
467 pcicore_write32(pc
, SSB_PCICORE_SBTOPCI2
, tmp
);
471 static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore
*pc
)
474 u8 rev
= pc
->dev
->id
.revision
;
476 if (rev
== 0 || rev
== 1) {
477 /* TLP Workaround register. */
478 tmp
= ssb_pcie_read(pc
, 0x4);
480 ssb_pcie_write(pc
, 0x4, tmp
);
483 /* DLLP Link Control register. */
484 tmp
= ssb_pcie_read(pc
, 0x100);
486 ssb_pcie_write(pc
, 0x100, tmp
);
490 const u8 serdes_rx_device
= 0x1F;
492 ssb_pcie_mdio_write(pc
, serdes_rx_device
,
493 2 /* Timer */, 0x8128);
494 ssb_pcie_mdio_write(pc
, serdes_rx_device
,
495 6 /* CDR */, 0x0100);
496 ssb_pcie_mdio_write(pc
, serdes_rx_device
,
497 7 /* CDR BW */, 0x1466);
498 } else if (rev
== 3 || rev
== 4 || rev
== 5) {
499 /* TODO: DLLP Power Management Threshold */
500 ssb_pcicore_serdes_workaround(pc
);
502 } else if (rev
== 7) {
503 /* TODO: No PLL down */
507 /* Miscellaneous Configuration Fixup */
508 tmp
= pcicore_read16(pc
, SSB_PCICORE_SPROM(5));
510 pcicore_write16(pc
, SSB_PCICORE_SPROM(5),
515 /**************************************************
516 * Generic and Clientmode operation code.
517 **************************************************/
519 static void ssb_pcicore_init_clientmode(struct ssb_pcicore
*pc
)
521 /* Disable PCI interrupts. */
522 ssb_write32(pc
->dev
, SSB_INTVEC
, 0);
525 void ssb_pcicore_init(struct ssb_pcicore
*pc
)
527 struct ssb_device
*dev
= pc
->dev
;
531 if (!ssb_device_is_enabled(dev
))
532 ssb_device_enable(dev
, 0);
534 ssb_pcicore_fix_sprom_core_index(pc
);
536 #ifdef CONFIG_SSB_PCICORE_HOSTMODE
537 pc
->hostmode
= pcicore_is_in_hostmode(pc
);
539 ssb_pcicore_init_hostmode(pc
);
540 #endif /* CONFIG_SSB_PCICORE_HOSTMODE */
542 ssb_pcicore_init_clientmode(pc
);
544 /* Additional always once-executed workarounds */
545 ssb_pcicore_serdes_workaround(pc
);
547 /* TODO: Clock Request Update */
550 static u32
ssb_pcie_read(struct ssb_pcicore
*pc
, u32 address
)
552 pcicore_write32(pc
, 0x130, address
);
553 return pcicore_read32(pc
, 0x134);
556 static void ssb_pcie_write(struct ssb_pcicore
*pc
, u32 address
, u32 data
)
558 pcicore_write32(pc
, 0x130, address
);
559 pcicore_write32(pc
, 0x134, data
);
562 static void ssb_pcie_mdio_set_phy(struct ssb_pcicore
*pc
, u8 phy
)
564 const u16 mdio_control
= 0x128;
565 const u16 mdio_data
= 0x12C;
569 v
= (1 << 30); /* Start of Transaction */
570 v
|= (1 << 28); /* Write Transaction */
571 v
|= (1 << 17); /* Turnaround */
574 pcicore_write32(pc
, mdio_data
, v
);
577 for (i
= 0; i
< 200; i
++) {
578 v
= pcicore_read32(pc
, mdio_control
);
579 if (v
& 0x100 /* Trans complete */)
585 static u16
ssb_pcie_mdio_read(struct ssb_pcicore
*pc
, u8 device
, u8 address
)
587 const u16 mdio_control
= 0x128;
588 const u16 mdio_data
= 0x12C;
589 int max_retries
= 10;
594 v
= 0x80; /* Enable Preamble Sequence */
595 v
|= 0x2; /* MDIO Clock Divisor */
596 pcicore_write32(pc
, mdio_control
, v
);
598 if (pc
->dev
->id
.revision
>= 10) {
600 ssb_pcie_mdio_set_phy(pc
, device
);
603 v
= (1 << 30); /* Start of Transaction */
604 v
|= (1 << 29); /* Read Transaction */
605 v
|= (1 << 17); /* Turnaround */
606 if (pc
->dev
->id
.revision
< 10)
607 v
|= (u32
)device
<< 22;
608 v
|= (u32
)address
<< 18;
609 pcicore_write32(pc
, mdio_data
, v
);
610 /* Wait for the device to complete the transaction */
612 for (i
= 0; i
< max_retries
; i
++) {
613 v
= pcicore_read32(pc
, mdio_control
);
614 if (v
& 0x100 /* Trans complete */) {
616 ret
= pcicore_read32(pc
, mdio_data
);
621 pcicore_write32(pc
, mdio_control
, 0);
625 static void ssb_pcie_mdio_write(struct ssb_pcicore
*pc
, u8 device
,
626 u8 address
, u16 data
)
628 const u16 mdio_control
= 0x128;
629 const u16 mdio_data
= 0x12C;
630 int max_retries
= 10;
634 v
= 0x80; /* Enable Preamble Sequence */
635 v
|= 0x2; /* MDIO Clock Divisor */
636 pcicore_write32(pc
, mdio_control
, v
);
638 if (pc
->dev
->id
.revision
>= 10) {
640 ssb_pcie_mdio_set_phy(pc
, device
);
643 v
= (1 << 30); /* Start of Transaction */
644 v
|= (1 << 28); /* Write Transaction */
645 v
|= (1 << 17); /* Turnaround */
646 if (pc
->dev
->id
.revision
< 10)
647 v
|= (u32
)device
<< 22;
648 v
|= (u32
)address
<< 18;
650 pcicore_write32(pc
, mdio_data
, v
);
651 /* Wait for the device to complete the transaction */
653 for (i
= 0; i
< max_retries
; i
++) {
654 v
= pcicore_read32(pc
, mdio_control
);
655 if (v
& 0x100 /* Trans complete */)
659 pcicore_write32(pc
, mdio_control
, 0);
662 static void ssb_broadcast_value(struct ssb_device
*dev
,
663 u32 address
, u32 data
)
665 /* This is used for both, PCI and ChipCommon core, so be careful. */
666 BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR
!= SSB_CHIPCO_BCAST_ADDR
);
667 BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA
!= SSB_CHIPCO_BCAST_DATA
);
669 ssb_write32(dev
, SSB_PCICORE_BCAST_ADDR
, address
);
670 ssb_read32(dev
, SSB_PCICORE_BCAST_ADDR
); /* flush */
671 ssb_write32(dev
, SSB_PCICORE_BCAST_DATA
, data
);
672 ssb_read32(dev
, SSB_PCICORE_BCAST_DATA
); /* flush */
675 static void ssb_commit_settings(struct ssb_bus
*bus
)
677 struct ssb_device
*dev
;
679 dev
= bus
->chipco
.dev
? bus
->chipco
.dev
: bus
->pcicore
.dev
;
682 /* This forces an update of the cached registers. */
683 ssb_broadcast_value(dev
, 0xFD8, 0);
686 int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore
*pc
,
687 struct ssb_device
*dev
)
689 struct ssb_device
*pdev
= pc
->dev
;
694 if (dev
->bus
->bustype
!= SSB_BUSTYPE_PCI
) {
695 /* This SSB device is not on a PCI host-bus. So the IRQs are
696 * not routed through the PCI core.
697 * So we must not enable routing through the PCI core. */
705 might_sleep_if(pdev
->id
.coreid
!= SSB_DEV_PCI
);
707 /* Enable interrupts for this device. */
708 if ((pdev
->id
.revision
>= 6) || (pdev
->id
.coreid
== SSB_DEV_PCIE
)) {
711 /* Calculate the "coremask" for the device. */
712 coremask
= (1 << dev
->core_index
);
714 SSB_WARN_ON(bus
->bustype
!= SSB_BUSTYPE_PCI
);
715 err
= pci_read_config_dword(bus
->host_pci
, SSB_PCI_IRQMASK
, &tmp
);
718 tmp
|= coremask
<< 8;
719 err
= pci_write_config_dword(bus
->host_pci
, SSB_PCI_IRQMASK
, tmp
);
725 intvec
= ssb_read32(pdev
, SSB_INTVEC
);
726 tmp
= ssb_read32(dev
, SSB_TPSFLAG
);
727 tmp
&= SSB_TPSFLAG_BPFLAG
;
728 intvec
|= (1 << tmp
);
729 ssb_write32(pdev
, SSB_INTVEC
, intvec
);
732 /* Setup PCIcore operation. */
735 if (pdev
->id
.coreid
== SSB_DEV_PCI
) {
736 ssb_pcicore_pci_setup_workarounds(pc
);
738 WARN_ON(pdev
->id
.coreid
!= SSB_DEV_PCIE
);
739 ssb_pcicore_pcie_setup_workarounds(pc
);
745 EXPORT_SYMBOL(ssb_pcicore_dev_irqvecs_enable
);