/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by UCHIYAMA Yasushi.
*
* 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.
*/
const struct evcnt *
isa_intr_evcnt(isa_chipset_tag_t ic, int irq)
{
/* XXX for now, no evcnt parent reported */
return (NULL);
}
void *
isa_intr_establish(isa_chipset_tag_t ic, int intr, int type, int level,
int (*ih_fun)(void*), void *ih_arg)
{
struct vrisab_softc *sc = ic->ic_sc;
int port, irq, mode;
int
isa_intr_alloc(isa_chipset_tag_t ic, int mask, int type, int *irq)
{
/* XXX not coded yet. this is temporary XXX */
DPRINTF(("isa_intr_alloc:"));
DBITDISP(mask);
*irq = (ffs(mask) -1); /* XXX */
return (0);
}
#ifdef DEBUG_FIND_PCIC
#warning DEBUG_FIND_PCIC
static void
__find_pcic(void)
{
int i, j, step, found;
u_int32_t addr;
u_int8_t reg;
int __read_revid (u_int32_t port)
{
addr = MIPS_PHYS_TO_KSEG1(i + port);
printf("%#x\r", i);
for (found = 0, j = 0; j < 0x100; j += 0x40) {
*((volatile u_int8_t *)addr) = j;
reg = *((volatile u_int8_t *)(addr + 1));
#ifdef DEBUG_FIND_PCIC_I82365SL_ONLY
if (reg == 0x82 || reg == 0x83) {
#else
if ((reg & 0xc0) == 0x80) {
#endif
found++;
}
if (found)
printf("\nfound %d socket at %#x"
"(base from %#x)\n", found, addr,
i + port - VR_ISA_PORT_BASE);
}
}
step = 0x1000000;
printf("\nFinding PCIC. Trying ISA port %#x-%#x step %#x\n",
VR_ISA_PORT_BASE, VR_ISA_PORT_BASE + VR_ISA_PORT_SIZE, step);
for (i = VR_ISA_PORT_BASE; i < VR_ISA_PORT_BASE+VR_ISA_PORT_SIZE;
i+= step) {
__read_revid (0x3e0);
__read_revid (0x3e2);
}
}
#endif /* DEBUG_FIND_PCIC */