[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debian boot CDs & G5



 On Sat, Apr 24, Christoph Hellwig wrote:

> On Sat, Apr 24, 2004 at 05:02:51PM +1000, Benjamin Herrenschmidt wrote:
> > Hi Sven !
> > 
> > The current CDs won't boot a G5 with the -power4 option. The problem
> > is that the kernel contains legacy drivers (8250 serial, etc...) that
> > are fine for IBM POWER4 hardware, but will lockup a G5. You really need
> > different kernel images for now.
> 
> Sure seems to have lots of little patches to check the ppc subarch in
> all those drivers.  Any plan to get them into mainline while we're at
> it.

I disabled all these drivers with a
if(_machine == _MACH_Pmac)
        return -ENODEV;

pcspkr will even kill a g4 reliable after a while if compiled into the
kernel.
parallel port is still missing, but should be trivial to add.
serial is really needed if zilog and 8250 are compiled in, there is even
a bugzilla open for that one.

they really should go into mainline.

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

sUse lINUX ag, nÜRNBERG
--- linux-2.6.4.vanilla/drivers/input/misc/pcspkr.c	2003-12-18 03:58:57.000000000 +0100
+++ ./drivers/input/misc/pcspkr.c	2004-03-27 12:09:43.864500707 +0100
@@ -17,6 +17,9 @@
 #include <linux/init.h>
 #include <linux/input.h>
 #include <asm/io.h>
+#ifdef CONFIG_PPC_PMAC
+#include <asm/processor.h>
+#endif
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("PC Speaker beeper driver");
@@ -67,6 +70,12 @@ static int pcspkr_event(struct input_dev
 
 static int __init pcspkr_init(void)
 {
+#ifdef CONFIG_PPC_PMAC
+	if(_machine == _MACH_Pmac) {
+		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
+		return -ENODEV;
+	}
+#endif
 	pcspkr_dev.evbit[0] = BIT(EV_SND);
 	pcspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
 	pcspkr_dev.event = pcspkr_event;
diff -p -purN linux-2.6.2/drivers/block/floppy.c linux-2.6.2.pc_floppy/drivers/block/floppy.c
--- linux-2.6.2/drivers/block/floppy.c	2004-02-10 16:20:24.000000000 +0100
+++ linux-2.6.2.pc_floppy/drivers/block/floppy.c	2004-02-10 16:33:11.000000000 +0100
@@ -182,6 +182,9 @@ static int print_unex=1;
 #include <linux/device.h>
 #include <linux/buffer_head.h>		/* for invalidate_buffers() */
 
+#ifdef CONFIG_PPC_PMAC
+#include <asm/processor.h>
+#endif
 /*
  * PS/2 floppies have much slower step rates than regular floppies.
  * It's been recommended that take about 1/4 of the default speed
@@ -4236,6 +4239,12 @@ int __init floppy_init(void)
 	int i,unit,drive;
 	int err;
 
+#ifdef CONFIG_PPC_PMAC
+	if(_machine == _MACH_Pmac) {
+		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
+		return -ENODEV;
+	}
+#endif
 	raw_cmd = NULL;
 
 	for (i=0; i<N_DRIVE; i++) {
diff -purNX /home/olaf/kernel/kernel_exclude.txt linux-2.6.0-test11.orig/drivers/input/serio/i8042-ppcio.h linux-2.6.0-test11.SuSE/drivers/input/serio/i8042-ppcio.h
--- linux-2.6.0-test11.orig/drivers/input/serio/i8042-ppcio.h	2003-11-26 20:43:24.000000000 +0000
+++ linux-2.6.0-test11.SuSE/drivers/input/serio/i8042-ppcio.h	2003-11-29 16:07:15.000000000 +0000
@@ -127,6 +127,73 @@ static inline void i8042_platform_exit(v
 {
 }
 
+#elif defined(CONFIG_PPC_MULTIPLATFORM)
+
+#include <asm/processor.h>
+
+/*
+ * Names.
+ */
+
+#define I8042_KBD_PHYS_DESC "isa0060/serio0"
+#define I8042_AUX_PHYS_DESC "isa0060/serio1"
+#define I8042_MUX_PHYS_DESC "isa0060/serio%d"
+
+/*
+ * IRQs.
+ */
+
+# define I8042_KBD_IRQ	1
+# define I8042_AUX_IRQ	12
+
+/*
+ * Register numbers.
+ */
+
+#define I8042_COMMAND_REG	0x64	
+#define I8042_STATUS_REG	0x64	
+#define I8042_DATA_REG		0x60
+
+static inline int i8042_read_data(void)
+{
+	return inb(I8042_DATA_REG);
+}
+
+static inline int i8042_read_status(void)
+{
+	return inb(I8042_STATUS_REG);
+}
+
+static inline void i8042_write_data(int val)
+{
+	outb(val, I8042_DATA_REG);
+	return;
+}
+
+static inline void i8042_write_command(int val)
+{
+	outb(val, I8042_COMMAND_REG);
+	return;
+}
+
+static inline int i8042_platform_init(void)
+{
+	if(_machine == _MACH_Pmac) {
+		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
+		return -ENODEV;
+	}
+	if (!request_region(I8042_DATA_REG, 16, "i8042"))
+		return -1;
+
+        i8042_reset = 1;
+	return 0;
+}
+
+static inline void i8042_platform_exit(void)
+{
+	release_region(I8042_DATA_REG, 16);
+}
+
 #else
 
 #include "i8042-io.h"
diff -purNX /home/olaf/kernel/kernel_exclude.txt linux-2.6.0-test11.orig/drivers/pnp/isapnp/core.c linux-2.6.0-test11.SuSE/drivers/pnp/isapnp/core.c
--- linux-2.6.0-test11.orig/drivers/pnp/isapnp/core.c	2003-11-26 20:44:19.000000000 +0000
+++ linux-2.6.0-test11.SuSE/drivers/pnp/isapnp/core.c	2003-11-29 16:24:39.000000000 +0000
@@ -1081,6 +1081,11 @@ int __init isapnp_init(void)
 	struct pnp_card *card;
 	struct pnp_dev *dev;
 
+#if defined(CONFIG_PPC_MULTIPLATFORM)
+#include <asm/processor.h>
+	if(_machine == _MACH_Pmac)
+		isapnp_disable = 1;
+#endif
 	if (isapnp_disable) {
 		isapnp_detected = 0;
 		printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n");
diff -purNX /home/olaf/kernel/kernel_exclude.txt linux-2.6.0-test11.orig/drivers/serial/8250.c linux-2.6.0-test11.SuSE/drivers/serial/8250.c
--- linux-2.6.0-test11.orig/drivers/serial/8250.c	2003-11-26 20:42:55.000000000 +0000
+++ linux-2.6.0-test11.SuSE/drivers/serial/8250.c	2003-11-29 15:57:50.000000000 +0000
@@ -45,6 +45,10 @@
 #include <linux/serial_core.h>
 #include "8250.h"
 
+#ifdef CONFIG_PPC_MULTIPLATFORM
+#include <asm/processor.h>
+#endif
+
 /*
  * Configuration:
  *   share_irqs - whether we pass SA_SHIRQ to request_irq().  This option
@@ -2008,6 +2044,12 @@ static struct console serial8250_console
 
 static int __init serial8250_console_init(void)
 {
+#ifdef CONFIG_PPC_MULTIPLATFORM
+	if(_machine == _MACH_Pmac) {
+		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
+		return -ENODEV;
+	}
+#endif
 	serial8250_isa_init_ports();
 	register_console(&serial8250_console);
 	return 0;
@@ -2149,6 +2191,12 @@ static int __init serial8250_init(void)
 {
 	int ret, i;
 
+#ifdef CONFIG_PPC_MULTIPLATFORM
+	if(_machine == _MACH_Pmac) {
+		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
+		return -ENODEV;
+	}
+#endif
 	printk(KERN_INFO "Serial: 8250/16550 driver $Revision: 1.90 $ "
 		"%d ports, IRQ sharing %sabled\n", (int) UART_NR,
 		share_irqs ? "en" : "dis");

Reply to: