diff options
Diffstat (limited to 'arch/mips/tx4938')
-rw-r--r-- | arch/mips/tx4938/toshiba_rbtx4938/setup.c | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c index 361d89a81175..6ed39a5aea72 100644 --- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c +++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c | |||
@@ -352,7 +352,7 @@ static struct pci_dev *fake_pci_dev(struct pci_controller *hose, | |||
352 | static struct pci_dev dev; | 352 | static struct pci_dev dev; |
353 | static struct pci_bus bus; | 353 | static struct pci_bus bus; |
354 | 354 | ||
355 | dev.sysdata = (void *)hose; | 355 | dev.sysdata = bus.sysdata = hose; |
356 | dev.devfn = devfn; | 356 | dev.devfn = devfn; |
357 | bus.number = busnr; | 357 | bus.number = busnr; |
358 | bus.ops = hose->pci_ops; | 358 | bus.ops = hose->pci_ops; |
@@ -385,8 +385,10 @@ int txboard_pci66_check(struct pci_controller *hose, int top_bus, int current_bu | |||
385 | printk("PCI: Checking 66MHz capabilities...\n"); | 385 | printk("PCI: Checking 66MHz capabilities...\n"); |
386 | 386 | ||
387 | for (pci_devfn=devfn_start; pci_devfn<devfn_stop; pci_devfn++) { | 387 | for (pci_devfn=devfn_start; pci_devfn<devfn_stop; pci_devfn++) { |
388 | early_read_config_word(hose, top_bus, current_bus, pci_devfn, | 388 | if (early_read_config_word(hose, top_bus, current_bus, |
389 | PCI_VENDOR_ID, &vid); | 389 | pci_devfn, PCI_VENDOR_ID, |
390 | &vid) != PCIBIOS_SUCCESSFUL) | ||
391 | continue; | ||
390 | 392 | ||
391 | if (vid == 0xffff) continue; | 393 | if (vid == 0xffff) continue; |
392 | 394 | ||
@@ -463,7 +465,6 @@ static int __init tx4938_pcibios_init(void) | |||
463 | int extarb = !(tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIXARB); | 465 | int extarb = !(tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIXARB); |
464 | 466 | ||
465 | PCIBIOS_MIN_IO = 0x00001000UL; | 467 | PCIBIOS_MIN_IO = 0x00001000UL; |
466 | PCIBIOS_MIN_MEM = 0x01000000UL; | ||
467 | 468 | ||
468 | mem_base[0] = txboard_request_phys_region_shrink(&mem_size[0]); | 469 | mem_base[0] = txboard_request_phys_region_shrink(&mem_size[0]); |
469 | io_base[0] = txboard_request_phys_region_shrink(&io_size[0]); | 470 | io_base[0] = txboard_request_phys_region_shrink(&io_size[0]); |
@@ -578,18 +579,17 @@ arch_initcall(tx4938_pcibios_init); | |||
578 | #define SRTC_CS 2 /* IOC */ | 579 | #define SRTC_CS 2 /* IOC */ |
579 | 580 | ||
580 | #ifdef CONFIG_PCI | 581 | #ifdef CONFIG_PCI |
581 | static unsigned char rbtx4938_ethaddr[17]; | ||
582 | static int __init rbtx4938_ethaddr_init(void) | 582 | static int __init rbtx4938_ethaddr_init(void) |
583 | { | 583 | { |
584 | unsigned char dat[17]; | ||
584 | unsigned char sum; | 585 | unsigned char sum; |
585 | int i; | 586 | int i; |
586 | 587 | ||
587 | /* 0-3: "MAC\0", 4-9:eth0, 10-15:eth1, 16:sum */ | 588 | /* 0-3: "MAC\0", 4-9:eth0, 10-15:eth1, 16:sum */ |
588 | if (spi_eeprom_read(SEEPROM1_CS, 0, | 589 | if (spi_eeprom_read(SEEPROM1_CS, 0, dat, sizeof(dat))) { |
589 | rbtx4938_ethaddr, sizeof(rbtx4938_ethaddr))) | ||
590 | printk(KERN_ERR "seeprom: read error.\n"); | 590 | printk(KERN_ERR "seeprom: read error.\n"); |
591 | else { | 591 | return -ENODEV; |
592 | unsigned char *dat = rbtx4938_ethaddr; | 592 | } else { |
593 | if (strcmp(dat, "MAC") != 0) | 593 | if (strcmp(dat, "MAC") != 0) |
594 | printk(KERN_WARNING "seeprom: bad signature.\n"); | 594 | printk(KERN_WARNING "seeprom: bad signature.\n"); |
595 | for (i = 0, sum = 0; i < sizeof(dat); i++) | 595 | for (i = 0, sum = 0; i < sizeof(dat); i++) |
@@ -597,31 +597,22 @@ static int __init rbtx4938_ethaddr_init(void) | |||
597 | if (sum) | 597 | if (sum) |
598 | printk(KERN_WARNING "seeprom: bad checksum.\n"); | 598 | printk(KERN_WARNING "seeprom: bad checksum.\n"); |
599 | } | 599 | } |
600 | return 0; | 600 | for (i = 0; i < 2; i++) { |
601 | } | 601 | unsigned int slot = TX4938_PCIC_IDSEL_AD_TO_SLOT(31 - i); |
602 | device_initcall(rbtx4938_ethaddr_init); | 602 | unsigned int id = (1 << 8) | PCI_DEVFN(slot, 0); /* bus 1 */ |
603 | 603 | struct platform_device *pdev; | |
604 | int rbtx4938_get_tx4938_ethaddr(struct pci_dev *dev, unsigned char *addr) | 604 | if (!(tx4938_ccfgptr->pcfg & |
605 | { | 605 | (i ? TX4938_PCFG_ETH1_SEL : TX4938_PCFG_ETH0_SEL))) |
606 | struct pci_controller *channel = (struct pci_controller *)dev->bus->sysdata; | 606 | continue; |
607 | int ch = 0; | 607 | pdev = platform_device_alloc("tc35815-mac", id); |
608 | 608 | if (!pdev || | |
609 | if (channel != &tx4938_pci_controller[1]) | 609 | platform_device_add_data(pdev, &dat[4 + 6 * i], 6) || |
610 | return -ENODEV; | 610 | platform_device_add(pdev)) |
611 | /* TX4938 PCIC1 */ | 611 | platform_device_put(pdev); |
612 | switch (PCI_SLOT(dev->devfn)) { | ||
613 | case TX4938_PCIC_IDSEL_AD_TO_SLOT(31): | ||
614 | ch = 0; | ||
615 | break; | ||
616 | case TX4938_PCIC_IDSEL_AD_TO_SLOT(30): | ||
617 | ch = 1; | ||
618 | break; | ||
619 | default: | ||
620 | return -ENODEV; | ||
621 | } | 612 | } |
622 | memcpy(addr, &rbtx4938_ethaddr[4 + 6 * ch], 6); | ||
623 | return 0; | 613 | return 0; |
624 | } | 614 | } |
615 | device_initcall(rbtx4938_ethaddr_init); | ||
625 | #endif /* CONFIG_PCI */ | 616 | #endif /* CONFIG_PCI */ |
626 | 617 | ||
627 | static void __init rbtx4938_spi_setup(void) | 618 | static void __init rbtx4938_spi_setup(void) |