diff options
author | Olaf Hering <olaf@aepfle.de> | 2007-04-25 16:36:56 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-27 07:14:30 -0400 |
commit | 8d8a0241eb019ce9648a77b55f9f76a834207cbb (patch) | |
tree | 1363c38d6ff4898dfcfee19c25258015152c84f7 | |
parent | 8d2169e8d6b8a91413df33bc402e0f602ceaabcc (diff) |
[POWERPC] Generic check_legacy_ioport
check_legacy_ioport makes only sense on PREP, CHRP and pSeries.
They may have an isa node with PS/2, parport, floppy and serial ports.
Remove the check_legacy_ioport call from ppc_md, it's not needed
anymore. Hardware capabilities come from the device-tree.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 34 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/setup.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/celleb/setup.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/setup.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 27 | ||||
-rw-r--r-- | include/asm-powerpc/io.h | 7 | ||||
-rw-r--r-- | include/asm-powerpc/machdep.h | 3 |
9 files changed, 37 insertions, 81 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 3c8847b647fa..370803722e47 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -478,11 +478,39 @@ void probe_machine(void) | |||
478 | printk(KERN_INFO "Using %s machine description\n", ppc_md.name); | 478 | printk(KERN_INFO "Using %s machine description\n", ppc_md.name); |
479 | } | 479 | } |
480 | 480 | ||
481 | /* Match a class of boards, not a specific device configuration. */ | ||
481 | int check_legacy_ioport(unsigned long base_port) | 482 | int check_legacy_ioport(unsigned long base_port) |
482 | { | 483 | { |
483 | if (ppc_md.check_legacy_ioport == NULL) | 484 | struct device_node *parent, *np = NULL; |
484 | return 0; | 485 | int ret = -ENODEV; |
485 | return ppc_md.check_legacy_ioport(base_port); | 486 | |
487 | switch(base_port) { | ||
488 | case I8042_DATA_REG: | ||
489 | np = of_find_node_by_type(NULL, "8042"); | ||
490 | break; | ||
491 | case FDC_BASE: /* FDC1 */ | ||
492 | np = of_find_node_by_type(NULL, "fdc"); | ||
493 | break; | ||
494 | #ifdef CONFIG_PPC_PREP | ||
495 | case _PIDXR: | ||
496 | case _PNPWRP: | ||
497 | case PNPBIOS_BASE: | ||
498 | /* implement me */ | ||
499 | #endif | ||
500 | default: | ||
501 | /* ipmi is supposed to fail here */ | ||
502 | break; | ||
503 | } | ||
504 | if (!np) | ||
505 | return ret; | ||
506 | parent = of_get_parent(np); | ||
507 | if (parent) { | ||
508 | if (strcmp(parent->type, "isa") == 0) | ||
509 | ret = 0; | ||
510 | of_node_put(parent); | ||
511 | } | ||
512 | of_node_put(np); | ||
513 | return ret; | ||
486 | } | 514 | } |
487 | EXPORT_SYMBOL(check_legacy_ioport); | 515 | EXPORT_SYMBOL(check_legacy_ioport); |
488 | 516 | ||
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 5c5fa34e59ee..54b96183cb64 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -190,15 +190,6 @@ static int __init cell_probe(void) | |||
190 | return 1; | 190 | return 1; |
191 | } | 191 | } |
192 | 192 | ||
193 | /* | ||
194 | * Cell has no legacy IO; anything calling this function has to | ||
195 | * fail or bad things will happen | ||
196 | */ | ||
197 | static int cell_check_legacy_ioport(unsigned int baseport) | ||
198 | { | ||
199 | return -ENODEV; | ||
200 | } | ||
201 | |||
202 | define_machine(cell) { | 193 | define_machine(cell) { |
203 | .name = "Cell", | 194 | .name = "Cell", |
204 | .probe = cell_probe, | 195 | .probe = cell_probe, |
@@ -211,7 +202,6 @@ define_machine(cell) { | |||
211 | .get_rtc_time = rtas_get_rtc_time, | 202 | .get_rtc_time = rtas_get_rtc_time, |
212 | .set_rtc_time = rtas_set_rtc_time, | 203 | .set_rtc_time = rtas_set_rtc_time, |
213 | .calibrate_decr = generic_calibrate_decr, | 204 | .calibrate_decr = generic_calibrate_decr, |
214 | .check_legacy_ioport = cell_check_legacy_ioport, | ||
215 | .progress = cell_progress, | 205 | .progress = cell_progress, |
216 | .init_IRQ = cell_init_irq, | 206 | .init_IRQ = cell_init_irq, |
217 | .pci_setup_phb = rtas_setup_phb, | 207 | .pci_setup_phb = rtas_setup_phb, |
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c index ab1db9dd1aa1..596ab2a788d4 100644 --- a/arch/powerpc/platforms/celleb/setup.c +++ b/arch/powerpc/platforms/celleb/setup.c | |||
@@ -128,15 +128,6 @@ static int __init celleb_probe(void) | |||
128 | return 1; | 128 | return 1; |
129 | } | 129 | } |
130 | 130 | ||
131 | /* | ||
132 | * Cell has no legacy IO; anything calling this function has to | ||
133 | * fail or bad things will happen | ||
134 | */ | ||
135 | static int celleb_check_legacy_ioport(unsigned int baseport) | ||
136 | { | ||
137 | return -ENODEV; | ||
138 | } | ||
139 | |||
140 | #ifdef CONFIG_KEXEC | 131 | #ifdef CONFIG_KEXEC |
141 | static void celleb_kexec_cpu_down(int crash, int secondary) | 132 | static void celleb_kexec_cpu_down(int crash, int secondary) |
142 | { | 133 | { |
@@ -173,7 +164,6 @@ define_machine(celleb) { | |||
173 | .get_rtc_time = beat_get_rtc_time, | 164 | .get_rtc_time = beat_get_rtc_time, |
174 | .set_rtc_time = beat_set_rtc_time, | 165 | .set_rtc_time = beat_set_rtc_time, |
175 | .calibrate_decr = generic_calibrate_decr, | 166 | .calibrate_decr = generic_calibrate_decr, |
176 | .check_legacy_ioport = celleb_check_legacy_ioport, | ||
177 | .progress = celleb_progress, | 167 | .progress = celleb_progress, |
178 | .power_save = beat_power_save, | 168 | .power_save = beat_power_save, |
179 | .nvram_size = beat_nvram_get_size, | 169 | .nvram_size = beat_nvram_get_size, |
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index cce7e309340c..7f5dcee814d4 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -628,15 +628,6 @@ static void iseries_iounmap(volatile void __iomem *token) | |||
628 | { | 628 | { |
629 | } | 629 | } |
630 | 630 | ||
631 | /* | ||
632 | * iSeries has no legacy IO, anything calling this function has to | ||
633 | * fail or bad things will happen | ||
634 | */ | ||
635 | static int iseries_check_legacy_ioport(unsigned int baseport) | ||
636 | { | ||
637 | return -ENODEV; | ||
638 | } | ||
639 | |||
640 | static int __init iseries_probe(void) | 631 | static int __init iseries_probe(void) |
641 | { | 632 | { |
642 | unsigned long root = of_get_flat_dt_root(); | 633 | unsigned long root = of_get_flat_dt_root(); |
@@ -667,7 +658,6 @@ define_machine(iseries) { | |||
667 | .calibrate_decr = generic_calibrate_decr, | 658 | .calibrate_decr = generic_calibrate_decr, |
668 | .progress = iSeries_progress, | 659 | .progress = iSeries_progress, |
669 | .probe = iseries_probe, | 660 | .probe = iseries_probe, |
670 | .check_legacy_ioport = iseries_check_legacy_ioport, | ||
671 | .ioremap = iseries_ioremap, | 661 | .ioremap = iseries_ioremap, |
672 | .iounmap = iseries_iounmap, | 662 | .iounmap = iseries_iounmap, |
673 | /* XXX Implement enable_pmcs for iSeries */ | 663 | /* XXX Implement enable_pmcs for iSeries */ |
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index a7bf88e94c64..f88f0ec4c8cb 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -102,12 +102,6 @@ void __init pas_setup_arch(void) | |||
102 | pasemi_idle_init(); | 102 | pasemi_idle_init(); |
103 | } | 103 | } |
104 | 104 | ||
105 | /* No legacy IO on our parts */ | ||
106 | static int pas_check_legacy_ioport(unsigned int baseport) | ||
107 | { | ||
108 | return -ENODEV; | ||
109 | } | ||
110 | |||
111 | static __init void pas_init_IRQ(void) | 105 | static __init void pas_init_IRQ(void) |
112 | { | 106 | { |
113 | struct device_node *np; | 107 | struct device_node *np; |
@@ -252,7 +246,6 @@ define_machine(pas) { | |||
252 | .restart = pas_restart, | 246 | .restart = pas_restart, |
253 | .get_boot_time = pas_get_boot_time, | 247 | .get_boot_time = pas_get_boot_time, |
254 | .calibrate_decr = generic_calibrate_decr, | 248 | .calibrate_decr = generic_calibrate_decr, |
255 | .check_legacy_ioport = pas_check_legacy_ioport, | ||
256 | .progress = pas_progress, | 249 | .progress = pas_progress, |
257 | .machine_check_exception = pas_machine_check_handler, | 250 | .machine_check_exception = pas_machine_check_handler, |
258 | .pci_irq_fixup = pas_pci_irq_fixup, | 251 | .pci_irq_fixup = pas_pci_irq_fixup, |
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 0444e07e8d7a..b820cabac697 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -635,15 +635,6 @@ static void __init pmac_init_early(void) | |||
635 | #endif | 635 | #endif |
636 | } | 636 | } |
637 | 637 | ||
638 | /* | ||
639 | * pmac has no legacy IO, anything calling this function has to | ||
640 | * fail or bad things will happen | ||
641 | */ | ||
642 | static int pmac_check_legacy_ioport(unsigned int baseport) | ||
643 | { | ||
644 | return -ENODEV; | ||
645 | } | ||
646 | |||
647 | static int __init pmac_declare_of_platform_devices(void) | 638 | static int __init pmac_declare_of_platform_devices(void) |
648 | { | 639 | { |
649 | struct device_node *np; | 640 | struct device_node *np; |
@@ -755,7 +746,6 @@ define_machine(powermac) { | |||
755 | .get_rtc_time = pmac_get_rtc_time, | 746 | .get_rtc_time = pmac_get_rtc_time, |
756 | .calibrate_decr = pmac_calibrate_decr, | 747 | .calibrate_decr = pmac_calibrate_decr, |
757 | .feature_call = pmac_do_feature_call, | 748 | .feature_call = pmac_do_feature_call, |
758 | .check_legacy_ioport = pmac_check_legacy_ioport, | ||
759 | .progress = udbg_progress, | 749 | .progress = udbg_progress, |
760 | #ifdef CONFIG_PPC64 | 750 | #ifdef CONFIG_PPC64 |
761 | .pci_probe_mode = pmac_pci_probe_mode, | 751 | .pci_probe_mode = pmac_pci_probe_mode, |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index e2fcd2307e67..33eec2822c66 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -335,32 +335,6 @@ static void __init pSeries_init_early(void) | |||
335 | DBG(" <- pSeries_init_early()\n"); | 335 | DBG(" <- pSeries_init_early()\n"); |
336 | } | 336 | } |
337 | 337 | ||
338 | |||
339 | static int pSeries_check_legacy_ioport(unsigned int baseport) | ||
340 | { | ||
341 | struct device_node *np; | ||
342 | |||
343 | #define I8042_DATA_REG 0x60 | ||
344 | #define FDC_BASE 0x3f0 | ||
345 | |||
346 | |||
347 | switch(baseport) { | ||
348 | case I8042_DATA_REG: | ||
349 | np = of_find_node_by_type(NULL, "8042"); | ||
350 | if (np == NULL) | ||
351 | return -ENODEV; | ||
352 | of_node_put(np); | ||
353 | break; | ||
354 | case FDC_BASE: | ||
355 | np = of_find_node_by_type(NULL, "fdc"); | ||
356 | if (np == NULL) | ||
357 | return -ENODEV; | ||
358 | of_node_put(np); | ||
359 | break; | ||
360 | } | ||
361 | return 0; | ||
362 | } | ||
363 | |||
364 | /* | 338 | /* |
365 | * Called very early, MMU is off, device-tree isn't unflattened | 339 | * Called very early, MMU is off, device-tree isn't unflattened |
366 | */ | 340 | */ |
@@ -537,7 +511,6 @@ define_machine(pseries) { | |||
537 | .set_rtc_time = rtas_set_rtc_time, | 511 | .set_rtc_time = rtas_set_rtc_time, |
538 | .calibrate_decr = generic_calibrate_decr, | 512 | .calibrate_decr = generic_calibrate_decr, |
539 | .progress = rtas_progress, | 513 | .progress = rtas_progress, |
540 | .check_legacy_ioport = pSeries_check_legacy_ioport, | ||
541 | .system_reset_exception = pSeries_system_reset_exception, | 514 | .system_reset_exception = pSeries_system_reset_exception, |
542 | .machine_check_exception = pSeries_machine_check_exception, | 515 | .machine_check_exception = pSeries_machine_check_exception, |
543 | }; | 516 | }; |
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 301c9bb308b1..350c9bdb31dc 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -11,7 +11,12 @@ | |||
11 | 11 | ||
12 | /* Check of existence of legacy devices */ | 12 | /* Check of existence of legacy devices */ |
13 | extern int check_legacy_ioport(unsigned long base_port); | 13 | extern int check_legacy_ioport(unsigned long base_port); |
14 | #define PNPBIOS_BASE 0xf000 /* only relevant for PReP */ | 14 | #define I8042_DATA_REG 0x60 |
15 | #define FDC_BASE 0x3f0 | ||
16 | /* only relevant for PReP */ | ||
17 | #define _PIDXR 0x279 | ||
18 | #define _PNPWRP 0xa79 | ||
19 | #define PNPBIOS_BASE 0xf000 | ||
15 | 20 | ||
16 | #include <linux/compiler.h> | 21 | #include <linux/compiler.h> |
17 | #include <asm/page.h> | 22 | #include <asm/page.h> |
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 1b04e5723548..b204926ce913 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
@@ -153,9 +153,6 @@ struct machdep_calls { | |||
153 | */ | 153 | */ |
154 | long (*feature_call)(unsigned int feature, ...); | 154 | long (*feature_call)(unsigned int feature, ...); |
155 | 155 | ||
156 | /* Check availability of legacy devices like i8042 */ | ||
157 | int (*check_legacy_ioport)(unsigned int baseport); | ||
158 | |||
159 | /* Get legacy PCI/IDE interrupt mapping */ | 156 | /* Get legacy PCI/IDE interrupt mapping */ |
160 | int (*pci_get_legacy_ide_irq)(struct pci_dev *dev, int channel); | 157 | int (*pci_get_legacy_ide_irq)(struct pci_dev *dev, int channel); |
161 | 158 | ||