Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] IP27: misc fixes

- fix PCI interrupt assignment by emulating ioc3 interrupt pin register
- use pci_probe_only mode
- select correct page size in bridge
- remove no longer needed ioc3_sio_init() code

[Ralf: Fix for 64kB or larger pagesizes]

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Thomas Bogendoerfer and committed by
Ralf Baechle
96173a6c b32bb803

+26 -24
+18 -2
arch/mips/pci/ops-bridge.c
··· 14 14 #include <asm/sn/sn0/hub.h> 15 15 16 16 /* 17 + * Most of the IOC3 PCI config register aren't present 18 + * we emulate what is needed for a normal PCI enumeration 19 + */ 20 + static u32 emulate_ioc3_cfg(int where, int size) 21 + { 22 + if (size == 1 && where == 0x3d) 23 + return 0x01; 24 + else if (size == 2 && where == 0x3c) 25 + return 0x0100; 26 + else if (size == 4 && where == 0x3c) 27 + return 0x00000100; 28 + 29 + return 0; 30 + } 31 + 32 + /* 17 33 * The Bridge ASIC supports both type 0 and type 1 access. Type 1 is 18 34 * not really documented, so right now I can't write code which uses it. 19 35 * Therefore we use type 0 accesses for now even though they won't work ··· 80 64 * generic PCI code a chance to look at the wrong register. 81 65 */ 82 66 if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) { 83 - *value = 0; 67 + *value = emulate_ioc3_cfg(where, size); 84 68 return PCIBIOS_SUCCESSFUL; 85 69 } 86 70 ··· 143 127 * generic PCI code a chance to look at the wrong register. 144 128 */ 145 129 if ((where >= 0x14 && where < 0x40) || (where >= 0x48)) { 146 - *value = 0; 130 + *value = emulate_ioc3_cfg(where, size); 147 131 return PCIBIOS_SUCCESSFUL; 148 132 } 149 133
+8
arch/mips/pci/pci-ip27.c
··· 47 47 static int num_bridges = 0; 48 48 bridge_t *bridge; 49 49 int slot; 50 + extern int pci_probe_only; 51 + 52 + pci_probe_only = 1; 50 53 51 54 printk("a bridge\n"); 52 55 ··· 103 100 */ 104 101 bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP | 105 102 BRIDGE_CTRL_MEM_SWAP; 103 + #ifdef CONFIG_PAGE_SIZE_4KB 104 + bridge->b_wid_control &= ~BRIDGE_CTRL_PAGE_SIZE; 105 + #else /* 16kB or larger */ 106 + bridge->b_wid_control |= BRIDGE_CTRL_PAGE_SIZE; 107 + #endif 106 108 107 109 /* 108 110 * Hmm... IRIX sets additional bits in the address which
-22
arch/mips/sgi-ip27/ip27-init.c
··· 161 161 return NASID_TO_COMPACT_NODEID(get_nasid()); 162 162 } 163 163 164 - /* Extracted from the IOC3 meta driver. FIXME. */ 165 - static inline void ioc3_sio_init(void) 166 - { 167 - struct ioc3 *ioc3; 168 - nasid_t nid; 169 - long loops; 170 - 171 - nid = get_nasid(); 172 - ioc3 = (struct ioc3 *) KL_CONFIG_CH_CONS_INFO(nid)->memory_base; 173 - 174 - ioc3->sscr_a = 0; /* PIO mode for uarta. */ 175 - ioc3->sscr_b = 0; /* PIO mode for uartb. */ 176 - ioc3->sio_iec = ~0; 177 - ioc3->sio_ies = (SIO_IR_SA_INT | SIO_IR_SB_INT); 178 - 179 - loops=1000000; while(loops--); 180 - ioc3->sregs.uarta.iu_fcr = 0; 181 - ioc3->sregs.uartb.iu_fcr = 0; 182 - loops=1000000; while(loops--); 183 - } 184 - 185 164 static inline void ioc3_eth_init(void) 186 165 { 187 166 struct ioc3 *ioc3; ··· 213 234 panic("Kernel compiled for N mode."); 214 235 #endif 215 236 216 - ioc3_sio_init(); 217 237 ioc3_eth_init(); 218 238 per_cpu_init(); 219 239