Home | History | Annotate | Line # | Download | only in ic
smc93cx6var.h revision 1.1
      1  1.1  mycroft /*
      2  1.1  mycroft  * Interface to the 93C46 serial EEPROM that is used to store BIOS
      3  1.1  mycroft  * settings for the aic7xxx based adaptec SCSI controllers.  It can
      4  1.1  mycroft  * also be used for 93C26 and 93C06 serial EEPROMS.
      5  1.1  mycroft  *
      6  1.1  mycroft  * Copyright (c) 1994, 1995 Justin T. Gibbs.
      7  1.1  mycroft  * All rights reserved.
      8  1.1  mycroft  *
      9  1.1  mycroft  * Redistribution and use in source and binary forms, with or without
     10  1.1  mycroft  * modification, are permitted provided that the following conditions
     11  1.1  mycroft  * are met:
     12  1.1  mycroft  * 1. Redistributions of source code must retain the above copyright
     13  1.1  mycroft  *    notice immediately at the beginning of the file, without modification,
     14  1.1  mycroft  *    this list of conditions, and the following disclaimer.
     15  1.1  mycroft  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  mycroft  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  mycroft  *    documentation and/or other materials provided with the distribution.
     18  1.1  mycroft  * 3. Absolutely no warranty of function or purpose is made by the author
     19  1.1  mycroft  *    Justin T. Gibbs.
     20  1.1  mycroft  * 4. Modifications may be freely made to this file if the above conditions
     21  1.1  mycroft  *    are met.
     22  1.1  mycroft  *
     23  1.1  mycroft  *      $Id: smc93cx6var.h,v 1.1 1996/05/16 03:59:11 mycroft Exp $
     24  1.1  mycroft  */
     25  1.1  mycroft 
     26  1.1  mycroft #include <sys/param.h>
     27  1.1  mycroft #if !defined(__NetBSD__)
     28  1.1  mycroft #include <sys/systm.h>
     29  1.1  mycroft #endif
     30  1.1  mycroft 
     31  1.1  mycroft struct seeprom_descriptor {
     32  1.1  mycroft #if defined(__FreeBSD__)
     33  1.1  mycroft 	u_long sd_iobase;
     34  1.1  mycroft #elif defined(__NetBSD__)
     35  1.1  mycroft 	bus_chipset_tag_t sd_bc;
     36  1.1  mycroft 	bus_io_handle_t sd_ioh;
     37  1.1  mycroft 	bus_io_size_t sd_offset;
     38  1.1  mycroft #endif
     39  1.1  mycroft 	u_int16_t sd_MS;
     40  1.1  mycroft 	u_int16_t sd_RDY;
     41  1.1  mycroft 	u_int16_t sd_CS;
     42  1.1  mycroft 	u_int16_t sd_CK;
     43  1.1  mycroft 	u_int16_t sd_DO;
     44  1.1  mycroft 	u_int16_t sd_DI;
     45  1.1  mycroft };
     46  1.1  mycroft 
     47  1.1  mycroft /*
     48  1.1  mycroft  * This function will read count 16-bit words from the serial EEPROM and
     49  1.1  mycroft  * return their value in buf.  The port address of the aic7xxx serial EEPROM
     50  1.1  mycroft  * control register is passed in as offset.  The following parameters are
     51  1.1  mycroft  * also passed in:
     52  1.1  mycroft  *
     53  1.1  mycroft  *   CS  - Chip select
     54  1.1  mycroft  *   CK  - Clock
     55  1.1  mycroft  *   DO  - Data out
     56  1.1  mycroft  *   DI  - Data in
     57  1.1  mycroft  *   RDY - SEEPROM ready
     58  1.1  mycroft  *   MS  - Memory port mode select
     59  1.1  mycroft  *
     60  1.1  mycroft  *  A failed read attempt returns 0, and a successful read returns 1.
     61  1.1  mycroft  */
     62  1.1  mycroft #if defined(__FreeBSD__)
     63  1.1  mycroft int read_seeprom __P((struct seeprom_descriptor *sd,
     64  1.1  mycroft     u_int16_t *buf, u_int start_addr, int count));
     65  1.1  mycroft #elif defined(__NetBSD__)
     66  1.1  mycroft int read_seeprom __P((struct seeprom_descriptor *sd,
     67  1.1  mycroft     u_int16_t *buf, bus_io_size_t start_addr, bus_io_size_t count));
     68  1.1  mycroft #endif
     69  1.1  mycroft int acquire_seeprom __P((struct seeprom_descriptor *sd));
     70  1.1  mycroft void release_seeprom __P((struct seeprom_descriptor *sd));
     71