/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Michael Smith and Jason R. Thorpe.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Apollo Domain keyboard routines for the standalone ITE.
*/
#include <hp300/dev/frodoreg.h> /* for apci offsets */
#include <hp300/dev/intioreg.h> /* for frodo offsets */
#include <hp300/stand/common/dcareg.h> /* for the register bit definitions */
#include <hp300/stand/common/apcireg.h> /* for the apci registers */
#include <hp300/stand/common/samachdep.h>
#include <hp300/stand/common/kbdvar.h>
/* Is this the start of a mouse packet? */
if (c == 0xdf) {
dnkbd_ignore = 3; /* 3 bytes of junk */
return 0;
}
/* It's a keyboard event. */
switch (dnkbd_keymap[c]) {
case 0x00:
/* passthrough */
break;
case 0xff:
/* ignore */
c = 0;
break;
default:
c = dnkbd_keymap[c];
break;
}
}
return c;
}
#endif /* SMALL */
void
dnkbd_nmi(void)
{
/*
* XXX Should we do anything? Can we even generate one?
*/
}
int
dnkbd_init(void)
{
/*
* 400, 425, and 433 models can have a Domain keyboard.
*/
switch (machineid) {
case HP_400:
case HP_425:
case HP_433:
break;
default:
return 0;
}
/*
* Look for a Frodo utility chip. If we find one, assume there
* is a Domain keyboard attached.
*/
if (badaddr((void *)IIOV(INTIOBASE + FRODO_BASE +
FRODO_APCI_OFFSET(0))))
return 0;
/*
* XXX Any other initialization? This appears to work ok.
*/
return 1;
}
#endif /* ITECONSOLE && DOMAIN_KEYBOARD */