1996-04-22 01:10:48 +04:00
|
|
|
/* $NetBSD: gvpbus.c,v 1.11 1996/04/21 21:11:36 veego Exp $ */
|
1994-10-26 05:01:24 +03:00
|
|
|
|
1994-05-08 09:52:54 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1994 Christian E. Hopps
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* 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 Christian E. Hopps.
|
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
|
|
|
|
*/
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/device.h>
|
1996-04-22 01:10:48 +04:00
|
|
|
#include <sys/systm.h>
|
1994-05-08 09:52:54 +04:00
|
|
|
#include <amiga/amiga/device.h>
|
1994-12-28 12:24:55 +03:00
|
|
|
#include <amiga/dev/zbusvar.h>
|
1994-05-08 09:52:54 +04:00
|
|
|
#include <amiga/dev/gvpbusvar.h>
|
|
|
|
|
|
|
|
void gvpbusattach __P((struct device *, struct device *, void *));
|
1996-03-17 04:16:48 +03:00
|
|
|
int gvpbusmatch __P((struct device *, void *, void *));
|
1994-05-08 09:52:54 +04:00
|
|
|
int gvpbusprint __P((void *auxp, char *));
|
|
|
|
|
1995-02-12 22:18:33 +03:00
|
|
|
extern int sbic_no_dma; /* Kludge for A1291 - mlh */
|
|
|
|
|
1996-03-17 04:16:48 +03:00
|
|
|
struct cfattach gvpbus_ca = {
|
|
|
|
sizeof(struct device), gvpbusmatch, gvpbusattach
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cfdriver gvpbus_cd = {
|
|
|
|
NULL, "gvpbus", DV_DULL, NULL, 0
|
|
|
|
};
|
1994-05-08 09:52:54 +04:00
|
|
|
|
|
|
|
int
|
1996-03-17 04:16:48 +03:00
|
|
|
gvpbusmatch(pdp, match, auxp)
|
1994-05-08 09:52:54 +04:00
|
|
|
struct device *pdp;
|
1996-03-17 04:16:48 +03:00
|
|
|
void *match, *auxp;
|
1994-05-08 09:52:54 +04:00
|
|
|
{
|
1994-12-28 12:24:55 +03:00
|
|
|
struct zbus_args *zap;
|
1994-05-08 09:52:54 +04:00
|
|
|
|
|
|
|
zap = auxp;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check manufacturer and product id.
|
|
|
|
*/
|
1994-06-21 08:02:13 +04:00
|
|
|
#if 0
|
1994-05-26 01:55:04 +04:00
|
|
|
if (zap->manid == 2017 && (zap->prodid == 11 || zap->prodid == 2))
|
1994-06-21 08:02:13 +04:00
|
|
|
#else
|
|
|
|
if (zap->manid == 2017 && zap->prodid == 11)
|
|
|
|
#endif
|
1994-05-08 09:52:54 +04:00
|
|
|
return(1);
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gvpbusattach(pdp, dp, auxp)
|
|
|
|
struct device *pdp, *dp;
|
|
|
|
void *auxp;
|
|
|
|
{
|
1994-12-28 12:24:55 +03:00
|
|
|
struct zbus_args *zap;
|
1994-05-08 09:52:54 +04:00
|
|
|
struct gvpbus_args ga;
|
|
|
|
|
|
|
|
zap = auxp;
|
1994-12-28 12:24:55 +03:00
|
|
|
bcopy(zap, &ga.zargs, sizeof(struct zbus_args));
|
1994-05-08 09:52:54 +04:00
|
|
|
ga.flags = 0;
|
|
|
|
|
|
|
|
/*
|
1994-05-26 01:55:04 +04:00
|
|
|
* grab secondary type (or fake it if we have a series I)
|
1994-05-08 09:52:54 +04:00
|
|
|
*/
|
1995-08-18 19:27:29 +04:00
|
|
|
if (zap->prodid != 9) {
|
1994-05-26 01:55:04 +04:00
|
|
|
ga.prod = *((u_char *)zap->va + 0x8001) & 0xf8;
|
1995-08-18 19:27:29 +04:00
|
|
|
if (*((u_char *)zap->va + 0x8001) & 0x01)
|
|
|
|
ga.flags |= GVP_14MHZ;
|
|
|
|
printf(": subprod %02x flags %02x", *((u_char *)zap->va + 0x8001), ga.flags);
|
1994-06-21 08:02:13 +04:00
|
|
|
#if 0
|
1995-08-18 19:27:29 +04:00
|
|
|
} else {
|
1994-05-26 01:55:04 +04:00
|
|
|
ga.prod = GVP_SERIESII; /* really a series I */
|
|
|
|
ga.flags |= GVP_NOBANK;
|
1994-06-21 08:02:13 +04:00
|
|
|
#endif
|
1995-08-18 19:27:29 +04:00
|
|
|
}
|
1994-05-26 01:55:04 +04:00
|
|
|
|
|
|
|
|
1994-05-08 09:52:54 +04:00
|
|
|
switch (ga.prod) {
|
|
|
|
/* no scsi */
|
|
|
|
case GVP_GFORCE_040:
|
|
|
|
case GVP_GFORCE_030:
|
|
|
|
ga.flags = GVP_IO;
|
|
|
|
/*FALLTHROUGH*/
|
|
|
|
case GVP_COMBO_R4:
|
|
|
|
case GVP_COMBO_R3:
|
|
|
|
ga.flags |= GVP_ACCEL;
|
|
|
|
break;
|
|
|
|
/* scsi */
|
1995-02-12 22:18:33 +03:00
|
|
|
case GVP_A1291_SCSI:
|
1995-08-18 19:27:29 +04:00
|
|
|
ga.flags |= GVP_SCSI | GVP_ACCEL;
|
1995-02-12 22:18:33 +03:00
|
|
|
sbic_no_dma = 1; /* Kludge !!!!!!! mlh */
|
|
|
|
break;
|
1994-05-08 09:52:54 +04:00
|
|
|
case GVP_GFORCE_040_SCSI:
|
1995-08-18 19:27:29 +04:00
|
|
|
ga.flags |= GVP_SCSI | GVP_IO | GVP_ACCEL;
|
1994-05-08 09:52:54 +04:00
|
|
|
break;
|
|
|
|
case GVP_GFORCE_030_SCSI:
|
1995-08-18 19:27:29 +04:00
|
|
|
ga.flags |= GVP_SCSI | GVP_IO | GVP_ACCEL | GVP_25BITDMA;
|
1994-05-08 09:52:54 +04:00
|
|
|
break;
|
1995-03-05 16:01:24 +03:00
|
|
|
case GVP_A530_SCSI:
|
1994-05-08 09:52:54 +04:00
|
|
|
case GVP_COMBO_R4_SCSI:
|
1995-08-18 19:27:29 +04:00
|
|
|
ga.flags |= GVP_SCSI | GVP_ACCEL | GVP_25BITDMA;
|
|
|
|
if (ga.prod == GVP_COMBO_R4_SCSI)
|
|
|
|
ga.flags ^= GVP_14MHZ;
|
1994-05-08 09:52:54 +04:00
|
|
|
break;
|
|
|
|
case GVP_COMBO_R3_SCSI:
|
1995-08-18 19:27:29 +04:00
|
|
|
ga.flags |= GVP_SCSI | GVP_ACCEL | GVP_24BITDMA;
|
|
|
|
ga.flags ^= GVP_14MHZ;
|
1994-05-08 09:52:54 +04:00
|
|
|
break;
|
|
|
|
case GVP_SERIESII:
|
1994-05-26 01:55:04 +04:00
|
|
|
ga.flags |= GVP_SCSI | GVP_24BITDMA;
|
1994-05-08 09:52:54 +04:00
|
|
|
break;
|
|
|
|
/* misc */
|
|
|
|
case GVP_IOEXTEND:
|
|
|
|
ga.flags |= GVP_IO;
|
|
|
|
break;
|
|
|
|
default:
|
1994-12-28 12:24:55 +03:00
|
|
|
printf(": unknown Series II %x", ga.prod);
|
1994-05-08 09:52:54 +04:00
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
/*
|
|
|
|
* attempt to configure the board.
|
|
|
|
*/
|
|
|
|
config_found(dp, &ga, gvpbusprint);
|
|
|
|
/*
|
|
|
|
* eventually when io support is added we need to
|
|
|
|
* configure that too.
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
gvpbusprint(auxp, pnp)
|
|
|
|
void *auxp;
|
|
|
|
char *pnp;
|
|
|
|
{
|
|
|
|
struct gvpbus_args *gap;
|
|
|
|
|
|
|
|
gap = auxp;
|
|
|
|
if (pnp == NULL)
|
|
|
|
return(QUIET);
|
|
|
|
/*
|
|
|
|
* doesn't support io yet.
|
|
|
|
*/
|
|
|
|
if (gap->prod == GVP_IOEXTEND)
|
|
|
|
printf("gio at %s", pnp);
|
|
|
|
else
|
|
|
|
printf("gtsc at %s", pnp);
|
|
|
|
return(UNCONF);
|
|
|
|
}
|
|
|
|
|