Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm32 Add PowerROM support to asc(4), csa(4), csc(4...



details:   https://anonhg.NetBSD.org/src/rev/b0126cc9004b
branches:  trunk
changeset: 512071:b0126cc9004b
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Wed Jul 04 17:54:18 2001 +0000

description:
Add PowerROM support to asc(4), csa(4), csc(4) and ptsc(4).  Not tested much,
I'm afraid.

diffstat:

 sys/arch/arm32/conf/files.arm32 |  10 +++++-----
 sys/arch/arm32/podulebus/asc.c  |  18 ++++++++++++------
 sys/arch/arm32/podulebus/csa.c  |  16 ++++++++++++----
 sys/arch/arm32/podulebus/csc.c  |  15 +++++++++++----
 sys/arch/arm32/podulebus/ptsc.c |  16 ++++++++++++----
 5 files changed, 52 insertions(+), 23 deletions(-)

diffs (192 lines):

diff -r ab78c6a0aa06 -r b0126cc9004b sys/arch/arm32/conf/files.arm32
--- a/sys/arch/arm32/conf/files.arm32   Wed Jul 04 17:46:06 2001 +0000
+++ b/sys/arch/arm32/conf/files.arm32   Wed Jul 04 17:54:18 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.arm32,v 1.122 2001/07/04 13:49:24 bjh21 Exp $
+#      $NetBSD: files.arm32,v 1.123 2001/07/04 17:54:18 bjh21 Exp $
 #
 # First try for arm-specific configuration info
 #
@@ -274,7 +274,7 @@
 file   arch/arm32/podulebus/sbic.c             sbic
 
 # Acorn SCSI I specific layer for sbic
-device  asc: scsi, sbic
+device  asc: scsi, sbic, podloader
 attach asc at podulebus
 file   arch/arm32/podulebus/asc.c              asc needs-flag
 
@@ -291,16 +291,16 @@
 define sfas
 file   arch/arm32/podulebus/sfas.c             sfas
 
-device ptsc: scsi, sfas
+device ptsc: scsi, sfas, podloader
 attach ptsc at podulebus
 file   arch/arm32/podulebus/ptsc.c             ptsc
 
-device csc: scsi, sfas
+device csc: scsi, sfas, podloader
 attach csc at podulebus
 file   arch/arm32/podulebus/csc.c              csc
 
 # Cumana SCSI1 specific layer for ncr5380
-device csa: scsi, ncr5380sbc
+device csa: scsi, ncr5380sbc, podloader
 attach csa at podulebus
 file   arch/arm32/podulebus/csa.c              csa
 
diff -r ab78c6a0aa06 -r b0126cc9004b sys/arch/arm32/podulebus/asc.c
--- a/sys/arch/arm32/podulebus/asc.c    Wed Jul 04 17:46:06 2001 +0000
+++ b/sys/arch/arm32/podulebus/asc.c    Wed Jul 04 17:54:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asc.c,v 1.33 2001/05/13 13:53:08 bjh21 Exp $   */
+/*     $NetBSD: asc.c,v 1.34 2001/07/04 17:54:18 bjh21 Exp $   */
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -69,6 +69,7 @@
 #include <arm32/podulebus/ascreg.h>
 #include <arm32/podulebus/ascvar.h>
 #include <dev/podulebus/podules.h>
+#include <dev/podulebus/powerromreg.h>
 
 void ascattach __P((struct device *, struct device *, void *));
 int ascmatch   __P((struct device *, struct cfdata *, void *));
@@ -111,13 +112,18 @@
 
 /* Look for the card */
 
-       if (matchpodule(pa, MANUFACTURER_ACORN, PODULE_ACORN_SCSI, -1) == 0)
-               return(0);
+       /* Standard ROM, skipping the MCS card that used the same ID. */
+       if (matchpodule(pa, MANUFACTURER_ACORN, PODULE_ACORN_SCSI, -1) &&
+           strncmp(pa->pa_podule->description, "MCS", 3) != 0)
+               return(1);
 
-       if (strncmp(pa->pa_podule->description, "MCS", 3) == 0)
-               return(0);
+       /* PowerROM */
+        if (pa->pa_product == PODULE_ALSYSTEMS_SCSI &&
+            podulebus_initloader(pa) == 0 &&
+            podloader_callloader(pa, 0, 0) == PRID_ACORN_SCSI1)
+                return 1;
 
-       return(1);
+       return 0;
 }
 
 void
diff -r ab78c6a0aa06 -r b0126cc9004b sys/arch/arm32/podulebus/csa.c
--- a/sys/arch/arm32/podulebus/csa.c    Wed Jul 04 17:46:06 2001 +0000
+++ b/sys/arch/arm32/podulebus/csa.c    Wed Jul 04 17:54:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: csa.c,v 1.11 2001/04/25 17:53:11 bouyer Exp $  */
+/*     $NetBSD: csa.c,v 1.12 2001/07/04 17:54:18 bjh21 Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -58,6 +58,7 @@
 
 #include <arm32/podulebus/podulebus.h>
 #include <dev/podulebus/podules.h>
+#include <dev/podulebus/powerromreg.h>
 
 #define CSA_NCR5380_OFFSET     0x2100
 #define CSA_CTRL_OFFSET                0x2000 - 2308
@@ -116,10 +117,17 @@
 {
        struct podule_attach_args *pa = aux;
 
-       if (matchpodule(pa, MANUFACTURER_CUMANA, PODULE_CUMANA_SCSI1, -1) == 0)
-               return(0);
+       if (matchpodule(pa, MANUFACTURER_CUMANA, PODULE_CUMANA_SCSI1, -1))
+               return(1);
 
-       return(1);
+       /* PowerROM */
+        if (pa->pa_product == PODULE_ALSYSTEMS_SCSI &&
+            podulebus_initloader(pa) == 0 &&
+            (podloader_callloader(pa, 0, 0) == PRID_CUMANA_SCSI1_8 ||
+            podloader_callloader(pa, 0, 0) == PRID_CUMANA_SCSI1_16))
+                return 1;
+
+       return 0;
 }
 
 /*
diff -r ab78c6a0aa06 -r b0126cc9004b sys/arch/arm32/podulebus/csc.c
--- a/sys/arch/arm32/podulebus/csc.c    Wed Jul 04 17:46:06 2001 +0000
+++ b/sys/arch/arm32/podulebus/csc.c    Wed Jul 04 17:54:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: csc.c,v 1.12 2001/04/25 17:53:11 bouyer Exp $  */
+/*     $NetBSD: csc.c,v 1.13 2001/07/04 17:54:18 bjh21 Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -58,6 +58,7 @@
 #include <arm32/podulebus/cscreg.h>
 #include <arm32/podulebus/cscvar.h>
 #include <dev/podulebus/podules.h>
+#include <dev/podulebus/powerromreg.h>
 
 void cscattach   __P((struct device *, struct device *, void *));
 int  cscmatch    __P((struct device *, struct cfdata *, void *));
@@ -88,10 +89,16 @@
        struct podule_attach_args *pa = (struct podule_attach_args *)auxp;
 
        /* Look for the card */
-       if (matchpodule(pa, MANUFACTURER_CUMANA, PODULE_CUMANA_SCSI2, -1) == 0)
-               return(0);
+       if (matchpodule(pa, MANUFACTURER_CUMANA, PODULE_CUMANA_SCSI2, -1))
+               return 1;
 
-       return(1);
+       /* PowerROM */
+        if (pa->pa_product == PODULE_ALSYSTEMS_SCSI &&
+            podulebus_initloader(pa) == 0 &&
+            podloader_callloader(pa, 0, 0) == PRID_CUMANA_SCSI2)
+                return 1;
+
+       return 0;
 }
 
 void
diff -r ab78c6a0aa06 -r b0126cc9004b sys/arch/arm32/podulebus/ptsc.c
--- a/sys/arch/arm32/podulebus/ptsc.c   Wed Jul 04 17:46:06 2001 +0000
+++ b/sys/arch/arm32/podulebus/ptsc.c   Wed Jul 04 17:54:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptsc.c,v 1.29 2001/04/25 17:53:11 bouyer Exp $ */
+/*     $NetBSD: ptsc.c,v 1.30 2001/07/04 17:54:18 bjh21 Exp $  */
 
 /*
  * Copyright (c) 1995 Scott Stevens
@@ -63,6 +63,7 @@
 #include <arm32/podulebus/ptscreg.h>
 #include <arm32/podulebus/ptscvar.h>
 #include <dev/podulebus/podules.h>
+#include <dev/podulebus/powerromreg.h>
 
 void ptscattach __P((struct device *, struct device *, void *));
 int  ptscmatch  __P((struct device *, struct cfdata *, void *));
@@ -94,10 +95,17 @@
 
        /* Look for the card */
 
-       if (matchpodule(pa, MANUFACTURER_ALSYSTEMS, PODULE_ALSYSTEMS_SCSI, -1) == 0)
-               return(0);
+       /*
+        * All Power-tec cards effectively have PowerROMS.  Note,
+        * though, that here, if we fail to initialise the loader, we
+        * assume this _is_ the right kind of card.
+        */
+        if (pa->pa_product == PODULE_ALSYSTEMS_SCSI &&
+            (podulebus_initloader(pa) != 0 ||
+            podloader_callloader(pa, 0, 0) == PRID_POWERTEC))
+                return 1;
 
-       return(1);
+       return 0;
 }
 
 void



Home | Main Index | Thread Index | Old Index