Clean up deleted files.

This commit is contained in:
mycroft 1994-12-28 09:26:13 +00:00
parent 4726ce2818
commit bf085a3795
5 changed files with 0 additions and 888 deletions

View File

@ -1,303 +0,0 @@
; ** $NetBSD: Zeus.script,v 1.4 1994/10/26 02:02:39 cgd Exp $
; **
; ** 53C710 SCRIPTS for Progressive Peripherals, Inc. Zeus SCSI-2 driver
; **
; **
; ** Absolute definitions
; **
ABSOLUTE ds_Device = 0x00
ABSOLUTE ds_Identify = ds_Device + 4
ABSOLUTE ds_Cmd = ds_Identify + 8
ABSOLUTE ds_Status = ds_Cmd + 8
ABSOLUTE ds_Msg = ds_Status + 8
ABSOLUTE ds_MsgOut = ds_Msg + 8
ABSOLUTE ds_MsgIn = ds_MsgOut + 8
ABSOLUTE ds_Data = ds_MsgIn + 8
;ABSOLUTE xx = 0x00ff00
;ABSOLUTE xx = 0x00ff01
;ABSOLUTE xx = 0x00ff02
;ABSOLUTE xx = 0x00ff03
;ABSOLUTE xx = 0x00ff04
;ABSOLUTE xx = 0x00ff05
;ABSOLUTE xx = 0x00ff06
;ABSOLUTE xx = 0x00ff07
;ABSOLUTE xx = 0x00ff08
;ABSOLUTE xx = 0x00ff09
;ABSOLUTE xx = 0x00ff10
;ABSOLUTE xx = 0x00ff11
;ABSOLUTE xx = 0x00ff12
;ABSOLUTE xx = 0x00ff13
;ABSOLUTE xx = 0x00ff14
;ABSOLUTE xx = 0x00ff15
;ABSOLUTE xx = 0x00ff16
;ABSOLUTE xx = 0x00ff17
;ABSOLUTE xx = 0x00ff18
;ABSOLUTE xx = 0x00ff19
;ABSOLUTE xx = 0x00ff20
;ABSOLUTE xx = 0x00ff21
;ABSOLUTE xx = 0x00ff22
;ABSOLUTE xx = 0x00ff23
;ABSOLUTE xx = 0x00ff24
;ABSOLUTE xx = 0x00ff25
;ABSOLUTE xx = 0x00ff26
;ABSOLUTE xx = 0x00fffb
;ABSOLUTE xx = 0x00fffc
;ABSOLUTE xx = 0x00fffd
;ABSOLUTE xx = 0x00fffe
ENTRY msgout, cmd, status, msgin, dataout, datain
PROC scripts:
; **
; ** Initial starting point - select device with ATN
; **
SELECT ATN FROM ds_Device, REL(x288)
JUMP REL(status), WHEN Status
MOVE CTEST7 | 0x10 TO CTEST7 ; ** disable selection timeout?
; **
; ** Should be message out phase [older devices won't respond to Select with ATN]
; **
msgout:
JUMP REL(cmd), IF Cmd ; **FIX** target wants command directly
INT 0x0000ff01, IF NOT Msg_Out ; ** expected message out
MOVE SCRATCH1 | 0x00 TO SFBR
JUMP REL(x78), IF 0x00
; **
; ** Scratch1 != 00 means we have a special message to send to the target
; ** (the synchronous negotiation message)
x30:
SET ATN
MOVE FROM ds_MsgOut, WHEN Msg_Out ; ** send message
x40:
JUMP REL(status), WHEN Status
MOVE FROM ds_MsgIn, WHEN Msg_In ; ** receive response
JUMP REL(status), WHEN Status
JUMP REL(x30), IF Msg_Out
JUMP REL(status), IF Status
JUMP REL(x180), IF Msg_In
JUMP REL(cmd)
; **
; ** send identify message
; **
x78:
MOVE FROM ds_Identify, WHEN Msg_Out
JUMP REL(status), WHEN Status
JUMP REL(x78), IF Msg_Out
JUMP REL(status), IF Status
JUMP REL(x180), IF Msg_In
; **
; ** Should be in command phase
; **
cmd:
INT 0x0000ff02, IF NOT Cmd ; ** expected command
MOVE FROM ds_Cmd, WHEN Cmd
JUMP REL(x1d8), WHEN Msg_In
JUMP REL(status), IF Status
JUMP REL(datain), IF Data_In
JUMP REL(dataout), IF Data_Out
INT 0x0000ff03 ; ** invalid phase after command
; **
; ** Should be in status phase
; **
status:
MOVE FROM ds_Status, WHEN Status
MOVE SIDL | 0x00 TO SFBR
MOVE SFBR | 0x00 TO SCRATCH0 ; ** save status in SCRATCH0
; **
; ** Should be in message in phase
; **
msgin:
INT 0x0000ff04, WHEN NOT Msg_In ; ** expected message in
MOVE FROM ds_Msg, WHEN Msg_In
JUMP REL(msgin_rej), IF 0x07 ; ** assume REJECT is for sync neg
INT 0x0000ff26, IF NOT 0x00 ; ** message byte != complete
CLEAR ACK
WAIT DISCONNECT
MOVE CTEST7 & 0xef TO CTEST7
MOVE SCRATCH0 | 0x00 TO SFBR ; ** check status byte
INT 0x0000fffc, IF 0x02 ; ** -> Check Condition
INT 0x0000fffb, IF 0x08 ; ** -> Busy
INT 0x0000fffd, IF 0x18 ; ** -> ??
INT 0x0000fffe, IF NOT 0x00 ; ** -> not good status
INT 0x0000ff00 ; ** -> normal completion
msgin_rej:
CLEAR ATN
INT 0x0000ff26
CLEAR ACK
JUMP REL(cmd) WHEN Cmd
JUMP REL(status) WHEN Status
JUMP REL(msgin) WHEN Msg_In
; **
; ** Should be in data out phase
; **
dataout:
MOVE FROM ds_Data, WHEN Data_Out
JUMP REL(chain_out), WHEN Data_Out
; **
; ** Check phase after data transfer
; **
x158:
JUMP REL(status), WHEN Status
JUMP REL(x230), IF Msg_In
INT 0x0000ff05 ; ** unexpected phase after data
; **
; ** Should be data in phase
; **
datain:
MOVE FROM ds_Data, WHEN Data_In
JUMP REL(chain_in), WHEN Data_In
JUMP REL(x158)
; **
; ** Got message in phase after sending message out
;
x180:
MOVE FROM ds_Msg, WHEN Msg_In
JUMP REL(x1a8), IF 0x01 ; ** -> Extended message
INT 0x0000ff08, IF 0x02 ; ** -> Save Data Pointer
JUMP REL(x1c0), IF 0x04 ; ** -> Disconnect
INT 0x0000ff06 ; ** Unexpected message
; **
; ** Extended message
; **
x1a8:
CLEAR ACK
MOVE FROM ds_MsgIn, WHEN Msg_In ; ** input message
INT 0x0000ff07 ; ** and interrupt
; **
; ** Disconnect message received
; **
x1c0:
CLEAR ACK
WAIT DISCONNECT
INT 0x0000ff09
; **
; ** Message in after command
; **
x1d8:
MOVE FROM ds_Msg, WHEN Msg_In ; ** get message byte
JUMP REL(x200), IF 0x01 ; ** -> Extended Message
INT 0x0000ff10, IF 0x02 ; ** -> Save Data Pointer
JUMP REL(x218), IF 0x04 ; ** -> Disconnect
INT 0x0000ff11 ; ** unexpected message
; **
; ** Extended message after command
; **
x200:
CLEAR ACK
MOVE FROM ds_MsgIn, WHEN Msg_In
INT 0x0000ff12
; **
; ** Disconnect after command
; **
x218:
CLEAR ACK
WAIT DISCONNECT
INT 0x0000ff13
; **
; ** Message in after data transfer
; **
x230:
MOVE FROM ds_Msg, WHEN Msg_In ; ** Get message byte
JUMP REL(x258), IF 0x01 ; ** -> Extended Message
INT 0x0000ff14, IF 0x02 ; ** -> Save Data Pointers
JUMP REL(x270), IF 0x04 ; ** -> Disconnected
INT 0x0000ff15 ; ** Unexpected message
; **
; ** Extended message after data transfer
; **
x258:
CLEAR ACK
MOVE FROM ds_MsgIn, WHEN Msg_In
INT 0x0000ff16
; **
; ** Disconnect after data transfer
; **
x270:
CLEAR ACK
WAIT DISCONNECT
INT 0x0000ff17
; **
; ** Selection aborted
; **
x288:
WAIT RESELECT REL (x2d0)
INT 0x0000ff18, WHEN NOT Msg_In
MOVE FROM ds_Msg, WHEN Msg_In
INT 0x0000ff19, WHEN Data_In
INT 0x0000ff20, IF Data_Out
INT 0x0000ff21, IF Msg_In
INT 0x0000ff22, IF Status
INT 0x0000ff23, IF Msg_Out
INT 0x0000ff24
x2d0:
INT 0x0000ff25
; **
; ** DMA chaining
; **
chain_in:
MOVE DSA0 + 8 TO SFBR
JUMP REL(chain_in1), IF NOT 00, AND MASK 0x07
MOVE DSA1 + 1 TO DSA1
chain_in1:
MOVE SFBR TO DSA0
MOVE FROM ds_Data, WHEN Data_In
JUMP REL(chain_in), WHEN Data_In
INT 0x0000ff27 ; ** DMA chain transfer complete
chain_out:
MOVE DSA0 + 8 TO SFBR
JUMP REL(chain_out1), IF NOT 00, AND MASK 0x07
MOVE DSA1 + 1 TO DSA1
chain_out1:
MOVE SFBR TO DSA0
MOVE FROM ds_Data, WHEN Data_Out
JUMP REL(chain_out), WHEN Data_Out
INT 0x0000ff27 ; ** DMA chain transfer complete

View File

@ -1,240 +0,0 @@
/* $NetBSD: zthreebus.c,v 1.9 1994/12/01 17:25:41 chopps Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
* 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>
#include <machine/cpu.h>
#include <machine/pte.h>
#include <amiga/amiga/cfdev.h>
#include <amiga/amiga/device.h>
#include <amiga/dev/zthreebusvar.h>
struct aconfdata {
char *name;
int manid;
int prodid;
};
struct preconfdata {
int manid;
int prodid;
caddr_t vaddr;
};
/*
* explain the names.. 0123456789 => zothfisven
*/
static struct aconfdata aconftab[] = {
/* MacroSystemsUS */
{ "wesc", 2203, 19}, /* Warp engine */
{ "grfrtblt", 18260, 16}, /* Retina BLT Z3 */
/* Commodore Amiga */
{ "afsc", 514, 84} /* A4091 SCSI HD Controller */
};
static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata);
/*
* Anything listed in this table is subject to pre-configuration,
* if autoconf.c:config_console() calls amiga_config_found() on
* the Zorro III device.
*/
static struct preconfdata preconftab[] = {
/* Retina BLT Z3 */
{ 18260, 16, 0 }
};
static int npreconfent = sizeof(preconftab) / sizeof(struct preconfdata);
void zthreeattach __P((struct device *, struct device *, void *));
int zthreeprint __P((void *, char *));
int zthreematch __P((struct device *, struct cfdata *,void *));
caddr_t zthreemap __P((caddr_t, u_int));
static char *aconflookup __P((int, int));
/*
* given a manufacturer id and product id, find the name
* that describes this board.
*/
static char *
aconflookup(mid, pid)
int mid, pid;
{
struct aconfdata *adp, *eadp;
eadp = &aconftab[naconfent];
for (adp = aconftab; adp < eadp; adp++)
if (adp->manid == mid && adp->prodid == pid)
return(adp->name);
return("board");
}
/*
* zorro three bus driver
*/
struct cfdriver zthreebuscd = {
NULL, "zthreebus", (cfmatch_t)zthreematch, zthreeattach,
DV_DULL, sizeof(struct device), NULL, 0
};
static struct cfdata *early_cfdata;
/*ARGSUSED*/
int
zthreematch(pdp, cfp, auxp)
struct device *pdp;
struct cfdata *cfp;
void *auxp;
{
if (matchname(auxp, "zthreebus") == 0)
return(0);
if (amiga_realconfig == 0)
early_cfdata = cfp;
return(1);
}
/*
* called to attach bus, we probe, i.e., scan configdev structs passed
* in, for each found name call config_found() which will do this again
* with that driver if matched else print a diag.
*
* If called during config_console() (i.e., amiga_realconfig == 0), skip
* everything but the approved devices in preconftab, and when doing
* those devices save the allocated virtual address.
*/
void
zthreeattach(pdp, dp, auxp)
struct device *pdp, *dp;
void *auxp;
{
struct zthreebus_args za;
struct preconfdata *pcp, *epcp;
struct cfdev *cdp, *ecdp;
epcp = &preconftab[npreconfent];
ecdp = &cfdev[ncfdev];
if (amiga_realconfig) {
if (ZTHREEAVAIL)
printf(": i/o size 0x%08x", ZTHREEAVAIL);
printf("\n");
}
for (cdp = cfdev; cdp < ecdp; cdp++) {
for (pcp = preconftab; pcp < epcp; pcp++) {
if (pcp->manid == cdp->rom.manid &&
pcp->prodid == cdp->rom.prodid)
break;
}
if (amiga_realconfig == 0 && pcp >= epcp)
continue;
za.pa = cdp->addr;
za.size = cdp->size;
if (amiga_realconfig && pcp < epcp && pcp->vaddr)
za.va = pcp->vaddr;
else {
/*
* check that its from zorro III space
* (board type = Zorro III and not memory)
*/
if ((cdp->rom.type & 0xe0) != 0x80)
continue;
za.va = (void *)(iszthreepa(za.pa) ?
zthreemap(za.pa, za.size) : 0);
/*
* save value if early console init
*/
if (amiga_realconfig == 0)
pcp->vaddr = za.va;
}
za.manid = cdp->rom.manid;
za.prodid = cdp->rom.prodid;
za.serno = cdp->rom.serno;
za.slot = (((u_long)za.pa >> 16) & 0xF) - 0x9;
amiga_config_found(early_cfdata, dp, &za, zthreeprint);
}
}
/*
* print configuration info.
*/
int
zthreeprint(auxp, pnp)
void *auxp;
char *pnp;
{
struct zthreebus_args *zap;
int rv;
rv = UNCONF;
zap = auxp;
if (pnp) {
printf("%s at %s", aconflookup(zap->manid, zap->prodid),
pnp);
if (zap->manid == -1)
rv = UNSUPP;
}
printf(" rom 0x%x man/pro %d/%d", zap->pa, zap->manid, zap->prodid);
return(rv);
}
/*
* this function is used to map Z3 physical addresses into kernel virtual
* addresses. We don't keep track which address we map where, we don't NEED
* to know this. We made sure in amiga_init.c (by scanning all available Z3
* devices) to have enough kva-space available, so there is no extra range
* check done here.
*/
caddr_t
zthreemap (pa, size)
caddr_t pa;
u_int size;
{
static vm_offset_t nextkva = 0;
vm_offset_t kva;
if (nextkva == 0)
nextkva = ZTHREEADDR;
if (nextkva > ZTHREEADDR + ZTHREEAVAIL)
return 0;
/* size better be an integral multiple of the page size... */
kva = nextkva;
nextkva += size;
if (nextkva > ZTHREEADDR + ZTHREEAVAIL)
panic("allocating too much Zorro III address space");
physaccess((caddr_t)kva, (caddr_t)pa, size, PG_RW|PG_CI);
return((caddr_t)kva);
}

View File

@ -1,51 +0,0 @@
/* $NetBSD: zthreebusvar.h,v 1.3 1994/10/26 02:05:19 cgd Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
* 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.
*/
#ifndef _ZTHREEBUSVAR_H_
#define _ZTHREEBUSVAR_H_
struct zthreebus_args {
void *pa;
void *va;
int size;
int slot;
int manid;
int prodid;
int serno;
};
vm_offset_t ZTHREEADDR;
u_int ZTHREEAVAIL; /* Amount of Zorro III address space */
#define ZTHREEBASE (0x40000000)
#define ZTHREETOP ((u_long)0x80000000)
#define NZTHREEPG btoc(ZTHREETOP - ZTHREEBASE)
#define iszthreepa(pa) ((u_int)(pa) >= ZTHREEBASE && (u_int)(pa) <= ZTHREETOP)
#endif /* _ZTHREEBUS_H_ */

View File

@ -1,225 +0,0 @@
/* $NetBSD: ztwobus.c,v 1.11 1994/12/01 17:25:42 chopps Exp $ */
/*
* 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>
#include <machine/cpu.h>
#include <amiga/amiga/cfdev.h>
#include <amiga/amiga/device.h>
#include <amiga/dev/ztwobusvar.h>
struct aconfdata {
char *name;
int manid;
int prodid;
};
struct preconfdata {
int manid;
int prodid;
};
/*
* explian the names.. 0123456789 => zothfisven
*/
static struct aconfdata aconftab[] = {
/* Commodore Amiga */
{ "atzee", 513, 1 },
{ "atzsc", 514, 3 },
{ "le", 514, 112 },
{ "ql", 514, 69 },
{ "ql", 514, 70 },
/* Ameristart */
{ "le", 1053, 1 },
/* Univeristy lowell */
{ "ulwl", 1030, 0 },
/* Macorsystems */
{ "grfrt", 18260, 6 },
/* Greater valley products */
{ "gvpbus", 2017, 2 },
{ "gvpbus", 2017, 11 },
{ "giv", 2017, 32 },
/* progressive perhiperals */
{ "zssc", 2026, 150 },
{ "ppia", 2026, 187 },
{ "ppta", 2026, 105 },
{ "ppha", 2026, 1 },
{ "mrsc", 2026, 0 },
/* CSA */
{ "mgnsc", 1058, 17 },
{ "otgsc", 1058, 21 },
/* Microbotics */
{ "vhzsc", 1010, 69 },
/* Supra */
{ "wstsc", 1056, 12 },
/* IVS */
{ "itrmp", 2112, 52 },
{ "ivasc", 2112, 242 },
{ "ivsc", 2112, 243 },
/* Hydra */
{ "ed", 2121, 1 },
/* ASDG */
{ "ed", 9999, 9 }, /* XXXX */
/* Hacker Inc. */
{ "mlhsc", 2011, 1 },
};
static int naconfent = sizeof(aconftab) / sizeof(struct aconfdata);
/*
* Anything listed in this table is subject to pre-configuration,
* if autoconf.c:config_console() calls amiga_config_found() on
* the Zorro III device.
*/
static struct preconfdata preconftab[] = {
/* Retina BLT Z3 */
{ 18260, 6 }
};
static int npreconfent = sizeof(preconftab) / sizeof(struct preconfdata);
void ztwoattach __P((struct device *, struct device *, void *));
int ztwoprint __P((void *, char *));
int ztwomatch __P((struct device *, struct cfdata *,void *));
static char *aconflookup __P((int, int));
/*
* given a manufacturer id and product id, find the name
* that describes this board.
*/
static char *
aconflookup(mid, pid)
int mid, pid;
{
struct aconfdata *adp, *eadp;
eadp = &aconftab[naconfent];
for (adp = aconftab; adp < eadp; adp++)
if (adp->manid == mid && adp->prodid == pid)
return(adp->name);
return("board");
}
/*
* mainbus driver
*/
struct cfdriver ztwobuscd = {
NULL, "ztwobus", (cfmatch_t)ztwomatch, ztwoattach,
DV_DULL, sizeof(struct device), NULL, 0
};
static struct cfdata *early_cfdata;
/*ARGSUSED*/
int
ztwomatch(pdp, cfp, auxp)
struct device *pdp;
struct cfdata *cfp;
void *auxp;
{
if (matchname(auxp, "ztwobus") == 0)
return(0);
if (amiga_realconfig == 0)
early_cfdata = cfp;
return(1);
}
/*
* called to attach bus, we probe, i.e., scan configdev structs passed
* in, for each found name call config_found() which will do this again
* with that driver if matched else print a diag.
*/
void
ztwoattach(pdp, dp, auxp)
struct device *pdp, *dp;
void *auxp;
{
struct ztwobus_args za;
struct preconfdata *pcp, *epcp;
struct cfdev *cdp, *ecdp;
epcp = &preconftab[npreconfent];
ecdp = &cfdev[ncfdev];
if (amiga_realconfig) {
if (ZTWOMEMADDR)
printf(": mem 0x%08x-0x%08x",
ZTWOMEMADDR, ZTWOMEMADDR + NBPG * NZTWOMEMPG - 1);
printf("\n");
}
for (cdp = cfdev; cdp < ecdp; cdp++) {
for (pcp = preconftab; pcp < epcp; pcp++) {
if (pcp->manid == cdp->rom.manid &&
pcp->prodid == cdp->rom.prodid)
break;
}
if (amiga_realconfig == 0 && pcp >= epcp)
continue;
/*
* check if it's a Zorro II board and not linked into
* MemList (i.e. not a memory board)
*/
if ((cdp->rom.type & 0xe0) != 0xc0)
continue; /* er_Type != ZorroII I/O */
za.pa = cdp->addr;
za.va = (void *) (isztwopa(za.pa) ? ztwomap(za.pa) : 0);
za.size = cdp->size;
za.manid = cdp->rom.manid;
za.prodid = cdp->rom.prodid;
za.serno = cdp->rom.serno;
za.slot = (((u_long)za.pa >> 16) & 0xF) - 0x9;
amiga_config_found(early_cfdata, dp, &za, ztwoprint);
}
}
/*
* print configuration info.
*/
int
ztwoprint(auxp, pnp)
void *auxp;
char *pnp;
{
struct ztwobus_args *zap;
int rv;
rv = UNCONF;
zap = auxp;
if (pnp) {
printf("%s at %s:", aconflookup(zap->manid, zap->prodid),
pnp);
if (zap->manid == -1)
rv = UNSUPP;
}
printf(" rom 0x%x man/pro %d/%d", zap->pa, zap->manid, zap->prodid);
return(rv);
}

View File

@ -1,69 +0,0 @@
/* $NetBSD: ztwobusvar.h,v 1.3 1994/10/26 02:05:22 cgd Exp $ */
/*
* 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.
*/
#ifndef _ZTWOBUSVAR_H_
#define _ZTWOBUSVAR_H_
struct ztwobus_args {
void *pa;
void *va;
int size;
int slot;
int manid;
int prodid;
int serno;
};
vm_offset_t ZTWOROMADDR;
vm_offset_t ZTWOMEMADDR;
u_int NZTWOMEMPG;
#define ZTWOROMBASE (0x00D80000)
#define ZTWOROMTOP (0x00F80000)
#define NZTWOROMPG btoc(ZTWOROMTOP-ZTWOROMBASE)
/*
* maps a ztwo and/or A3000 builtin address into the mapped kva address
*/
#define ztwomap(pa) \
((volatile void *)((u_int)ZTWOROMADDR - ZTWOROMBASE + (u_int)(pa)))
#define ztwopa(va) ((caddr_t)(ZTWOROMBASE + (u_int)(va) - (u_int)ZTWOROMADDR))
/*
* tests whether the address lies in our zorro2 rom space
*/
#define isztwokva(kva) \
((u_int)(kva) >= ZTWOROMADDR && \
(u_int)(kva) < \
(ZTWOROMADDR + ZTWOROMTOP - ZTWOROMBASE))
#define isztwopa(pa) ((u_int)(pa) >= ZTWOROMBASE && (u_int)(pa) <= ZTWOROMTOP)
#define isztwomem(kva) \
(ZTWOMEMADDR && (u_int)(kva) >= ZTWOMEMADDR && \
(u_int)(kva) < (ZTWOMEMADDR + NZTWOMEMPG * NBPG))
#endif /* _ZTWOBUS_H_ */