public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: linux-kernel@vger.kernel.org, Paul Mackeras <paulus@samba.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Olaf Hering <olh@suse.de>
Subject: reserve legacy io regions on powermac
Date: Wed, 21 Jul 2004 11:12:49 +0200	[thread overview]
Message-ID: <20040721091249.GA1336@suse.de> (raw)


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

             reply	other threads:[~2004-07-21  9:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-21  9:12 Olaf Hering [this message]
2004-07-21 14:51 ` reserve legacy io regions on powermac 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
  -- strict thread matches above, loose matches on Subject: below --
2004-07-22  0:59 Albert Cahalan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040721091249.GA1336@suse.de \
    --to=olh@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox