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

[MIPS] TXx9: Add some pci options

Add pci options for backplane type, clock selection, error handling,
timeout values.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Atsushi Nemoto and committed by
Ralf Baechle
07517529 47a5c976

+68
+22
arch/mips/pci/ops-tx4927.c
··· 194 194 .gbwc = 0xfe0, /* 4064 GBUSCLK for CCFG.GTOT=0b11 */ 195 195 }; 196 196 197 + char *__devinit tx4927_pcibios_setup(char *str) 198 + { 199 + unsigned long val; 200 + 201 + if (!strncmp(str, "trdyto=", 7)) { 202 + if (strict_strtoul(str + 7, 0, &val) == 0) 203 + tx4927_pci_opts.trdyto = val; 204 + return NULL; 205 + } 206 + if (!strncmp(str, "retryto=", 8)) { 207 + if (strict_strtoul(str + 8, 0, &val) == 0) 208 + tx4927_pci_opts.retryto = val; 209 + return NULL; 210 + } 211 + if (!strncmp(str, "gbwc=", 5)) { 212 + if (strict_strtoul(str + 5, 0, &val) == 0) 213 + tx4927_pci_opts.gbwc = val; 214 + return NULL; 215 + } 216 + return str; 217 + } 218 + 197 219 void __init tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr, 198 220 struct pci_controller *channel, int extarb) 199 221 {
+36
arch/mips/txx9/generic/pci.c
··· 386 386 { 387 387 return txx9_board_vec->pci_map_irq(dev, slot, pin); 388 388 } 389 + 390 + char * (*txx9_board_pcibios_setup)(char *str) __devinitdata; 391 + 392 + char *__devinit txx9_pcibios_setup(char *str) 393 + { 394 + if (txx9_board_pcibios_setup && !txx9_board_pcibios_setup(str)) 395 + return NULL; 396 + if (!strcmp(str, "picmg")) { 397 + /* PICMG compliant backplane (TOSHIBA JMB-PICMG-ATX 398 + (5V or 3.3V), JMB-PICMG-L2 (5V only), etc.) */ 399 + txx9_pci_option |= TXX9_PCI_OPT_PICMG; 400 + return NULL; 401 + } else if (!strcmp(str, "nopicmg")) { 402 + /* non-PICMG compliant backplane (TOSHIBA 403 + RBHBK4100,RBHBK4200, Interface PCM-PCM05, etc.) */ 404 + txx9_pci_option &= ~TXX9_PCI_OPT_PICMG; 405 + return NULL; 406 + } else if (!strncmp(str, "clk=", 4)) { 407 + char *val = str + 4; 408 + txx9_pci_option &= ~TXX9_PCI_OPT_CLK_MASK; 409 + if (strcmp(val, "33") == 0) 410 + txx9_pci_option |= TXX9_PCI_OPT_CLK_33; 411 + else if (strcmp(val, "66") == 0) 412 + txx9_pci_option |= TXX9_PCI_OPT_CLK_66; 413 + else /* "auto" */ 414 + txx9_pci_option |= TXX9_PCI_OPT_CLK_AUTO; 415 + return NULL; 416 + } else if (!strncmp(str, "err=", 4)) { 417 + if (!strcmp(str + 4, "panic")) 418 + txx9_pci_err_action = TXX9_PCI_ERR_PANIC; 419 + else if (!strcmp(str + 4, "ignore")) 420 + txx9_pci_err_action = TXX9_PCI_ERR_IGNORE; 421 + return NULL; 422 + } 423 + return str; 424 + }
+4
arch/mips/txx9/generic/setup.c
··· 23 23 #include <asm/bootinfo.h> 24 24 #include <asm/time.h> 25 25 #include <asm/txx9/generic.h> 26 + #include <asm/txx9/pci.h> 26 27 #ifdef CONFIG_CPU_TX49XX 27 28 #include <asm/txx9/tx4938.h> 28 29 #endif ··· 195 194 ioport_resource.end = ~0UL; /* no limit */ 196 195 iomem_resource.start = 0; 197 196 iomem_resource.end = ~0UL; /* no limit */ 197 + #ifdef CONFIG_PCI 198 + pcibios_plat_setup = txx9_pcibios_setup; 199 + #endif 198 200 txx9_board_vec->mem_setup(); 199 201 } 200 202
+1
arch/mips/txx9/rbtx4927/setup.c
··· 238 238 txx9_alloc_pci_controller(&txx9_primary_pcic, 239 239 RBTX4927_PCIMEM, RBTX4927_PCIMEM_SIZE, 240 240 RBTX4927_PCIIO, RBTX4927_PCIIO_SIZE); 241 + txx9_board_pcibios_setup = tx4927_pcibios_setup; 241 242 #else 242 243 set_io_port_base(KSEG1 + RBTX4927_ISA_IO_OFFSET); 243 244 #endif
+1
arch/mips/txx9/rbtx4938/setup.c
··· 193 193 194 194 #ifdef CONFIG_PCI 195 195 txx9_alloc_pci_controller(&txx9_primary_pcic, 0, 0, 0, 0); 196 + txx9_board_pcibios_setup = tx4927_pcibios_setup; 196 197 #else 197 198 set_io_port_base(RBTX4938_ETHER_BASE); 198 199 #endif
+3
include/asm-mips/txx9/pci.h
··· 33 33 }; 34 34 extern enum txx9_pci_err_action txx9_pci_err_action; 35 35 36 + extern char * (*txx9_board_pcibios_setup)(char *str); 37 + char *txx9_pcibios_setup(char *str); 38 + 36 39 #endif /* __ASM_TXX9_PCI_H */
+1
include/asm-mips/txx9/tx4927pcic.h
··· 195 195 void __init tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr, 196 196 struct pci_controller *channel, int extarb); 197 197 void tx4927_report_pcic_status(void); 198 + char *tx4927_pcibios_setup(char *str); 198 199 199 200 #endif /* __ASM_TXX9_TX4927PCIC_H */