From 852962d3c5fec2c149e0d58edc8345f1148afeff Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sat, 4 Jun 2005 21:52:56 +0000 Subject: [PATCH] On AXi and AXmp boards the NS16550 (used to connect keyboard and mouse) share their IRQ lines with the i8042. Any IRQ activity (typically during attach) on the NS16550 used to connect the keyboard when actually the PS/2 keyboard is selected in OFW causes interaction with the OBP i8042 driver resulting in a hang (and vice versa). As RS232 keyboards and mice obviously aren't meant to be used in parallel with PS/2 ones on these boards don't attach to these NS16550 in case the RS232 keyboard isn't selected in order to prevent such hangs. Ok'ed by: marcel --- sys/dev/uart/uart_bus_ebus.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/dev/uart/uart_bus_ebus.c b/sys/dev/uart/uart_bus_ebus.c index 15e8bcb9899..16a4411dccd 100644 --- a/sys/dev/uart/uart_bus_ebus.c +++ b/sys/dev/uart/uart_bus_ebus.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -64,6 +65,7 @@ uart_ebus_probe(device_t dev) { const char *nm, *cmpt; struct uart_softc *sc; + struct uart_devinfo dummy; int error; sc = device_get_softc(dev); @@ -73,6 +75,24 @@ uart_ebus_probe(device_t dev) cmpt = ofw_bus_get_compat(dev); if (!strcmp(nm, "su") || !strcmp(nm, "su_pnp") || (cmpt != NULL && (!strcmp(cmpt, "su") || !strcmp(cmpt, "su16550")))) { + /* + * On AXi and AXmp boards the NS16550 (used to connect + * keyboard/mouse) share their IRQ lines with the i8042. + * Any IRQ activity (typically during attach) of the + * NS16550 used to connect the keyboard when actually the + * PS/2 keyboard is selected in OFW causes interaction + * with the OBP i8042 driver resulting in a hang and vice + * versa. As RS232 keyboards and mice obviously aren't + * meant to be used in parallel with PS/2 ones on these + * boards don't attach to the NS16550 in case the RS232 + * keyboard isn't selected in order to prevent such hangs. + */ + if ((!strcmp(sparc64_model, "SUNW,UltraAX-MP") || + !strcmp(sparc64_model, "SUNW,UltraSPARC-IIi-Engine")) && + uart_cpu_getdev(UART_DEV_KEYBOARD, &dummy)) { + device_disable(dev); + return (ENXIO); + } sc->sc_class = &uart_ns8250_class; return (uart_bus_probe(dev, 0, 0, 0, 0)); }