Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Added macros for the bits in the SYSBUS byte, and macros
details: https://anonhg.NetBSD.org/src/rev/201fd6325aac
branches: trunk
changeset: 518252:201fd6325aac
user: fredette <fredette%NetBSD.org@localhost>
date: Mon Nov 26 23:30:59 2001 +0000
description:
Added macros for the bits in the SYSBUS byte, and macros
for the i82596 PORT access interface, from the documentation
for that chip. These help clarify writes to the SYSBUS
part of the SCP, and PORT usage by i82596-aware drivers.
diffstat:
sys/arch/mvme68k/dev/if_ie.c | 10 +++++-----
sys/arch/mvme68k/dev/if_iereg.h | 17 ++++++++++++-----
sys/dev/ic/i82586.c | 8 ++++----
sys/dev/ic/i82586reg.h | 30 +++++++++++++++++++++++++++++-
sys/dev/isa/if_ai.c | 10 ++++++----
sys/dev/isa/if_ef.c | 7 ++++---
sys/dev/isa/if_ix.c | 10 ++++++----
sys/dev/mca/if_elmc_mca.c | 7 ++++---
8 files changed, 70 insertions(+), 29 deletions(-)
diffs (281 lines):
diff -r c68f531506da -r 201fd6325aac sys/arch/mvme68k/dev/if_ie.c
--- a/sys/arch/mvme68k/dev/if_ie.c Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/arch/mvme68k/dev/if_ie.c Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.12 2001/07/07 07:51:37 scw Exp $ */
+/* $NetBSD: if_ie.c,v 1.13 2001/11/26 23:31:00 fredette Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
case CHIP_PROBE:
case CARD_RESET:
bus_space_write_2(ps->ps_bust, ps->ps_bush, IE_MPUREG_UPPER,
- IE_MPU_RESET);
+ IE_PORT_RESET);
bus_space_write_2(ps->ps_bust, ps->ps_bush, IE_MPUREG_LOWER, 0);
delay(1000);
@@ -121,10 +121,10 @@
* (due to wrong-endianess of the chip)
*/
ie_write_16(sc, IE_ISCP_BUSY(sc->iscp), 1);
- ie_write_16(sc, IE_SCP_BUS_USE(sc->scp), 0x50);
+ ie_write_16(sc, IE_SCP_BUS_USE(sc->scp), IE_BUS_USE);
scp_addr = sc->scp + (u_int) sc->sc_iobase;
- scp_addr |= IE_MPU_SCP_ADDRESS;
+ scp_addr |= IE_PORT_ALT_SCP;
bus_space_write_2(ps->ps_bust, ps->ps_bush, IE_MPUREG_UPPER,
scp_addr & 0xffff);
@@ -331,7 +331,7 @@
* Internal bus throttle timer triggering,
* 82586 operating mode.
*/
- ie_write_16(sc, IE_SCP_BUS_USE(sc->scp), 0x50);
+ ie_write_16(sc, IE_SCP_BUS_USE(sc->scp), IE_BUS_USE);
ie_write_24(sc, IE_SCP_ISCP(sc->scp), sc->iscp);
ie_write_16(sc, IE_ISCP_SCB(sc->iscp), sc->scb);
ie_write_24(sc, IE_ISCP_BASE(sc->iscp), sc->scp);
diff -r c68f531506da -r 201fd6325aac sys/arch/mvme68k/dev/if_iereg.h
--- a/sys/arch/mvme68k/dev/if_iereg.h Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/arch/mvme68k/dev/if_iereg.h Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iereg.h,v 1.3 2000/03/18 22:33:02 scw Exp $ */
+/* $NetBSD: if_iereg.h,v 1.4 2001/11/26 23:31:00 fredette Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -49,9 +49,16 @@
#define IE_MPUREG_SIZE 0x08
-#define IE_MPU_RESET 0x00 /* Software Reset */
-#define IE_MPU_SELF_TEST 0x01 /* Execute a Self-Test */
-#define IE_MPU_SCP_ADDRESS 0x02 /* Sys. Configuration Address Pointer */
-#define IE_MPU_DUMP 0x03 /* Execute a Dump */
+/*
+ * BUS_USE -> Interrupt Active High (edge-triggered),
+ * Lock function enabled,
+ * Internal bus throttle timer triggering,
+ * 82586 operating mode.
+ */
+#define IE_BUS_USE (IE_SYSBUS_596_INTHIGH | \
+ IE_SYSBUS_596_LOCK | \
+ IE_SYSBUS_596_TRGINT | \
+ IE_SYSBUS_596_82586 | \
+ IE_SYSBUS_596_RSVD_SET)
#endif /* __mvme68k_if_iereg_h */
diff -r c68f531506da -r 201fd6325aac sys/dev/ic/i82586.c
--- a/sys/dev/ic/i82586.c Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/dev/ic/i82586.c Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i82586.c,v 1.41 2001/11/13 13:14:38 lukem Exp $ */
+/* $NetBSD: i82586.c,v 1.42 2001/11/26 23:30:59 fredette Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -144,12 +144,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.41 2001/11/13 13:14:38 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.42 2001/11/26 23:30:59 fredette Exp $");
#include "bpfilter.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.41 2001/11/13 13:14:38 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.42 2001/11/26 23:30:59 fredette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1258,7 +1258,7 @@
/* Put in 16-bit mode */
off = IE_SCP_BUS_USE(sc->scp);
- sc->ie_bus_write16(sc, off, 0);
+ sc->ie_bus_write16(sc, off, IE_SYSBUS_16BIT);
IE_BUS_BARRIER(sc, off, 2, BUS_SPACE_BARRIER_WRITE);
/* Set the ISCP `busy' bit */
diff -r c68f531506da -r 201fd6325aac sys/dev/ic/i82586reg.h
--- a/sys/dev/ic/i82586reg.h Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/dev/ic/i82586reg.h Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i82586reg.h,v 1.8 2001/03/10 19:57:38 jdolecek Exp $ */
+/* $NetBSD: i82586reg.h,v 1.9 2001/11/26 23:31:00 fredette Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -83,6 +83,15 @@
* We use integer offsets exclusively to access the i82586 data structures.
*/
+/*
+ * The i82596 has a hardware port that can be used to command the
+ * chip to perform special functions. For all but IE_PORT_RESET,
+ * a 16-byte aligned memory address is ORed into the port command.
+ */
+#define IE_PORT_RESET 0x00 /* software reset */
+#define IE_PORT_SELF_TEST 0x01 /* self-test */
+#define IE_PORT_ALT_SCP 0x02 /* set alternate SCP address */
+#define IE_PORT_DUMP 0x03 /* dump state */
/*
* This is the master configuration block.
@@ -100,6 +109,25 @@
#define IE_SCP_ISCP(base) ((base) + 8)
/*
+ * SYSBUS byte flags. Most are specific to the i82596, and so
+ * far we always run an i82596 in i82586-compatible mode.
+ */
+#define IE_SYSBUS_16BIT (0x0 << 0)
+#define IE_SYSBUS_8BIT (0x1 << 0)
+#define IE_SYSBUS_596_82586 (0x0 << 1)
+#define IE_SYSBUS_596_32SEG (0x1 << 1)
+#define IE_SYSBUS_596_LINEAR (0x2 << 1)
+#define IE_SYSBUS_596_TRGINT (0x0 << 3)
+#define IE_SYSBUS_596_TRGEXT (0x1 << 3)
+#define IE_SYSBUS_596_NOLOCK (0x0 << 4)
+#define IE_SYSBUS_596_LOCK (0x1 << 4)
+#define IE_SYSBUS_596_INTHIGH (0x0 << 4)
+#define IE_SYSBUS_596_INTLOW (0x1 << 5)
+#define IE_SYSBUS_596_RSVD_SET (0x1 << 6)
+#define IE_SYSBUS_596_LE (0x0 << 7)
+#define IE_SYSBUS_596_BE (0x1 << 7)
+
+/*
* Note that this is wired in hardware; the SCP is always located here, no
* matter what.
*/
diff -r c68f531506da -r 201fd6325aac sys/dev/isa/if_ai.c
--- a/sys/dev/isa/if_ai.c Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/dev/isa/if_ai.c Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ai.c,v 1.12 2001/11/13 08:01:15 lukem Exp $ */
+/* $NetBSD: if_ai.c,v 1.13 2001/11/26 23:31:00 fredette Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ai.c,v 1.12 2001/11/13 08:01:15 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ai.c,v 1.13 2001/11/26 23:31:00 fredette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -385,7 +385,8 @@
bus_space_set_region_1(sc->bt, sc->bh, 0, 0, sc->sc_msize);
/* set card to 16-bit bus mode */
- bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp), 0);
+ bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp),
+ IE_SYSBUS_16BIT);
/* set up pointers to key structures */
ai_write_24(sc, IE_SCP_ISCP((u_long)sc->scp), (u_long) sc->iscp);
@@ -475,7 +476,8 @@
bus_space_set_region_1(memt, memh, sc->scb, 0, IE_SCB_SZ);
/* set card to 16-bit bus mode */
- bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp), 0);
+ bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp),
+ IE_SYSBUS_16BIT);
/* set up pointers to key structures */
ai_write_24(sc, IE_SCP_ISCP((u_long)sc->scp), (u_long) sc->iscp);
diff -r c68f531506da -r 201fd6325aac sys/dev/isa/if_ef.c
--- a/sys/dev/isa/if_ef.c Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/dev/isa/if_ef.c Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ef.c,v 1.10 2001/11/13 08:01:16 lukem Exp $ */
+/* $NetBSD: if_ef.c,v 1.11 2001/11/26 23:31:00 fredette Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.10 2001/11/13 08:01:16 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.11 2001/11/26 23:31:00 fredette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -597,7 +597,8 @@
bus_space_set_region_1(sc->bt, sc->bh, 0, 0, sc->sc_msize);
/* set card to 16-bit bus mode */
- bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp), 0);
+ bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp),
+ IE_SYSBUS_16BIT);
/* set up pointers to key structures */
ef_write_24(sc, IE_SCP_ISCP((u_long)sc->scp), (u_long) sc->iscp);
diff -r c68f531506da -r 201fd6325aac sys/dev/isa/if_ix.c
--- a/sys/dev/isa/if_ix.c Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/dev/isa/if_ix.c Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ix.c,v 1.10 2001/11/13 08:01:19 lukem Exp $ */
+/* $NetBSD: if_ix.c,v 1.11 2001/11/26 23:31:00 fredette Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.10 2001/11/13 08:01:19 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.11 2001/11/26 23:31:00 fredette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -924,10 +924,12 @@
bus_space_barrier(sc->bt, sc->bh, IX_WRITEPTR, 2,
BUS_SPACE_BARRIER_WRITE);
- bus_space_write_1(sc->bt, sc->bh, IX_DATAPORT, 0);
+ bus_space_write_1(sc->bt, sc->bh, IX_DATAPORT,
+ IE_SYSBUS_16BIT);
} else {
bus_space_write_1(sc->bt, sc->bh,
- IE_SCP_BUS_USE((u_long)sc->scp), 0);
+ IE_SCP_BUS_USE((u_long)sc->scp),
+ IE_SYSBUS_16BIT);
}
/* set up pointers to key structures */
diff -r c68f531506da -r 201fd6325aac sys/dev/mca/if_elmc_mca.c
--- a/sys/dev/mca/if_elmc_mca.c Mon Nov 26 23:26:33 2001 +0000
+++ b/sys/dev/mca/if_elmc_mca.c Mon Nov 26 23:30:59 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_elmc_mca.c,v 1.7 2001/11/13 07:46:25 lukem Exp $ */
+/* $NetBSD: if_elmc_mca.c,v 1.8 2001/11/26 23:31:00 fredette Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_elmc_mca.c,v 1.7 2001/11/13 07:46:25 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_elmc_mca.c,v 1.8 2001/11/26 23:31:00 fredette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -226,7 +226,8 @@
bus_space_set_region_1(sc->bt, sc->bh, 0, 0, sc->sc_msize);
/* set card to 16-bit bus mode */
- bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp), 0);
+ bus_space_write_1(sc->bt, sc->bh, IE_SCP_BUS_USE((u_long)sc->scp),
+ IE_SYSBUS_16BIT);
/* set up pointers to key structures */
elmc_mca_write_24(sc, IE_SCP_ISCP((u_long)sc->scp), (u_long) sc->iscp);
Home |
Main Index |
Thread Index |
Old Index