Go to the documentation of this file.
15 #define REG_RD( scope, inst, reg ) \
16 REG_READ( reg_##scope##_##reg, \
17 (inst) + REG_RD_ADDR_##scope##_##reg )
21 #define REG_WR( scope, inst, reg, val ) \
22 REG_WRITE( reg_##scope##_##reg, \
23 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27 #define REG_RD_VECT( scope, inst, reg, index ) \
28 REG_READ( reg_##scope##_##reg, \
29 (inst) + REG_RD_ADDR_##scope##_##reg + \
30 (index) * STRIDE_##scope##_##reg )
34 #define REG_WR_VECT( scope, inst, reg, index, val ) \
35 REG_WRITE( reg_##scope##_##reg, \
36 (inst) + REG_WR_ADDR_##scope##_##reg + \
37 (index) * STRIDE_##scope##_##reg, (val) )
41 #define REG_RD_INT( scope, inst, reg ) \
42 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46 #define REG_WR_INT( scope, inst, reg, val ) \
47 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
50 #ifndef REG_RD_INT_VECT
51 #define REG_RD_INT_VECT( scope, inst, reg, index ) \
52 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
53 (index) * STRIDE_##scope##_##reg )
56 #ifndef REG_WR_INT_VECT
57 #define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
58 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
59 (index) * STRIDE_##scope##_##reg, (val) )
63 #define REG_TYPE_CONV( type, orgtype, val ) \
64 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68 #define reg_page_size 8192
72 #define REG_ADDR( scope, inst, reg ) \
73 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77 #define REG_ADDR_VECT( scope, inst, reg, index ) \
78 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
79 (index) * STRIDE_##scope##_##reg )
88 #define REG_RD_ADDR_gio_r_pa_din 0
94 #define REG_RD_ADDR_gio_rw_pa_dout 4
95 #define REG_WR_ADDR_gio_rw_pa_dout 4
101 #define REG_RD_ADDR_gio_rw_pa_oe 8
102 #define REG_WR_ADDR_gio_rw_pa_oe 8
107 unsigned int dummy1 : 24;
109 #define REG_RD_ADDR_gio_rw_pa_byte0_dout 12
110 #define REG_WR_ADDR_gio_rw_pa_byte0_dout 12
115 unsigned int dummy1 : 24;
117 #define REG_RD_ADDR_gio_rw_pa_byte0_oe 16
118 #define REG_WR_ADDR_gio_rw_pa_byte0_oe 16
123 unsigned int dummy1 : 24;
125 #define REG_RD_ADDR_gio_rw_pa_byte1_dout 20
126 #define REG_WR_ADDR_gio_rw_pa_byte1_dout 20
131 unsigned int dummy1 : 24;
133 #define REG_RD_ADDR_gio_rw_pa_byte1_oe 24
134 #define REG_WR_ADDR_gio_rw_pa_byte1_oe 24
139 unsigned int dummy1 : 24;
141 #define REG_RD_ADDR_gio_rw_pa_byte2_dout 28
142 #define REG_WR_ADDR_gio_rw_pa_byte2_dout 28
147 unsigned int dummy1 : 24;
149 #define REG_RD_ADDR_gio_rw_pa_byte2_oe 32
150 #define REG_WR_ADDR_gio_rw_pa_byte2_oe 32
155 unsigned int dummy1 : 24;
157 #define REG_RD_ADDR_gio_rw_pa_byte3_dout 36
158 #define REG_WR_ADDR_gio_rw_pa_byte3_dout 36
163 unsigned int dummy1 : 24;
165 #define REG_RD_ADDR_gio_rw_pa_byte3_oe 40
166 #define REG_WR_ADDR_gio_rw_pa_byte3_oe 40
172 #define REG_RD_ADDR_gio_r_pb_din 44
178 #define REG_RD_ADDR_gio_rw_pb_dout 48
179 #define REG_WR_ADDR_gio_rw_pb_dout 48
183 unsigned int oe : 32;
185 #define REG_RD_ADDR_gio_rw_pb_oe 52
186 #define REG_WR_ADDR_gio_rw_pb_oe 52
191 unsigned int dummy1 : 24;
193 #define REG_RD_ADDR_gio_rw_pb_byte0_dout 56
194 #define REG_WR_ADDR_gio_rw_pb_byte0_dout 56
199 unsigned int dummy1 : 24;
201 #define REG_RD_ADDR_gio_rw_pb_byte0_oe 60
202 #define REG_WR_ADDR_gio_rw_pb_byte0_oe 60
207 unsigned int dummy1 : 24;
209 #define REG_RD_ADDR_gio_rw_pb_byte1_dout 64
210 #define REG_WR_ADDR_gio_rw_pb_byte1_dout 64
215 unsigned int dummy1 : 24;
217 #define REG_RD_ADDR_gio_rw_pb_byte1_oe 68
218 #define REG_WR_ADDR_gio_rw_pb_byte1_oe 68
223 unsigned int dummy1 : 24;
225 #define REG_RD_ADDR_gio_rw_pb_byte2_dout 72
226 #define REG_WR_ADDR_gio_rw_pb_byte2_dout 72
231 unsigned int dummy1 : 24;
233 #define REG_RD_ADDR_gio_rw_pb_byte2_oe 76
234 #define REG_WR_ADDR_gio_rw_pb_byte2_oe 76
239 unsigned int dummy1 : 24;
241 #define REG_RD_ADDR_gio_rw_pb_byte3_dout 80
242 #define REG_WR_ADDR_gio_rw_pb_byte3_dout 80
247 unsigned int dummy1 : 24;
249 #define REG_RD_ADDR_gio_rw_pb_byte3_oe 84
250 #define REG_WR_ADDR_gio_rw_pb_byte3_oe 84
255 unsigned int dummy1 : 16;
257 #define REG_RD_ADDR_gio_r_pc_din 88
262 unsigned int dummy1 : 16;
264 #define REG_RD_ADDR_gio_rw_pc_dout 92
265 #define REG_WR_ADDR_gio_rw_pc_dout 92
269 unsigned int oe : 16;
270 unsigned int dummy1 : 16;
272 #define REG_RD_ADDR_gio_rw_pc_oe 96
273 #define REG_WR_ADDR_gio_rw_pc_oe 96
278 unsigned int dummy1 : 24;
280 #define REG_RD_ADDR_gio_rw_pc_byte0_dout 100
281 #define REG_WR_ADDR_gio_rw_pc_byte0_dout 100
286 unsigned int dummy1 : 24;
288 #define REG_RD_ADDR_gio_rw_pc_byte0_oe 104
289 #define REG_WR_ADDR_gio_rw_pc_byte0_oe 104
294 unsigned int dummy1 : 24;
296 #define REG_RD_ADDR_gio_rw_pc_byte1_dout 108
297 #define REG_WR_ADDR_gio_rw_pc_byte1_dout 108
302 unsigned int dummy1 : 24;
304 #define REG_RD_ADDR_gio_rw_pc_byte1_oe 112
305 #define REG_WR_ADDR_gio_rw_pc_byte1_oe 112
311 #define REG_RD_ADDR_gio_r_pd_din 116
315 unsigned int intr0 : 3;
316 unsigned int intr1 : 3;
317 unsigned int intr2 : 3;
318 unsigned int intr3 : 3;
319 unsigned int intr4 : 3;
320 unsigned int intr5 : 3;
321 unsigned int intr6 : 3;
322 unsigned int intr7 : 3;
323 unsigned int dummy1 : 8;
325 #define REG_RD_ADDR_gio_rw_intr_cfg 120
326 #define REG_WR_ADDR_gio_rw_intr_cfg 120
330 unsigned int intr0 : 4;
331 unsigned int intr1 : 4;
332 unsigned int intr2 : 4;
333 unsigned int intr3 : 4;
334 unsigned int intr4 : 4;
335 unsigned int intr5 : 4;
336 unsigned int intr6 : 4;
337 unsigned int intr7 : 4;
339 #define REG_RD_ADDR_gio_rw_intr_pins 124
340 #define REG_WR_ADDR_gio_rw_intr_pins 124
344 unsigned int intr0 : 1;
345 unsigned int intr1 : 1;
346 unsigned int intr2 : 1;
347 unsigned int intr3 : 1;
348 unsigned int intr4 : 1;
349 unsigned int intr5 : 1;
350 unsigned int intr6 : 1;
351 unsigned int intr7 : 1;
352 unsigned int i2c0_done : 1;
353 unsigned int i2c1_done : 1;
354 unsigned int dummy1 : 22;
356 #define REG_RD_ADDR_gio_rw_intr_mask 128
357 #define REG_WR_ADDR_gio_rw_intr_mask 128
361 unsigned int intr0 : 1;
362 unsigned int intr1 : 1;
363 unsigned int intr2 : 1;
364 unsigned int intr3 : 1;
365 unsigned int intr4 : 1;
366 unsigned int intr5 : 1;
367 unsigned int intr6 : 1;
368 unsigned int intr7 : 1;
369 unsigned int i2c0_done : 1;
370 unsigned int i2c1_done : 1;
371 unsigned int dummy1 : 22;
373 #define REG_RD_ADDR_gio_rw_ack_intr 132
374 #define REG_WR_ADDR_gio_rw_ack_intr 132
378 unsigned int intr0 : 1;
379 unsigned int intr1 : 1;
380 unsigned int intr2 : 1;
381 unsigned int intr3 : 1;
382 unsigned int intr4 : 1;
383 unsigned int intr5 : 1;
384 unsigned int intr6 : 1;
385 unsigned int intr7 : 1;
386 unsigned int i2c0_done : 1;
387 unsigned int i2c1_done : 1;
388 unsigned int dummy1 : 22;
390 #define REG_RD_ADDR_gio_r_intr 136
394 unsigned int intr0 : 1;
395 unsigned int intr1 : 1;
396 unsigned int intr2 : 1;
397 unsigned int intr3 : 1;
398 unsigned int intr4 : 1;
399 unsigned int intr5 : 1;
400 unsigned int intr6 : 1;
401 unsigned int intr7 : 1;
402 unsigned int i2c0_done : 1;
403 unsigned int i2c1_done : 1;
404 unsigned int dummy1 : 22;
406 #define REG_RD_ADDR_gio_r_masked_intr 140
411 unsigned int dummy1 : 31;
413 #define REG_RD_ADDR_gio_rw_i2c0_start 144
414 #define REG_WR_ADDR_gio_rw_i2c0_start 144
419 unsigned int bit_order : 1;
420 unsigned int scl_io : 1;
421 unsigned int scl_inv : 1;
422 unsigned int sda_io : 1;
423 unsigned int sda_idle : 1;
424 unsigned int dummy1 : 26;
426 #define REG_RD_ADDR_gio_rw_i2c0_cfg 148
427 #define REG_WR_ADDR_gio_rw_i2c0_cfg 148
431 unsigned int trf_bits : 6;
432 unsigned int switch_dir : 6;
433 unsigned int extra_start : 3;
434 unsigned int early_end : 1;
435 unsigned int start_stop : 1;
436 unsigned int ack_dir0 : 1;
437 unsigned int ack_dir1 : 1;
438 unsigned int ack_dir2 : 1;
439 unsigned int ack_dir3 : 1;
440 unsigned int ack_dir4 : 1;
441 unsigned int ack_dir5 : 1;
442 unsigned int ack_bit : 1;
445 unsigned int dummy1 : 5;
447 #define REG_RD_ADDR_gio_rw_i2c0_ctrl 152
448 #define REG_WR_ADDR_gio_rw_i2c0_ctrl 152
457 #define REG_RD_ADDR_gio_rw_i2c0_data 156
458 #define REG_WR_ADDR_gio_rw_i2c0_data 156
462 unsigned int data4 : 8;
463 unsigned int data5 : 8;
464 unsigned int start_val : 6;
465 unsigned int ack_val : 6;
466 unsigned int dummy1 : 4;
468 #define REG_RD_ADDR_gio_rw_i2c0_data2 160
469 #define REG_WR_ADDR_gio_rw_i2c0_data2 160
474 unsigned int dummy1 : 31;
476 #define REG_RD_ADDR_gio_rw_i2c1_start 164
477 #define REG_WR_ADDR_gio_rw_i2c1_start 164
482 unsigned int bit_order : 1;
483 unsigned int scl_io : 1;
484 unsigned int scl_inv : 1;
485 unsigned int sda0_io : 1;
486 unsigned int sda0_idle : 1;
487 unsigned int sda1_io : 1;
488 unsigned int sda1_idle : 1;
489 unsigned int sda2_io : 1;
490 unsigned int sda2_idle : 1;
491 unsigned int sda3_io : 1;
492 unsigned int sda3_idle : 1;
493 unsigned int sda_sel : 2;
494 unsigned int sen_idle : 1;
495 unsigned int sen_inv : 1;
496 unsigned int sen_sel : 2;
497 unsigned int dummy1 : 14;
499 #define REG_RD_ADDR_gio_rw_i2c1_cfg 168
500 #define REG_WR_ADDR_gio_rw_i2c1_cfg 168
504 unsigned int trf_bits : 6;
505 unsigned int switch_dir : 6;
506 unsigned int extra_start : 3;
507 unsigned int early_end : 1;
508 unsigned int start_stop : 1;
509 unsigned int ack_dir0 : 1;
510 unsigned int ack_dir1 : 1;
511 unsigned int ack_dir2 : 1;
512 unsigned int ack_dir3 : 1;
513 unsigned int ack_dir4 : 1;
514 unsigned int ack_dir5 : 1;
515 unsigned int ack_bit : 1;
518 unsigned int dummy1 : 5;
520 #define REG_RD_ADDR_gio_rw_i2c1_ctrl 172
521 #define REG_WR_ADDR_gio_rw_i2c1_ctrl 172
530 #define REG_RD_ADDR_gio_rw_i2c1_data 176
531 #define REG_WR_ADDR_gio_rw_i2c1_data 176
535 unsigned int data4 : 8;
536 unsigned int data5 : 8;
537 unsigned int start_val : 6;
538 unsigned int ack_val : 6;
539 unsigned int dummy1 : 4;
541 #define REG_RD_ADDR_gio_rw_i2c1_data2 180
542 #define REG_WR_ADDR_gio_rw_i2c1_data2 180
547 unsigned int dummy1 : 30;
549 #define REG_RD_ADDR_gio_r_ppwm_stat 184
554 unsigned int dummy1 : 24;
556 #define REG_RD_ADDR_gio_rw_ppwm_data 188
557 #define REG_WR_ADDR_gio_rw_ppwm_data 188
562 unsigned int ccd_override : 1;
563 unsigned int ccd_val : 1;
564 unsigned int dummy1 : 28;
566 #define REG_RD_ADDR_gio_rw_pwm0_ctrl 192
567 #define REG_WR_ADDR_gio_rw_pwm0_ctrl 192
571 unsigned int lo : 13;
572 unsigned int hi : 13;
573 unsigned int dummy1 : 6;
575 #define REG_RD_ADDR_gio_rw_pwm0_var 196
576 #define REG_WR_ADDR_gio_rw_pwm0_var 196
581 unsigned int dummy1 : 24;
583 #define REG_RD_ADDR_gio_rw_pwm0_data 200
584 #define REG_WR_ADDR_gio_rw_pwm0_data 200
589 unsigned int ccd_override : 1;
590 unsigned int ccd_val : 1;
591 unsigned int dummy1 : 28;
593 #define REG_RD_ADDR_gio_rw_pwm1_ctrl 204
594 #define REG_WR_ADDR_gio_rw_pwm1_ctrl 204
598 unsigned int lo : 13;
599 unsigned int hi : 13;
600 unsigned int dummy1 : 6;
602 #define REG_RD_ADDR_gio_rw_pwm1_var 208
603 #define REG_WR_ADDR_gio_rw_pwm1_var 208
608 unsigned int dummy1 : 24;
610 #define REG_RD_ADDR_gio_rw_pwm1_data 212
611 #define REG_WR_ADDR_gio_rw_pwm1_data 212
616 unsigned int ccd_override : 1;
617 unsigned int ccd_val : 1;
618 unsigned int dummy1 : 28;
620 #define REG_RD_ADDR_gio_rw_pwm2_ctrl 216
621 #define REG_WR_ADDR_gio_rw_pwm2_ctrl 216
625 unsigned int lo : 13;
626 unsigned int hi : 13;
627 unsigned int dummy1 : 6;
629 #define REG_RD_ADDR_gio_rw_pwm2_var 220
630 #define REG_WR_ADDR_gio_rw_pwm2_var 220
635 unsigned int dummy1 : 24;
637 #define REG_RD_ADDR_gio_rw_pwm2_data 224
638 #define REG_WR_ADDR_gio_rw_pwm2_data 224
643 unsigned int dummy1 : 29;
645 #define REG_RD_ADDR_gio_rw_pwm_in_cfg 228
646 #define REG_WR_ADDR_gio_rw_pwm_in_cfg 228
652 #define REG_RD_ADDR_gio_r_pwm_in_lo 232
658 #define REG_RD_ADDR_gio_r_pwm_in_hi 236
664 #define REG_RD_ADDR_gio_r_pwm_in_cnt 240