pci-sh7780.c (9cdf083f981b8d37b3212400a359368661385099) pci-sh7780.c (32351a28a7e1f2c68afbe559dd35e1ad0301be6d)
1/*
2 * Low-Level PCI Support for the SH7780
3 *
4 * Dustin McIntire (dustin@sensoria.com)
5 * Derived from arch/i386/kernel/pci-*.c which bore the message:
6 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
7 *
8 * Ported to the new API by Paul Mundt <lethal@linux-sh.org>

--- 34 unchanged lines hidden (view full) ---

43 *
44 * Note that the platform specific initialization (BSC registers, and memory
45 * space mapping) will be called via the platform defined function
46 * pcibios_init_platform().
47 */
48static int __init sh7780_pci_init(void)
49{
50 unsigned int id;
1/*
2 * Low-Level PCI Support for the SH7780
3 *
4 * Dustin McIntire (dustin@sensoria.com)
5 * Derived from arch/i386/kernel/pci-*.c which bore the message:
6 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
7 *
8 * Ported to the new API by Paul Mundt <lethal@linux-sh.org>

--- 34 unchanged lines hidden (view full) ---

43 *
44 * Note that the platform specific initialization (BSC registers, and memory
45 * space mapping) will be called via the platform defined function
46 * pcibios_init_platform().
47 */
48static int __init sh7780_pci_init(void)
49{
50 unsigned int id;
51 int ret;
51 int ret, match = 0;
52
53 pr_debug("PCI: Starting intialization.\n");
54
55 outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */
56
57 /* check for SH7780/SH7780R hardware */
58 id = pci_read_reg(SH7780_PCIVID);
52
53 pr_debug("PCI: Starting intialization.\n");
54
55 outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */
56
57 /* check for SH7780/SH7780R hardware */
58 id = pci_read_reg(SH7780_PCIVID);
59 if ((id != ((SH7780_DEVICE_ID << 16) | SH7780_VENDOR_ID)) &&
60 (id != ((SH7781_DEVICE_ID << 16) | SH7780_VENDOR_ID))) {
59 if ((id & 0xffff) == SH7780_VENDOR_ID) {
60 switch ((id >> 16) & 0xffff) {
61 case SH7780_DEVICE_ID:
62 case SH7781_DEVICE_ID:
63 case SH7785_DEVICE_ID:
64 match = 1;
65 break;
66 }
67 }
68
69 if (unlikely(!match)) {
61 printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id);
62 return -ENODEV;
63 }
64
65 /* Setup the INTC */
66 ctrl_outl(0x00200000, INTC_ICR0); /* INTC SH-4 Mode */
67 ctrl_outl(0x00078000, INTC_INT2MSKCR); /* enable PCIINTA - PCIINTD */
68 ctrl_outl(0x40000000, INTC_INTMSK1); /* disable IRL4-7 Interrupt */

--- 64 unchanged lines hidden (view full) ---

133 PCIBIOS_MIN_IO, (64 << 10),
134 SH7780_PCI_IO_BASE + PCIBIOS_MIN_IO);
135
136 /* NOTE: I'm ignoring the PCI error IRQs for now..
137 * TODO: add support for the internal error interrupts and
138 * DMA interrupts...
139 */
140
70 printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id);
71 return -ENODEV;
72 }
73
74 /* Setup the INTC */
75 ctrl_outl(0x00200000, INTC_ICR0); /* INTC SH-4 Mode */
76 ctrl_outl(0x00078000, INTC_INT2MSKCR); /* enable PCIINTA - PCIINTD */
77 ctrl_outl(0x40000000, INTC_INTMSK1); /* disable IRL4-7 Interrupt */

--- 64 unchanged lines hidden (view full) ---

142 PCIBIOS_MIN_IO, (64 << 10),
143 SH7780_PCI_IO_BASE + PCIBIOS_MIN_IO);
144
145 /* NOTE: I'm ignoring the PCI error IRQs for now..
146 * TODO: add support for the internal error interrupts and
147 * DMA interrupts...
148 */
149
141#ifdef CONFIG_SH_R7780RP
150#ifdef CONFIG_SH_HIGHLANDER
142 pci_fixup_pcic();
143#endif
144
145 /* SH7780 init done, set central function init complete */
146 /* use round robin mode to stop a device starving/overruning */
147 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO;
148 pci_write_reg(word, SH4_PCICR);
149
150 return 1;
151}
151 pci_fixup_pcic();
152#endif
153
154 /* SH7780 init done, set central function init complete */
155 /* use round robin mode to stop a device starving/overruning */
156 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO;
157 pci_write_reg(word, SH4_PCICR);
158
159 return 1;
160}