Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d8a0241 authored by Olaf Hering's avatar Olaf Hering Committed by Paul Mackerras
Browse files

[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: default avatarOlaf Hering <olaf@aepfle.de>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 8d2169e8
Loading
Loading
Loading
Loading
+31 −3
Original line number Diff line number Diff line
@@ -478,11 +478,39 @@ void probe_machine(void)
	printk(KERN_INFO "Using %s machine description\n", ppc_md.name);
}

/* Match a class of boards, not a specific device configuration. */
int check_legacy_ioport(unsigned long base_port)
{
	if (ppc_md.check_legacy_ioport == NULL)
		return 0;
	return ppc_md.check_legacy_ioport(base_port);
	struct device_node *parent, *np = NULL;
	int ret = -ENODEV;

	switch(base_port) {
	case I8042_DATA_REG:
		np = of_find_node_by_type(NULL, "8042");
		break;
	case FDC_BASE: /* FDC1 */
		np = of_find_node_by_type(NULL, "fdc");
		break;
#ifdef CONFIG_PPC_PREP
	case _PIDXR:
	case _PNPWRP:
	case PNPBIOS_BASE:
		/* implement me */
#endif
	default:
		/* ipmi is supposed to fail here */
		break;
	}
	if (!np)
		return ret;
	parent = of_get_parent(np);
	if (parent) {
		if (strcmp(parent->type, "isa") == 0)
			ret = 0;
		of_node_put(parent);
	}
	of_node_put(np);
	return ret;
}
EXPORT_SYMBOL(check_legacy_ioport);

+0 −10
Original line number Diff line number Diff line
@@ -190,15 +190,6 @@ static int __init cell_probe(void)
	return 1;
}

/*
 * Cell has no legacy IO; anything calling this function has to
 * fail or bad things will happen
 */
static int cell_check_legacy_ioport(unsigned int baseport)
{
	return -ENODEV;
}

define_machine(cell) {
	.name			= "Cell",
	.probe			= cell_probe,
@@ -211,7 +202,6 @@ define_machine(cell) {
	.get_rtc_time		= rtas_get_rtc_time,
	.set_rtc_time		= rtas_set_rtc_time,
	.calibrate_decr		= generic_calibrate_decr,
	.check_legacy_ioport	= cell_check_legacy_ioport,
	.progress		= cell_progress,
	.init_IRQ       	= cell_init_irq,
	.pci_setup_phb		= rtas_setup_phb,
+0 −10
Original line number Diff line number Diff line
@@ -128,15 +128,6 @@ static int __init celleb_probe(void)
	return 1;
}

/*
 * Cell has no legacy IO; anything calling this function has to
 * fail or bad things will happen
 */
static int celleb_check_legacy_ioport(unsigned int baseport)
{
	return -ENODEV;
}

#ifdef CONFIG_KEXEC
static void celleb_kexec_cpu_down(int crash, int secondary)
{
@@ -173,7 +164,6 @@ define_machine(celleb) {
	.get_rtc_time		= beat_get_rtc_time,
	.set_rtc_time		= beat_set_rtc_time,
	.calibrate_decr		= generic_calibrate_decr,
	.check_legacy_ioport	= celleb_check_legacy_ioport,
	.progress		= celleb_progress,
	.power_save		= beat_power_save,
	.nvram_size		= beat_nvram_get_size,
+0 −10
Original line number Diff line number Diff line
@@ -628,15 +628,6 @@ static void iseries_iounmap(volatile void __iomem *token)
{
}

/*
 * iSeries has no legacy IO, anything calling this function has to
 * fail or bad things will happen
 */
static int iseries_check_legacy_ioport(unsigned int baseport)
{
	return -ENODEV;
}

static int __init iseries_probe(void)
{
	unsigned long root = of_get_flat_dt_root();
@@ -667,7 +658,6 @@ define_machine(iseries) {
	.calibrate_decr	= generic_calibrate_decr,
	.progress	= iSeries_progress,
	.probe		= iseries_probe,
	.check_legacy_ioport	= iseries_check_legacy_ioport,
	.ioremap	= iseries_ioremap,
	.iounmap	= iseries_iounmap,
	/* XXX Implement enable_pmcs for iSeries */
+0 −7
Original line number Diff line number Diff line
@@ -102,12 +102,6 @@ void __init pas_setup_arch(void)
	pasemi_idle_init();
}

/* No legacy IO on our parts */
static int pas_check_legacy_ioport(unsigned int baseport)
{
	return -ENODEV;
}

static __init void pas_init_IRQ(void)
{
	struct device_node *np;
@@ -252,7 +246,6 @@ define_machine(pas) {
	.restart		= pas_restart,
	.get_boot_time		= pas_get_boot_time,
	.calibrate_decr		= generic_calibrate_decr,
	.check_legacy_ioport    = pas_check_legacy_ioport,
	.progress		= pas_progress,
	.machine_check_exception = pas_machine_check_handler,
	.pci_irq_fixup		= pas_pci_irq_fixup,
Loading