ARPDAS_QNX6 1.0
sc104.h
Go to the documentation of this file.
00001 #ifndef SC104_H_INCLUDED
00002 #define SC104_H_INCLUDED
00003 #include <sys/dispatch.h>
00004 #include "subbusd.h"
00005 #include "subbus.h"
00006 
00007 #define LIBRARY_SUB SB_SYSCON104
00008 #define SUBBUS_VERSION 0x400 /* subbus version 4.00 QNX6 */
00009 
00010 //---------------------------------------------------------------------
00011 //Subbus Features:
00012 //---------------------------------------------------------------------
00013 #define SBF_SIC 1 // SIC Functions (SICFUNC)
00014 #define SBF_LG_RAM 2 // Large NVRAM (SYSCON)
00015 #define SBF_HW_CNTS 4 // Hardware rst & pwr Counters (SIC)
00016 #define SBF_WD 8 // Watchdog functions (always)
00017 #define SBF_SET_FAIL 0x10 // Set failure lamp (Comes w/ SICFUNC)
00018 #define SBF_READ_FAIL 0x20 // Read failure lamps (SYSCON)
00019 #define SBF_READ_SW 0x40 // Read Switches (was SICFUNC, now indep.)
00020 #define SBF_NVRAM 0x80 // Any NVRAM at all!
00021 #define SBF_CMDSTROBE 0x100 // Cmdstrobe Function
00022 
00023 
00024 #if LIBRARY_SUB == 1
00025   #define PCICC 1
00026   #define SIC 0
00027   #define SYSCON 0
00028   #define SICFUNC 0
00029   #define SC104 0
00030   #define READSWITCH 0
00031   #define NVRAM 0
00032 #endif
00033 
00034 #if LIBRARY_SUB == 2
00035   #define PCICC 1
00036   #define SIC 1
00037   #define SYSCON 0
00038   #define SICFUNC 1
00039   #define SC104 0
00040   #define READSWITCH 1
00041   #define NVRAM 1
00042 #endif
00043 
00044 #if LIBRARY_SUB == 3
00045   #define PCICC 0
00046   #define SIC 0
00047   #define SYSCON 1
00048   #define SICFUNC 1
00049   #define SC104 0
00050   #define READSWITCH 1
00051   #define NVRAM 1
00052 #endif
00053 
00054 #if LIBRARY_SUB == 4
00055   #define PCICC 0
00056   #define SIC 0
00057   #define SYSCON 1
00058   #define SICFUNC 0
00059   #define SC104 1
00060   #define READSWITCH 1
00061   #define NVRAM 0
00062 #endif
00063 
00064 #if PCICC
00065   #define SC_SB_RESET 0x310
00066   #define SC_SB_LOWA 0x308
00067   #define SC_SB_HIGHA 0x30C
00068   #define SC_SB_LOWB 0x309
00069   #define SC_SB_HIGHB 0x30D
00070   #define SC_SB_LOWC 0x30A
00071   #define SC_SB_HIGHC 0x30E
00072   #define SC_SB_LOWCTRL 0x30B
00073   #define SC_SB_HIGHCTRL 0x30F
00074   #define SC_SB_CONFIG 0x0C1C0
00075   #define SC_CMDENBL 0x311
00076   #define SC_DISARM 0x318
00077   #define SC_TICK 0x319
00078   #define WAIT_COUNT 10
00079 #endif
00080 
00081 #if SIC
00082   #define SC_RES_CNT 0x31A
00083   #define SC_PWR_CNT 0x31B
00084   #define SC_RAMADDR 0x31C
00085   #define SC_NMI_ENABLE 0x31C
00086   #define SC_NMIE_VAL 0x20
00087   #define SC_RAMDATA 0x31D
00088   #define SC_SWITCHES 0x31E
00089   #define SC_LAMP 0x31F
00090 #endif
00091 
00092 #if SYSCON
00093   #define SC_SB_RESET 0x310
00094   #define SC_SB_LOWA 0x308
00095   #define SC_SB_LOWB 0x30A
00096   #define SC_SB_LOWC 0x30C
00097   #define SC_SB_LOWCTRL 0x30E
00098   #define SC_SB_HIGHA 0x309
00099   #define SC_SB_HIGHB 0x30B
00100   #define SC_SB_HIGHC 0x30D
00101   #define SC_SB_HIGHCTRL 0x30F
00102   #define SC_SB_CONFIG 0x0C1C0
00103   #define SC_CMDENBL 0x318
00104   #define SC_DISARM 0x311
00105   #define SC_TICK 0x319
00106   #define SC_LAMP 0x317
00107         #if SC104
00108     #define SC_SWITCHES 0x316
00109     #define WAIT_COUNT 5
00110     #define SET_FAIL 1
00111         #else
00112     #define SC_RAMADDR 0x31A
00113     #define SC_RAMDATA 0x31D
00114     #define SC_NMI_ENABLE 0x31C
00115     #define SC_NMIE_VAL 1 
00116     #define WAIT_COUNT 1
00117     #define SC_SWITCHES 0x31C
00118     #define LG_RAM 1
00119         #endif
00120 #endif
00121 
00122 #if SICFUNC
00123   #define TICKFAIL 6 // novram addr for tick fail info
00124   #ifndef SET_FAIL
00125     #define SET_FAIL 1
00126   #endif
00127 #endif
00128 
00129 //----------------------------------------------------------------
00130 // SC104 is the first unit without any NVRAM
00131 //----------------------------------------------------------------
00132 #ifndef SET_FAIL
00133   #define SET_FAIL 0
00134 #endif
00135 #ifndef LG_RAM
00136   #define LG_RAM 0
00137 #endif
00138 
00139 #define SUBBUS_FEATURES (SBF_WD | (SIC*SBF_HW_CNTS) | (SET_FAIL*SBF_SET_FAIL) | \
00140  (LG_RAM*SBF_LG_RAM) | (SYSCON*(SBF_READ_FAIL|SBF_CMDSTROBE)) | \
00141  (SICFUNC*SBF_SIC) | (READSWITCH*SBF_READ_SW) | (NVRAM*SBF_NVRAM))
00142 
00143 extern void process_IRQs( char *t );
00144 extern int int_attach(int rcvid, subbusd_req_t *req);
00145 extern int int_detach(int rcvid, subbusd_req_t *req);
00146 extern int service_expint( message_context_t * ctp, int code,
00147                      unsigned flags, void * handle );
00148 extern void expint_init( int coid, short code, int value );
00149 extern int service_expint( message_context_t * ctp, int code,
00150                      unsigned flags, void * handle );
00151 
00152 extern void sc104_init_options(int argc, char **argv);
00153 
00154 #endif
00155 
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines