public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: reserve legacy io regions on powermac
@ 2004-07-22  0:59 Albert Cahalan
  0 siblings, 0 replies; 10+ messages in thread
From: Albert Cahalan @ 2004-07-22  0:59 UTC (permalink / raw)
  To: linux-kernel mailing list; +Cc: olh, benh, geert

I think a great many drivers could be cleaned up
by making IO fail if the proper IO address cookies
haven't been obtained. This might be done with
byteswapping, XOR, addition, putting a checksum in
the top 2 bytes of a 64-bit cookie, or simply
tracking where an ioremap has been done. Then the
read and write operations can check this.

In general, make IO fail if a driver doesn't play
by the rules.

Perhaps some of the low memory-mapped stuff on
x86 could be moved.



^ permalink raw reply	[flat|nested] 10+ messages in thread
* reserve legacy io regions on powermac
@ 2004-07-21  9:12 Olaf Hering
  2004-07-21 14:51 ` Benjamin Herrenschmidt
  2004-07-23 16:44 ` Olaf Hering
  0 siblings, 2 replies; 10+ messages in thread
From: Olaf Hering @ 2004-07-21  9:12 UTC (permalink / raw)
  To: linux-kernel, Paul Mackeras, Benjamin Herrenschmidt; +Cc: Olaf Hering


Anton pointed this out.

ppc32 can boot one single binary on prep, chrp and pmac boards.
pmac has no legacy io, probing for PC style legacy hardware leads to a
hard crash.
Several patches exist to prevent serial, floppy, ps2, parport and other
drivers from probing these io ports.
I think the simplest fix for 2.6 is a request_region of the problematic
areas.
PCMCIA is still missing.
I found that partport_pc.c pokes at varios ports, without claiming the
ports first. Should this be fixed?
smsc_check(), winbond_check(), winbond_check2()


If this approach is acceptable, ppc64 needs something similar.
Maybe we can put that into generic code, hidden inside CONFIG_PPC_PMAC?


--- linux-2.6.8-rc2/arch/ppc/platforms/pmac_pci.c	2004-06-16 07:19:23.000000000 +0200
+++ linux-2.6.8-rc2-legacy/arch/ppc/platforms/pmac_pci.c	2004-07-21 10:46:50.000000000 +0200
@@ -883,11 +883,59 @@ pcibios_fixup_OF_interrupts(void)
 	}
 }
 
+#define I8042_DATA_REG 0x60UL
+#define I8250_2_DATA_REG 0x2e0UL
+#define I8250_3_DATA_REG 0x3e0UL
+
+#define PARPORT_278_DATA_REG 0x278UL
+#define PARPORT_371_DATA_REG 0x371UL
+#define PARPORT_378_DATA_REG 0x378UL
+#define PARPORT_3BC_DATA_REG 0x3bcUL
+#define PARPORT_678_DATA_REG 0x678UL
+#define PARPORT_778_DATA_REG 0x778UL
+#define PARPORT_7BC_DATA_REG 0x7bcUL
+
+#define ISAPNP_WRITE_213_DATA_REG 0x213UL
+#define ISAPNP_WRITE_233_DATA_REG 0x233UL
+#define ISAPNP_WRITE_253_DATA_REG 0x253UL
+#define ISAPNP_WRITE_273_DATA_REG 0x273UL
+#define ISAPNP_WRITE_393_DATA_REG 0x393UL
+#define ISAPNP_WRITE_3B3_DATA_REG 0x3b3UL
+#define ISAPNP_WRITE_3D3_DATA_REG 0x3d3UL
+#define ISAPNP_WRITE_3F3_DATA_REG 0x3f3UL
+#define ISAPNP_WRITE_A19_DATA_REG 0xa19UL
+
+static void __init
+pmac_request_regions(void)
+{
+	printk("%s(%u)\n",__FUNCTION__,__LINE__);
+	request_region(I8042_DATA_REG, 16, "reserved (no i8042)");
+	request_region(I8250_2_DATA_REG, 32, "reserved (no i8250)");
+	request_region(I8250_3_DATA_REG, 32, "reserved (no i8250)");
+	request_region(PARPORT_278_DATA_REG, 8, "reserved (no parport");
+	request_region(PARPORT_371_DATA_REG, 7, "reserved (no parport");
+	request_region(PARPORT_378_DATA_REG, 8, "reserved (no parport");
+	request_region(PARPORT_3BC_DATA_REG, 8, "reserved (no parport");
+	request_region(PARPORT_678_DATA_REG, 8, "reserved (no parport");
+	request_region(PARPORT_778_DATA_REG, 8, "reserved (no parport");
+	request_region(PARPORT_7BC_DATA_REG, 8, "reserved (no parport");
+	request_region(ISAPNP_WRITE_A19_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_213_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_233_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_253_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_273_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_393_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_3B3_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_3D3_DATA_REG, 1, "reserved (no isa-pnp)");
+	request_region(ISAPNP_WRITE_3F3_DATA_REG, 1, "reserved (no isa-pnp)");
+}
+
 void __init
 pmac_pcibios_fixup(void)
 {
 	/* Fixup interrupts according to OF tree */
 	pcibios_fixup_OF_interrupts();
+	pmac_request_regions();
 }
 
 int __pmac

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-07-23 16:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-22  0:59 reserve legacy io regions on powermac Albert Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2004-07-21  9:12 Olaf Hering
2004-07-21 14:51 ` Benjamin Herrenschmidt
2004-07-21 14:56   ` Olaf Hering
2004-07-21 15:48     ` Geert Uytterhoeven
2004-07-21 17:08       ` Segher Boessenkool
2004-07-21 20:07   ` Jesse Barnes
2004-07-22  8:21     ` Segher Boessenkool
2004-07-23 14:21   ` Olaf Hering
2004-07-23 16:44 ` Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox