aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-sh7780.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/drivers/pci/pci-sh7780.c')
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 602b644c35ad..5508e45d4838 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -48,7 +48,7 @@
48static int __init sh7780_pci_init(void) 48static int __init sh7780_pci_init(void)
49{ 49{
50 unsigned int id; 50 unsigned int id;
51 int ret; 51 int ret, match = 0;
52 52
53 pr_debug("PCI: Starting intialization.\n"); 53 pr_debug("PCI: Starting intialization.\n");
54 54
@@ -56,19 +56,43 @@ static int __init sh7780_pci_init(void)
56 56
57 /* check for SH7780/SH7780R hardware */ 57 /* check for SH7780/SH7780R hardware */
58 id = pci_read_reg(SH7780_PCIVID); 58 id = pci_read_reg(SH7780_PCIVID);
59 if ((id != ((SH7780_DEVICE_ID << 16) | SH7780_VENDOR_ID)) && 59 if ((id & 0xffff) == SH7780_VENDOR_ID) {
60 (id != ((SH7781_DEVICE_ID << 16) | 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); 70 printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id);
62 return -ENODEV; 71 return -ENODEV;
63 } 72 }
64 73
65 /* Setup the INTC */ 74 /* Setup the INTC */
66 ctrl_outl(0x00200000, INTC_ICR0); /* INTC SH-4 Mode */ 75 if (mach_is_7780se()) {
67 ctrl_outl(0x00078000, INTC_INT2MSKCR); /* enable PCIINTA - PCIINTD */ 76 /* ICR0: IRL=use separately */
68 ctrl_outl(0x40000000, INTC_INTMSK1); /* disable IRL4-7 Interrupt */ 77 ctrl_outl(0x00C00020, INTC_ICR0);
69 ctrl_outl(0x0000fffe, INTC_INTMSK2); /* disable IRL4-7 Interrupt */ 78 /* ICR1: detect low level(for 2ndcut) */
70 ctrl_outl(0x80000000, INTC_INTMSKCLR1); /* enable IRL0-3 Interrupt */ 79 ctrl_outl(0xAAAA0000, INTC_ICR1);
71 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2); /* enable IRL0-3 Interrupt */ 80 /* INTPRI: priority=3(all) */
81 ctrl_outl(0x33333333, INTC_INTPRI);
82 } else {
83 /* INTC SH-4 Mode */
84 ctrl_outl(0x00200000, INTC_ICR0);
85 /* enable PCIINTA - PCIINTD */
86 ctrl_outl(0x00078000, INTC_INT2MSKCR);
87 /* disable IRL4-7 Interrupt */
88 ctrl_outl(0x40000000, INTC_INTMSK1);
89 /* disable IRL4-7 Interrupt */
90 ctrl_outl(0x0000fffe, INTC_INTMSK2);
91 /* enable IRL0-3 Interrupt */
92 ctrl_outl(0x80000000, INTC_INTMSKCLR1);
93 /* enable IRL0-3 Interrupt */
94 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2);
95 }
72 96
73 if ((ret = sh4_pci_check_direct()) != 0) 97 if ((ret = sh4_pci_check_direct()) != 0)
74 return ret; 98 return ret;
@@ -138,9 +162,8 @@ int __init sh7780_pcic_init(struct sh4_pci_address_map *map)
138 * DMA interrupts... 162 * DMA interrupts...
139 */ 163 */
140 164
141#ifdef CONFIG_SH_R7780RP 165 /* Apply any last-minute PCIC fixups */
142 pci_fixup_pcic(); 166 pci_fixup_pcic();
143#endif
144 167
145 /* SH7780 init done, set central function init complete */ 168 /* SH7780 init done, set central function init complete */
146 /* use round robin mode to stop a device starving/overruning */ 169 /* use round robin mode to stop a device starving/overruning */