2 * BRIEF MODULE DESCRIPTION
3 * Board specific pci fixups.
5 * Copyright 2001-2003 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc.
7 * ppopov@mvista.com or source@mvista.com
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <linux/config.h>
30 #include <linux/types.h>
31 #include <linux/pci.h>
32 #include <linux/kernel.h>
33 #include <linux/init.h>
35 #include <asm/au1000.h>
36 //#include <asm/pb1500.h>
37 #ifdef CONFIG_MIPS_PB1000
38 #include <asm/pb1000.h>
43 #define DBG(x...) printk(x)
48 static void fixup_resource(int r_num
, struct pci_dev
*dev
);
49 #ifdef CONFIG_SOC_AU1500
50 static unsigned long virt_io_addr
;
53 void __init
pcibios_fixup_resources(struct pci_dev
*dev
)
55 /* will need to fixup IO resources */
58 void __init
pcibios_fixup(void)
60 #ifdef CONFIG_SOC_AU1500
64 virt_io_addr
= (unsigned long) ioremap(Au1500_PCI_IO_START
,
66 Au1500_PCI_IO_START
+ 1);
69 printk(KERN_ERR
"Unable to ioremap pci space\n");
73 set_io_port_base(virt_io_addr
);
76 #ifdef CONFIG_MIPS_PB1000 /* This is truly board specific */
77 unsigned long pci_mem_start
= (unsigned long) PCI_MEM_START
;
79 au_writel(0, PCI_BRIDGE_CONFIG
); // set extend byte to 0
80 au_writel(0, SDRAM_MBAR
); // set mbar to 0
81 au_writel(0x2, SDRAM_CMD
); // enable memory accesses
84 // set extend byte to mbar of ext slot
85 au_writel(((pci_mem_start
>> 24) & 0xff) |
86 (1 << 8 | 1 << 9 | 1 << 10 | 1 << 27),
88 DBG("Set bridge config to %x\n", au_readl(PCI_BRIDGE_CONFIG
));
92 void __init
pcibios_fixup_irqs(void)
94 #ifdef CONFIG_SOC_AU1500
95 unsigned int slot
, func
;
99 pci_for_each_dev(dev
) {
100 if (dev
->bus
->number
!= 0)
104 slot
= PCI_SLOT(dev
->devfn
);
108 dev
->irq
= AU1000_PCI_INTA
;
112 pci_write_config_byte(dev
, PCI_INTERRUPT_LINE
, dev
->irq
);
113 DBG("slot %d irq %d\n", slot
, dev
->irq
);
117 unsigned int pcibios_assign_all_busses(void)
122 static void fixup_resource(int r_num
, struct pci_dev
*dev
)