summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-11-05 01:18:22 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-11-05 01:18:22 +0000
commit6fb9ab687a66ba93b32860922d5b3080aa630e8e (patch)
treef9d81f803575dd0ae7ed72a134d8f01fa5638fee /sys/dev
parent21812af4b3496b6b0be4dce431f68366f37efffd (diff)
wait for the marvell firmware to become ok.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/arc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c
index 9a52ead7a48..f1ddae45ddf 100644
--- a/sys/dev/pci/arc.c
+++ b/sys/dev/pci/arc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc.c,v 1.74 2007/11/04 11:07:36 dlg Exp $ */
+/* $OpenBSD: arc.c,v 1.75 2007/11/05 01:18:21 dlg Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -109,6 +109,14 @@ int arcdebug = 0;
#define ARC_RA_IOC_RBUF 0x0f04
#define ARC_RA_IOC_RWBUF_MAXLEN 124 /* for both RBUF and WBUF */
+/* Areca boards using the Marvel IOP are Revision B (RB) */
+
+#define ARC_RB_DRV2IOP_DOORBELL 0x00020400
+#define ARC_RB_DRV2IOP_DOORBELL_MASK 0x00020404
+#define ARC_RB_IOP2DRV_DOORBELL 0x00020408
+#define ARC_RB_IOP2DRV_DOORBELL_FIRMWARE_OK (1<<31)
+#define ARC_RB_IOP2DRV_DOORBELL_MASK 0x0002040c
+
struct arc_msg_firmware_info {
u_int32_t signature;
#define ARC_FWINFO_SIGNATURE_GET_CONFIG (0x87974060)
@@ -1027,6 +1035,13 @@ arc_intel_query_firmware(struct arc_softc *sc)
int
arc_marvell_query_firmware(struct arc_softc *sc)
{
+ if (arc_wait_eq(sc, ARC_RB_IOP2DRV_DOORBELL,
+ ARC_RA_OUTB_ADDR1_FIRMWARE_OK,
+ ARC_RA_OUTB_ADDR1_FIRMWARE_OK) != 0) {
+ printf("%s: timeout waiting for firmware ok\n", DEVNAME(sc));
+ return (1);
+ }
+
return (1);
}