3 Copyright 2002 Broadcom Corp. All Rights Reserved.
5 This program is free software; you can distribute it and/or modify it
6 under the terms of the GNU General Public License (Version 2) as
7 published by the Free Software Foundation.
9 This program is distributed in the hope it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 #include <linux/init.h>
20 #include <linux/types.h>
21 #include <linux/pci.h>
25 #include <bcm_map_part.h>
26 #include <6348_intr.h>
27 #include <6348_map_part.h>
29 static volatile MpiRegisters
* mpi
= (MpiRegisters
*)(MPI_BASE
);
31 static char irq_tab_bcm96348
[] __initdata
= {
32 [0] = INTERRUPT_ID_MPI
,
33 [1] = INTERRUPT_ID_MPI
,
34 #if defined(CONFIG_USB)
35 [USB_HOST_SLOT
] = INTERRUPT_ID_USBH
39 int __init
pcibios_map_irq(struct pci_dev
*dev
, u8 slot
, u8 pin
)
41 return irq_tab_bcm96348
[slot
];
44 static void bcm96348_fixup(struct pci_dev
*dev
)
49 memaddr
= pci_resource_start(dev
, 0);
50 size
= pci_resource_len(dev
, 0);
52 switch (PCI_SLOT(dev
->devfn
)) {
54 // UBUS to PCI address range
55 // Memory Window 1. Mask determines which bits are decoded.
56 mpi
->l2pmrange1
= ~(size
-1);
57 // UBUS to PCI Memory base address. This is akin to the ChipSelect base
59 mpi
->l2pmbase1
= memaddr
& BCM_PCI_ADDR_MASK
;
60 // UBUS to PCI Remap Address. Replaces the masked address bits in the
61 // range register with this setting.
62 // Also, enable direct I/O and direct Memory accesses
63 mpi
->l2pmremap1
= (memaddr
| MEM_WINDOW_EN
);
68 mpi
->l2pmrange2
= ~(size
-1);
69 // UBUS to PCI Memory base address.
70 mpi
->l2pmbase2
= memaddr
& BCM_PCI_ADDR_MASK
;
71 // UBUS to PCI Remap Address
72 mpi
->l2pmremap2
= (memaddr
| MEM_WINDOW_EN
);
75 #if defined(CONFIG_USB)
77 dev
->resource
[0].start
= USB_HOST_BASE
;
78 dev
->resource
[0].end
= USB_HOST_BASE
+USB_BAR0_MEM_SIZE
-1;
84 int pcibios_plat_dev_init(struct pci_dev
*dev
)
89 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM
, PCI_ANY_ID
,
92 /*struct pci_fixup pcibios_fixups[] = {
93 { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, bcm96348_fixup },
This page took 0.060619 seconds and 5 git commands to generate.