BOOTLOADER
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
cs8900.h
Go to the documentation of this file.
1 #ifndef CS8900DRIVER_H
2 #define CS8900DRIVER_H
3 
4 // nGCS2|A28|0x300=0x10000000+0x01000000+0x00000300=19000300
5 #define CS8900_ADDRESS 0x11000300 // cs8900 io base address...FS2410XP...nCGS2
6 //#define CS8900_ADDRESS 0x19000000 // cs8900 io base address...FS2410XP...nCGS2
7 // I/O mode register mapping
8 #define IO_RX_TX_DATA_0 (0x00000000)
9 #define IO_RX_TX_DATA_1 (0x00000002)
10 #define IO_TX_CMD (0x00000004)
11 #define IO_TX_LENGTH (0x00000006)
12 #define IO_INT_STATSU_QUEUE (0x00000008)
13 #define IO_PACKET_PAGE_POINTER (0x0000000a)
14 #define IO_PACKET_PAGE_DATA_0 (0x0000000c)
15 #define IO_PACKET_PAGE_DATA_1 (0x0000000e)
16 // Bus interface registers
17 #define PKTPG_EISA_NUMBER 0x0000
18 #define PKTPG_PRDCT_ID_CODE 0x0002
19 #define PKTPG_IO_BASE_ADDR 0x0020
20 #define PKTPG_INTERRUPT_NUMBER 0x0022
21 #define PKTPG_DMA_CHANNEL_NUMBER 0x0024
22 #define PKTPG_DMA_START_OF_FRAME 0x0026
23 #define PKTPG_DMA_FRAME_COUNT 0x0028
24 #define PKTPG_RX_DMA_BYTE_COUNT 0x002a
25 #define PKTPG_MEMORY_BASE_ADDR 0x002c
26 #define PKTPG_BOOT_PROM_BASE_ADDR 0x0030
27 #define PKTPG_BOOT_PROM_ADDR_MASK 0x0034
28 #define PKTPG_EEPROM_COMMAND 0x0040
29 #define PKTPG_EEPROM_DATA 0x0042
30 #define PKTPG_RX_FRAME_BYTE_COUNT 0x0050
31 // Status and control registers
32 #define PKTPG_ISQ 0x0120
33 #define PKTPG_RX_CFG 0x0102
34 #define PKTPG_RX_EVENT 0x0124
35 #define PKTPG_RX_CTL 0x0104
36 #define PKTPG_TX_CFG 0x0106
37 #define PKTPG_TX_EVENT 0x0128
38 #define PKTPG_TX_CMD_ST 0x0108
39 #define PKTPG_BUF_CFG 0x010a
40 #define PKTPG_BUF_EVENT 0x012c
41 #define PKTPG_RX_MISS 0x0130
42 #define PKTPG_TX_COL 0x0132
43 #define PKTPG_LINE_CTL 0x0112
44 #define PKTPG_LINE_ST 0x0134
45 #define PKTPG_SELF_CTL 0x0114
46 #define PKTPG_SELF_ST 0x0136
47 #define PKTPG_BUS_CTL 0x0116
48 #define PKTPG_BUS_ST 0x0138
49 #define PKTPG_TEST_CTL 0x0118
50 #define PKTPG_AUI_TIME_DOMAIN_REF 0x013c
51 // Initiate transmit registers
52 #define PKTPG_TX_CMD_REQ 0x0144
53 #define PKTPG_TX_LENGTH 0x0146
54 // Address filter registers
55 #define PKTPG_LOGICAL_ADDR_FILTER 0x0150
56 #define PKTPG_INDIVISUAL_ADDR 0x0158
57 // Frame locations
58 #define PKTPG_RX_STATUS 0x0400
59 #define PKTPG_RX_LENGTH 0x0402
60 #define PKTPG_RX_FRAME 0x0404
61 #define PKTPG_TX_FRAME 0x0a00
62 // Bit masks
63 //PKTPG_SELF_CTL
64 #define SELF_CTL_RESET 0x0040
65 #define SELF_CTL_LOW_BITS 0x0015
66 //PKTPG_SELF_ST
67 #define SELF_ST_INITD 0x0080
68 #define SELF_ST_SIBUSY 0x0100
69 //
70 #define BUS_ST_TX_BID_ERR 0x0080
71 #define BUS_ST_RDY_4_TX_NOW 0x0100
72 #define BUS_CTL_MEMORY_E 0x0400
73 #define BUS_CTL_ENABLE_IRQ 0x8000
74 #define BUS_CTL_IOCHRDYE 0x1000
75 #define BUS_CTL_LOW_BITS 0x0017
76 #define TX_CMD_START_5 0x0000
77 #define TX_CMD_START_381 0x0040
78 #define TX_CMD_START_1021 0x0080
79 #define TX_CMD_START_ALL 0x00c0
80 #define TX_CMD_FORCE 0x0100
81 #define TX_CMD_ONECOLL 0x0200
82 #define TX_CMD_NO_CRC 0x1000
83 #define TX_CMD_NO_PAD 0x2000
84 #define TX_CMD_LOW_BITS 0x0009
85 #define ISQ_REG_NUM 0x003f
86 #define ISQ_REG_CONTENT 0xffc0
87 
88 //PKTPG_RX_EVENT
89 #define RX_EVENT_IA_HASH 0x0040
90 #define RX_EVENT_DRIBBLEBITS 0x0080
91 #define RX_EVENT_RX_OK 0x0100
92 #define RX_EVENT_HASHED 0x0200
93 #define RX_EVENT_IND_ADDR 0x0400
94 #define RX_EVENT_BROADCAST 0x0800
95 #define RX_EVENT_CRC_ERROR 0x1000
96 #define RX_EVENT_RUNT 0x2000
97 #define RX_EVENT_EXTRADATA 0x4000
98 
99 #define RX_CTL_RX_OK_A 0x0100
100 #define RX_CTL_IND_ADDR_A 0x0400
101 #define RX_CTL_BROADCAST_A 0x0800
102 #define RX_CTL_LOW_BITS 0x0005
103 #define RX_CFG_SKIP 0x0040
104 #define RX_CFG_RX_OK_I_E 0x0100
105 #define RX_CFG_LOW_BITS 0x0003
106 #define BUF_EVENT_RDY_4_TX 0x0100
107 #define BUF_CFG_RDY_4_TX_I_E 0x0100
108 #define BUF_CFG_LOW_BITS 0x000b
109 #define TX_CFG_LOSS_OF_CRC_I_E 0x0040
110 #define TX_CFG_SQE_ERROR_I_E 0x0080
111 #define TX_CFG_TX_OK_I_E 0x0100
112 #define TX_CFG_OUT_OF_WINDOW_I_E 0x0200
113 #define TX_CFG_JABBER_I_E 0x0400
114 #define TX_CFG_ANYCOLL_I_E 0x0800
115 #define TX_CFG_16_COLL_I_E 0x8000
116 #define TX_CFG_ALL 0x8fc0
117 #define TX_CFG_LOW_BITS 0x0007
118 #define TX_EVENT_LOSS_OF_CRS 0x0040
119 #define TX_EVENT_SQE_ERROR 0x0080
120 #define TX_EVENT_TX_OK 0x0100
121 #define TX_EVENT_OUT_OF_WINDOW 0x0200
122 #define TX_EVENT_JABBER 0x0400
123 #define TX_EVENT_NUM_TX_COLL 0x7800
124 #define TX_EVENT_16_COLL 0x8000
125 // One of the values of 0, 1, 2, 3
126 #define INTERRUPT_NUMBER 0x0000
127 #define LINE_CTL_10_BASE_T 0x0000
128 #define LINE_CTL_AUI_ONLY 0x0100
129 #define LINE_CTL_RX_ON 0x0040
130 #define LINE_CTL_TX_ON 0x0080
131 #define LINE_CTL_MOD_BACKOFF 0x0800
132 #define LINE_CTL_LOW_BITS 0x0013
133 #define LINE_ST_LINK_OK 0x0080
134 #define LINE_ST_AUI 0x0100
135 #define LINE_ST_10BT 0x0200
136 #define LINE_ST_POLARITY_OK 0x1000
137 #define LINE_ST_CRS 0x4000
138 #define TEST_CTL_FDX 0x4000
139 #define TEST_CTL_LOW_BITS 0x0019
140 // Register numbers
141 #define REG_NUM_RX_EVENT 0x0004
142 #define REG_NUM_TX_EVENT 0x0008
143 #define REG_NUM_BUF_EVENT 0x000c
144 #define REG_NUM_RX_MISS 0x0010
145 #define REG_NUM_TX_COL 0x0012
146 // CS8900 signature read from PacketPage Pointer port at reset
147 #define CS8900_SIGNATURE 0x3000
148 #define CS8900_SIGNATURE_MASK 0x3000
149 #define CS8900_EISA_NUMBER 0x630e // CS8900 EISA number
150 #define CS8900_PRDCT_ID 0x0000 // CS8900 product ID 0s
151 #define CS8900_PRDCT_ID_MASK 0xe0ff // 0's mask 0->1(0000 0000)0xff (000x xxxx)0xe0
152 #define CS8900_ID_REV_B 0x0e00
153 #define CS8900_ID_REV_C 0x0800
154 #define CS8900_ID_REV_D 0x0900
155 // CS8900 conditional compile setting
156 #define CS8900_MEM_MODE 1
157 
158 typedef struct{
171 
173 extern void F_Cs8900Init(void);
174 extern void F_Cs8900Svc(void);
175 extern INT8U F_Cs8900InUseCheck(void);
176 extern INT8U F_Cs8900Allocate(INT16U UserId);
177 extern INT8U F_Cs8900Release(INT16U UserId);
178 extern INT8U F_Cs8900InitialStart(INT16U UserId);
179 extern INT8U F_Cs8900MacAddressSet(INT16U UserId,INT8U *pMacAddress);
180 extern INT8U F_Cs8900IpAddressSet(INT16U UserId,INT8U *pIpAddress);
181 extern INT8U F_Cs8900InitialPassCheck(void);
182 extern INT8U F_Cs8900ReadyCheck(void);
183 extern INT16U F_Cs8900IoRegisterRead(INT16U Offset);
184 extern void F_Cs8900RegisterWrite(INT16U Offset,INT16U Data);
185 extern INT16U F_Cs8900RegisterRead(INT16U Offset);
186 extern void F_Cs8900IrqEnable(void);
187 extern INT8U F_Cs8900MacSet(INT16U *pMac);
188 extern INT8U F_Cs8900PacketTransmit(INT8U *pPacketData,INT16U PacketLength);
189 extern INT32U F_Cs8900PacketReceive(INT8U *pPacketData,INT32U PacketLength);
190 extern INT8U F_Cs8900PacketReceiveCheck(void);
191 extern INT8U F_Cs8900Link(void);
192 
193 #endif