Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Make this work on a PowerPC system:



details:   https://anonhg.NetBSD.org/src/rev/01841f1b4325
branches:  trunk
changeset: 506968:01841f1b4325
user:      briggs <briggs%NetBSD.org@localhost>
date:      Sat Mar 10 13:30:55 2001 +0000

description:
Make this work on a PowerPC system:

 - Load the DMA address a byte at a time, and
 - Use bus_space_read_stream_2() instead of bus_space_read_2() when reading
   the byte-stream of configuration data from the card.

Sanity-checked on both i386 and sandpoint.  Reviewed by ad.

diffstat:

 sys/dev/ic/dpt.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 674773639346 -r 01841f1b4325 sys/dev/ic/dpt.c
--- a/sys/dev/ic/dpt.c  Sat Mar 10 13:29:38 2001 +0000
+++ b/sys/dev/ic/dpt.c  Sat Mar 10 13:30:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dpt.c,v 1.26 2001/03/07 23:07:15 thorpej Exp $ */
+/*     $NetBSD: dpt.c,v 1.27 2001/03/10 13:30:55 briggs Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.26 2001/03/07 23:07:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.27 2001/03/10 13:30:55 briggs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -387,7 +387,10 @@
        if (cp == NULL)
                addr = 0;
 
-       dpt_outl(sc, HA_DMA_BASE, (u_int32_t)addr);
+       dpt_outb(sc, HA_DMA_BASE+0, (addr    ) & 0xff);
+       dpt_outb(sc, HA_DMA_BASE+1, (addr>>8 ) & 0xff);
+       dpt_outb(sc, HA_DMA_BASE+2, (addr>>16) & 0xff);
+       dpt_outb(sc, HA_DMA_BASE+3, (addr>>24) & 0xff);
 
        if (eatacmd == CP_IMMEDIATE) {
                if (cp == NULL) {
@@ -516,7 +519,7 @@
 
        /* Begin reading */
        while (i--)
-               *p++ = dpt_inw(sc, HA_DATA);
+               *p++ = bus_space_read_stream_2(sc->sc_iot, sc->sc_ioh, HA_DATA);
 
        if ((i = ec->ec_cfglen) > (sizeof(struct eata_cfg)
            - (int)(&(((struct eata_cfg *)0L)->ec_cfglen))
@@ -530,12 +533,12 @@
        i >>= 1;
 
        while (i--)
-               *p++ = dpt_inw(sc, HA_DATA);
+               *p++ = bus_space_read_stream_2(sc->sc_iot, sc->sc_ioh, HA_DATA);
        
        /* Flush until we have read 512 bytes. */
        i = (512 - j + 1) >> 1;
        while (i--)
-               dpt_inw(sc, HA_DATA);
+               dpt_inw(sc, HA_DATA);
        
        /* Defaults for older Firmware */
        if (p <= (u_short *)&ec->ec_hba[DPT_MAX_CHANNELS - 1])



Home | Main Index | Thread Index | Old Index