Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/dev fix typos, deal with hardware insanity
details: https://anonhg.NetBSD.org/src/rev/3193d4253e20
branches: trunk
changeset: 784699:3193d4253e20
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Feb 06 04:06:29 2013 +0000
description:
fix typos, deal with hardware insanity
diffstat:
sys/arch/sparc/dev/sx.c | 12 +++++-------
sys/arch/sparc/dev/sxreg.h | 34 ++++++++++++++++++++++++----------
2 files changed, 29 insertions(+), 17 deletions(-)
diffs (103 lines):
diff -r d930f4d5a133 -r 3193d4253e20 sys/arch/sparc/dev/sx.c
--- a/sys/arch/sparc/dev/sx.c Wed Feb 06 01:31:55 2013 +0000
+++ b/sys/arch/sparc/dev/sx.c Wed Feb 06 04:06:29 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sx.c,v 1.1 2013/02/05 21:52:48 macallan Exp $ */
+/* $NetBSD: sx.c,v 1.2 2013/02/06 04:06:29 macallan Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sx.c,v 1.1 2013/02/05 21:52:48 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sx.c,v 1.2 2013/02/06 04:06:29 macallan Exp $");
#include "locators.h"
@@ -50,8 +50,6 @@
#include <sparc/dev/sxvar.h>
#include <sparc/dev/sxreg.h>
-
-
/* autoconfiguration driver */
static int sx_match(device_t, struct cfdata *, void *);
static void sx_attach(device_t, device_t, void *);
@@ -111,11 +109,11 @@
sx_write(sc, SX_CONTROL_STATUS, SX_PB | SX_GO);
#ifdef SX_DEBUG
- sta(0xfc000000, ASI_SX, SX_LD(8, 31));
+ sta(0xfc000000, ASI_SX, SX_LD(8, 31, 0));
for (i = 1; i < 60; i++)
- sta(0xfc000000 + (i * 1280), ASI_SX, SX_ST(8, 31));
+ sta(0xfc000000 + (i * 1280), ASI_SX, SX_ST(8, 31, 0));
for (i = 900; i < 1000; i++)
- sta(0xfc000000 + (i * 1280) + 600, ASI_SX, SX_ST(0, 31));
+ sta(0xfc000000 + (i * 1280) + 600, ASI_SX, SX_ST(0, 31, 0));
for (i = 0; i < 0x30; i+= 16) {
printf("%08x:", i);
diff -r d930f4d5a133 -r 3193d4253e20 sys/arch/sparc/dev/sxreg.h
--- a/sys/arch/sparc/dev/sxreg.h Wed Feb 06 01:31:55 2013 +0000
+++ b/sys/arch/sparc/dev/sxreg.h Wed Feb 06 04:06:29 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sxreg.h,v 1.1 2013/02/05 21:52:48 macallan Exp $ */
+/* $NetBSD: sxreg.h,v 1.2 2013/02/06 04:06:29 macallan Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -53,6 +53,12 @@
/* write registers via pseudo instructions */
#define SX_QUEUED_R0 0x00000300
#define SX_QUEUED_R1 0x00000304 /* and so on until R127 */
+#define SX_QUEUED(r) (0x300 + (r << 2))
+
+/* special purpose registers */
+#define R_ZERO 0
+#define R_SCAM 1
+#define R_MASK 2 /* bitmask for SX_STORE_SELECT */
/*
* registers are repeated at 0x1000 with certain parts read only
@@ -99,7 +105,7 @@
#define SX_STORE_COND (0x4 << 19) /* conditional write with mask */
#define SX_STORE_CLAMP (0x2 << 19)
#define SX_STORE_MASK (0x1 << 19) /* apply plane mask */
-#define SX_STORE_SELECT (0x9 << 19) /* expand with plane reg dest[0]/dest[1] */
+#define SX_STORE_SELECT (0x8 << 19) /* expand with plane reg dest[0]/dest[1] */
#define SX_LOAD (0xa << 19)
#define SX_STORE (0x0 << 19)
@@ -138,13 +144,21 @@
#define SX_PACKED (0x1f << 14)
-#define SX_LD(dreg, cnt) (0x80000000 | (cnt << 23) | SX_STORE | SX_LONG | (dreg << 7))
-#define SX_LDB(dreg, cnt) (0x80000000 | (cnt << 23) | SX_STORE | SX_UBYTE_0 | (dreg << 7))
-#define SX_LDP(dreg, cnt) (0x80000000 | (cnt << 23) | SX_STORE | SX_PACKED | (dreg << 7))
-#define SX_ST(sreg, cnt) (0x80000000 | (cnt << 23) | SX_LOAD | SX_LONG | (sreg << 7))
-#define SX_STB(sreg, cnt) (0x80000000 | (cnt << 23) | SX_LOAD | SX_UBYTE_0 | (sreg << 7))
-#define SX_STP(sreg, cnt) (0x80000000 | (cnt << 23) | SX_LOAD | SX_PACKED | (sreg << 7))
-#define SX_STS(sreg, cnt) (0x80000000 | (cnt << 23) | SX_STORE_SELECT | SX_LONG | (sreg << 7))
-#define SX_STBS(reg, cnt) (0x80000000 | (cnt << 23) | SX_STORE_SELECT | SX_UBYTE_0 | (reg << 7))
+#define SX_LD(dreg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_LOAD | \
+ SX_LONG | (dreg << 7) | (o))
+#define SX_LDB(dreg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_LOAD | \
+ SX_UBYTE_0 | (dreg << 7) | (o))
+#define SX_LDP(dreg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_LOAD | \
+ SX_PACKED | (dreg << 7) | (o))
+#define SX_ST(sreg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_STORE | \
+ SX_LONG | (sreg << 7) | (o))
+#define SX_STB(sreg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_STORE | \
+ SX_UBYTE_0 | (sreg << 7) | (o))
+#define SX_STP(sreg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_STORE | \
+ SX_PACKED | (sreg << 7) | (o))
+#define SX_STS(sreg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_STORE_SELECT \
+ | SX_LONG | (sreg << 7) | (o))
+#define SX_STBS(reg, cnt, o) (0x80000000 | ((cnt) << 23) | SX_STORE_SELECT \
+ | SX_UBYTE_0 | (reg << 7) | (o))
#endif /* SXREG_H */
Home |
Main Index |
Thread Index |
Old Index