2 * arch/ppc/platforms/lopec_pci.c
4 * PCI setup routines for the Motorola LoPEC.
7 * danc@mvista.com (or, alternately, source@mvista.com)
9 * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
15 #include <linux/init.h>
16 #include <linux/pci.h>
18 #include <asm/machdep.h>
19 #include <asm/pci-bridge.h>
20 #include <asm/mpc10x.h>
22 static inline int __init
23 lopec_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
26 static char pci_irq_table[][4] = {
27 {16, 0, 0, 0}, /* ID 11 - Winbond */
28 {22, 0, 0, 0}, /* ID 12 - SCSI */
29 {0, 0, 0, 0}, /* ID 13 - nothing */
30 {17, 0, 0, 0}, /* ID 14 - 82559 Ethernet */
31 {27, 0, 0, 0}, /* ID 15 - USB */
32 {23, 0, 0, 0}, /* ID 16 - PMC slot 1 */
33 {24, 0, 0, 0}, /* ID 17 - PMC slot 2 */
34 {25, 0, 0, 0}, /* ID 18 - PCI slot */
35 {0, 0, 0, 0}, /* ID 19 - nothing */
36 {0, 0, 0, 0}, /* ID 20 - nothing */
37 {0, 0, 0, 0}, /* ID 21 - nothing */
38 {0, 0, 0, 0}, /* ID 22 - nothing */
39 {0, 0, 0, 0}, /* ID 23 - nothing */
40 {0, 0, 0, 0}, /* ID 24 - PMC slot 1b */
41 {0, 0, 0, 0}, /* ID 25 - nothing */
42 {0, 0, 0, 0} /* ID 26 - PMC Slot 2b */
44 const long min_idsel = 11, max_idsel = 26, irqs_per_slot = 4;
46 irq = PCI_IRQ_TABLE_LOOKUP;
54 lopec_setup_winbond_83553(struct pci_controller *hose)
58 devfn = PCI_DEVFN(11,0);
60 /* IDE interrupt routing (primary 14, secondary 15) */
61 early_write_config_byte(hose, 0, devfn, 0x43, 0xef);
62 /* PCI interrupt routing */
63 early_write_config_word(hose, 0, devfn, 0x44, 0x0000);
65 /* ISA-PCI address decoder */
66 early_write_config_byte(hose, 0, devfn, 0x48, 0xf0);
68 /* RTC, kb, not used in PPC */
69 early_write_config_byte(hose, 0, devfn, 0x4d, 0x00);
70 early_write_config_byte(hose, 0, devfn, 0x4e, 0x04);
71 devfn = PCI_DEVFN(11, 1);
72 early_write_config_byte(hose, 0, devfn, 0x09, 0x8f);
73 early_write_config_dword(hose, 0, devfn, 0x40, 0x00ff0011);
77 lopec_find_bridges(void)
79 struct pci_controller *hose;
81 hose = pcibios_alloc_controller();
85 hose->first_busno = 0;
86 hose->last_busno = 0xff;
88 if (mpc10x_bridge_init(hose,
91 MPC10X_MAPB_EUMB_BASE) == 0) {
93 hose->mem_resources[0].end = 0xffffffff;
94 lopec_setup_winbond_83553(hose);
95 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
96 ppc_md.pci_swizzle = common_swizzle;
97 ppc_md.pci_map_irq = lopec_map_irq;