/*-
* Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe and Steve C. Woodford.
*
* 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.
*/
/*
* VME support specific to the Type 1 VMEchip found on the
* MVME-147.
*
* For a manual on the MVME-147, call: 408.991.8634. (Yes, this
* is the Sunnyvale sales office.)
*/
/*
* Adjust the start address of the first range in vme_pcc_masters[]
* according to how much onboard memory exists. Disable the first
* range if onboard memory >= 16Mb, and adjust the start of the
* second range (A32D32).
*/
vme_pcc_masters[0].vr_vmestart = (vme_addr_t) mem_clusters[0].size;
if (mem_clusters[0].size >= 0x01000000) {
vme_pcc_masters[0].vr_am = MVMEBUS_AM_DISABLED;
vme_pcc_masters[1].vr_vmestart +=
(vme_addr_t) (mem_clusters[0].size - 0x01000000);
}
am = 0;
reg = vme1_reg_read(sc, VME1REG_SLADDRMOD);
if ((reg & VME1_SLMOD_DATA) != 0)
am |= MVMEBUS_AM_CAP_DATA;
if ((reg & VME1_SLMOD_PRGRM) != 0)
am |= MVMEBUS_AM_CAP_PROG;
if ((reg & VME1_SLMOD_SUPER) != 0)
am |= MVMEBUS_AM_CAP_SUPER;
if ((reg & VME1_SLMOD_USER) != 0)
am |= MVMEBUS_AM_CAP_USER;
if ((reg & VME1_SLMOD_BLOCK) != 0)
am |= MVMEBUS_AM_CAP_BLK;
void
vme_pcc_intr_establish(void *csc, int prior, int level, int vector, int first, int (*func)(void *), void *arg, struct evcnt *evcnt)
{
struct vme_pcc_softc *sc = csc;
if (prior != level)
panic("vme_pcc_intr_establish: CPU priority != VMEbus irq level");
if (first) {
evcnt_attach_dynamic(evcnt, EVCNT_TYPE_INTR,
isrlink_evcnt(prior), device_xname(sc->sc_mvmebus.sc_dev),
mvmebus_irq_name[level]);
/*
* There had better not be another VMEbus master responding
* to this interrupt level...
*/
vme1_reg_write(sc, VME1REG_IRQEN,
vme1_reg_read(sc, VME1REG_IRQEN) | VME1_IRQ_VME(level));
}
}
void
vme_pcc_intr_disestablish(void *csc, int level, int vector, int last, struct evcnt *evcnt)
{
struct vme_pcc_softc *sc = csc;