Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
/* $NetBSD: pcctwo.c,v 1.4 2000/09/06 19:51:43 scw Exp $ */
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by 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.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the NetBSD
|
|
|
|
* Foundation, Inc. and its contributors.
|
|
|
|
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
* PCCchip2 and MCchip Driver
|
1999-02-14 20:54:27 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/kernel.h>
|
2000-03-19 01:33:02 +03:00
|
|
|
#include <sys/systm.h>
|
1999-02-14 20:54:27 +03:00
|
|
|
#include <sys/device.h>
|
2000-03-19 01:33:02 +03:00
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
#include <machine/cpu.h>
|
2000-03-19 01:33:02 +03:00
|
|
|
#include <machine/bus.h>
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
#include <mvme68k/mvme68k/isr.h>
|
|
|
|
|
2000-03-19 01:33:02 +03:00
|
|
|
#include <mvme68k/dev/mainbus.h>
|
1999-02-14 20:54:27 +03:00
|
|
|
#include <mvme68k/dev/pcctworeg.h>
|
2000-03-19 01:33:02 +03:00
|
|
|
#include <mvme68k/dev/pcctwovar.h>
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Autoconfiguration stuff.
|
|
|
|
*/
|
2000-03-19 01:33:02 +03:00
|
|
|
void pcctwoattach __P((struct device *, struct device *, void *));
|
|
|
|
int pcctwomatch __P((struct device *, struct cfdata *, void *));
|
|
|
|
int pcctwoprint __P((void *, const char *));
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
struct cfattach pcctwo_ca = {
|
2000-03-19 01:33:02 +03:00
|
|
|
sizeof(struct pcctwo_softc), pcctwomatch, pcctwoattach
|
1999-02-14 20:54:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct cfdriver pcctwo_cd;
|
|
|
|
|
2000-03-19 01:33:02 +03:00
|
|
|
/*
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
* Global Pointer to the PCCChip2/MCchip soft state, and chip ID
|
2000-03-19 01:33:02 +03:00
|
|
|
*/
|
|
|
|
struct pcctwo_softc *sys_pcctwo;
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
/*
|
2000-03-19 01:33:02 +03:00
|
|
|
* Structure used to describe a device for autoconfiguration purposes.
|
1999-02-14 20:54:27 +03:00
|
|
|
*/
|
2000-03-19 01:33:02 +03:00
|
|
|
struct pcctwo_device {
|
|
|
|
char *pcc_name; /* name of device (e.g. "clock") */
|
|
|
|
bus_addr_t pcc_offset; /* offset from PCC2 base */
|
|
|
|
};
|
1999-02-14 20:54:27 +03:00
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
/*
|
|
|
|
* Macroes to make life easy when converting vector offset to interrupt
|
|
|
|
* control register, and how to initialise the ICSR.
|
|
|
|
*/
|
|
|
|
#define VEC2ICSR(r,v) ((r) | (((v) | PCCTWO_ICR_IEN) << 8))
|
|
|
|
#define VEC2ICSR_REG(x) ((x) & 0xff)
|
|
|
|
#define VEC2ICSR_INIT(x) ((x) >> 8)
|
|
|
|
|
|
|
|
#if defined(MVME167) || defined(MVME177)
|
1999-02-14 20:54:27 +03:00
|
|
|
/*
|
|
|
|
* Devices that live on the PCCchip2, attached in this order.
|
|
|
|
*/
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
static struct pcctwo_device pcctwo_devices[] = {
|
2000-03-19 01:33:02 +03:00
|
|
|
{"clock", PCCTWO_RTC_OFF},
|
|
|
|
{"clmpcc", PCCTWO_SCC_OFF},
|
|
|
|
{"ie", PCCTWO_IE_OFF},
|
|
|
|
{"ncrsc", PCCTWO_NCRSC_OFF},
|
|
|
|
{"lpt", PCCTWO_LPT_OFF},
|
|
|
|
{"nvram", PCCTWO_NVRAM_OFF},
|
|
|
|
{NULL, 0}
|
1999-02-14 20:54:27 +03:00
|
|
|
};
|
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
static int pcctwo_vec2icsr_1x7[] = {
|
|
|
|
VEC2ICSR(PCC2REG_PRT_BUSY_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_PRT_PE_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_PRT_SEL_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_PRT_FAULT_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_PRT_ACK_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_SCSI_ICSR, 0),
|
|
|
|
VEC2ICSR(PCC2REG_ETH_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_ETH_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_TIMER2_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_TIMER1_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_GPIO_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
-1,
|
|
|
|
VEC2ICSR(PCC2REG_SCC_RX_ICSR, 0),
|
|
|
|
VEC2ICSR(PCC2REG_SCC_MODEM_ICSR, 0),
|
|
|
|
VEC2ICSR(PCC2REG_SCC_TX_ICSR, 0),
|
|
|
|
VEC2ICSR(PCC2REG_SCC_RX_ICSR, 0)
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MVME162
|
|
|
|
/*
|
|
|
|
* Devices that live on the MCchip, attached in this order.
|
|
|
|
*/
|
|
|
|
static struct pcctwo_device mcchip_devices[] = {
|
|
|
|
{"clock", PCCTWO_RTC_OFF},
|
|
|
|
{"zsc", MCCHIP_ZS0_OFF},
|
|
|
|
{"zsc", MCCHIP_ZS1_OFF},
|
|
|
|
{"ie", PCCTWO_IE_OFF},
|
|
|
|
{"ncrsc", PCCTWO_NCRSC_OFF},
|
|
|
|
{"nvram", PCCTWO_NVRAM_OFF},
|
|
|
|
{NULL, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
static int pcctwo_vec2icsr_1x2[] = {
|
|
|
|
-1,
|
|
|
|
-1,
|
|
|
|
-1,
|
|
|
|
VEC2ICSR(MCCHIPREG_TIMER4_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(MCCHIPREG_TIMER3_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_SCSI_ICSR, 0),
|
|
|
|
VEC2ICSR(PCC2REG_ETH_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_ETH_ICSR, PCCTWO_ICR_EDGE | PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_TIMER2_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(PCC2REG_TIMER1_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
-1,
|
|
|
|
VEC2ICSR(MCCHIPREG_PARERR_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
VEC2ICSR(MCCHIPREG_SCC_ICSR, 0),
|
|
|
|
VEC2ICSR(MCCHIPREG_SCC_ICSR, 0),
|
|
|
|
VEC2ICSR(MCCHIPREG_ABORT_ICSR, PCCTWO_ICR_ICLR),
|
|
|
|
-1
|
|
|
|
};
|
|
|
|
|
|
|
|
static int pcctwoabortintr(void *);
|
|
|
|
#endif
|
|
|
|
|
2000-03-19 01:33:02 +03:00
|
|
|
/* ARGSUSED */
|
1999-02-14 20:54:27 +03:00
|
|
|
int
|
|
|
|
pcctwomatch(parent, cf, args)
|
|
|
|
struct device *parent;
|
|
|
|
struct cfdata *cf;
|
|
|
|
void *args;
|
|
|
|
{
|
2000-03-19 01:33:02 +03:00
|
|
|
struct mainbus_attach_args *ma;
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
bus_space_handle_t bh;
|
|
|
|
u_int8_t cid;
|
2000-03-19 01:33:02 +03:00
|
|
|
|
|
|
|
ma = args;
|
1999-02-14 20:54:27 +03:00
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
/* There can be only one. */
|
|
|
|
if (sys_pcctwo || strcmp(ma->ma_name, pcctwo_cd.cd_name))
|
|
|
|
return (0);
|
|
|
|
|
1999-02-14 20:54:27 +03:00
|
|
|
/*
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
* Grab the Chip's ID
|
1999-02-14 20:54:27 +03:00
|
|
|
*/
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
bus_space_map(ma->ma_bust, PCCTWO_REG_OFF + ma->ma_offset,
|
|
|
|
PCC2REG_SIZE, 0, &bh);
|
|
|
|
cid = bus_space_read_1(ma->ma_bust, bh, PCC2REG_CHIP_ID);
|
|
|
|
bus_space_unmap(ma->ma_bust, bh, PCC2REG_SIZE);
|
|
|
|
|
|
|
|
#if defined(MVME167) || defined(MVME177)
|
|
|
|
if ((machineid == MVME_167 || machineid == MVME_177) &&
|
|
|
|
cid == PCCTWO_CHIP_ID_PCC2)
|
|
|
|
return (1);
|
|
|
|
#endif
|
|
|
|
#ifdef MVME162
|
|
|
|
if (machineid == MVME_162 && cid == PCCTWO_CHIP_ID_MCCHIP)
|
|
|
|
return (1);
|
|
|
|
#endif
|
1999-02-14 20:54:27 +03:00
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
return (0);
|
1999-02-14 20:54:27 +03:00
|
|
|
}
|
|
|
|
|
2000-03-19 01:33:02 +03:00
|
|
|
/* ARGSUSED */
|
1999-02-14 20:54:27 +03:00
|
|
|
void
|
|
|
|
pcctwoattach(parent, self, args)
|
2000-03-19 01:33:02 +03:00
|
|
|
struct device *parent;
|
|
|
|
struct device *self;
|
1999-02-14 20:54:27 +03:00
|
|
|
void *args;
|
|
|
|
{
|
2000-03-19 01:33:02 +03:00
|
|
|
struct mainbus_attach_args *ma;
|
|
|
|
struct pcctwo_softc *sc;
|
|
|
|
struct pcctwo_attach_args npa;
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
struct pcctwo_device *pd;
|
|
|
|
u_int8_t cid;
|
1999-02-14 20:54:27 +03:00
|
|
|
|
2000-03-19 01:33:02 +03:00
|
|
|
ma = args;
|
|
|
|
sc = sys_pcctwo = (struct pcctwo_softc *) self;
|
1999-02-14 20:54:27 +03:00
|
|
|
|
2000-03-19 01:33:02 +03:00
|
|
|
/* Get a handle to the PCCChip2's registers */
|
|
|
|
sc->sc_bust = ma->ma_bust;
|
|
|
|
bus_space_map(sc->sc_bust, PCCTWO_REG_OFF + ma->ma_offset,
|
|
|
|
PCC2REG_SIZE, 0, &sc->sc_bush);
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Fix up the vector base for PCCChip2 Interrupts
|
|
|
|
*/
|
2000-03-19 01:33:02 +03:00
|
|
|
pcc2_reg_write(sc, PCC2REG_VECTOR_BASE, PCCTWO_VECBASE);
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable PCCChip2 Interrupts
|
|
|
|
*/
|
2000-03-19 01:33:02 +03:00
|
|
|
pcc2_reg_write(sc, PCC2REG_GENERAL_CONTROL,
|
|
|
|
pcc2_reg_read(sc, PCC2REG_GENERAL_CONTROL) | PCCTWO_GEN_CTRL_MIEN);
|
1999-02-14 20:54:27 +03:00
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
/* What are we? */
|
|
|
|
cid = pcc2_reg_read(sc, PCC2REG_CHIP_ID);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Announce ourselves to the world in general
|
|
|
|
*/
|
|
|
|
#if defined(MVME167) || defined(MVME177)
|
|
|
|
if (cid == PCCTWO_CHIP_ID_PCC2) {
|
|
|
|
printf(": Peripheral Channel Controller (PCCchip2), Rev %d\n",
|
|
|
|
pcc2_reg_read(sc, PCC2REG_CHIP_REVISION));
|
|
|
|
pd = pcctwo_devices;
|
|
|
|
sc->sc_vec2icsr = pcctwo_vec2icsr_1x7;
|
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
#ifdef MVME162
|
|
|
|
if (cid == PCCTWO_CHIP_ID_MCCHIP) {
|
|
|
|
printf(": Memory Controller ASIC (MCchip), Rev %d\n",
|
|
|
|
pcc2_reg_read(sc, PCC2REG_CHIP_REVISION));
|
|
|
|
pd = mcchip_devices;
|
|
|
|
sc->sc_vec2icsr = pcctwo_vec2icsr_1x2;
|
|
|
|
|
|
|
|
pcctwointr_establish(MCCHIPV_ABORT, pcctwoabortintr, 7, NULL);
|
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
/* This is one of those "Can't Happen" things ... */
|
|
|
|
panic("pcctwoattach: unsupported ASIC!");
|
|
|
|
}
|
|
|
|
|
1999-02-14 20:54:27 +03:00
|
|
|
/*
|
|
|
|
* Attach configured children.
|
|
|
|
*/
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
while (pd->pcc_name != NULL) {
|
1999-02-14 20:54:27 +03:00
|
|
|
/*
|
|
|
|
* Note that IPL is filled in by match function.
|
|
|
|
*/
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
npa.pa_name = pd->pcc_name;
|
1999-02-14 20:54:27 +03:00
|
|
|
npa.pa_ipl = -1;
|
2000-03-19 01:33:02 +03:00
|
|
|
npa.pa_dmat = ma->ma_dmat;
|
|
|
|
npa.pa_bust = ma->ma_bust;
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
npa.pa_offset = pd->pcc_offset + ma->ma_offset;
|
|
|
|
pd++;
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
/* Attach the device if configured. */
|
2000-03-19 01:33:02 +03:00
|
|
|
(void) config_found(self, &npa, pcctwoprint);
|
1999-02-14 20:54:27 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
pcctwoprint(aux, cp)
|
|
|
|
void *aux;
|
|
|
|
const char *cp;
|
|
|
|
{
|
2000-03-19 01:33:02 +03:00
|
|
|
struct pcctwo_attach_args *pa;
|
|
|
|
|
|
|
|
pa = aux;
|
1999-02-14 20:54:27 +03:00
|
|
|
|
|
|
|
if (cp)
|
|
|
|
printf("%s at %s", pa->pa_name, cp);
|
|
|
|
|
|
|
|
printf(" offset 0x%lx", pa->pa_offset);
|
|
|
|
if (pa->pa_ipl != -1)
|
|
|
|
printf(" ipl %d", pa->pa_ipl);
|
|
|
|
|
|
|
|
return (UNCONF);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* pcctwointr_establish: Establish PCCChip2 Interrupt
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
pcctwointr_establish(vec, hand, lvl, arg)
|
|
|
|
int vec;
|
|
|
|
int (*hand) __P((void *)), lvl;
|
|
|
|
void *arg;
|
|
|
|
{
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
int vec2icsr;
|
2000-03-19 01:33:02 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
if (vec < 0 || vec >= PCCTWOV_MAX) {
|
1999-02-14 20:54:27 +03:00
|
|
|
printf("pcctwo: illegal vector offset: 0x%x\n", vec);
|
|
|
|
panic("pcctwointr_establish");
|
|
|
|
}
|
2000-03-19 01:33:02 +03:00
|
|
|
if (lvl < 1 || lvl > 7) {
|
1999-02-14 20:54:27 +03:00
|
|
|
printf("pcctwo: illegal interrupt level: %d\n", lvl);
|
|
|
|
panic("pcctwointr_establish");
|
|
|
|
}
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
if (sys_pcctwo->sc_vec2icsr[vec] == -1) {
|
|
|
|
printf("pcctwo: unsupported vector: %d\n", vec);
|
|
|
|
panic("pcctwointr_establish");
|
|
|
|
}
|
2000-03-19 01:33:02 +03:00
|
|
|
#endif
|
1999-02-14 20:54:27 +03:00
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
vec2icsr = sys_pcctwo->sc_vec2icsr[vec];
|
|
|
|
pcc2_reg_write(sys_pcctwo, VEC2ICSR_REG(vec2icsr), 0);
|
|
|
|
|
|
|
|
/* Hook the interrupt */
|
1999-02-14 20:54:27 +03:00
|
|
|
isrlink_vectored(hand, arg, lvl, vec + PCCTWO_VECBASE);
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
|
|
|
|
/* Enable it in hardware */
|
|
|
|
pcc2_reg_write(sys_pcctwo, VEC2ICSR_REG(vec2icsr),
|
|
|
|
VEC2ICSR_INIT(vec2icsr) | lvl);
|
1999-02-14 20:54:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
pcctwointr_disestablish(vec)
|
|
|
|
int vec;
|
|
|
|
{
|
2000-03-19 01:33:02 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
if (vec < 0 || vec >= PCCTWOV_MAX) {
|
1999-02-14 20:54:27 +03:00
|
|
|
printf("pcctwo: illegal vector offset: 0x%x\n", vec);
|
2000-03-19 01:33:02 +03:00
|
|
|
panic("pcctwointr_disestablish");
|
1999-02-14 20:54:27 +03:00
|
|
|
}
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
if (sys_pcctwo->sc_vec2icsr[vec] == -1) {
|
|
|
|
printf("pcctwo: unsupported vector: %d\n", vec);
|
|
|
|
panic("pcctwointr_establish");
|
|
|
|
}
|
2000-03-19 01:33:02 +03:00
|
|
|
#endif
|
1999-02-14 20:54:27 +03:00
|
|
|
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
/* Disable it in hardware */
|
|
|
|
pcc2_reg_write(sys_pcctwo, sys_pcctwo->sc_vec2icsr[vec], 0);
|
|
|
|
|
1999-02-14 20:54:27 +03:00
|
|
|
isrunlink_vectored(vec + PCCTWO_VECBASE);
|
|
|
|
}
|
Add preliminary support for the MVME162-LX 200/300 series of boards.
Currently, the major onboard devices are supported (disk, network,
rs232 and VMEbus). However, work is still need to support the remaining
devices (eg. IndustryPack sites).
These boards are available with a dazzling array of build options. At
this time, the following options are *required*:
o Real floating point hardware (the 68LC040 model isn't tested),
o The VMEchip2 must be present,
o If offboard VMEbus RAM is not present, at least 8MB of onboard
RAM is required.
o Even if offboard VMEbus RAM *is* present, at least 4MB of onboard
RAM is required. (Boards with 1 or 2MB onboard RAM *can* be
supported with offboard RAM, but not without some funky values in
the VMEbus Master mapping registers.)
There is no support for boards other than those in the -LX 200/300 series.
2000-09-06 23:51:42 +04:00
|
|
|
|
|
|
|
#ifdef MVME162
|
|
|
|
static int
|
|
|
|
pcctwoabortintr(void *frame)
|
|
|
|
{
|
|
|
|
|
|
|
|
pcc2_reg_write(sys_pcctwo, MCCHIPREG_ABORT_ICSR, PCCTWO_ICR_ICLR |
|
|
|
|
pcc2_reg_read(sys_pcctwo, MCCHIPREG_ABORT_ICSR));
|
|
|
|
|
|
|
|
return (nmihand(frame));
|
|
|
|
}
|
|
|
|
#endif
|