1
2#ifndef _FORE200E_H
3#define _FORE200E_H
4
5#ifdef __KERNEL__
6#include <linux/config.h>
7
8
9
10#define SMALL_BUFFER_SIZE 384
11#define LARGE_BUFFER_SIZE 4032
12
13
14#define RBD_BLK_SIZE 32
15
16
17#define MAX_PDU_SIZE 65535
18
19
20#define BUFFER_S1_SIZE SMALL_BUFFER_SIZE
21#define BUFFER_L1_SIZE LARGE_BUFFER_SIZE
22
23#define BUFFER_S2_SIZE SMALL_BUFFER_SIZE
24#define BUFFER_L2_SIZE LARGE_BUFFER_SIZE
25
26#define BUFFER_S1_NBR (RBD_BLK_SIZE * 6)
27#define BUFFER_L1_NBR (RBD_BLK_SIZE * 4)
28
29#define BUFFER_S2_NBR (RBD_BLK_SIZE * 6)
30#define BUFFER_L2_NBR (RBD_BLK_SIZE * 4)
31
32
33#define QUEUE_SIZE_CMD 16
34#define QUEUE_SIZE_RX 64
35#define QUEUE_SIZE_TX 256
36#define QUEUE_SIZE_BS 32
37
38#define FORE200E_VPI_BITS 0
39#define FORE200E_VCI_BITS 10
40#define NBR_CONNECT (1 << (FORE200E_VPI_BITS + FORE200E_VCI_BITS))
41
42
43#define TSD_FIXED 2
44#define TSD_EXTENSION 0
45#define TSD_NBR (TSD_FIXED + TSD_EXTENSION)
46
47
48
49
50
51
52
53#define RSD_REQUIRED (((MAX_PDU_SIZE - SMALL_BUFFER_SIZE + LARGE_BUFFER_SIZE) / LARGE_BUFFER_SIZE) + 1)
54
55#define RSD_FIXED 3
56
57
58
59
60
61
62#define RSD_EXTENSION ((RSD_REQUIRED - RSD_FIXED) + 1)
63#define RSD_NBR (RSD_FIXED + RSD_EXTENSION)
64
65
66#define FORE200E_DEV(d) ((struct fore200e*)((d)->dev_data))
67#define FORE200E_VCC(d) ((struct fore200e_vcc*)((d)->dev_data))
68
69
70
71#if defined(__LITTLE_ENDIAN_BITFIELD)
72#define BITFIELD2(b1, b2) b1; b2;
73#define BITFIELD3(b1, b2, b3) b1; b2; b3;
74#define BITFIELD4(b1, b2, b3, b4) b1; b2; b3; b4;
75#define BITFIELD5(b1, b2, b3, b4, b5) b1; b2; b3; b4; b5;
76#define BITFIELD6(b1, b2, b3, b4, b5, b6) b1; b2; b3; b4; b5; b6;
77#elif defined(__BIG_ENDIAN_BITFIELD)
78#define BITFIELD2(b1, b2) b2; b1;
79#define BITFIELD3(b1, b2, b3) b3; b2; b1;
80#define BITFIELD4(b1, b2, b3, b4) b4; b3; b2; b1;
81#define BITFIELD5(b1, b2, b3, b4, b5) b5; b4; b3; b2; b1;
82#define BITFIELD6(b1, b2, b3, b4, b5, b6) b6; b5; b4; b3; b2; b1;
83#else
84#error unknown bitfield endianess
85#endif
86
87
88
89
90typedef struct atm_header {
91 BITFIELD5(
92 u32 clp : 1,
93 u32 plt : 3,
94 u32 vci : 16,
95 u32 vpi : 8,
96 u32 gfc : 4
97 )
98} atm_header_t;
99
100
101
102
103typedef enum fore200e_aal {
104 FORE200E_AAL0 = 0,
105 FORE200E_AAL34 = 4,
106 FORE200E_AAL5 = 5,
107} fore200e_aal_t;
108
109
110
111
112typedef struct tpd_spec {
113 BITFIELD4(
114 u32 length : 16,
115 u32 nseg : 8,
116 enum fore200e_aal aal : 4,
117 u32 intr : 4
118 )
119} tpd_spec_t;
120
121
122
123
124typedef struct tpd_rate
125{
126 BITFIELD2(
127 u32 idle_cells : 16,
128 u32 data_cells : 16
129 )
130} tpd_rate_t;
131
132
133
134
135typedef struct tsd {
136 u32 buffer;
137 u32 length;
138} tsd_t;
139
140
141
142
143typedef struct tpd {
144 struct atm_header atm_header;
145 struct tpd_spec spec;
146 struct tpd_rate rate;
147 u32 pad;
148 struct tsd tsd[ TSD_NBR ];
149} tpd_t;
150
151
152
153
154typedef struct rsd {
155 u32 handle;
156 u32 length;
157} rsd_t;
158
159
160
161
162typedef struct rpd {
163 struct atm_header atm_header;
164 u32 nseg;
165 struct rsd rsd[ RSD_NBR ];
166} rpd_t;
167
168
169
170
171typedef enum buffer_scheme {
172 BUFFER_SCHEME_ONE,
173 BUFFER_SCHEME_TWO,
174 BUFFER_SCHEME_NBR
175} buffer_scheme_t;
176
177
178
179
180typedef enum buffer_magn {
181 BUFFER_MAGN_SMALL,
182 BUFFER_MAGN_LARGE,
183 BUFFER_MAGN_NBR
184} buffer_magn_t;
185
186
187
188
189typedef struct rbd {
190 u32 handle;
191 u32 buffer_haddr;
192} rbd_t;
193
194
195
196
197typedef struct rbd_block {
198 struct rbd rbd[ RBD_BLK_SIZE ];
199} rbd_block_t;
200
201
202
203
204typedef struct tpd_haddr {
205 BITFIELD3(
206 u32 size : 4,
207 u32 pad : 1,
208 u32 haddr : 27
209 )
210} tpd_haddr_t;
211
212#define TPD_HADDR_SHIFT 5
213
214
215
216typedef struct cp_txq_entry {
217 struct tpd_haddr tpd_haddr;
218 u32 status_haddr;
219} cp_txq_entry_t;
220
221
222
223
224typedef struct cp_rxq_entry {
225 u32 rpd_haddr;
226 u32 status_haddr;
227} cp_rxq_entry_t;
228
229
230
231
232typedef struct cp_bsq_entry {
233 u32 rbd_block_haddr;
234 u32 status_haddr;
235} cp_bsq_entry_t;
236
237
238
239
240typedef volatile enum status {
241 STATUS_PENDING = (1<<0),
242 STATUS_COMPLETE = (1<<1),
243 STATUS_FREE = (1<<2),
244 STATUS_ERROR = (1<<3)
245} status_t;
246
247
248
249
250typedef enum opcode {
251 OPCODE_INITIALIZE = 1,
252 OPCODE_ACTIVATE_VCIN,
253 OPCODE_ACTIVATE_VCOUT,
254 OPCODE_DEACTIVATE_VCIN,
255 OPCODE_DEACTIVATE_VCOUT,
256 OPCODE_GET_STATS,
257 OPCODE_SET_OC3,
258 OPCODE_GET_OC3,
259 OPCODE_RESET_STATS,
260 OPCODE_GET_PROM,
261 OPCODE_SET_VPI_BITS,
262
263
264 OPCODE_REQUEST_INTR = (1<<7)
265} opcode_t;
266
267
268
269
270typedef struct vpvc {
271 BITFIELD3(
272 u32 vci : 16,
273 u32 vpi : 8,
274 u32 pad : 8
275 )
276} vpvc_t;
277
278
279
280
281typedef struct activate_opcode {
282 BITFIELD4(
283 enum opcode opcode : 8,
284 enum fore200e_aal aal : 8,
285 enum buffer_scheme scheme : 8,
286 u32 pad : 8
287 )
288} activate_opcode_t;
289
290
291
292
293typedef struct activate_block {
294 struct activate_opcode opcode;
295 struct vpvc vpvc;
296 u32 mtu;
297
298} activate_block_t;
299
300
301
302
303typedef struct deactivate_opcode {
304 BITFIELD2(
305 enum opcode opcode : 8,
306 u32 pad : 24
307 )
308} deactivate_opcode_t;
309
310
311
312
313typedef struct deactivate_block {
314 struct deactivate_opcode opcode;
315 struct vpvc vpvc;
316} deactivate_block_t;
317
318
319
320
321typedef struct oc3_regs {
322 u32 reg[ 128 ];
323
324
325} oc3_regs_t;
326
327
328
329
330typedef struct oc3_opcode {
331 BITFIELD4(
332 enum opcode opcode : 8,
333 u32 reg : 8,
334 u32 value : 8,
335 u32 mask : 8
336
337
338 )
339} oc3_opcode_t;
340
341
342
343
344typedef struct oc3_block {
345 struct oc3_opcode opcode;
346 u32 regs_haddr;
347} oc3_block_t;
348
349
350
351
352typedef struct stats_phy {
353 u32 crc_header_errors;
354 u32 framing_errors;
355 u32 pad[ 2 ];
356} stats_phy_t;
357
358
359
360
361typedef struct stats_oc3 {
362 u32 section_bip8_errors;
363 u32 path_bip8_errors;
364 u32 line_bip24_errors;
365 u32 line_febe_errors;
366 u32 path_febe_errors;
367 u32 corr_hcs_errors;
368 u32 ucorr_hcs_errors;
369 u32 pad[ 1 ];
370} stats_oc3_t;
371
372
373
374
375typedef struct stats_atm {
376 u32 cells_transmitted;
377 u32 cells_received;
378 u32 vpi_bad_range;
379 u32 vpi_no_conn;
380 u32 vci_bad_range;
381 u32 vci_no_conn;
382 u32 pad[ 2 ];
383} stats_atm_t;
384
385
386
387typedef struct stats_aal0 {
388 u32 cells_transmitted;
389 u32 cells_received;
390 u32 cells_dropped;
391 u32 pad[ 1 ];
392} stats_aal0_t;
393
394
395
396
397typedef struct stats_aal34 {
398 u32 cells_transmitted;
399 u32 cells_received;
400 u32 cells_crc_errors;
401 u32 cells_protocol_errors;
402 u32 cells_dropped;
403 u32 cspdus_transmitted;
404 u32 cspdus_received;
405 u32 cspdus_protocol_errors;
406 u32 cspdus_dropped;
407 u32 pad[ 3 ];
408} stats_aal34_t;
409
410
411
412
413typedef struct stats_aal5 {
414 u32 cells_transmitted;
415 u32 cells_received;
416 u32 cells_dropped;
417 u32 congestion_experienced;
418 u32 cspdus_transmitted;
419 u32 cspdus_received;
420 u32 cspdus_crc_errors;
421 u32 cspdus_protocol_errors;
422 u32 cspdus_dropped;
423 u32 pad[ 3 ];
424} stats_aal5_t;
425
426
427
428
429typedef struct stats_aux {
430 u32 small_b1_failed;
431 u32 large_b1_failed;
432 u32 small_b2_failed;
433 u32 large_b2_failed;
434 u32 rpd_alloc_failed;
435 u32 receive_carrier;
436 u32 pad[ 2 ];
437} stats_aux_t;
438
439
440
441
442typedef struct stats {
443 struct stats_phy phy;
444 struct stats_oc3 oc3;
445 struct stats_atm atm;
446 struct stats_aal0 aal0;
447 struct stats_aal34 aal34;
448 struct stats_aal5 aal5;
449 struct stats_aux aux;
450} stats_t;
451
452
453
454
455typedef struct stats_opcode {
456 BITFIELD2(
457 enum opcode opcode : 8,
458 u32 pad : 24
459 )
460} stats_opcode_t;
461
462
463
464
465typedef struct stats_block {
466 struct stats_opcode opcode;
467 u32 stats_haddr;
468} stats_block_t;
469
470
471
472
473typedef struct prom_data {
474 u32 hw_revision;
475 u32 serial_number;
476 u8 mac_addr[ 8 ];
477} prom_data_t;
478
479
480
481
482typedef struct prom_opcode {
483 BITFIELD2(
484 enum opcode opcode : 8,
485 u32 pad : 24
486 )
487} prom_opcode_t;
488
489
490
491
492typedef struct prom_block {
493 struct prom_opcode opcode;
494 u32 prom_haddr;
495} prom_block_t;
496
497
498
499
500typedef union cmd {
501 enum opcode opcode;
502 struct activate_block activate_block;
503 struct deactivate_block deactivate_block;
504 struct stats_block stats_block;
505 struct prom_block prom_block;
506 struct oc3_block oc3_block;
507 u32 pad[ 4 ];
508} cmd_t;
509
510
511
512
513typedef struct cp_cmdq_entry {
514 union cmd cmd;
515 u32 status_haddr;
516 u32 pad[ 3 ];
517} cp_cmdq_entry_t;
518
519
520
521
522typedef struct host_txq_entry {
523 struct cp_txq_entry* cp_entry;
524 enum status* status;
525 struct tpd* tpd;
526 u32 tpd_dma;
527 struct sk_buff* skb;
528 void* data;
529 unsigned long incarn;
530 struct fore200e_vc_map* vc_map;
531
532} host_txq_entry_t;
533
534
535
536
537typedef struct host_rxq_entry {
538 struct cp_rxq_entry* cp_entry;
539 enum status* status;
540 struct rpd* rpd;
541 u32 rpd_dma;
542} host_rxq_entry_t;
543
544
545
546
547typedef struct host_bsq_entry {
548 struct cp_bsq_entry* cp_entry;
549 enum status* status;
550 struct rbd_block* rbd_block;
551 u32 rbd_block_dma;
552} host_bsq_entry_t;
553
554
555
556
557typedef struct host_cmdq_entry {
558 struct cp_cmdq_entry* cp_entry;
559 enum status* status;
560} host_cmdq_entry_t;
561
562
563
564
565typedef struct chunk {
566 void* alloc_addr;
567 void* align_addr;
568 u32 dma_addr;
569 int direction;
570 u32 alloc_size;
571 u32 align_size;
572} chunk_t;
573
574#define dma_size align_size
575
576
577
578
579typedef struct buffer {
580 struct buffer* next;
581 enum buffer_scheme scheme;
582 enum buffer_magn magn;
583 struct chunk data;
584#ifdef FORE200E_BSQ_DEBUG
585 unsigned long index;
586 int supplied;
587#endif
588} buffer_t;
589
590
591#if (BITS_PER_LONG == 32)
592#define FORE200E_BUF2HDL(buffer) ((u32)(buffer))
593#define FORE200E_HDL2BUF(handle) ((struct buffer*)(handle))
594#else
595#define FORE200E_BUF2HDL(buffer) ((u32)((u64)(buffer)))
596#define FORE200E_HDL2BUF(handle) ((struct buffer*)(((u64)(handle)) | PAGE_OFFSET))
597#endif
598
599
600
601
602typedef struct host_cmdq {
603 struct host_cmdq_entry host_entry[ QUEUE_SIZE_CMD ];
604 int head;
605 struct chunk status;
606} host_cmdq_t;
607
608
609
610
611typedef struct host_txq {
612 struct host_txq_entry host_entry[ QUEUE_SIZE_TX ];
613 int head;
614 int tail;
615 struct chunk tpd;
616 struct chunk status;
617 int txing;
618} host_txq_t;
619
620
621
622
623typedef struct host_rxq {
624 struct host_rxq_entry host_entry[ QUEUE_SIZE_RX ];
625 int head;
626 struct chunk rpd;
627 struct chunk status;
628} host_rxq_t;
629
630
631
632
633typedef struct host_bsq {
634 struct host_bsq_entry host_entry[ QUEUE_SIZE_BS ];
635 int head;
636 struct chunk rbd_block;
637 struct chunk status;
638 struct buffer* buffer;
639 struct buffer* freebuf;
640 volatile int freebuf_count;
641} host_bsq_t;
642
643
644
645
646typedef struct fw_header {
647 u32 magic;
648 u32 version;
649 u32 load_offset;
650 u32 start_offset;
651} fw_header_t;
652
653#define FW_HEADER_MAGIC 0x65726f66
654
655
656
657
658typedef struct bs_spec {
659 u32 queue_length;
660 u32 buffer_size;
661 u32 pool_size;
662 u32 supply_blksize;
663
664} bs_spec_t;
665
666
667
668
669typedef struct init_block {
670 enum opcode opcode;
671 enum status status;
672 u32 receive_threshold;
673 u32 num_connect;
674 u32 cmd_queue_len;
675 u32 tx_queue_len;
676 u32 rx_queue_len;
677 u32 rsd_extension;
678 u32 tsd_extension;
679 u32 conless_vpvc;
680 u32 pad[ 2 ];
681 struct bs_spec bs_spec[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ];
682} init_block_t;
683
684
685typedef enum media_type {
686 MEDIA_TYPE_CAT5_UTP = 0x06,
687 MEDIA_TYPE_MM_OC3_ST = 0x16,
688 MEDIA_TYPE_MM_OC3_SC = 0x26,
689 MEDIA_TYPE_SM_OC3_ST = 0x36,
690 MEDIA_TYPE_SM_OC3_SC = 0x46
691} media_type_t;
692
693#define FORE200E_MEDIA_INDEX(media_type) ((media_type)>>4)
694
695
696
697
698typedef struct cp_queues {
699 u32 cp_cmdq;
700 u32 cp_txq;
701 u32 cp_rxq;
702 u32 cp_bsq[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ];
703 u32 imask;
704 u32 istat;
705 u32 heap_base;
706 u32 heap_size;
707 u32 hlogger;
708 u32 heartbeat;
709 u32 fw_release;
710 u32 mon960_release;
711 u32 tq_plen;
712
713 struct init_block init;
714 enum media_type media_type;
715 u32 oc3_revision;
716} cp_queues_t;
717
718
719
720
721typedef enum boot_status {
722 BSTAT_COLD_START = (u32) 0xc01dc01d,
723 BSTAT_SELFTEST_OK = (u32) 0x02201958,
724 BSTAT_SELFTEST_FAIL = (u32) 0xadbadbad,
725 BSTAT_CP_RUNNING = (u32) 0xce11feed,
726 BSTAT_MON_TOO_BIG = (u32) 0x10aded00
727} boot_status_t;
728
729
730
731
732typedef struct soft_uart {
733 u32 send;
734 u32 recv;
735} soft_uart_t;
736
737#define FORE200E_CP_MONITOR_UART_FREE 0x00000000
738#define FORE200E_CP_MONITOR_UART_AVAIL 0x01000000
739
740
741
742
743typedef struct cp_monitor {
744 struct soft_uart soft_uart;
745 enum boot_status bstat;
746 u32 app_base;
747 u32 mon_version;
748} cp_monitor_t;
749
750
751
752
753typedef enum fore200e_state {
754 FORE200E_STATE_BLANK,
755 FORE200E_STATE_REGISTER,
756 FORE200E_STATE_CONFIGURE,
757 FORE200E_STATE_MAP,
758 FORE200E_STATE_RESET,
759 FORE200E_STATE_LOAD_FW,
760 FORE200E_STATE_START_FW,
761 FORE200E_STATE_INITIALIZE,
762 FORE200E_STATE_INIT_CMDQ,
763 FORE200E_STATE_INIT_TXQ,
764 FORE200E_STATE_INIT_RXQ,
765 FORE200E_STATE_INIT_BSQ,
766 FORE200E_STATE_ALLOC_BUF,
767 FORE200E_STATE_IRQ,
768 FORE200E_STATE_COMPLETE
769} fore200e_state;
770
771
772
773
774typedef struct fore200e_pca_regs {
775 volatile u32* hcr;
776 volatile u32* imr;
777 volatile u32* psr;
778} fore200e_pca_regs_t;
779
780
781
782
783typedef struct fore200e_sba_regs {
784 volatile u32* hcr;
785 volatile u32* bsr;
786 volatile u32* isr;
787} fore200e_sba_regs_t;
788
789
790
791
792typedef union fore200e_regs {
793 struct fore200e_pca_regs pca;
794 struct fore200e_sba_regs sba;
795} fore200e_regs;
796
797
798struct fore200e;
799
800
801
802typedef struct fore200e_bus {
803 char* model_name;
804 char* proc_name;
805 int descr_alignment;
806 int buffer_alignment;
807 int status_alignment;
808 const unsigned char* fw_data;
809 const unsigned int* fw_size;
810 u32 (*read)(volatile u32*);
811 void (*write)(u32, volatile u32*);
812 u32 (*dma_map)(struct fore200e*, void*, int, int);
813 void (*dma_unmap)(struct fore200e*, u32, int, int);
814 void (*dma_sync)(struct fore200e*, u32, int, int);
815 int (*dma_chunk_alloc)(struct fore200e*, struct chunk*, int, int, int);
816 void (*dma_chunk_free)(struct fore200e*, struct chunk*);
817 struct fore200e* (*detect)(const struct fore200e_bus*, int);
818 int (*configure)(struct fore200e*);
819 int (*map)(struct fore200e*);
820 void (*reset)(struct fore200e*);
821 int (*prom_read)(struct fore200e*, struct prom_data*);
822 void (*unmap)(struct fore200e*);
823 void (*irq_enable)(struct fore200e*);
824 int (*irq_check)(struct fore200e*);
825 void (*irq_ack)(struct fore200e*);
826 int (*proc_read)(struct fore200e*, char*);
827} fore200e_bus_t;
828
829
830#if defined(CONFIG_ATM_FORE200E_SBA)
831# if defined(CONFIG_ATM_FORE200E_PCA)
832# if (PCI_DMA_BIDIRECTIONAL == SBUS_DMA_BIDIRECTIONAL) && \
833 (PCI_DMA_TODEVICE == SBUS_DMA_TODEVICE) && \
834 (PCI_DMA_FROMDEVICE == SBUS_DMA_FROMDEVICE)
835# define FORE200E_DMA_BIDIRECTIONAL PCI_DMA_BIDIRECTIONAL
836# define FORE200E_DMA_TODEVICE PCI_DMA_TODEVICE
837# define FORE200E_DMA_FROMDEVICE PCI_DMA_FROMDEVICE
838# else
839
840
841# error PCI and SBUS DMA direction flags have different values!
842# endif
843# else
844# define FORE200E_DMA_BIDIRECTIONAL SBUS_DMA_BIDIRECTIONAL
845# define FORE200E_DMA_TODEVICE SBUS_DMA_TODEVICE
846# define FORE200E_DMA_FROMDEVICE SBUS_DMA_FROMDEVICE
847# endif
848#else
849# ifndef CONFIG_ATM_FORE200E_PCA
850# warning compiling the fore200e driver without any hardware support enabled!
851# include <linux/pci.h>
852# endif
853# define FORE200E_DMA_BIDIRECTIONAL PCI_DMA_BIDIRECTIONAL
854# define FORE200E_DMA_TODEVICE PCI_DMA_TODEVICE
855# define FORE200E_DMA_FROMDEVICE PCI_DMA_FROMDEVICE
856#endif
857
858
859
860
861typedef struct fore200e_vc_map {
862 struct atm_vcc* vcc;
863 unsigned long incarn;
864} fore200e_vc_map_t;
865
866#define FORE200E_VC_MAP(fore200e, vpi, vci) \
867 (& (fore200e)->vc_map[ ((vpi) << FORE200E_VCI_BITS) | (vci) ])
868
869
870
871
872typedef struct fore200e {
873 struct fore200e* next;
874 const struct fore200e_bus* bus;
875 union fore200e_regs regs;
876 struct atm_dev* atm_dev;
877
878 enum fore200e_state state;
879
880 char name[16];
881 void* bus_dev;
882 int irq;
883 unsigned long phys_base;
884 void* virt_base;
885
886 unsigned char esi[ ESI_LEN ];
887
888 struct cp_monitor* cp_monitor;
889 struct cp_queues* cp_queues;
890 struct host_cmdq host_cmdq;
891 struct host_txq host_txq;
892 struct host_rxq host_rxq;
893
894 struct host_bsq host_bsq[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ];
895
896 u32 available_cell_rate;
897
898 int loop_mode;
899
900 struct stats* stats;
901
902 struct semaphore rate_sf;
903 spinlock_t q_lock;
904#ifdef FORE200E_USE_TASKLET
905 struct tasklet_struct tx_tasklet;
906 struct tasklet_struct rx_tasklet;
907#endif
908 unsigned long tx_sat;
909
910 unsigned long incarn_count;
911 struct fore200e_vc_map vc_map[ NBR_CONNECT ];
912} fore200e_t;
913
914
915
916
917typedef struct fore200e_vcc {
918 enum buffer_scheme scheme;
919 struct tpd_rate rate;
920 int rx_min_pdu;
921 int rx_max_pdu;
922 int tx_min_pdu;
923 int tx_max_pdu;
924 unsigned long tx_pdu;
925 unsigned long rx_pdu;
926} fore200e_vcc_t;
927
928
929
930
931
932#define FORE200E_CP_MONITOR_OFFSET 0x00000400
933#define FORE200E_CP_QUEUES_OFFSET 0x00004d40
934
935
936
937
938#define PCA200E_IOSPACE_LENGTH 0x00200000
939
940#define PCA200E_HCR_OFFSET 0x00100000
941#define PCA200E_IMR_OFFSET 0x00100004
942#define PCA200E_PSR_OFFSET 0x00100008
943
944
945
946
947#define PCA200E_HCR_RESET (1<<0)
948#define PCA200E_HCR_HOLD_LOCK (1<<1)
949#define PCA200E_HCR_I960FAIL (1<<2)
950#define PCA200E_HCR_INTRB (1<<2)
951#define PCA200E_HCR_HOLD_ACK (1<<3)
952#define PCA200E_HCR_INTRA (1<<3)
953#define PCA200E_HCR_OUTFULL (1<<4)
954#define PCA200E_HCR_CLRINTR (1<<4)
955#define PCA200E_HCR_ESPHOLD (1<<5)
956#define PCA200E_HCR_INFULL (1<<6)
957#define PCA200E_HCR_TESTMODE (1<<7)
958
959
960
961
962#define PCA200E_PCI_LATENCY 0x40
963#define PCA200E_PCI_MASTER_CTRL 0x41
964#define PCA200E_PCI_THRESHOLD 0x42
965
966
967
968#define PCA200E_CTRL_DIS_CACHE_RD (1<<0)
969#define PCA200E_CTRL_DIS_WRT_INVAL (1<<1)
970#define PCA200E_CTRL_2_CACHE_WRT_INVAL (1<<2)
971#define PCA200E_CTRL_IGN_LAT_TIMER (1<<3)
972#define PCA200E_CTRL_ENA_CONT_REQ_MODE (1<<4)
973#define PCA200E_CTRL_LARGE_PCI_BURSTS (1<<5)
974#define PCA200E_CTRL_CONVERT_ENDIAN (1<<6)
975
976
977
978#define SBA200E_PROM_NAME "FORE,sba-200e"
979
980
981
982
983#define SBA200E_HCR_LENGTH 4
984#define SBA200E_BSR_LENGTH 4
985#define SBA200E_ISR_LENGTH 4
986#define SBA200E_RAM_LENGTH 0x40000
987
988
989
990
991#define SBA200E_BSR_BURST4 0x04
992#define SBA200E_BSR_BURST8 0x08
993#define SBA200E_BSR_BURST16 0x10
994
995
996
997
998#define SBA200E_HCR_RESET (1<<0)
999#define SBA200E_HCR_HOLD_LOCK (1<<1)
1000#define SBA200E_HCR_I960FAIL (1<<2)
1001#define SBA200E_HCR_I960SETINTR (1<<2)
1002#define SBA200E_HCR_OUTFULL (1<<3)
1003#define SBA200E_HCR_INTR_CLR (1<<3)
1004#define SBA200E_HCR_INTR_ENA (1<<4)
1005#define SBA200E_HCR_ESPHOLD (1<<5)
1006#define SBA200E_HCR_INFULL (1<<6)
1007#define SBA200E_HCR_TESTMODE (1<<7)
1008#define SBA200E_HCR_INTR_REQ (1<<8)
1009
1010#define SBA200E_HCR_STICKY (SBA200E_HCR_RESET | SBA200E_HCR_HOLD_LOCK | SBA200E_HCR_INTR_ENA)
1011
1012
1013#endif
1014#endif
1015