* [POWERPC] iSeries has no legacy I/O
@ 2006-09-26 3:57 Stephen Rothwell
2006-09-26 5:06 ` Olof Johansson
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2006-09-26 3:57 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 7cb6b5f..a0ff7ba 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -649,6 +649,15 @@ #ifndef CONFIG_PCI
void __init iSeries_init_IRQ(void) { }
#endif
+/*
+ * 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();
@@ -677,6 +686,7 @@ define_machine(iseries) {
.calibrate_decr = generic_calibrate_decr,
.progress = iSeries_progress,
.probe = iseries_probe,
+ .check_legacy_ioport = iseries_check_legacy_ioport,
/* XXX Implement enable_pmcs for iSeries */
};
--
1.4.2.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [POWERPC] iSeries has no legacy I/O
2006-09-26 3:57 [POWERPC] iSeries has no legacy I/O Stephen Rothwell
@ 2006-09-26 5:06 ` Olof Johansson
2006-09-26 5:32 ` Olaf Hering
0 siblings, 1 reply; 3+ messages in thread
From: Olof Johansson @ 2006-09-26 5:06 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc-dev, paulus, arnd
On Tue, 26 Sep 2006 13:57:21 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> +/*
> + * 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)
Ok, I was the third platform that needed this, you're fourth. How about
we just switch the default to assume legacy ioports not being allowed?
This will break floppy and 8042 on platforms that previously did not
define it and relied on the default being that it was allowed. I'm not
sure which ones that would be? Getting it in early would give us
plenty of time to deal with fallout, if any.
Every single platform that lacks legacy ports has to define a dummy
check_legacy_ioport() or else things will blow up since default is
to allow the accesses. Instead, default to legacy io ports not being
supported unless the platform defines the function and returns 0 from it.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: linux-2.6/arch/powerpc/platforms/cell/setup.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/setup.c
+++ linux-2.6/arch/powerpc/platforms/cell/setup.c
@@ -155,15 +155,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,
@@ -177,7 +168,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,
.pcibios_fixup = cell_pcibios_fixup,
Index: linux-2.6/arch/powerpc/platforms/pasemi/setup.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pasemi/setup.c
+++ linux-2.6/arch/powerpc/platforms/pasemi/setup.c
@@ -93,12 +93,6 @@ static void __init pas_init_early(void)
pci_direct_iommu_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;
@@ -183,6 +177,5 @@ define_machine(pas) {
.halt = pas_halt,
.get_boot_time = pas_get_boot_time,
.calibrate_decr = generic_calibrate_decr,
- .check_legacy_ioport = pas_check_legacy_ioport,
.progress = pas_progress,
};
Index: linux-2.6/arch/powerpc/platforms/powermac/setup.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/powermac/setup.c
+++ linux-2.6/arch/powerpc/platforms/powermac/setup.c
@@ -615,14 +615,6 @@ static void __init pmac_init_early(void)
#endif
}
-/*
- * pmac has no legacy IO, anything calling this function has to
- * fail or bad things will happen
- */
-static int pmac_check_legacy_ioport(unsigned int baseport)
-{
- return -ENODEV;
-}
static int __init pmac_declare_of_platform_devices(void)
{
@@ -737,7 +729,6 @@ define_machine(powermac) {
.get_rtc_time = pmac_get_rtc_time,
.calibrate_decr = pmac_calibrate_decr,
.feature_call = pmac_do_feature_call,
- .check_legacy_ioport = pmac_check_legacy_ioport,
.progress = udbg_progress,
#ifdef CONFIG_PPC64
.pci_probe_mode = pmac_pci_probe_mode,
Index: linux-2.6/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/setup-common.c
+++ linux-2.6/arch/powerpc/kernel/setup-common.c
@@ -523,8 +523,8 @@ void probe_machine(void)
int check_legacy_ioport(unsigned long base_port)
{
- if (ppc_md.check_legacy_ioport == NULL)
- return 0;
+ if (!ppc_md.check_legacy_ioport)
+ return -ENODEV;
return ppc_md.check_legacy_ioport(base_port);
}
EXPORT_SYMBOL(check_legacy_ioport);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [POWERPC] iSeries has no legacy I/O
2006-09-26 5:06 ` Olof Johansson
@ 2006-09-26 5:32 ` Olaf Hering
0 siblings, 0 replies; 3+ messages in thread
From: Olaf Hering @ 2006-09-26 5:32 UTC (permalink / raw)
To: Olof Johansson; +Cc: Stephen Rothwell, paulus, arnd, ppc-dev
On Tue, Sep 26, Olof Johansson wrote:
> This will break floppy and 8042 on platforms that previously did not
> define it and relied on the default being that it was allowed. I'm not
> sure which ones that would be? Getting it in early would give us
> plenty of time to deal with fallout, if any.
chrp32 and prep at least.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-26 5:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-26 3:57 [POWERPC] iSeries has no legacy I/O Stephen Rothwell
2006-09-26 5:06 ` Olof Johansson
2006-09-26 5:32 ` Olaf Hering
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).