summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2006-08-14 14:43:37 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2006-08-14 14:43:37 +0000
commit8377bcb6bb7e4365da274fc70255b527f5706efe (patch)
treee93eecf8f5bcacce7af27088f44f4cee7bb1a02f
parent1b13bc453ffa2a129542e7b6cccf741c50f918ed (diff)
firmware commands (as opposed to io commands) are sent to the firmware via
the IOC_WBUF area in bus_space, and replies to it are read from the IOC_RBUF area. the freebsd and linux drivers define these areas to be 32 dwords in length, but it then goes and casts these spaces to a struct that has a 4 byte word at the start with the length of the message in it, followed by a 124 byte buffer which is filled with the actual message in it. rather than screwing around with an extra struct and casts, we can define this header as a register of its own, and the buffer as a separate region in bus_space. this simplifies command submission and the retrieval of the replies (which is yet to be written properly).
-rw-r--r--sys/dev/pci/arc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c
index b73c102b166..b19a447852a 100644
--- a/sys/dev/pci/arc.c
+++ b/sys/dev/pci/arc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc.c,v 1.16 2006/08/09 09:21:13 dlg Exp $ */
+/* $OpenBSD: arc.c,v 1.17 2006/08/14 14:43:36 dlg Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -83,7 +83,11 @@ static const struct pci_matchid arc_devices[] = {
#define ARC_REG_OUTB_ADDR1 0x001c
#define ARC_REG_OUTB_ADDR1_FIRMWARE_OK (1<<31)
#define ARC_REG_INB_DOORBELL 0x0020
+#define ARC_REG_INB_DOORBELL_WRITE_OK (1<<0)
+#define ARC_REG_INB_DOORBELL_READ_OK (1<<1)
#define ARC_REG_OUTB_DOORBELL 0x002c
+#define ARC_REG_OUTB_DOORBELL_WRITE_OK (1<<0)
+#define ARC_REG_OUTB_DOORBELL_READ_OK (1<<1)
#define ARC_REG_INTRSTAT 0x0030
#define ARC_REG_INTRSTAT_MSG0 (1<<0)
#define ARC_REG_INTRSTAT_MSG1 (1<<1)
@@ -106,10 +110,12 @@ static const struct pci_matchid arc_devices[] = {
#define ARC_REG_REPLY_QUEUE_IAMBIOS (1<<30)
#define ARC_REG_MSGBUF 0x0a00
#define ARC_REG_MSGBUF_LEN 1024
-#define ARC_REG_IOC_WBUF 0x0e00
-#define ARC_REG_IOC_WBUF_LEN 128
-#define ARC_REG_IOC_RBUF 0x0f00
-#define ARC_REG_IOC_RBUF_LEN 128
+#define ARC_REG_IOC_WBUF_LEN 0x0e00
+#define ARC_REG_IOC_WBUF 0x0e04
+#define ARC_REG_IOC_WBUF_MAXLEN 124
+#define ARC_REG_IOC_RBUF_LEN 0x0f00
+#define ARC_REG_IOC_RBUF 0x0f04
+#define ARC_REG_IOC_RBUF_MAXLEN 124
struct arc_msg_firmware_info {
u_int32_t signature;