Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari/dev Limit the io-region mapped by this driver...



details:   https://anonhg.NetBSD.org/src/rev/28964543328a
branches:  trunk
changeset: 477574:28964543328a
user:      leo <leo%NetBSD.org@localhost>
date:      Fri Oct 22 08:50:59 1999 +0000

description:
Limit the io-region mapped by this driver to the part actually used.
Otherwise, it conflicts with the wd-driver.

diffstat:

 sys/arch/atari/dev/hdfd.c    |   7 ++++---
 sys/arch/atari/dev/hdfdreg.h |  16 +++++++++-------
 2 files changed, 13 insertions(+), 10 deletions(-)

diffs (73 lines):

diff -r c59041b78222 -r 28964543328a sys/arch/atari/dev/hdfd.c
--- a/sys/arch/atari/dev/hdfd.c Fri Oct 22 07:42:05 1999 +0000
+++ b/sys/arch/atari/dev/hdfd.c Fri Oct 22 08:50:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hdfd.c,v 1.16 1999/10/21 15:03:28 leo Exp $    */
+/*     $NetBSD: hdfd.c,v 1.17 1999/10/22 08:50:59 leo Exp $    */
 
 /*-
  * Copyright (c) 1996 Leo Weppelman
@@ -289,7 +289,8 @@
        if ((mb_tag = mb_alloc_bus_space_tag()) == NULL)
                return 0;
 
-       if (bus_space_map(mb_tag, 0xfff00000, NBPG, 0, (caddr_t*)&fdio_addr)) {
+       if (bus_space_map(mb_tag, FD_IOBASE, FD_IOSIZE, 0,
+                                               (caddr_t*)&fdio_addr)) {
                printf("fdcprobe: cannot map io-area\n");
                mb_free_bus_space_tag(mb_tag);
                return (0);
@@ -314,7 +315,7 @@
 
  out:
        if (rv == 0) {
-               bus_space_unmap(mb_tag, (caddr_t)fdio_addr, NBPG);
+               bus_space_unmap(mb_tag, (caddr_t)fdio_addr, FD_IOSIZE);
                mb_free_bus_space_tag(mb_tag);
        }
 
diff -r c59041b78222 -r 28964543328a sys/arch/atari/dev/hdfdreg.h
--- a/sys/arch/atari/dev/hdfdreg.h      Fri Oct 22 07:42:05 1999 +0000
+++ b/sys/arch/atari/dev/hdfdreg.h      Fri Oct 22 08:50:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hdfdreg.h,v 1.2 1996/12/14 13:47:14 leo Exp $  */
+/*     $NetBSD: hdfdreg.h,v 1.3 1999/10/22 08:50:59 leo Exp $  */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -53,27 +53,29 @@
 #define NE7CMD_CONFIGURE       0x13
 #define NE7CMD_LOCK            0x94
 
+#define        FD_IOBASE               0xfff00080
+#define        FD_IOSIZE               0x80
+
 /* registers */
-#define        fdout   0xc0    /* Digital Output Register (W) */
+#define        fdout   0x40    /* Digital Output Register (W) */
 #define        FDO_FDSEL       0x03    /*  floppy device select */
 #define        FDO_FRST        0x04    /*  floppy controller reset */
 #define        FDO_FDMAEN      0x08    /*  enable floppy DMA and Interrupt */
 #define        FDO_MOEN(n)     ((1 << n) * 0x10)       /* motor enable */
 
-#define        fdsts   0x80    /* NEC 765 Main Status Register (R) */
-#define        fddata  0x82    /* NEC 765 Data Register (R/W) */
+#define        fdsts   0x00    /* NEC 765 Main Status Register (R) */
+#define        fddata  0x02    /* NEC 765 Data Register (R/W) */
 
-#define        fdctl   0xe0    /* Control Register (W) */
+#define        fdctl   0x60    /* Control Register (W) */
 #define        FDC_500KBPS     0x00    /* 500KBPS MFM drive transfer rate */
 #define        FDC_300KBPS     0x01    /* 300KBPS MFM drive transfer rate */
 #define        FDC_250KBPS     0x02    /* 250KBPS MFM drive transfer rate */
 #define        FDC_125KBPS     0x03    /* 125KBPS FM drive transfer rate */
 
-#define        fdin    0xe0    /* Digital Input Register (R) */
+#define        fdin    0x60    /* Digital Input Register (R) */
 #define        FDI_DCHG        0x80    /* diskette has been changed */
 
 #define        FDC_BSIZE       512
-#define        FDC_NPORT       8
 #define        FDC_MAXIOSIZE   NBPG    /* XXX should be MAXBSIZE */
 
 /*



Home | Main Index | Thread Index | Old Index