Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
drv_mpipe_intf.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Tilera Corporation. All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation, version 2.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11  * NON INFRINGEMENT. See the GNU General Public License for
12  * more details.
13  */
14 
19 #ifndef _SYS_HV_DRV_MPIPE_INTF_H
20 #define _SYS_HV_DRV_MPIPE_INTF_H
21 
22 #include <arch/mpipe.h>
23 #include <arch/mpipe_constants.h>
24 
25 
27 #define HV_MPIPE_NUM_BUFFER_STACKS \
28  (MPIPE_MMIO_INIT_DAT_GX36_1__BUFFER_STACK_MASK_WIDTH)
29 
31 #define HV_MPIPE_NUM_NOTIF_RINGS (MPIPE_NUM_NOTIF_RINGS)
32 
34 #define HV_MPIPE_NUM_NOTIF_GROUPS (MPIPE_NUM_NOTIF_GROUPS)
35 
37 #define HV_MPIPE_NUM_BUCKETS (MPIPE_NUM_BUCKETS)
38 
40 #define HV_MPIPE_NUM_LO_BUCKETS 4096
41 
43 #define HV_MPIPE_NUM_HI_BUCKETS \
44  (HV_MPIPE_NUM_BUCKETS - HV_MPIPE_NUM_LO_BUCKETS)
45 
47 #define HV_MPIPE_NUM_EDMA_RINGS \
48  (MPIPE_MMIO_INIT_DAT_GX36_1__EDMA_POST_MASK_WIDTH)
49 
50 
51 
52 
54 #define HV_MPIPE_ALLOC_FIXED 0x01
55 
57 #define HV_MPIPE_CONFIG_MMIO_OFFSET \
58  (MPIPE_MMIO_ADDR__REGION_VAL_CFG << MPIPE_MMIO_ADDR__REGION_SHIFT)
59 
61 #define HV_MPIPE_CONFIG_MMIO_SIZE (64 * 1024)
62 
64 #define HV_MPIPE_FAST_MMIO_OFFSET \
65  (MPIPE_MMIO_ADDR__REGION_VAL_IDMA << MPIPE_MMIO_ADDR__REGION_SHIFT)
66 
68 #define HV_MPIPE_FAST_MMIO_SIZE \
69  ((MPIPE_MMIO_ADDR__REGION_VAL_BSM + 1 - MPIPE_MMIO_ADDR__REGION_VAL_IDMA) \
70  << MPIPE_MMIO_ADDR__REGION_SHIFT)
71 
72 
73 /*
74  * Each type of resource allocation comes in quantized chunks, where
75  * XXX_BITS is the number of chunks, and XXX_RES_PER_BIT is the number
76  * of resources in each chunk.
77  */
78 
80 #define HV_MPIPE_ALLOC_BUFFER_STACKS_BITS \
81  MPIPE_MMIO_INIT_DAT_GX36_1__BUFFER_STACK_MASK_WIDTH
82 
84 #define HV_MPIPE_ALLOC_BUFFER_STACKS_RES_PER_BIT \
85  (HV_MPIPE_NUM_BUFFER_STACKS / HV_MPIPE_ALLOC_BUFFER_STACKS_BITS)
86 
88 #define HV_MPIPE_ALLOC_NOTIF_RINGS_BITS \
89  MPIPE_MMIO_INIT_DAT_GX36_0__NOTIF_RING_MASK_WIDTH
90 
92 #define HV_MPIPE_ALLOC_NOTIF_RINGS_RES_PER_BIT \
93  (HV_MPIPE_NUM_NOTIF_RINGS / HV_MPIPE_ALLOC_NOTIF_RINGS_BITS)
94 
96 #define HV_MPIPE_ALLOC_NOTIF_GROUPS_BITS \
97  HV_MPIPE_NUM_NOTIF_GROUPS
98 
100 #define HV_MPIPE_ALLOC_NOTIF_GROUPS_RES_PER_BIT \
101  (HV_MPIPE_NUM_NOTIF_GROUPS / HV_MPIPE_ALLOC_NOTIF_GROUPS_BITS)
102 
104 #define HV_MPIPE_ALLOC_LO_BUCKETS_BITS \
105  MPIPE_MMIO_INIT_DAT_GX36_0__BUCKET_RELEASE_MASK_LO_WIDTH
106 
108 #define HV_MPIPE_ALLOC_LO_BUCKETS_RES_PER_BIT \
109  (HV_MPIPE_NUM_LO_BUCKETS / HV_MPIPE_ALLOC_LO_BUCKETS_BITS)
110 
112 #define HV_MPIPE_ALLOC_HI_BUCKETS_BITS \
113  MPIPE_MMIO_INIT_DAT_GX36_0__BUCKET_RELEASE_MASK_HI_WIDTH
114 
116 #define HV_MPIPE_ALLOC_HI_BUCKETS_RES_PER_BIT \
117  (HV_MPIPE_NUM_HI_BUCKETS / HV_MPIPE_ALLOC_HI_BUCKETS_BITS)
118 
120 #define HV_MPIPE_ALLOC_EDMA_RINGS_BITS \
121  MPIPE_MMIO_INIT_DAT_GX36_1__EDMA_POST_MASK_WIDTH
122 
124 #define HV_MPIPE_ALLOC_EDMA_RINGS_RES_PER_BIT \
125  (HV_MPIPE_NUM_EDMA_RINGS / HV_MPIPE_ALLOC_EDMA_RINGS_BITS)
126 
127 
128 
129 
131 typedef struct
132 {
134  uint64_t ring_mask[4];
135 
137 
138 
141 
142 
143 
145 typedef struct
146 {
148  uint8_t stacks[8];
149 
151 
152 
154 typedef struct
155 {
157  uint8_t octets[6];
158 
160 
161 
164 
165 
166 
168 #define GXIO_MPIPE_LINK_NAME_LEN 32
169 
170 
174 typedef struct
175 {
178 }
180 
182 #define GXIO_MPIPE_SYMBOL_NAME_LEN 128
183 
184 
188 typedef struct
189 {
192 }
194 
195 
197 typedef struct
198 {
201 }
203 
204 
205 
214 #define GXIO_MPIPE_LINK_DATA 0x00000001UL
215 
222 #define GXIO_MPIPE_LINK_NO_DATA 0x00000002UL
223 
233 #define GXIO_MPIPE_LINK_EXCL_DATA 0x00000004UL
234 
244 #define GXIO_MPIPE_LINK_STATS 0x00000008UL
245 
252 #define GXIO_MPIPE_LINK_NO_STATS 0x00000010UL
253 
270 #define GXIO_MPIPE_LINK_EXCL_STATS 0x00000020UL
271 
281 #define GXIO_MPIPE_LINK_CTL 0x00000040UL
282 
289 #define GXIO_MPIPE_LINK_NO_CTL 0x00000080UL
290 
304 #define GXIO_MPIPE_LINK_EXCL_CTL 0x00000100UL
305 
314 #define GXIO_MPIPE_LINK_AUTO_UP 0x00000200UL
315 
325 #define GXIO_MPIPE_LINK_AUTO_UPDOWN 0x00000400UL
326 
335 #define GXIO_MPIPE_LINK_AUTO_DOWN 0x00000800UL
336 
345 #define GXIO_MPIPE_LINK_AUTO_NONE 0x00001000UL
346 
358 #define GXIO_MPIPE_LINK_WAIT 0x00002000UL
359 
360 
361 /*
362  * Note: link attributes must fit in 24 bits, since we use the top 8 bits
363  * of the IORPC offset word for the channel number.
364  */
365 
370 #define GXIO_MPIPE_LINK_RECEIVE_JUMBO 0x010000
371 
386 #define GXIO_MPIPE_LINK_SEND_PAUSE 0x020000
387 
392 #define GXIO_MPIPE_LINK_RECEIVE_PAUSE 0x030000
393 
408 #define GXIO_MPIPE_LINK_MAC 0x040000
409 
414 #define GXIO_MPIPE_LINK_DISCARD_IF_DOWN 0x050000
415 
420 #define GXIO_MPIPE_LINK_POSSIBLE_STATE 0x060000
421 
429 #define GXIO_MPIPE_LINK_CURRENT_STATE 0x070000
430 
449 #define GXIO_MPIPE_LINK_DESIRED_STATE 0x080000
450 
451 
452 
454 #define GXIO_MPIPE_LINK_10M 0x0000000000000001UL
455 
457 #define GXIO_MPIPE_LINK_100M 0x0000000000000002UL
458 
460 #define GXIO_MPIPE_LINK_1G 0x0000000000000004UL
461 
463 #define GXIO_MPIPE_LINK_10G 0x0000000000000008UL
464 
466 #define GXIO_MPIPE_LINK_20G 0x0000000000000010UL
467 
469 #define GXIO_MPIPE_LINK_25G 0x0000000000000020UL
470 
472 #define GXIO_MPIPE_LINK_50G 0x0000000000000040UL
473 
478 #define GXIO_MPIPE_LINK_ANYSPEED 0x0000000000000800UL
479 
485 #define GXIO_MPIPE_LINK_SPEED_MASK 0x0000000000000FFFUL
486 
490 #define GXIO_MPIPE_LINK_LOOP_MAC 0x0000000000001000UL
491 
495 #define GXIO_MPIPE_LINK_LOOP_PHY 0x0000000000002000UL
496 
502 #define GXIO_MPIPE_LINK_LOOP_EXT 0x0000000000004000UL
503 
505 #define GXIO_MPIPE_LINK_LOOP_MASK 0x000000000000F000UL
506 
510 #define GXIO_MPIPE_LINK_FDX 0x0000000000010000UL
511 
515 #define GXIO_MPIPE_LINK_HDX 0x0000000000020000UL
516 
517 
519 typedef struct
520 {
523 
526 
529 
532 
535 
538 
541 
544 
547 
550 
553 
555  uint8_t dmacs_and_vlans[];
556 
558 
559 
561 typedef struct
562 {
565 
568 
570  uint8_t rules[4096 - 4];
571 
573 
574 
575 
576 
579 typedef struct
580 {
598 }
600 
601 
602 #endif /* _SYS_HV_DRV_MPIPE_INTF_H */