Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/dev pckbc@ebus: match "kb_ps2" device to ma...
details: https://anonhg.NetBSD.org/src/rev/540987f4b4a1
branches: trunk
changeset: 339869:540987f4b4a1
user: nakayama <nakayama%NetBSD.org@localhost>
date: Fri Aug 14 10:59:27 2015 +0000
description:
pckbc@ebus: match "kb_ps2" device to make keyboard and mouse work
on qemu-sparc64.
XXX OpenBIOS doesn't provide interrupts for pckbc currently, so use
the interrupt numbers described in QEMU's hw/sparc64/sun4u.c::isa_irq_handler.
diffstat:
sys/arch/sparc64/dev/pckbc_ebus.c | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diffs (66 lines):
diff -r 91e75860566d -r 540987f4b4a1 sys/arch/sparc64/dev/pckbc_ebus.c
--- a/sys/arch/sparc64/dev/pckbc_ebus.c Fri Aug 14 06:54:22 2015 +0000
+++ b/sys/arch/sparc64/dev/pckbc_ebus.c Fri Aug 14 10:59:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc_ebus.c,v 1.1 2012/10/09 20:55:04 jdc Exp $ */
+/* $NetBSD: pckbc_ebus.c,v 1.2 2015/08/14 10:59:27 nakayama Exp $ */
/*
* Copyright (c) 2002 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbc_ebus.c,v 1.1 2012/10/09 20:55:04 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc_ebus.c,v 1.2 2015/08/14 10:59:27 nakayama Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -58,6 +58,7 @@
static void pckbc_ebus_intr_establish(struct pckbc_softc *, pckbport_slot_t);
#define PCKBC_PROM_DEVICE_NAME "8042"
+#define PCKBC_PROM_DEVICE_NAME2 "kb_ps2"
CFATTACH_DECL_NEW(pckbc_ebus, sizeof(struct pckbc_ebus_softc),
pckbc_ebus_match, pckbc_ebus_attach, NULL, NULL);
@@ -68,7 +69,10 @@
{
struct ebus_attach_args *ea = aux;
- return (strcmp(ea->ea_name, PCKBC_PROM_DEVICE_NAME) == 0);
+ if (strcmp(ea->ea_name, PCKBC_PROM_DEVICE_NAME) == 0 ||
+ strcmp(ea->ea_name, PCKBC_PROM_DEVICE_NAME2) == 0)
+ return 1;
+ return 0;
}
static void
@@ -98,8 +102,25 @@
psc->intr_establish = pckbc_ebus_intr_establish;
- for (i = 0; i < PCKBC_NSLOTS; i++)
- sc->psc_intr[i] = ea->ea_intr[i];
+ if (ea->ea_nintr < PCKBC_NSLOTS) {
+ aprint_error(": no intr %d", ea->ea_nintr);
+
+ /*
+ * XXX OpenBIOS doesn't provide interrupts for pckbc
+ * currently, so use the interrupt numbers described in
+ * QEMU's hw/sparc64/sun4u.c::isa_irq_handler.
+ */
+ if (strcmp(machine_model, "OpenBiosTeam,OpenBIOS") == 0) {
+ sc->psc_intr[PCKBC_KBD_SLOT] = 0x29;
+ sc->psc_intr[PCKBC_AUX_SLOT] = 0x2a;
+ } else {
+ aprint_error("\n");
+ return;
+ }
+ } else {
+ for (i = 0; i < PCKBC_NSLOTS; i++)
+ sc->psc_intr[i] = ea->ea_intr[i];
+ }
if (isconsole) {
int status;
Home |
Main Index |
Thread Index |
Old Index