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#include <linux/dma-mapping.h>
29#include <linux/init.h>
30#include <linux/interrupt.h>
31#include <linux/io.h>
32#include <linux/module.h>
33#include <linux/of_platform.h>
34#include <linux/of_address.h>
35#include <linux/of_irq.h>
36#include <linux/platform_device.h>
37#include <linux/slab.h>
38
39
40
41
42#define XTG_PARAM_RAM_OFFSET 0x1000
43#define XTG_COMMAND_RAM_OFFSET 0x8000
44#define XTG_COMMAND_RAM_MSB_OFFSET 0xa000
45#define XTG_MASTER_RAM_INIT_OFFSET 0x10000
46#define XTG_MASTER_RAM_OFFSET 0xc000
47
48
49#define XTG_MCNTL_OFFSET 0x00
50#define XTG_SCNTL_OFFSET 0x04
51#define XTG_ERR_STS_OFFSET 0x08
52#define XTG_ERR_EN_OFFSET 0x0C
53#define XTG_MSTERR_INTR_OFFSET 0x10
54#define XTG_CFG_STS_OFFSET 0x14
55#define XTG_STREAM_CNTL_OFFSET 0x30
56#define XTG_STREAM_TL_OFFSET 0x38
57#define XTG_STATIC_CNTL_OFFSET 0x60
58#define XTG_STATIC_LEN_OFFSET 0x64
59
60
61
62
63#define XTG_MCNTL_MSTEN_MASK 0x00100000
64
65#define XTG_SCNTL_ERREN_MASK 0x00008000
66
67#define XTG_ERR_EN_MSTIRQEN_MASK 0x80000000
68
69#define XTG_MSTERR_INTR_MINTREN_MASK 0x00008000
70
71#define XTG_ERR_STS_MSTDONE_MASK 0x80000000
72
73#define XTG_ERR_ALL_ERRS_MASK 0x001F0003
74
75#define XTG_MCNTL_REV_SHIFT 24
76
77
78
79
80#define XTG_LEN_MASK 0xFF
81#define XTG_LOCK_MASK 0x1
82#define XTG_BURST_MASK 0x3
83#define XTG_SIZE_MASK 0x7
84#define XTG_ID_MASK 0x1F
85#define XTG_PROT_MASK 0x7
86#define XTG_LAST_ADDR_MASK 0x7
87#define XTG_VALID_CMD_MASK 0x1
88#define XTG_MSTRAM_INDEX_MASK 0x1FFF
89#define XTG_OTHER_DEPEND_MASK 0x1FF
90#define XTG_MY_DEPEND_MASK 0x1FF
91#define XTG_QOS_MASK 0xF
92#define XTG_USER_MASK 0xFF
93#define XTG_CACHE_MASK 0xF
94#define XTG_EXPECTED_RESP_MASK 0x7
95
96
97#define XTG_LEN_SHIFT 0
98#define XTG_LOCK_SHIFT 8
99#define XTG_BURST_SHIFT 10
100#define XTG_SIZE_SHIFT 12
101#define XTG_ID_SHIFT 15
102#define XTG_PROT_SHIFT 21
103#define XTG_LAST_ADDR_SHIFT 28
104#define XTG_VALID_CMD_SHIFT 31
105#define XTG_MSTRAM_INDEX_SHIFT 0
106#define XTG_OTHER_DEPEND_SHIFT 13
107#define XTG_MY_DEPEND_SHIFT 22
108#define XTG_QOS_SHIFT 16
109#define XTG_USER_SHIFT 5
110#define XTG_CACHE_SHIFT 4
111#define XTG_EXPECTED_RESP_SHIFT 0
112
113
114
115
116#define XTG_PARAM_ADDRMODE_SHIFT 24
117#define XTG_PARAM_INTERVALMODE_SHIFT 26
118#define XTG_PARAM_IDMODE_SHIFT 28
119#define XTG_PARAM_OP_SHIFT 29
120
121
122#define XTG_PARAM_COUNT_SHIFT 0
123#define XTG_PARAM_DELAYRANGE_SHIFT 0
124#define XTG_PARAM_DELAY_SHIFT 8
125#define XTG_PARAM_ADDRRANGE_SHIFT 20
126
127
128#define XTG_PARAM_ADDRMODE_MASK 0x3
129#define XTG_PARAM_INTERVALMODE_MASK 0x3
130#define XTG_PARAM_IDMODE_MASK 0x1
131#define XTG_PARAM_OP_MASK 0x7
132
133
134#define XTG_PARAM_COUNT_MASK 0xFFFFFF
135#define XTG_PARAM_DELAYRANGE_MASK 0xFF
136#define XTG_PARAM_DELAY_MASK 0xFFF
137#define XTG_PARAM_ADDRRANGE_MASK 0xF
138
139
140#define XTG_PARAM_OP_NOP 0x0
141#define XTG_PARAM_OP_RPT 0x1
142#define XTG_PARAM_OP_DELAY 0x2
143#define XTG_PARAM_OP_FIXEDRPT 0x3
144
145
146#define XTG_STATIC_CNTL_TD_MASK 0x00000002
147#define XTG_STATIC_CNTL_STEN_MASK 0x00000001
148#define XTG_STATIC_CNTL_RESET_MASK 0x00000000
149
150
151#define XTG_STREAM_CNTL_STEN_MASK 0x00000001
152#define XTG_STREAM_TL_TCNT_MASK 0xFFFF0000
153#define XTG_STREAM_TL_TLEN_MASK 0x0000FFFF
154#define XTG_STREAM_TL_TCNT_SHIFT 16
155
156
157
158#define MAX_NUM_ENTRIES 256
159
160#define VALID_SIG 0xa5a5a5a5
161
162
163#define XTG_PRM_RAM_BLOCK_SIZE 0x400
164#define XTG_CMD_RAM_BLOCK_SIZE 0x1000
165#define XTG_EXTCMD_RAM_BLOCK_SIZE 0x400
166#define XTG_PARAM_RAM_SIZE 0x800
167#define XTG_COMMAND_RAM_SIZE 0x2000
168#define XTG_EXTCMD_RAM_SIZE 0x800
169#define XTG_MASTER_RAM_SIZE 0x2000
170
171
172#define XTG_READ_RAM 0x0
173#define XTG_WRITE_RAM 0x1
174#define XTG_WRITE_RAM_ZERO 0x2
175
176
177#define XTG_CRAM_BYTES_PER_ENTRY 16
178#define XTG_PRAM_BYTES_PER_ENTRY 4
179
180
181#define XTG_MASTER_CMP_INTR 0x1
182#define XTG_MASTER_ERR_INTR 0x2
183#define XTG_SLAVE_ERR_INTR 0x4
184
185
186
187
188
189
190
191
192
193
194#define XTG_INIT_VERSION 0x47
195
196
197#define to_xtg_dev_info(n) ((struct xtg_dev_info *)dev_get_drvdata(n))
198
199#define CMD_WDS 0x4
200#define EXT_WDS 0x1
201#define MSB_INDEX 0x4
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
229struct xtg_cram {
230 phys_addr_t addr;
231 u32 valid_cmd;
232 u32 last_addr;
233 u32 prot;
234 u32 id;
235 u32 size;
236 u32 burst;
237 u32 lock;
238 u32 length;
239 u32 my_dpnd;
240 u32 other_dpnd;
241 u32 mram_idx;
242 u32 qos;
243 u32 user;
244 u32 cache;
245 u32 expected_resp;
246 u16 index;
247 bool is_write_block;
248 u32 is_valid_req;
249};
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269struct xtg_pram {
270 u32 op_cntl0;
271 u32 op_cntl1;
272 u32 op_cntl2;
273 u32 addr_mode;
274 u32 interval_mode;
275 u32 id_mode;
276 u32 opcode;
277 u16 index;
278 bool is_write_block;
279 u32 is_valid_req;
280};
281
282
283
284
285
286
287
288
289
290
291
292struct xtg_dev_info {
293 void __iomem *regs;
294 struct device *dev;
295 phys_addr_t phys_base_addr;
296 s16 last_rd_valid_idx;
297 s16 last_wr_valid_idx;
298 u32 id;
299 u32 xtg_mram_offset;
300};
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334enum xtg_sysfs_ioctl_opcode {
335 XTG_GET_MASTER_CMP_STS,
336 XTG_GET_SLV_CTRL_REG,
337 XTG_GET_ERR_STS,
338 XTG_GET_CFG_STS,
339 XTG_GET_LAST_VALID_INDEX,
340 XTG_GET_DEVICE_ID,
341 XTG_GET_RESOURCE,
342 XTG_GET_STATIC_ENABLE,
343 XTG_GET_STATIC_BURSTLEN,
344 XTG_GET_STATIC_TRANSFERDONE,
345 XTG_GET_STREAM_ENABLE,
346 XTG_GET_STREAM_TRANSFERLEN,
347 XTG_GET_STREAM_TRANSFERCNT,
348 XTG_START_MASTER_LOGIC,
349 XTG_SET_SLV_CTRL_REG,
350 XTG_CLEAR_ERRORS,
351 XTG_ENABLE_ERRORS,
352 XTG_ENABLE_INTRS,
353 XTG_CLEAR_MRAM,
354 XTG_CLEAR_CRAM,
355 XTG_CLEAR_PRAM,
356 XTG_SET_STATIC_ENABLE,
357 XTG_SET_STATIC_DISABLE,
358 XTG_SET_STATIC_BURSTLEN,
359 XTG_SET_STATIC_TRANSFERDONE,
360 XTG_SET_STREAM_ENABLE,
361 XTG_SET_STREAM_DISABLE,
362 XTG_SET_STREAM_TRANSFERLEN,
363 XTG_SET_STREAM_TRANSFERCNT
364};
365
366
367
368
369
370
371
372
373
374static void xtg_access_rams(struct xtg_dev_info *tg, int where,
375 int count, int flags, u32 *data)
376{
377 u32 index;
378
379 switch (flags) {
380 case XTG_WRITE_RAM_ZERO:
381 memset_io(tg->regs + where, 0, count);
382#ifdef CONFIG_PHYS_ADDR_T_64BIT
383 writel(0x0, tg->regs + where +
384 (XTG_COMMAND_RAM_MSB_OFFSET - XTG_COMMAND_RAM_OFFSET) +
385 XTG_EXTCMD_RAM_BLOCK_SIZE - XTG_CMD_RAM_BLOCK_SIZE);
386#endif
387 break;
388 case XTG_WRITE_RAM:
389 for (index = 0; count > 0; index++, count -= 4)
390 writel(data[index], tg->regs + where + index * 4);
391#ifdef CONFIG_PHYS_ADDR_T_64BIT
392 writel(data[MSB_INDEX], tg->regs + where +
393 (XTG_COMMAND_RAM_MSB_OFFSET - XTG_COMMAND_RAM_OFFSET) +
394 XTG_EXTCMD_RAM_BLOCK_SIZE - XTG_CMD_RAM_BLOCK_SIZE);
395#endif
396 break;
397 case XTG_READ_RAM:
398 for (index = 0; count > 0; index++, count -= 4)
399 data[index] = readl(tg->regs + where + index * 4);
400#ifdef CONFIG_PHYS_ADDR_T_64BIT
401 data[MSB_INDEX] = readl(tg->regs + where +
402 (XTG_COMMAND_RAM_MSB_OFFSET - XTG_COMMAND_RAM_OFFSET));
403#endif
404 break;
405 }
406}
407
408
409
410
411
412
413
414static void xtg_prepare_cmd_words(struct xtg_dev_info *tg,
415 const struct xtg_cram *cmdp, u32 *cmd_words)
416{
417
418 cmd_words[0] = lower_32_bits(cmdp->addr);
419
420
421#ifdef CONFIG_PHYS_ADDR_T_64BIT
422 cmd_words[MSB_INDEX] = upper_32_bits(cmdp->addr);
423#endif
424
425
426 cmd_words[1] = 0;
427 cmd_words[1] |= (cmdp->length & XTG_LEN_MASK) << XTG_LEN_SHIFT;
428 cmd_words[1] |= (cmdp->lock & XTG_LOCK_MASK) << XTG_LOCK_SHIFT;
429 cmd_words[1] |= (cmdp->burst & XTG_BURST_MASK) << XTG_BURST_SHIFT;
430 cmd_words[1] |= (cmdp->size & XTG_SIZE_MASK) << XTG_SIZE_SHIFT;
431 cmd_words[1] |= (cmdp->id & XTG_ID_MASK) << XTG_ID_SHIFT;
432 cmd_words[1] |= (cmdp->prot & XTG_PROT_MASK) << XTG_PROT_SHIFT;
433 cmd_words[1] |= (cmdp->last_addr & XTG_LAST_ADDR_MASK) <<
434 XTG_LAST_ADDR_SHIFT;
435 cmd_words[1] |= (cmdp->valid_cmd & XTG_VALID_CMD_MASK) <<
436 XTG_VALID_CMD_SHIFT;
437
438
439 cmd_words[2] = 0;
440 cmd_words[2] |= (cmdp->mram_idx & XTG_MSTRAM_INDEX_MASK) <<
441 XTG_MSTRAM_INDEX_SHIFT;
442 cmd_words[2] |= (cmdp->other_dpnd & XTG_OTHER_DEPEND_MASK) <<
443 XTG_OTHER_DEPEND_SHIFT;
444 cmd_words[2] |= (cmdp->my_dpnd & XTG_MY_DEPEND_MASK) <<
445 XTG_MY_DEPEND_SHIFT;
446
447
448 cmd_words[3] = 0;
449 cmd_words[3] |= (cmdp->qos & XTG_QOS_MASK) << XTG_QOS_SHIFT;
450 cmd_words[3] |= (cmdp->user & XTG_USER_MASK) << XTG_USER_SHIFT;
451 cmd_words[3] |= (cmdp->cache & XTG_CACHE_MASK) << XTG_CACHE_SHIFT;
452 cmd_words[3] |= (cmdp->expected_resp & XTG_EXPECTED_RESP_MASK) <<
453 XTG_EXPECTED_RESP_SHIFT;
454}
455
456
457
458
459
460
461
462static void xtg_prepare_param_word(struct xtg_dev_info *tg,
463 const struct xtg_pram *cmdp, u32 *param_word)
464{
465 *param_word = 0;
466 *param_word |= (cmdp->opcode & XTG_PARAM_OP_MASK) << XTG_PARAM_OP_SHIFT;
467 *param_word |= (cmdp->addr_mode & XTG_PARAM_ADDRMODE_MASK) <<
468 XTG_PARAM_ADDRMODE_SHIFT;
469 *param_word |= (cmdp->id_mode & XTG_PARAM_IDMODE_MASK) <<
470 XTG_PARAM_IDMODE_SHIFT;
471 *param_word |= (cmdp->interval_mode & XTG_PARAM_INTERVALMODE_MASK) <<
472 XTG_PARAM_INTERVALMODE_SHIFT;
473
474 switch (cmdp->opcode) {
475 case XTG_PARAM_OP_RPT:
476 case XTG_PARAM_OP_DELAY:
477 *param_word |= (cmdp->op_cntl0 & XTG_PARAM_COUNT_MASK) <<
478 XTG_PARAM_COUNT_SHIFT;
479 break;
480
481 case XTG_PARAM_OP_FIXEDRPT:
482 *param_word |= (cmdp->op_cntl0 & XTG_PARAM_ADDRRANGE_MASK) <<
483 XTG_PARAM_ADDRRANGE_SHIFT;
484 *param_word |= (cmdp->op_cntl1 & XTG_PARAM_DELAY_MASK) <<
485 XTG_PARAM_DELAY_SHIFT;
486 *param_word |= (cmdp->op_cntl2 & XTG_PARAM_DELAYRANGE_MASK) <<
487 XTG_PARAM_DELAYRANGE_SHIFT;
488 break;
489
490 case XTG_PARAM_OP_NOP:
491 *param_word = 0;
492 break;
493 }
494}
495
496
497
498
499
500
501
502
503
504static ssize_t xtg_sysfs_ioctl(struct device *dev, const char *buf,
505 enum xtg_sysfs_ioctl_opcode opcode)
506{
507 struct xtg_dev_info *tg = to_xtg_dev_info(dev);
508 unsigned long wrval;
509 ssize_t status, rdval = 0;
510
511 if (opcode > XTG_GET_STREAM_TRANSFERCNT) {
512 status = kstrtoul(buf, 16, &wrval);
513 if (status < 0)
514 return status;
515 }
516
517 switch (opcode) {
518 case XTG_GET_MASTER_CMP_STS:
519 rdval = (readl(tg->regs + XTG_MCNTL_OFFSET) &
520 XTG_MCNTL_MSTEN_MASK) ? 1 : 0;
521 break;
522
523 case XTG_GET_SLV_CTRL_REG:
524 rdval = readl(tg->regs + XTG_SCNTL_OFFSET);
525 break;
526
527 case XTG_GET_ERR_STS:
528 rdval = readl(tg->regs + XTG_ERR_STS_OFFSET) &
529 XTG_ERR_ALL_ERRS_MASK;
530 break;
531
532 case XTG_GET_CFG_STS:
533 rdval = readl(tg->regs + XTG_CFG_STS_OFFSET);
534 break;
535
536 case XTG_GET_LAST_VALID_INDEX:
537 rdval = (tg->last_wr_valid_idx << 16) |
538 tg->last_rd_valid_idx;
539 break;
540
541 case XTG_GET_DEVICE_ID:
542 rdval = tg->id;
543 break;
544
545 case XTG_GET_RESOURCE:
546 rdval = (unsigned long)tg->regs;
547 break;
548
549 case XTG_GET_STATIC_ENABLE:
550 rdval = readl(tg->regs + XTG_STATIC_CNTL_OFFSET);
551 break;
552
553 case XTG_GET_STATIC_BURSTLEN:
554 rdval = readl(tg->regs + XTG_STATIC_LEN_OFFSET);
555 break;
556
557 case XTG_GET_STATIC_TRANSFERDONE:
558 rdval = (readl(tg->regs + XTG_STATIC_CNTL_OFFSET) &
559 XTG_STATIC_CNTL_TD_MASK);
560 break;
561
562 case XTG_GET_STREAM_ENABLE:
563 rdval = readl(tg->regs + XTG_STREAM_CNTL_OFFSET);
564 break;
565
566 case XTG_GET_STREAM_TRANSFERLEN:
567 rdval = (readl(tg->regs + XTG_STREAM_TL_OFFSET) &
568 XTG_STREAM_TL_TLEN_MASK);
569 break;
570
571 case XTG_GET_STREAM_TRANSFERCNT:
572 rdval = ((readl(tg->regs + XTG_STREAM_TL_OFFSET) &
573 XTG_STREAM_TL_TCNT_MASK) >>
574 XTG_STREAM_TL_TCNT_SHIFT);
575 break;
576
577 case XTG_START_MASTER_LOGIC:
578 if (wrval)
579 writel(readl(tg->regs + XTG_MCNTL_OFFSET) |
580 XTG_MCNTL_MSTEN_MASK,
581 tg->regs + XTG_MCNTL_OFFSET);
582 break;
583
584 case XTG_SET_SLV_CTRL_REG:
585 writel(wrval, tg->regs + XTG_SCNTL_OFFSET);
586 break;
587
588 case XTG_ENABLE_ERRORS:
589 wrval &= XTG_ERR_ALL_ERRS_MASK;
590 writel(readl(tg->regs + XTG_ERR_EN_OFFSET) | wrval,
591 tg->regs + XTG_ERR_EN_OFFSET);
592 break;
593
594 case XTG_CLEAR_ERRORS:
595 wrval &= XTG_ERR_ALL_ERRS_MASK;
596 writel(readl(tg->regs + XTG_ERR_STS_OFFSET) | wrval,
597 tg->regs + XTG_ERR_STS_OFFSET);
598 break;
599
600 case XTG_ENABLE_INTRS:
601 if (wrval & XTG_MASTER_CMP_INTR) {
602 pr_info("Enabling Master Complete Interrupt\n");
603 writel(readl(tg->regs + XTG_ERR_EN_OFFSET) |
604 XTG_ERR_EN_MSTIRQEN_MASK,
605 tg->regs + XTG_ERR_EN_OFFSET);
606 }
607 if (wrval & XTG_MASTER_ERR_INTR) {
608 pr_info("Enabling Interrupt on Master Errors\n");
609 writel(readl(tg->regs + XTG_MSTERR_INTR_OFFSET) |
610 XTG_MSTERR_INTR_MINTREN_MASK,
611 tg->regs + XTG_MSTERR_INTR_OFFSET);
612 }
613 if (wrval & XTG_SLAVE_ERR_INTR) {
614 pr_info("Enabling Interrupt on Slave Errors\n");
615 writel(readl(tg->regs + XTG_SCNTL_OFFSET) |
616 XTG_SCNTL_ERREN_MASK,
617 tg->regs + XTG_SCNTL_OFFSET);
618 }
619 break;
620
621 case XTG_CLEAR_MRAM:
622 if (wrval)
623 xtg_access_rams(tg, tg->xtg_mram_offset,
624 XTG_MASTER_RAM_SIZE, XTG_WRITE_RAM |
625 XTG_WRITE_RAM_ZERO, NULL);
626 break;
627
628 case XTG_CLEAR_CRAM:
629 if (wrval)
630 xtg_access_rams(tg, XTG_COMMAND_RAM_OFFSET,
631 XTG_COMMAND_RAM_SIZE, XTG_WRITE_RAM |
632 XTG_WRITE_RAM_ZERO, NULL);
633 break;
634
635 case XTG_CLEAR_PRAM:
636 if (wrval)
637 xtg_access_rams(tg, XTG_PARAM_RAM_OFFSET,
638 XTG_PARAM_RAM_SIZE, XTG_WRITE_RAM |
639 XTG_WRITE_RAM_ZERO, NULL);
640 break;
641
642 case XTG_SET_STATIC_ENABLE:
643 if (wrval) {
644 wrval &= XTG_STATIC_CNTL_STEN_MASK;
645 writel(readl(tg->regs + XTG_STATIC_CNTL_OFFSET) | wrval,
646 tg->regs + XTG_STATIC_CNTL_OFFSET);
647 } else {
648 writel(readl(tg->regs + XTG_STATIC_CNTL_OFFSET) &
649 ~XTG_STATIC_CNTL_STEN_MASK,
650 tg->regs + XTG_STATIC_CNTL_OFFSET);
651 }
652 break;
653
654 case XTG_SET_STATIC_BURSTLEN:
655 writel(wrval, tg->regs + XTG_STATIC_LEN_OFFSET);
656 break;
657
658 case XTG_SET_STATIC_TRANSFERDONE:
659 wrval |= XTG_STATIC_CNTL_TD_MASK;
660 writel(readl(tg->regs + XTG_STATIC_CNTL_OFFSET) | wrval,
661 tg->regs + XTG_STATIC_CNTL_OFFSET);
662 break;
663
664 case XTG_SET_STREAM_ENABLE:
665 if (wrval) {
666 wrval &= XTG_STREAM_CNTL_STEN_MASK;
667 writel(readl(tg->regs + XTG_STREAM_CNTL_OFFSET) | wrval,
668 tg->regs + XTG_STREAM_CNTL_OFFSET);
669 } else {
670 writel(readl(tg->regs + XTG_STREAM_CNTL_OFFSET) &
671 ~XTG_STREAM_CNTL_STEN_MASK,
672 tg->regs + XTG_STREAM_CNTL_OFFSET);
673 }
674 break;
675
676 case XTG_SET_STREAM_TRANSFERLEN:
677 wrval &= XTG_STREAM_TL_TLEN_MASK;
678 writel(readl(tg->regs + XTG_STREAM_TL_OFFSET) | wrval,
679 tg->regs + XTG_STREAM_TL_OFFSET);
680 break;
681
682 case XTG_SET_STREAM_TRANSFERCNT:
683 wrval = ((wrval << XTG_STREAM_TL_TCNT_SHIFT) &
684 XTG_STREAM_TL_TCNT_MASK);
685 writel(readl(tg->regs + XTG_STREAM_TL_OFFSET) | wrval,
686 tg->regs + XTG_STREAM_TL_OFFSET);
687 break;
688
689 default:
690 break;
691 }
692
693 return rdval;
694}
695
696
697
698static ssize_t id_show(struct device *dev,
699 struct device_attribute *attr, char *buf)
700{
701 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_DEVICE_ID);
702
703 return snprintf(buf, PAGE_SIZE, "%d\n", rdval);
704}
705static DEVICE_ATTR_RO(id);
706
707static ssize_t resource_show(struct device *dev,
708 struct device_attribute *attr, char *buf)
709{
710 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_RESOURCE);
711
712 return snprintf(buf, PAGE_SIZE, "0x%08x\n", rdval);
713}
714static DEVICE_ATTR_RO(resource);
715
716static ssize_t master_start_stop_show(struct device *dev,
717 struct device_attribute *attr, char *buf)
718{
719 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_MASTER_CMP_STS);
720
721 return snprintf(buf, PAGE_SIZE, "%d\n", rdval);
722}
723
724static ssize_t master_start_stop_store(struct device *dev,
725 struct device_attribute *attr, const char *buf, size_t size)
726{
727 xtg_sysfs_ioctl(dev, buf, XTG_START_MASTER_LOGIC);
728
729 return size;
730}
731static DEVICE_ATTR_RW(master_start_stop);
732
733static ssize_t config_slave_status_show(struct device *dev,
734 struct device_attribute *attr, char *buf)
735{
736 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_SLV_CTRL_REG);
737
738 return snprintf(buf, PAGE_SIZE, "0x%08x\n", rdval);
739}
740
741static ssize_t config_slave_status_store(struct device *dev,
742 struct device_attribute *attr, const char *buf, size_t size)
743{
744 xtg_sysfs_ioctl(dev, buf, XTG_SET_SLV_CTRL_REG);
745
746 return size;
747}
748static DEVICE_ATTR_RW(config_slave_status);
749
750static ssize_t err_sts_show(struct device *dev,
751 struct device_attribute *attr, char *buf)
752{
753 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_ERR_STS);
754
755 return snprintf(buf, PAGE_SIZE, "0x%08x\n", rdval);
756}
757
758static ssize_t err_sts_store(struct device *dev,
759 struct device_attribute *attr, const char *buf, size_t size)
760{
761 xtg_sysfs_ioctl(dev, buf, XTG_CLEAR_ERRORS);
762
763 return size;
764}
765static DEVICE_ATTR_RW(err_sts);
766
767static ssize_t err_en_store(struct device *dev,
768 struct device_attribute *attr, const char *buf, size_t size)
769{
770 xtg_sysfs_ioctl(dev, buf, XTG_ENABLE_ERRORS);
771
772 return size;
773}
774static DEVICE_ATTR_WO(err_en);
775
776static ssize_t intr_en_store(struct device *dev,
777 struct device_attribute *attr, const char *buf, size_t size)
778{
779 xtg_sysfs_ioctl(dev, buf, XTG_ENABLE_INTRS);
780
781 return size;
782}
783static DEVICE_ATTR_WO(intr_en);
784
785static ssize_t last_valid_index_show(struct device *dev,
786 struct device_attribute *attr, char *buf)
787{
788 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_LAST_VALID_INDEX);
789
790 return snprintf(buf, PAGE_SIZE, "0x%08x\n", rdval);
791}
792static DEVICE_ATTR_RO(last_valid_index);
793
794static ssize_t config_sts_show(struct device *dev,
795 struct device_attribute *attr, char *buf)
796{
797 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_CFG_STS);
798
799 return snprintf(buf, PAGE_SIZE, "0x%08x\n", rdval);
800}
801static DEVICE_ATTR_RO(config_sts);
802
803static ssize_t mram_clear_store(struct device *dev,
804 struct device_attribute *attr, const char *buf, size_t size)
805{
806 xtg_sysfs_ioctl(dev, buf, XTG_CLEAR_MRAM);
807
808 return size;
809}
810static DEVICE_ATTR_WO(mram_clear);
811
812static ssize_t cram_clear_store(struct device *dev,
813 struct device_attribute *attr, const char *buf, size_t size)
814{
815 xtg_sysfs_ioctl(dev, buf, XTG_CLEAR_CRAM);
816
817 return size;
818}
819static DEVICE_ATTR_WO(cram_clear);
820
821static ssize_t pram_clear_store(struct device *dev,
822 struct device_attribute *attr, const char *buf, size_t size)
823{
824 xtg_sysfs_ioctl(dev, buf, XTG_CLEAR_CRAM);
825
826 return size;
827}
828static DEVICE_ATTR_WO(pram_clear);
829
830static ssize_t static_enable_show(struct device *dev,
831 struct device_attribute *attr, char *buf)
832{
833 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_STATIC_ENABLE);
834
835 return snprintf(buf, PAGE_SIZE, "0x%08x\n", rdval);
836}
837
838static ssize_t static_enable_store(struct device *dev,
839 struct device_attribute *attr, const char *buf, size_t size)
840{
841 xtg_sysfs_ioctl(dev, buf, XTG_SET_STATIC_ENABLE);
842
843 return size;
844}
845static DEVICE_ATTR_RW(static_enable);
846
847static ssize_t static_burstlen_show(struct device *dev,
848 struct device_attribute *attr, char *buf)
849{
850 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_STATIC_BURSTLEN);
851
852 return snprintf(buf, PAGE_SIZE, "%d\n", rdval);
853}
854
855static ssize_t static_burstlen_store(struct device *dev,
856 struct device_attribute *attr, const char *buf, size_t size)
857{
858 xtg_sysfs_ioctl(dev, buf, XTG_SET_STATIC_BURSTLEN);
859
860 return size;
861}
862static DEVICE_ATTR_RW(static_burstlen);
863
864static ssize_t static_transferdone_show(struct device *dev,
865 struct device_attribute *attr, char *buf)
866{
867 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_STATIC_TRANSFERDONE);
868
869 return snprintf(buf, PAGE_SIZE, "%d\n", rdval);
870}
871
872static ssize_t static_transferdone_store(struct device *dev,
873 struct device_attribute *attr, const char *buf, size_t size)
874{
875 xtg_sysfs_ioctl(dev, buf, XTG_SET_STATIC_TRANSFERDONE);
876
877 return size;
878}
879static DEVICE_ATTR_RW(static_transferdone);
880
881static ssize_t reset_static_transferdone_show(struct device *dev,
882 struct device_attribute *attr, char *buf)
883{
884 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_STATIC_TRANSFERDONE);
885 if (rdval == XTG_STATIC_CNTL_RESET_MASK)
886 rdval = 1;
887 else
888 rdval = 0;
889 return snprintf(buf, PAGE_SIZE, "%d\n", rdval);
890}
891static DEVICE_ATTR_RO(reset_static_transferdone);
892
893static ssize_t stream_enable_show(struct device *dev,
894 struct device_attribute *attr, char *buf)
895{
896 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_STREAM_ENABLE);
897
898 return snprintf(buf, PAGE_SIZE, "0x%08x\n", rdval);
899}
900
901static ssize_t stream_enable_store(struct device *dev,
902 struct device_attribute *attr, const char *buf, size_t size)
903{
904 xtg_sysfs_ioctl(dev, buf, XTG_SET_STREAM_ENABLE);
905
906 return size;
907}
908static DEVICE_ATTR_RW(stream_enable);
909
910static ssize_t stream_transferlen_show(struct device *dev,
911 struct device_attribute *attr, char *buf)
912{
913 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_STREAM_TRANSFERLEN);
914
915 return snprintf(buf, PAGE_SIZE, "%d\n", rdval);
916}
917
918static ssize_t stream_transferlen_store(struct device *dev,
919 struct device_attribute *attr, const char *buf, size_t size)
920{
921 xtg_sysfs_ioctl(dev, buf, XTG_SET_STREAM_TRANSFERLEN);
922
923 return size;
924}
925static DEVICE_ATTR_RW(stream_transferlen);
926
927static ssize_t stream_transfercnt_show(struct device *dev,
928 struct device_attribute *attr, char *buf)
929{
930 ssize_t rdval = xtg_sysfs_ioctl(dev, buf, XTG_GET_STREAM_TRANSFERCNT);
931
932 return snprintf(buf, PAGE_SIZE, "%d\n", rdval);
933}
934
935static ssize_t stream_transfercnt_store(struct device *dev,
936 struct device_attribute *attr, const char *buf, size_t size)
937{
938 xtg_sysfs_ioctl(dev, buf, XTG_SET_STREAM_TRANSFERCNT);
939
940 return size;
941}
942static DEVICE_ATTR_RW(stream_transfercnt);
943
944static ssize_t xtg_pram_read(struct file *filp, struct kobject *kobj,
945 struct bin_attribute *bin_attr,
946 char *buf, loff_t off, size_t count)
947{
948 pr_info("No read access to Parameter RAM\n");
949
950 return 0;
951}
952
953static ssize_t xtg_pram_write(struct file *filp, struct kobject *kobj,
954 struct bin_attribute *bin_attr,
955 char *buf, loff_t off, size_t count)
956{
957 struct xtg_dev_info *tg =
958 to_xtg_dev_info(container_of(kobj, struct device, kobj));
959 u32 *data = (u32 *)buf;
960
961 if (off >= XTG_PARAM_RAM_SIZE) {
962 pr_err("Requested Write len exceeds 2K PRAM size\n");
963 return -ENOMEM;
964 }
965
966 if (count >= XTG_PARAM_RAM_SIZE)
967 count = XTG_PARAM_RAM_SIZE;
968
969
970 if (count == sizeof(struct xtg_pram)) {
971 struct xtg_pram *cmdp = (struct xtg_pram *)buf;
972 u32 param_word;
973
974 if (!cmdp)
975 return -EINVAL;
976
977 if (cmdp->is_valid_req == VALID_SIG) {
978
979 xtg_prepare_param_word(tg, cmdp, ¶m_word);
980
981 count = XTG_PRAM_BYTES_PER_ENTRY;
982 data = ¶m_word;
983
984
985 if (cmdp->index > MAX_NUM_ENTRIES)
986 return -EINVAL;
987
988
989 if (cmdp->is_write_block)
990 off = XTG_PRM_RAM_BLOCK_SIZE +
991 cmdp->index * count;
992 else
993 off = cmdp->index * count;
994 }
995 }
996
997 off += XTG_PARAM_RAM_OFFSET;
998 xtg_access_rams(tg, off, count, XTG_WRITE_RAM, data);
999
1000 return count;
1001}
1002
1003static ssize_t xtg_pram_mmap(struct file *filp, struct kobject *kobj,
1004 struct bin_attribute *attr,
1005 struct vm_area_struct *vma)
1006{
1007 struct xtg_dev_info *tg =
1008 to_xtg_dev_info(container_of(kobj, struct device, kobj));
1009 int ret;
1010
1011 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
1012 vma->vm_flags |= VM_IO;
1013
1014 ret = remap_pfn_range(vma, vma->vm_start, (tg->phys_base_addr +
1015 XTG_PARAM_RAM_OFFSET) >> PAGE_SHIFT,
1016 XTG_PARAM_RAM_SIZE, vma->vm_page_prot);
1017 return ret;
1018}
1019
1020static struct bin_attribute xtg_pram_attr = {
1021 .attr = {
1022 .name = "parameter_ram",
1023 .mode = S_IRUGO | S_IWUSR,
1024 },
1025 .size = XTG_PARAM_RAM_SIZE,
1026 .read = xtg_pram_read,
1027 .write = xtg_pram_write,
1028 .mmap = xtg_pram_mmap,
1029};
1030
1031static ssize_t xtg_cram_read(struct file *filp, struct kobject *kobj,
1032 struct bin_attribute *bin_attr,
1033 char *buf, loff_t off, size_t count)
1034{
1035 struct xtg_dev_info *tg =
1036 to_xtg_dev_info(container_of(kobj, struct device, kobj));
1037
1038 off += XTG_COMMAND_RAM_OFFSET;
1039 xtg_access_rams(tg, off, count, XTG_READ_RAM, (u32 *)buf);
1040
1041 return count;
1042}
1043
1044static ssize_t xtg_cram_write(struct file *filp, struct kobject *kobj,
1045 struct bin_attribute *bin_attr,
1046 char *buf, loff_t off, size_t count)
1047{
1048 struct xtg_dev_info *tg =
1049 to_xtg_dev_info(container_of(kobj, struct device, kobj));
1050 u32 *data = (u32 *)buf;
1051
1052 if (off >= XTG_COMMAND_RAM_SIZE) {
1053 pr_err("Requested Write len exceeds 8K CRAM size\n");
1054 return -ENOMEM;
1055 }
1056
1057
1058 if (count == sizeof(struct xtg_cram)) {
1059 struct xtg_cram *cmdp = (struct xtg_cram *)buf;
1060 u32 cmd_words[CMD_WDS + EXT_WDS];
1061
1062 if (!cmdp)
1063 return -EINVAL;
1064
1065 if (cmdp->is_valid_req == VALID_SIG) {
1066
1067 xtg_prepare_cmd_words(tg, cmdp, cmd_words);
1068 count = XTG_CRAM_BYTES_PER_ENTRY;
1069 data = cmd_words;
1070
1071
1072 if (cmdp->index > MAX_NUM_ENTRIES)
1073 return -EINVAL;
1074
1075
1076 if (cmdp->is_write_block)
1077 off = XTG_CMD_RAM_BLOCK_SIZE +
1078 cmdp->index * count;
1079 else
1080 off = cmdp->index * count;
1081
1082
1083 if (cmdp->valid_cmd) {
1084 if (cmdp->is_write_block)
1085 tg->last_wr_valid_idx =
1086 cmdp->index;
1087 else
1088 tg->last_rd_valid_idx =
1089 cmdp->index;
1090 }
1091 }
1092 }
1093
1094 off += XTG_COMMAND_RAM_OFFSET;
1095 xtg_access_rams(tg, off, count, XTG_WRITE_RAM, data);
1096
1097 return count;
1098}
1099
1100static ssize_t xtg_cram_mmap(struct file *filp, struct kobject *kobj,
1101 struct bin_attribute *attr,
1102 struct vm_area_struct *vma)
1103{
1104 struct xtg_dev_info *tg =
1105 to_xtg_dev_info(container_of(kobj, struct device, kobj));
1106 int ret;
1107
1108 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
1109 vma->vm_flags |= VM_IO;
1110
1111 ret = remap_pfn_range(vma, vma->vm_start, (tg->phys_base_addr +
1112 XTG_COMMAND_RAM_OFFSET) >> PAGE_SHIFT,
1113 XTG_COMMAND_RAM_SIZE + XTG_EXTCMD_RAM_SIZE,
1114 vma->vm_page_prot);
1115 return ret;
1116}
1117
1118static struct bin_attribute xtg_cram_attr = {
1119 .attr = {
1120 .name = "command_ram",
1121 .mode = S_IRUGO | S_IWUSR,
1122 },
1123 .size = XTG_COMMAND_RAM_SIZE,
1124 .read = xtg_cram_read,
1125 .write = xtg_cram_write,
1126 .mmap = xtg_cram_mmap,
1127};
1128
1129static ssize_t xtg_mram_read(struct file *filp, struct kobject *kobj,
1130 struct bin_attribute *bin_attr,
1131 char *buf, loff_t off, size_t count)
1132{
1133 struct xtg_dev_info *tg =
1134 to_xtg_dev_info(container_of(kobj, struct device, kobj));
1135
1136 off += tg->xtg_mram_offset;
1137 xtg_access_rams(tg, off, count, XTG_READ_RAM, (u32 *)buf);
1138
1139 return count;
1140}
1141
1142static ssize_t xtg_mram_write(struct file *filp, struct kobject *kobj,
1143 struct bin_attribute *bin_attr,
1144 char *buf, loff_t off, size_t count)
1145{
1146 struct xtg_dev_info *tg =
1147 to_xtg_dev_info(container_of(kobj, struct device, kobj));
1148
1149 if (off >= XTG_MASTER_RAM_SIZE) {
1150 pr_err("Requested Write len exceeds 8K MRAM size\n");
1151 return -ENOMEM;
1152 }
1153
1154 off += tg->xtg_mram_offset;
1155 xtg_access_rams(tg, off, count, XTG_WRITE_RAM, (u32 *)buf);
1156
1157 return count;
1158}
1159
1160static ssize_t xtg_mram_mmap(struct file *filp, struct kobject *kobj,
1161 struct bin_attribute *attr,
1162 struct vm_area_struct *vma)
1163{
1164 struct xtg_dev_info *tg =
1165 to_xtg_dev_info(container_of(kobj, struct device, kobj));
1166 int ret;
1167
1168 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
1169 vma->vm_flags |= VM_IO;
1170
1171 ret = remap_pfn_range(vma, vma->vm_start, (tg->phys_base_addr +
1172 tg->xtg_mram_offset) >> PAGE_SHIFT,
1173 XTG_MASTER_RAM_SIZE,
1174 vma->vm_page_prot);
1175 return ret;
1176}
1177
1178static struct bin_attribute xtg_mram_attr = {
1179 .attr = {
1180 .name = "master_ram",
1181 .mode = S_IRUGO | S_IWUSR,
1182 },
1183 .size = XTG_MASTER_RAM_SIZE,
1184 .read = xtg_mram_read,
1185 .write = xtg_mram_write,
1186 .mmap = xtg_mram_mmap,
1187};
1188
1189static struct bin_attribute *xtg_bin_attrs[] = {
1190 &xtg_mram_attr,
1191 &xtg_pram_attr,
1192 &xtg_cram_attr,
1193 NULL,
1194};
1195
1196static const struct attribute *xtg_attrs[] = {
1197 &dev_attr_id.attr,
1198 &dev_attr_resource.attr,
1199 &dev_attr_master_start_stop.attr,
1200 &dev_attr_config_slave_status.attr,
1201 &dev_attr_err_en.attr,
1202 &dev_attr_err_sts.attr,
1203 &dev_attr_intr_en.attr,
1204 &dev_attr_last_valid_index.attr,
1205 &dev_attr_config_sts.attr,
1206 &dev_attr_mram_clear.attr,
1207 &dev_attr_cram_clear.attr,
1208 &dev_attr_pram_clear.attr,
1209 &dev_attr_static_enable.attr,
1210 &dev_attr_static_burstlen.attr,
1211 &dev_attr_static_transferdone.attr,
1212 &dev_attr_stream_transfercnt.attr,
1213 &dev_attr_stream_transferlen.attr,
1214 &dev_attr_stream_enable.attr,
1215 &dev_attr_reset_static_transferdone.attr,
1216 NULL,
1217};
1218
1219static const struct attribute_group xtg_attributes = {
1220 .attrs = (struct attribute **)xtg_attrs,
1221 .bin_attrs = xtg_bin_attrs,
1222};
1223
1224
1225
1226
1227
1228
1229
1230static irqreturn_t xtg_cmp_intr_handler(int irq, void *data)
1231{
1232 struct xtg_dev_info *tg = (struct xtg_dev_info *)data;
1233
1234 writel(readl(tg->regs + XTG_ERR_STS_OFFSET) |
1235 XTG_ERR_STS_MSTDONE_MASK,
1236 tg->regs + XTG_ERR_STS_OFFSET);
1237
1238 return IRQ_HANDLED;
1239}
1240
1241
1242
1243
1244
1245
1246
1247
1248static irqreturn_t xtg_err_intr_handler(int irq, void *data)
1249{
1250 struct xtg_dev_info *tg = (struct xtg_dev_info *)data;
1251 u32 value;
1252
1253 value = readl(tg->regs + XTG_ERR_STS_OFFSET) &
1254 XTG_ERR_ALL_ERRS_MASK;
1255
1256 if (value) {
1257 dev_err(tg->dev, "Found errors 0x%08x\n", value);
1258 writel(readl(tg->regs + XTG_ERR_STS_OFFSET) | value,
1259 tg->regs + XTG_ERR_STS_OFFSET);
1260 }
1261
1262 return IRQ_HANDLED;
1263}
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274static int xtg_probe(struct platform_device *pdev)
1275{
1276 struct xtg_dev_info *tg;
1277 struct device_node *node;
1278 struct resource *res;
1279 struct device *dev;
1280 int err, irq, var;
1281
1282 tg = devm_kzalloc(&pdev->dev, sizeof(*tg), GFP_KERNEL);
1283 if (!tg)
1284 return -ENOMEM;
1285
1286 tg->dev = &(pdev->dev);
1287 dev = tg->dev;
1288 node = pdev->dev.of_node;
1289
1290
1291 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1292 tg->regs = devm_ioremap_resource(&pdev->dev, res);
1293 if (IS_ERR(tg->regs))
1294 return PTR_ERR(tg->regs);
1295
1296
1297
1298 tg->phys_base_addr = res->start;
1299
1300
1301 err = of_property_read_u32(node, "xlnx,device-id", &tg->id);
1302 if (err < 0) {
1303 dev_err(&pdev->dev, "unable to read property");
1304 return err;
1305 }
1306
1307
1308 irq = platform_get_irq_byname(pdev, "err-out");
1309 if (irq < 0) {
1310 dev_dbg(&pdev->dev, "unable to get err irq");
1311 } else {
1312 err = devm_request_irq(&pdev->dev, irq, xtg_err_intr_handler,
1313 0, dev_name(&pdev->dev), tg);
1314 if (err < 0) {
1315 dev_err(&pdev->dev, "unable to request irq %d", irq);
1316 return err;
1317 }
1318 }
1319
1320
1321 irq = platform_get_irq_byname(pdev, "irq-out");
1322 if (irq < 0) {
1323 dev_dbg(&pdev->dev, "unable to get cmp irq");
1324 } else {
1325 err = devm_request_irq(&pdev->dev, irq, xtg_cmp_intr_handler,
1326 0, dev_name(&pdev->dev), tg);
1327 if (err < 0) {
1328 dev_err(&pdev->dev, "unable to request irq %d", irq);
1329 return err;
1330 }
1331 }
1332
1333
1334
1335
1336 err = sysfs_create_group(&dev->kobj, &xtg_attributes);
1337 if (err < 0) {
1338 dev_err(tg->dev, "unable to create sysfs entries\n");
1339 return err;
1340 }
1341
1342
1343
1344
1345
1346 tg->last_wr_valid_idx = -1;
1347 tg->last_rd_valid_idx = -1;
1348
1349 dev_set_drvdata(&pdev->dev, tg);
1350
1351
1352 tg->xtg_mram_offset = XTG_MASTER_RAM_OFFSET;
1353 var = readl(tg->regs + XTG_MCNTL_OFFSET) >> XTG_MCNTL_REV_SHIFT;
1354 if (var == XTG_INIT_VERSION)
1355 tg->xtg_mram_offset = XTG_MASTER_RAM_INIT_OFFSET;
1356
1357 dev_info(&pdev->dev, "Probing xilinx traffic generator success\n");
1358
1359 return 0;
1360}
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370static int xtg_remove(struct platform_device *pdev)
1371{
1372 struct xtg_dev_info *tg;
1373 struct device *dev;
1374
1375 tg = dev_get_drvdata(&pdev->dev);
1376 dev = tg->dev;
1377 sysfs_remove_group(&dev->kobj, &xtg_attributes);
1378
1379
1380 return 0;
1381}
1382
1383static struct of_device_id xtg_of_match[] = {
1384 { .compatible = "xlnx,axi-traffic-gen", },
1385 { }
1386};
1387MODULE_DEVICE_TABLE(of, xtg_of_match);
1388
1389static struct platform_driver xtg_driver = {
1390 .driver = {
1391 .name = "xilinx-trafgen",
1392 .of_match_table = xtg_of_match,
1393 },
1394 .probe = xtg_probe,
1395 .remove = xtg_remove,
1396};
1397
1398module_platform_driver(xtg_driver);
1399
1400MODULE_AUTHOR("Xilinx Inc.");
1401MODULE_DESCRIPTION("Xilinx Traffic Generator driver");
1402MODULE_LICENSE("GPL");
1403