The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/alphapc/fdc37c93x.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #include "u.h"
    2 #include "../port/lib.h"
    3 #include "mem.h"
    4 #include "dat.h"
    5 #include "fns.h"
    6 #include "io.h"
    7 
    8 /*
    9  * SMC FDC37C93x Plug and Play Compatible Ultra I/O Controller.
   10  */
   11 enum {                                  /* I/O Ports */
   12         Config          = 0x370,        /* could also be 0x3F0 */
   13 
   14         Index           = 0,
   15         Data            = 1,
   16 };
   17 
   18 static int fddregs[] = {
   19         0x30,
   20         0x60, 0x61,
   21         0x70,
   22         0x74,
   23         0xF0,
   24         0xF1,
   25         0xF2,
   26         0xF4,
   27         0xF5,
   28         0,
   29 };
   30 
   31 #define OUTB(p, d)      outb(p, d); microdelay(10);
   32 
   33 void
   34 fdc37c93xdump(void)
   35 {
   36         int config, i, x;
   37 
   38         config = Config;
   39 
   40         OUTB(config, 0x55);
   41         OUTB(config, 0x55);
   42 
   43         OUTB(config+Index, 0x20);
   44         x = inb(config+Data);
   45         print("fdc37c93x: Device ID 0x%2.2uX\n", x);
   46         OUTB(config+Index, 0x22);
   47         x = inb(config+Data);
   48         print("fdc37c93x: Power/Control 0x%2.2uX\n", x);
   49 
   50         OUTB(config+Index, 0x07);
   51         OUTB(config+Data, 0);
   52         for(i = 0; fddregs[i]; i++){
   53                 OUTB(config+Index, fddregs[i]);
   54                 x = inb(config+Data);
   55                 print("FDD%2.2uX: 0x%2.2uX\n", fddregs[i], x);
   56         }
   57 
   58         OUTB(config+Index, 0x70);
   59         OUTB(config+Data, 0x06);
   60         OUTB(config+Index, 0x74);
   61         OUTB(config+Data, 0x02);
   62         OUTB(config+Index, 0x30);
   63         OUTB(config+Data, 0x01);
   64 
   65         OUTB(config, 0xAA);
   66 }

Cache object: 27572db408aed81911cfc089c162a9b0


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.