blob: 87fabb1392d4b6fc45515383a5b3585c2c8023c2 [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001module fpga-internal {
2
3 /*** NAMESPACE / PREFIX DEFINITION ***/
4
5 namespace "http://www.microsemi.com/fpga-int";
6 prefix "fpga-int";
7
8 /*** META INFORMATION ***/
9
10 organization
11 "Microsemi Inc., FTD Division";
12
13 contact
14 "Web URL: http://www.microsemi.com/
15 E-mail: info@microsemi.com
16 Postal: Microsemi Corporation Corporate Headquarters
17 One Enterprise Aliso Viejo,
18 CA 92656
19 U.S.A.
20 Phone: +1 949 380 6100
21 Fax: +1 949 215-4996";
22
23 description
24 "This YANG module add internal procedures to access FPAA hardware
25
26 Copyright 2015 Microsemi Inc.
27 All rights reserved.";
28
29 revision "2015-11-30" {
30 description
31 "Initial version - Sean Condon, Microsemi";
32 }
33
34 typedef sixteen-bit-hex {
35 type string {
36 pattern '0x[0-9a-fA-F]{4}';
37 }
38
39 description
40 "A 16-bit address represented as a hexadecimal number";
41 }
42
43 typedef thirtytwo-bit-hex {
44 type string {
45 pattern '0x[0-9a-fA-F]{8}';
46 }
47
48 description
49 "A 32-bit address represented as a hexadecimal number";
50 }
51
52 typedef thirtytwobit-data {
53 type string {
54 pattern '([0-9a-fA-F]{8}(:[0-9a-fA-F]{8})*)?';
55 }
56
57 description
58 "A set of 32 bit data values represented as colon separated
59 hex strings e.g. 'A1B2C3D4:B2C3D4F5:C3D4E5F6'";
60 }
61
62 typedef select-ram-enum {
63 type enumeration {
64 enum pkt-store-sel {value 0;}
65 enum probe-store-sel {value 1;}
66 enum xconn-store-sel {value 2;}
67 enum rmep-err-store-sel {value 3;}
68 enum rx-lmep-map-sel {value 4;}
69 enum cpu-sys-capt-fifo-sel {value 5;}
70 enum rmep-ram-sel {value 6;}
71 enum xconn-ram-sel {value 7;}
72 enum rmep-err-ram-sel {value 8;}
73 enum tx-lmep-map-sel {value 9;}
74 enum ext-sram-sel {value 10;}
75 enum car-rmac-sel {value 11;}
76 enum sys-mac-sel {value 12;}
77 enum rx-carr-data-fifo-sel {value 13;}
78 enum line-stats-ram-sel {value 14;}
79 enum cpu-sys-capt-info-fifo-sel {value 15;}
80 enum vlan-info-ram-sel {value 16;}
81 enum lbm-store-sel {value 17;}
82 enum lbr-ram-sel {value 18;}
83 enum mc-lbr-store-sel {value 19;}
84 enum port-mac-ram-sel {value 20;}
85 enum pm-db-ram-sel {value 22;}
86 enum tx-lb-ram-sel {value 24;}
87 enum tlv-ram-sel {value 25;}
88 enum cpu-capt-fifo-sel {value 26;}
89 enum cpu-capt-info-fifo-sel {value 27;}
90 enum policer-cfg-ram-sel {value 28;}
91 enum policer-ctxt-ram-sel {value 29;}
92 enum cpu-sys-tx-ram-sel {value 30;}
93 enum policer-stats-ram-sel {value 31;}
94 }
95 }
96
97
98 container fpga-internal {
99 presence "Supports FPGA direct access";
100 }
101
102 rpc read-registers {
103
104 description "Method to read directly from hardware registers";
105 input {
106 choice hex-or-dec {
107
108 description "Enter the starting address in either decimal (0-65535)
109 or hexadecimal (preceeded with 0x)";
110 mandatory true;
111
112 case hex {
113 leaf start-address-hex {
114 type sixteen-bit-hex;
115 }
116 }
117
118 case decimal {
119 leaf start-address-dec {
120 type uint16;
121 }
122 }
123 }
124
125 leaf num-locations {
126 type uint8 {
127 range 1..max;
128 }
129 description "The number of following locations (addresses) to read from";
130 default 1;
131 }
132 }
133
134 output {
135 anyxml data {
136 description "A set of 32 bit data values represented
137 as colon separated 8 character hexadecimal values";
138 }
139 }
140 }
141
142
143 rpc write-registers {
144
145 description "Method to write directly to hardware registers.
146 If a number of data values are given then subsequent
147 locations are written to";
148 input {
149 choice hex-or-dec {
150
151 description "Enter the starting address in either decimal (0-65535)
152 or hexadecimal (preceeded with 0x)";
153
154 case hex {
155 leaf start-address-hex {
156 type sixteen-bit-hex;
157 }
158 }
159
160 case decimal {
161 leaf start-address-dec {
162 type uint16;
163 }
164 }
165 }
166
167 leaf value-hex-32 {
168 type thirtytwobit-data;
169 description "A set of 32 bit data values represented
170 as colon separated 8 character hexadecimal values
171 e.g. ffffffff:ffffffff:ffffffff
172 The number of locations written to will be
173 determinted by the number of such values given";
174 }
175 }
176 }
177
178 rpc read-ram {
179
180 description "Method to read directly from hardware RAM";
181 input {
182 leaf ram {
183 type select-ram-enum;
184 mandatory true;
185 description "The type of RAM to read from";
186 }
187
188 choice hex-or-dec {
189
190 description "Enter the starting address in either decimal (0-65535)
191 or hexadecimal (preceeded with 0x)";
192 mandatory true;
193
194 case hex {
195 leaf start-address-hex {
196 type thirtytwo-bit-hex;
197 }
198 }
199
200 case decimal {
201 leaf start-address-dec {
202 type uint32;
203 }
204 }
205 }
206
207 leaf num-locations {
208 type uint8 {
209 range 1..max;
210 }
211 description "The number of following locations (addresses) to read from";
212 default 1;
213 }
214 }
215
216 output {
217 anyxml data {
218 description "A set of 32 bit data values represented
219 as colon separated 8 character hexadecimal values";
220 }
221 }
222 }
223
224 rpc write-ram {
225
226 description "Method to write directly to RAM registers.
227 If a number of data values are given then subsequent
228 locations are written to";
229 input {
230 leaf ram {
231 type select-ram-enum;
232 mandatory true;
233 description "The type of RAM to read from";
234 }
235
236 choice hex-or-dec {
237
238 description "Enter the starting address in either decimal (0-65535)
239 or hexadecimal (preceeded with 0x)";
240 mandatory true;
241
242 case hex {
243 leaf start-address-hex {
244 type thirtytwo-bit-hex;
245 }
246 }
247
248 case decimal {
249 leaf start-address-dec {
250 type uint32;
251 }
252 }
253 }
254
255 leaf value-hex-32 {
256 type thirtytwobit-data;
257 description "A set of 32 bit data values represented
258 as colon separated 8 character hexadecimal values
259 e.g. ffffffff:ffffffff:ffffffff
260 The number of locations written to will be
261 determinted by the number of such values given";
262 }
263 }
264 }
265
266}