diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/jmr3927/rbhma3100/setup.c | 4 | ||||
-rw-r--r-- | arch/mips/momentum/jaguar_atx/platform.c | 20 | ||||
-rw-r--r-- | arch/mips/momentum/ocelot_3/platform.c | 20 | ||||
-rw-r--r-- | arch/mips/momentum/ocelot_c/platform.c | 12 | ||||
-rw-r--r-- | arch/sparc/kernel/of_device.c | 10 | ||||
-rw-r--r-- | arch/sparc/kernel/pcic.c | 8 | ||||
-rw-r--r-- | arch/sparc64/kernel/of_device.c | 10 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci.c | 8 |
8 files changed, 34 insertions, 58 deletions
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c index 7ca3d6d07b34..ecabe5b08489 100644 --- a/arch/mips/jmr3927/rbhma3100/setup.c +++ b/arch/mips/jmr3927/rbhma3100/setup.c | |||
@@ -137,10 +137,6 @@ int jmr3927_ccfg_toeon = 0; | |||
137 | 137 | ||
138 | static inline void do_reset(void) | 138 | static inline void do_reset(void) |
139 | { | 139 | { |
140 | #ifdef CONFIG_TC35815 | ||
141 | extern void tc35815_killall(void); | ||
142 | tc35815_killall(); | ||
143 | #endif | ||
144 | #if 1 /* Resetting PCI bus */ | 140 | #if 1 /* Resetting PCI bus */ |
145 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); | 141 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); |
146 | jmr3927_ioc_reg_out(JMR3927_IOC_RESET_PCI, JMR3927_IOC_RESET_ADDR); | 142 | jmr3927_ioc_reg_out(JMR3927_IOC_RESET_PCI, JMR3927_IOC_RESET_ADDR); |
diff --git a/arch/mips/momentum/jaguar_atx/platform.c b/arch/mips/momentum/jaguar_atx/platform.c index 3df36eda75af..771e55f39875 100644 --- a/arch/mips/momentum/jaguar_atx/platform.c +++ b/arch/mips/momentum/jaguar_atx/platform.c | |||
@@ -47,11 +47,7 @@ static struct resource mv64x60_eth0_resources[] = { | |||
47 | }, | 47 | }, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static char eth0_mac_addr[ETH_ALEN]; | ||
51 | |||
52 | static struct mv643xx_eth_platform_data eth0_pd = { | 50 | static struct mv643xx_eth_platform_data eth0_pd = { |
53 | .mac_addr = eth0_mac_addr, | ||
54 | |||
55 | .tx_sram_addr = MV_SRAM_BASE_ETH0, | 51 | .tx_sram_addr = MV_SRAM_BASE_ETH0, |
56 | .tx_sram_size = MV_SRAM_TXRING_SIZE, | 52 | .tx_sram_size = MV_SRAM_TXRING_SIZE, |
57 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, | 53 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, |
@@ -80,11 +76,7 @@ static struct resource mv64x60_eth1_resources[] = { | |||
80 | }, | 76 | }, |
81 | }; | 77 | }; |
82 | 78 | ||
83 | static char eth1_mac_addr[ETH_ALEN]; | ||
84 | |||
85 | static struct mv643xx_eth_platform_data eth1_pd = { | 79 | static struct mv643xx_eth_platform_data eth1_pd = { |
86 | .mac_addr = eth1_mac_addr, | ||
87 | |||
88 | .tx_sram_addr = MV_SRAM_BASE_ETH1, | 80 | .tx_sram_addr = MV_SRAM_BASE_ETH1, |
89 | .tx_sram_size = MV_SRAM_TXRING_SIZE, | 81 | .tx_sram_size = MV_SRAM_TXRING_SIZE, |
90 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, | 82 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, |
@@ -113,11 +105,7 @@ static struct resource mv64x60_eth2_resources[] = { | |||
113 | }, | 105 | }, |
114 | }; | 106 | }; |
115 | 107 | ||
116 | static char eth2_mac_addr[ETH_ALEN]; | 108 | static struct mv643xx_eth_platform_data eth2_pd; |
117 | |||
118 | static struct mv643xx_eth_platform_data eth2_pd = { | ||
119 | .mac_addr = eth2_mac_addr, | ||
120 | }; | ||
121 | 109 | ||
122 | static struct platform_device eth2_device = { | 110 | static struct platform_device eth2_device = { |
123 | .name = MV643XX_ETH_NAME, | 111 | .name = MV643XX_ETH_NAME, |
@@ -200,9 +188,9 @@ static int __init mv643xx_eth_add_pds(void) | |||
200 | int ret; | 188 | int ret; |
201 | 189 | ||
202 | get_mac(mac); | 190 | get_mac(mac); |
203 | eth_mac_add(eth0_mac_addr, mac, 0); | 191 | eth_mac_add(eth0_pd.mac_addr, mac, 0); |
204 | eth_mac_add(eth1_mac_addr, mac, 1); | 192 | eth_mac_add(eth1_pd.mac_addr, mac, 1); |
205 | eth_mac_add(eth2_mac_addr, mac, 2); | 193 | eth_mac_add(eth2_pd.mac_addr, mac, 2); |
206 | ret = platform_add_devices(mv643xx_eth_pd_devs, | 194 | ret = platform_add_devices(mv643xx_eth_pd_devs, |
207 | ARRAY_SIZE(mv643xx_eth_pd_devs)); | 195 | ARRAY_SIZE(mv643xx_eth_pd_devs)); |
208 | 196 | ||
diff --git a/arch/mips/momentum/ocelot_3/platform.c b/arch/mips/momentum/ocelot_3/platform.c index 024aef25f372..b80733f0c66d 100644 --- a/arch/mips/momentum/ocelot_3/platform.c +++ b/arch/mips/momentum/ocelot_3/platform.c | |||
@@ -47,11 +47,7 @@ static struct resource mv64x60_eth0_resources[] = { | |||
47 | }, | 47 | }, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static char eth0_mac_addr[ETH_ALEN]; | ||
51 | |||
52 | static struct mv643xx_eth_platform_data eth0_pd = { | 50 | static struct mv643xx_eth_platform_data eth0_pd = { |
53 | .mac_addr = eth0_mac_addr, | ||
54 | |||
55 | .tx_sram_addr = MV_SRAM_BASE_ETH0, | 51 | .tx_sram_addr = MV_SRAM_BASE_ETH0, |
56 | .tx_sram_size = MV_SRAM_TXRING_SIZE, | 52 | .tx_sram_size = MV_SRAM_TXRING_SIZE, |
57 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, | 53 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, |
@@ -80,11 +76,7 @@ static struct resource mv64x60_eth1_resources[] = { | |||
80 | }, | 76 | }, |
81 | }; | 77 | }; |
82 | 78 | ||
83 | static char eth1_mac_addr[ETH_ALEN]; | ||
84 | |||
85 | static struct mv643xx_eth_platform_data eth1_pd = { | 79 | static struct mv643xx_eth_platform_data eth1_pd = { |
86 | .mac_addr = eth1_mac_addr, | ||
87 | |||
88 | .tx_sram_addr = MV_SRAM_BASE_ETH1, | 80 | .tx_sram_addr = MV_SRAM_BASE_ETH1, |
89 | .tx_sram_size = MV_SRAM_TXRING_SIZE, | 81 | .tx_sram_size = MV_SRAM_TXRING_SIZE, |
90 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, | 82 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, |
@@ -113,11 +105,7 @@ static struct resource mv64x60_eth2_resources[] = { | |||
113 | }, | 105 | }, |
114 | }; | 106 | }; |
115 | 107 | ||
116 | static char eth2_mac_addr[ETH_ALEN]; | 108 | static struct mv643xx_eth_platform_data eth2_pd; |
117 | |||
118 | static struct mv643xx_eth_platform_data eth2_pd = { | ||
119 | .mac_addr = eth2_mac_addr, | ||
120 | }; | ||
121 | 109 | ||
122 | static struct platform_device eth2_device = { | 110 | static struct platform_device eth2_device = { |
123 | .name = MV643XX_ETH_NAME, | 111 | .name = MV643XX_ETH_NAME, |
@@ -200,9 +188,9 @@ static int __init mv643xx_eth_add_pds(void) | |||
200 | int ret; | 188 | int ret; |
201 | 189 | ||
202 | get_mac(mac); | 190 | get_mac(mac); |
203 | eth_mac_add(eth0_mac_addr, mac, 0); | 191 | eth_mac_add(eth0_pd.mac_addr, mac, 0); |
204 | eth_mac_add(eth1_mac_addr, mac, 1); | 192 | eth_mac_add(eth1_pd.mac_addr, mac, 1); |
205 | eth_mac_add(eth2_mac_addr, mac, 2); | 193 | eth_mac_add(eth2_pd.mac_addr, mac, 2); |
206 | ret = platform_add_devices(mv643xx_eth_pd_devs, | 194 | ret = platform_add_devices(mv643xx_eth_pd_devs, |
207 | ARRAY_SIZE(mv643xx_eth_pd_devs)); | 195 | ARRAY_SIZE(mv643xx_eth_pd_devs)); |
208 | 196 | ||
diff --git a/arch/mips/momentum/ocelot_c/platform.c b/arch/mips/momentum/ocelot_c/platform.c index fac8b2499387..f7cd303f3eba 100644 --- a/arch/mips/momentum/ocelot_c/platform.c +++ b/arch/mips/momentum/ocelot_c/platform.c | |||
@@ -46,11 +46,7 @@ static struct resource mv64x60_eth0_resources[] = { | |||
46 | }, | 46 | }, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static char eth0_mac_addr[ETH_ALEN]; | ||
50 | |||
51 | static struct mv643xx_eth_platform_data eth0_pd = { | 49 | static struct mv643xx_eth_platform_data eth0_pd = { |
52 | .mac_addr = eth0_mac_addr, | ||
53 | |||
54 | .tx_sram_addr = MV_SRAM_BASE_ETH0, | 50 | .tx_sram_addr = MV_SRAM_BASE_ETH0, |
55 | .tx_sram_size = MV_SRAM_TXRING_SIZE, | 51 | .tx_sram_size = MV_SRAM_TXRING_SIZE, |
56 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, | 52 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, |
@@ -79,11 +75,7 @@ static struct resource mv64x60_eth1_resources[] = { | |||
79 | }, | 75 | }, |
80 | }; | 76 | }; |
81 | 77 | ||
82 | static char eth1_mac_addr[ETH_ALEN]; | ||
83 | |||
84 | static struct mv643xx_eth_platform_data eth1_pd = { | 78 | static struct mv643xx_eth_platform_data eth1_pd = { |
85 | .mac_addr = eth1_mac_addr, | ||
86 | |||
87 | .tx_sram_addr = MV_SRAM_BASE_ETH1, | 79 | .tx_sram_addr = MV_SRAM_BASE_ETH1, |
88 | .tx_sram_size = MV_SRAM_TXRING_SIZE, | 80 | .tx_sram_size = MV_SRAM_TXRING_SIZE, |
89 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, | 81 | .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, |
@@ -174,8 +166,8 @@ static int __init mv643xx_eth_add_pds(void) | |||
174 | int ret; | 166 | int ret; |
175 | 167 | ||
176 | get_mac(mac); | 168 | get_mac(mac); |
177 | eth_mac_add(eth0_mac_addr, mac, 0); | 169 | eth_mac_add(eth0_pd.mac_addr, mac, 0); |
178 | eth_mac_add(eth1_mac_addr, mac, 1); | 170 | eth_mac_add(eth1_pd.mac_addr, mac, 1); |
179 | ret = platform_add_devices(mv643xx_eth_pd_devs, | 171 | ret = platform_add_devices(mv643xx_eth_pd_devs, |
180 | ARRAY_SIZE(mv643xx_eth_pd_devs)); | 172 | ARRAY_SIZE(mv643xx_eth_pd_devs)); |
181 | 173 | ||
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c index dab6169e31ca..48c24f7518c2 100644 --- a/arch/sparc/kernel/of_device.c +++ b/arch/sparc/kernel/of_device.c | |||
@@ -495,7 +495,7 @@ static void __init build_device_resources(struct of_device *op, | |||
495 | u32 *reg = (preg + (index * ((na + ns) * 4))); | 495 | u32 *reg = (preg + (index * ((na + ns) * 4))); |
496 | struct device_node *dp = op->node; | 496 | struct device_node *dp = op->node; |
497 | struct device_node *pp = p_op->node; | 497 | struct device_node *pp = p_op->node; |
498 | struct of_bus *pbus; | 498 | struct of_bus *pbus, *dbus; |
499 | u64 size, result = OF_BAD_ADDR; | 499 | u64 size, result = OF_BAD_ADDR; |
500 | unsigned long flags; | 500 | unsigned long flags; |
501 | int dna, dns; | 501 | int dna, dns; |
@@ -516,6 +516,7 @@ static void __init build_device_resources(struct of_device *op, | |||
516 | 516 | ||
517 | dna = na; | 517 | dna = na; |
518 | dns = ns; | 518 | dns = ns; |
519 | dbus = bus; | ||
519 | 520 | ||
520 | while (1) { | 521 | while (1) { |
521 | dp = pp; | 522 | dp = pp; |
@@ -528,13 +529,13 @@ static void __init build_device_resources(struct of_device *op, | |||
528 | pbus = of_match_bus(pp); | 529 | pbus = of_match_bus(pp); |
529 | pbus->count_cells(dp, &pna, &pns); | 530 | pbus->count_cells(dp, &pna, &pns); |
530 | 531 | ||
531 | if (build_one_resource(dp, bus, pbus, addr, | 532 | if (build_one_resource(dp, dbus, pbus, addr, |
532 | dna, dns, pna)) | 533 | dna, dns, pna)) |
533 | break; | 534 | break; |
534 | 535 | ||
535 | dna = pna; | 536 | dna = pna; |
536 | dns = pns; | 537 | dns = pns; |
537 | bus = pbus; | 538 | dbus = pbus; |
538 | } | 539 | } |
539 | 540 | ||
540 | build_res: | 541 | build_res: |
@@ -549,9 +550,6 @@ static void __init build_device_resources(struct of_device *op, | |||
549 | r->start = result & 0xffffffff; | 550 | r->start = result & 0xffffffff; |
550 | r->end = result + size - 1; | 551 | r->end = result + size - 1; |
551 | r->flags = flags | ((result >> 32ULL) & 0xffUL); | 552 | r->flags = flags | ((result >> 32ULL) & 0xffUL); |
552 | } else { | ||
553 | r->start = ~0UL; | ||
554 | r->end = ~0UL; | ||
555 | } | 553 | } |
556 | r->name = op->node->name; | 554 | r->name = op->node->name; |
557 | } | 555 | } |
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 207f1b6eef53..3fa5f95c4614 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -944,6 +944,14 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource) | |||
944 | return -ENXIO; | 944 | return -ENXIO; |
945 | } | 945 | } |
946 | 946 | ||
947 | struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) | ||
948 | { | ||
949 | struct pcidev_cookie *pc = pdev->sysdata; | ||
950 | |||
951 | return pc->prom_node; | ||
952 | } | ||
953 | EXPORT_SYMBOL(pci_device_to_OF_node); | ||
954 | |||
947 | /* | 955 | /* |
948 | * This probably belongs here rather than ioport.c because | 956 | * This probably belongs here rather than ioport.c because |
949 | * we do not want this crud linked into SBus kernels. | 957 | * we do not want this crud linked into SBus kernels. |
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index ad74e5e8778e..fb9bf1e4d036 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c | |||
@@ -581,7 +581,7 @@ static void __init build_device_resources(struct of_device *op, | |||
581 | u32 *reg = (preg + (index * ((na + ns) * 4))); | 581 | u32 *reg = (preg + (index * ((na + ns) * 4))); |
582 | struct device_node *dp = op->node; | 582 | struct device_node *dp = op->node; |
583 | struct device_node *pp = p_op->node; | 583 | struct device_node *pp = p_op->node; |
584 | struct of_bus *pbus; | 584 | struct of_bus *pbus, *dbus; |
585 | u64 size, result = OF_BAD_ADDR; | 585 | u64 size, result = OF_BAD_ADDR; |
586 | unsigned long flags; | 586 | unsigned long flags; |
587 | int dna, dns; | 587 | int dna, dns; |
@@ -599,6 +599,7 @@ static void __init build_device_resources(struct of_device *op, | |||
599 | 599 | ||
600 | dna = na; | 600 | dna = na; |
601 | dns = ns; | 601 | dns = ns; |
602 | dbus = bus; | ||
602 | 603 | ||
603 | while (1) { | 604 | while (1) { |
604 | dp = pp; | 605 | dp = pp; |
@@ -611,13 +612,13 @@ static void __init build_device_resources(struct of_device *op, | |||
611 | pbus = of_match_bus(pp); | 612 | pbus = of_match_bus(pp); |
612 | pbus->count_cells(dp, &pna, &pns); | 613 | pbus->count_cells(dp, &pna, &pns); |
613 | 614 | ||
614 | if (build_one_resource(dp, bus, pbus, addr, | 615 | if (build_one_resource(dp, dbus, pbus, addr, |
615 | dna, dns, pna)) | 616 | dna, dns, pna)) |
616 | break; | 617 | break; |
617 | 618 | ||
618 | dna = pna; | 619 | dna = pna; |
619 | dns = pns; | 620 | dns = pns; |
620 | bus = pbus; | 621 | dbus = pbus; |
621 | } | 622 | } |
622 | 623 | ||
623 | build_res: | 624 | build_res: |
@@ -635,9 +636,6 @@ static void __init build_device_resources(struct of_device *op, | |||
635 | r->start = result; | 636 | r->start = result; |
636 | r->end = result + size - 1; | 637 | r->end = result + size - 1; |
637 | r->flags = flags; | 638 | r->flags = flags; |
638 | } else { | ||
639 | r->start = ~0UL; | ||
640 | r->end = ~0UL; | ||
641 | } | 639 | } |
642 | r->name = op->node->name; | 640 | r->name = op->node->name; |
643 | } | 641 | } |
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 6fedfb98f8b0..196b4b72482b 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -681,4 +681,12 @@ void arch_teardown_msi_irq(unsigned int virt_irq) | |||
681 | } | 681 | } |
682 | #endif /* !(CONFIG_PCI_MSI) */ | 682 | #endif /* !(CONFIG_PCI_MSI) */ |
683 | 683 | ||
684 | struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) | ||
685 | { | ||
686 | struct pcidev_cookie *pc = pdev->sysdata; | ||
687 | |||
688 | return pc->op->node; | ||
689 | } | ||
690 | EXPORT_SYMBOL(pci_device_to_OF_node); | ||
691 | |||
684 | #endif /* !(CONFIG_PCI) */ | 692 | #endif /* !(CONFIG_PCI) */ |