-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreadme
319 lines (228 loc) · 8.97 KB
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
Building the Driver and application:
--------------------
Run the following command in the driver source folder:
$ make
Once the driver is compliled, the loadable module ax99100.ko will be created in the same folder.
** '$' --this symbol represents the shell prompt on linux
Loading the Driver:
-------------------
To load the driver use the following command:
$ insmod ax99100.ko
** '$' --this symbol represent the shell prompt on linux
Unloading the Driver:
---------------------
To unload the driver use the following command:
$rmmod ax99100
** '$' --this symbol represent the shell prompt on linux
Installing the Serial Port Driver:
----------------------
To install the driver use the following command:
make install
Uninstalling the Serial Port Driver:
------------------------
To un-install the driver use the following command:
make uninstall
Features Supported:
-------------------
The driver supports all the features supported by the AX99100 serial device and the AX99100 SPI device.
Note: only baud rates upto 3.0Mbps are implemented in the current driver.
Feature Configuration:
----------------------
AX99100 serial port:
--------------------
This driver comes with a static array uart_99100_contxts[ ] for all the 16 ports features in the ax99100_sp.c file.
Where you can set the features like:
-DMA in RX
-DMA in TX
-enable/disable Flow control
-Flow control type
-RX fifo trigger level
-TX fifo trigger level
-x-on character
-x-off character
An example array setting for PORT 0 which will be recognised as /dev/ttyF0:
//Port 0 --**This represents that this setting is for port 0 which will be recognised as /dev/ttyF0
{
.rx_dma_en = 0,
.tx_dma_en = 0,
.uart_mode = AX99100_RS232_MODE,
.en_flow_control= 0,
.flow_ctrl_type = AX99100_XON_XOFF_HW_FLOWCONTROL,
.rxfifotrigger = 64,
.txfifotrigger = 64,
.x_on = SERIAL_DEF_XON,
.x_off = SERIAL_DEF_XOFF,
},
To change the port to different modes for uart_mode settings use the following,
AX99100_RS422_MODE (422 mode)
AX99100_RS485_HALF_DUPLEX (485 half duplex)
AX99100_RS485_HALF_DUPLEX_ECHO (485 half duplex echo)
AX99100_RS485_FULL_DUPLEX (485 full duplex)
AX99100_RS485_FULL_DUPLEX_TXEN (485 full duplex DxEN)
If you are use AX99100 chip with multi-protocol mode, the uart_99100_contxts[ ] array features need to setup.
{
...
.ltc2872_te485 = 0,
.ltc2872_dz = 0,
.ltc2872_lb = 0,
.ltc2872_fen = 0,
.pci_config_l0s = 0,
.pci_config_l1 = 0,
}
Kernels:
--------
This driver is currently developed and tested on 2.6.13 linux kernel and above
Limitations:
------------
This ax99100 driver supports a maximum of 4 serial devices or spi device. This can be modified as required
Steps for setting parallel port :
---------------------------------
1. rmmod lp
2. rmmod parport_pc
2. insmod parport_pc.ko io=bar0 io_hi=bar1 irq=number.
Note: Here, the io, io_hi and irq should be noted from lspci -v.
Steps for setting gpio[7:0] :
-----------------------------
Execute the "gpio_99100" application and the application will show:
Please input the port of AX99100. (ex. /dev/ttyF0):
After specify the serial port, application will show these selections to access GPIO:
0 : GPIO status
1 : Setup GPIO direction
2 : GPIO write
99 : Exit
SPI Test Tool Flow:
-------------------
This spi_test tool is used for the AX99100 SPI Demo Board non decoder.
The test case according to the following steps:
#Open AX99100 SPI device:
Open char device with AX99100 SPI(ex./dev/spi0)
$./spi_test /dev/spi0
#Step 1:
Set the SPI Control Master Register. Input 457 to set SPIMEN, ASS and SSOE bit.
/-----------------------------------------------------------------/
SPICMR Setting
Number: 0 1 2 3 4 5 6 7
Name: SSP CPHA CPOL LSB SPIMEN ASS SWE SSOE
Example: Need to set SPIMEN ASS SSOE bits, and the value is 457
Input the value of SPICMR: 457
/-----------------------------------------------------------------/
#Step 2:
Select SPI Source Clocks. Input 0 to select the source clock, 125MHz.
/-----------------------------------------------------------------/
SPICSS SPICKS Setting
Valus: 0:125MHz
1:100MHz
2,3:EXT_CLK
Input the value of SPICKS: 0
/-----------------------------------------------------------------/
#Step 3:
Select whether to enable the clock divide. Input 1 to enable the clock divider.
/-----------------------------------------------------------------/
SPICSS SPIDIVEN Setting
Valus: 0:Disable
1:Enable
Input the value of SPIDIVEN: 1
/-----------------------------------------------------------------/
#Step 4:
Set the SPI Divider. Input 3 to set the SPI Divider.
/-----------------------------------------------------------------/
SPIDIVIDER Setting
Valus: 0 - 255
Input the value of SPIDIVIDER: 3
/-----------------------------------------------------------------/
#Step 5:
Select whether to enable the external decoder. Input 0 to disable the externel decoder.
/-----------------------------------------------------------------/
Externel Decoder Setting
Valus: 0:Disable
1:Enable
Input the value of EDE: 0
/-----------------------------------------------------------------/
#Step 6:
Select the desired slave device. Input 0 to select Device 0.
/-----------------------------------------------------------------/
Divice Setting
Valus: 0 - 2 (Device 0 - Device 2)
Input the value of device: 0
/-----------------------------------------------------------------/
#Step 7:
Set the test count. Input 10 to perform ten times for test.
/-----------------------------------------------------------------/
Data Test Count Setting
Input the value of test count: 10
/-----------------------------------------------------------------/
#Step 8:
Select Tx, Rx or TXRX(Compare). Input 2 to select TX & RX (Compare data).
/-----------------------------------------------------------------/
Data Tx/Rx Direction Setting
Valus: 0:TX
1:RX
2:TX & RX
Input the value of direction: 2
/-----------------------------------------------------------------/
#Step 9:
Set the data pattern type. Input 255 to set the data pattern type. (255 -> 0xff)
/-----------------------------------------------------------------/
Data Pattern Type Setting
Valus: 0 - 255 (0x00 - 0xff)
Input the value of pattern: 255
/-----------------------------------------------------------------/
#Step 10:
Select Interrupt or Polling. Input 1 to select the Polling mode.
/-----------------------------------------------------------------/
Data Interrupt Setting
Method: 0:Interrupt
1:Polling
Select the mode: 1
/-----------------------------------------------------------------/
#Step 11:
If you want to modify one data setting, select the data item.
Run test to select number 9.
/-----------------------------------------------------------------/
*************************************************
* Test SPI Setting *
*************************************************
**Initial Information:
SPICMR: 0xb0 ( SPIMEN ASS SSOE )
SPICKS: 0x00 ( 125MHz ) SPIDIVEN: 0x1 ( Enable ) SPIDIVIDER: 3
**Test Setting:
Test Direction: TX & RX
Device Num.: 0x6 Test Count: 10 Externel Decoder: 0x0 ( Disable )
Pattern Type: 0xff Data Length: 256 Interrupt Mode: Polling
***Initial data***
0: Modify SPICMR
1: Modify SPICKS
2: Modify SPIDIVIDER
***Test setting***
3: Select Device
4: Modify Data Pattern(for tx)
5: Modify Test Count
6: Select Tx or Rx
7: Modify Data Length
8: Select Interrupt Mode
9: Test performace.
99: Exit the test tool.
Please choose: 9
/-----------------------------------------------------------------/
#Result:
If you want to run test with the same setting, input Y or y.
Otherwise, input N or n.
/-----------------------------------------------------------------/
*************************************************
* Test SPI Setting *
*************************************************
**Initial Information:
SPICMR: 0xb0 ( SPIMEN ASS SSOE )
SPICKS: 0x00 ( 125MHz ) SPIDIVEN: 0x1 ( Enable ) SPIDIVIDER: 3
**Test Setting:
Test Direction: TX & RX
Device Num.: 0x6 Test Count: 10 Externel Decoder: 0x0 ( Disable )
Pattern Type: 0xff Data Length: 256 Interrupt Mode: Polling
*************************************************
* Throughput *
*************************************************
Test Counter: 10
TX Throughput: 0.385650 MB/s
RX Throughput: 4.569484 MB/s
Test again?(Y/N):n
/-----------------------------------------------------------------/