1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*******************************************************************************
6 * Copyright (C) 2015-2018 Ondrej Ille <ondrej.ille@gmail.com> FEE CTU
7 * Copyright (C) 2018-2020 Ondrej Ille <ondrej.ille@gmail.com> self-funded
8 * Copyright (C) 2018-2019 Martin Jerabek <martin.jerabek01@gmail.com> FEE CTU
9 * Copyright (C) 2018-2020 Pavel Pisa <pisa@cmp.felk.cvut.cz> FEE CTU/self-funded
12 * Jiri Novak <jnovak@fel.cvut.cz>
13 * Pavel Pisa <pisa@cmp.felk.cvut.cz>
15 * Department of Measurement (http://meas.fel.cvut.cz/)
16 * Faculty of Electrical Engineering (http://www.fel.cvut.cz)
17 * Czech Technical University (http://www.cvut.cz/)
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 ******************************************************************************/
30 /* This file is autogenerated, DO NOT EDIT! */
32 #ifndef __CTU_CAN_FD_CAN_FD_REGISTER_MAP__
33 #define __CTU_CAN_FD_CAN_FD_REGISTER_MAP__
35 /* CAN_Registers memory map */
36 enum ctu_can_fd_can_registers
{
37 CTU_CAN_FD_DEVICE_ID
= 0x0,
38 CTU_CAN_FD_VERSION
= 0x2,
39 CTU_CAN_FD_MODE
= 0x4,
40 CTU_CAN_FD_SETTINGS
= 0x6,
41 CTU_CAN_FD_STATUS
= 0x8,
42 CTU_CAN_FD_COMMAND
= 0xc,
43 CTU_CAN_FD_INT_STAT
= 0x10,
44 CTU_CAN_FD_INT_ENA_SET
= 0x14,
45 CTU_CAN_FD_INT_ENA_CLR
= 0x18,
46 CTU_CAN_FD_INT_MASK_SET
= 0x1c,
47 CTU_CAN_FD_INT_MASK_CLR
= 0x20,
48 CTU_CAN_FD_BTR
= 0x24,
49 CTU_CAN_FD_BTR_FD
= 0x28,
50 CTU_CAN_FD_EWL
= 0x2c,
51 CTU_CAN_FD_ERP
= 0x2d,
52 CTU_CAN_FD_FAULT_STATE
= 0x2e,
53 CTU_CAN_FD_REC
= 0x30,
54 CTU_CAN_FD_TEC
= 0x32,
55 CTU_CAN_FD_ERR_NORM
= 0x34,
56 CTU_CAN_FD_ERR_FD
= 0x36,
57 CTU_CAN_FD_CTR_PRES
= 0x38,
58 CTU_CAN_FD_FILTER_A_MASK
= 0x3c,
59 CTU_CAN_FD_FILTER_A_VAL
= 0x40,
60 CTU_CAN_FD_FILTER_B_MASK
= 0x44,
61 CTU_CAN_FD_FILTER_B_VAL
= 0x48,
62 CTU_CAN_FD_FILTER_C_MASK
= 0x4c,
63 CTU_CAN_FD_FILTER_C_VAL
= 0x50,
64 CTU_CAN_FD_FILTER_RAN_LOW
= 0x54,
65 CTU_CAN_FD_FILTER_RAN_HIGH
= 0x58,
66 CTU_CAN_FD_FILTER_CONTROL
= 0x5c,
67 CTU_CAN_FD_FILTER_STATUS
= 0x5e,
68 CTU_CAN_FD_RX_MEM_INFO
= 0x60,
69 CTU_CAN_FD_RX_POINTERS
= 0x64,
70 CTU_CAN_FD_RX_STATUS
= 0x68,
71 CTU_CAN_FD_RX_SETTINGS
= 0x6a,
72 CTU_CAN_FD_RX_DATA
= 0x6c,
73 CTU_CAN_FD_TX_STATUS
= 0x70,
74 CTU_CAN_FD_TX_COMMAND
= 0x74,
75 CTU_CAN_FD_TX_PRIORITY
= 0x78,
76 CTU_CAN_FD_ERR_CAPT
= 0x7c,
77 CTU_CAN_FD_ALC
= 0x7e,
78 CTU_CAN_FD_TRV_DELAY
= 0x80,
79 CTU_CAN_FD_SSP_CFG
= 0x82,
80 CTU_CAN_FD_RX_FR_CTR
= 0x84,
81 CTU_CAN_FD_TX_FR_CTR
= 0x88,
82 CTU_CAN_FD_DEBUG_REGISTER
= 0x8c,
83 CTU_CAN_FD_YOLO_REG
= 0x90,
84 CTU_CAN_FD_TIMESTAMP_LOW
= 0x94,
85 CTU_CAN_FD_TIMESTAMP_HIGH
= 0x98,
86 CTU_CAN_FD_TXTB1_DATA_1
= 0x100,
87 CTU_CAN_FD_TXTB1_DATA_2
= 0x104,
88 CTU_CAN_FD_TXTB1_DATA_20
= 0x14c,
89 CTU_CAN_FD_TXTB2_DATA_1
= 0x200,
90 CTU_CAN_FD_TXTB2_DATA_2
= 0x204,
91 CTU_CAN_FD_TXTB2_DATA_20
= 0x24c,
92 CTU_CAN_FD_TXTB3_DATA_1
= 0x300,
93 CTU_CAN_FD_TXTB3_DATA_2
= 0x304,
94 CTU_CAN_FD_TXTB3_DATA_20
= 0x34c,
95 CTU_CAN_FD_TXTB4_DATA_1
= 0x400,
96 CTU_CAN_FD_TXTB4_DATA_2
= 0x404,
97 CTU_CAN_FD_TXTB4_DATA_20
= 0x44c,
101 /* Register descriptions: */
102 union ctu_can_fd_device_id_version
{
104 struct ctu_can_fd_device_id_version_s
{
105 #ifdef __LITTLE_ENDIAN_BITFIELD
107 uint32_t device_id
: 16;
109 uint32_t ver_minor
: 8;
110 uint32_t ver_major
: 8;
112 uint32_t ver_major
: 8;
113 uint32_t ver_minor
: 8;
114 uint32_t device_id
: 16;
119 enum ctu_can_fd_device_id_device_id
{
120 CTU_CAN_FD_ID
= 0xcafd,
123 union ctu_can_fd_mode_settings
{
125 struct ctu_can_fd_mode_settings_s
{
126 #ifdef __LITTLE_ENDIAN_BITFIELD
133 uint32_t reserved_6_5
: 2;
136 uint32_t reserved_15_9
: 7;
144 uint32_t reserved_31_25
: 7;
146 uint32_t reserved_31_25
: 7;
153 uint32_t reserved_15_9
: 7;
156 uint32_t reserved_6_5
: 2;
166 enum ctu_can_fd_mode_lom
{
171 enum ctu_can_fd_mode_stm
{
176 enum ctu_can_fd_mode_afm
{
181 enum ctu_can_fd_mode_fde
{
186 enum ctu_can_fd_mode_acf
{
191 enum ctu_can_fd_settings_rtrle
{
192 RTRLE_DISABLED
= 0x0,
196 enum ctu_can_fd_settings_ilbp
{
197 INT_LOOP_DISABLED
= 0x0,
198 INT_LOOP_ENABLED
= 0x1,
201 enum ctu_can_fd_settings_ena
{
202 CTU_CAN_DISABLED
= 0x0,
203 CTU_CAN_ENABLED
= 0x1,
206 enum ctu_can_fd_settings_nisofd
{
211 enum ctu_can_fd_settings_pex
{
212 PROTOCOL_EXCEPTION_DISABLED
= 0x0,
213 PROTOCOL_EXCEPTION_ENABLED
= 0x1,
216 union ctu_can_fd_status
{
218 struct ctu_can_fd_status_s
{
219 #ifdef __LITTLE_ENDIAN_BITFIELD
229 uint32_t reserved_31_8
: 24;
231 uint32_t reserved_31_8
: 24;
244 union ctu_can_fd_command
{
246 struct ctu_can_fd_command_s
{
247 #ifdef __LITTLE_ENDIAN_BITFIELD
248 uint32_t reserved_1_0
: 2;
253 uint32_t rxfcrst
: 1;
254 uint32_t txfcrst
: 1;
255 uint32_t reserved_31_7
: 25;
257 uint32_t reserved_31_7
: 25;
258 uint32_t txfcrst
: 1;
259 uint32_t rxfcrst
: 1;
263 uint32_t reserved_1_0
: 2;
268 union ctu_can_fd_int_stat
{
270 struct ctu_can_fd_int_stat_s
{
271 #ifdef __LITTLE_ENDIAN_BITFIELD
285 uint32_t reserved_31_12
: 20;
287 uint32_t reserved_31_12
: 20;
304 union ctu_can_fd_int_ena_set
{
306 struct ctu_can_fd_int_ena_set_s
{
307 #ifdef __LITTLE_ENDIAN_BITFIELD
309 uint32_t int_ena_set
: 12;
310 uint32_t reserved_31_12
: 20;
312 uint32_t reserved_31_12
: 20;
313 uint32_t int_ena_set
: 12;
318 union ctu_can_fd_int_ena_clr
{
320 struct ctu_can_fd_int_ena_clr_s
{
321 #ifdef __LITTLE_ENDIAN_BITFIELD
323 uint32_t int_ena_clr
: 12;
324 uint32_t reserved_31_12
: 20;
326 uint32_t reserved_31_12
: 20;
327 uint32_t int_ena_clr
: 12;
332 union ctu_can_fd_int_mask_set
{
334 struct ctu_can_fd_int_mask_set_s
{
335 #ifdef __LITTLE_ENDIAN_BITFIELD
337 uint32_t int_mask_set
: 12;
338 uint32_t reserved_31_12
: 20;
340 uint32_t reserved_31_12
: 20;
341 uint32_t int_mask_set
: 12;
346 union ctu_can_fd_int_mask_clr
{
348 struct ctu_can_fd_int_mask_clr_s
{
349 #ifdef __LITTLE_ENDIAN_BITFIELD
351 uint32_t int_mask_clr
: 12;
352 uint32_t reserved_31_12
: 20;
354 uint32_t reserved_31_12
: 20;
355 uint32_t int_mask_clr
: 12;
360 union ctu_can_fd_btr
{
362 struct ctu_can_fd_btr_s
{
363 #ifdef __LITTLE_ENDIAN_BITFIELD
380 union ctu_can_fd_btr_fd
{
382 struct ctu_can_fd_btr_fd_s
{
383 #ifdef __LITTLE_ENDIAN_BITFIELD
385 uint32_t prop_fd
: 6;
386 uint32_t reserved_6
: 1;
388 uint32_t reserved_12
: 1;
390 uint32_t reserved_18
: 1;
396 uint32_t reserved_18
: 1;
398 uint32_t reserved_12
: 1;
400 uint32_t reserved_6
: 1;
401 uint32_t prop_fd
: 6;
406 union ctu_can_fd_ewl_erp_fault_state
{
408 struct ctu_can_fd_ewl_erp_fault_state_s
{
409 #ifdef __LITTLE_ENDIAN_BITFIELD
411 uint32_t ew_limit
: 8;
413 uint32_t erp_limit
: 8;
418 uint32_t reserved_31_19
: 13;
420 uint32_t reserved_31_19
: 13;
424 uint32_t erp_limit
: 8;
425 uint32_t ew_limit
: 8;
430 union ctu_can_fd_rec_tec
{
432 struct ctu_can_fd_rec_tec_s
{
433 #ifdef __LITTLE_ENDIAN_BITFIELD
435 uint32_t rec_val
: 9;
436 uint32_t reserved_15_9
: 7;
438 uint32_t tec_val
: 9;
439 uint32_t reserved_31_25
: 7;
441 uint32_t reserved_31_25
: 7;
442 uint32_t tec_val
: 9;
443 uint32_t reserved_15_9
: 7;
444 uint32_t rec_val
: 9;
449 union ctu_can_fd_err_norm_err_fd
{
451 struct ctu_can_fd_err_norm_err_fd_s
{
452 #ifdef __LITTLE_ENDIAN_BITFIELD
454 uint32_t err_norm_val
: 16;
456 uint32_t err_fd_val
: 16;
458 uint32_t err_fd_val
: 16;
459 uint32_t err_norm_val
: 16;
464 union ctu_can_fd_ctr_pres
{
466 struct ctu_can_fd_ctr_pres_s
{
467 #ifdef __LITTLE_ENDIAN_BITFIELD
474 uint32_t reserved_31_13
: 19;
476 uint32_t reserved_31_13
: 19;
486 union ctu_can_fd_filter_a_mask
{
488 struct ctu_can_fd_filter_a_mask_s
{
489 #ifdef __LITTLE_ENDIAN_BITFIELD
491 uint32_t bit_mask_a_val
: 29;
492 uint32_t reserved_31_29
: 3;
494 uint32_t reserved_31_29
: 3;
495 uint32_t bit_mask_a_val
: 29;
500 union ctu_can_fd_filter_a_val
{
502 struct ctu_can_fd_filter_a_val_s
{
503 #ifdef __LITTLE_ENDIAN_BITFIELD
505 uint32_t bit_val_a_val
: 29;
506 uint32_t reserved_31_29
: 3;
508 uint32_t reserved_31_29
: 3;
509 uint32_t bit_val_a_val
: 29;
514 union ctu_can_fd_filter_b_mask
{
516 struct ctu_can_fd_filter_b_mask_s
{
517 #ifdef __LITTLE_ENDIAN_BITFIELD
519 uint32_t bit_mask_b_val
: 29;
520 uint32_t reserved_31_29
: 3;
522 uint32_t reserved_31_29
: 3;
523 uint32_t bit_mask_b_val
: 29;
528 union ctu_can_fd_filter_b_val
{
530 struct ctu_can_fd_filter_b_val_s
{
531 #ifdef __LITTLE_ENDIAN_BITFIELD
533 uint32_t bit_val_b_val
: 29;
534 uint32_t reserved_31_29
: 3;
536 uint32_t reserved_31_29
: 3;
537 uint32_t bit_val_b_val
: 29;
542 union ctu_can_fd_filter_c_mask
{
544 struct ctu_can_fd_filter_c_mask_s
{
545 #ifdef __LITTLE_ENDIAN_BITFIELD
547 uint32_t bit_mask_c_val
: 29;
548 uint32_t reserved_31_29
: 3;
550 uint32_t reserved_31_29
: 3;
551 uint32_t bit_mask_c_val
: 29;
556 union ctu_can_fd_filter_c_val
{
558 struct ctu_can_fd_filter_c_val_s
{
559 #ifdef __LITTLE_ENDIAN_BITFIELD
561 uint32_t bit_val_c_val
: 29;
562 uint32_t reserved_31_29
: 3;
564 uint32_t reserved_31_29
: 3;
565 uint32_t bit_val_c_val
: 29;
570 union ctu_can_fd_filter_ran_low
{
572 struct ctu_can_fd_filter_ran_low_s
{
573 #ifdef __LITTLE_ENDIAN_BITFIELD
575 uint32_t bit_ran_low_val
: 29;
576 uint32_t reserved_31_29
: 3;
578 uint32_t reserved_31_29
: 3;
579 uint32_t bit_ran_low_val
: 29;
584 union ctu_can_fd_filter_ran_high
{
586 struct ctu_can_fd_filter_ran_high_s
{
587 #ifdef __LITTLE_ENDIAN_BITFIELD
588 /* FILTER_RAN_HIGH */
589 uint32_t bit_ran_high_val
: 29;
590 uint32_t reserved_31_29
: 3;
592 uint32_t reserved_31_29
: 3;
593 uint32_t bit_ran_high_val
: 29;
598 union ctu_can_fd_filter_control_filter_status
{
600 struct ctu_can_fd_filter_control_filter_status_s
{
601 #ifdef __LITTLE_ENDIAN_BITFIELD
624 uint32_t reserved_31_20
: 12;
626 uint32_t reserved_31_20
: 12;
651 union ctu_can_fd_rx_mem_info
{
653 struct ctu_can_fd_rx_mem_info_s
{
654 #ifdef __LITTLE_ENDIAN_BITFIELD
656 uint32_t rx_buff_size
: 13;
657 uint32_t reserved_15_13
: 3;
658 uint32_t rx_mem_free
: 13;
659 uint32_t reserved_31_29
: 3;
661 uint32_t reserved_31_29
: 3;
662 uint32_t rx_mem_free
: 13;
663 uint32_t reserved_15_13
: 3;
664 uint32_t rx_buff_size
: 13;
669 union ctu_can_fd_rx_pointers
{
671 struct ctu_can_fd_rx_pointers_s
{
672 #ifdef __LITTLE_ENDIAN_BITFIELD
674 uint32_t rx_wpp
: 12;
675 uint32_t reserved_15_12
: 4;
676 uint32_t rx_rpp
: 12;
677 uint32_t reserved_31_28
: 4;
679 uint32_t reserved_31_28
: 4;
680 uint32_t rx_rpp
: 12;
681 uint32_t reserved_15_12
: 4;
682 uint32_t rx_wpp
: 12;
687 union ctu_can_fd_rx_status_rx_settings
{
689 struct ctu_can_fd_rx_status_rx_settings_s
{
690 #ifdef __LITTLE_ENDIAN_BITFIELD
694 uint32_t reserved_3_2
: 2;
696 uint32_t reserved_15
: 1;
699 uint32_t reserved_31_17
: 15;
701 uint32_t reserved_31_17
: 15;
703 uint32_t reserved_15
: 1;
705 uint32_t reserved_3_2
: 2;
712 enum ctu_can_fd_rx_settings_rtsop
{
717 union ctu_can_fd_rx_data
{
719 struct ctu_can_fd_rx_data_s
{
721 uint32_t rx_data
: 32;
725 union ctu_can_fd_tx_status
{
727 struct ctu_can_fd_tx_status_s
{
728 #ifdef __LITTLE_ENDIAN_BITFIELD
734 uint32_t reserved_31_16
: 16;
736 uint32_t reserved_31_16
: 16;
745 enum ctu_can_fd_tx_status_tx1s
{
755 union ctu_can_fd_tx_command
{
757 struct ctu_can_fd_tx_command_s
{
758 #ifdef __LITTLE_ENDIAN_BITFIELD
763 uint32_t reserved_7_3
: 5;
768 uint32_t reserved_31_12
: 20;
770 uint32_t reserved_31_12
: 20;
775 uint32_t reserved_7_3
: 5;
783 union ctu_can_fd_tx_priority
{
785 struct ctu_can_fd_tx_priority_s
{
786 #ifdef __LITTLE_ENDIAN_BITFIELD
789 uint32_t reserved_3
: 1;
791 uint32_t reserved_7
: 1;
793 uint32_t reserved_11
: 1;
795 uint32_t reserved_31_15
: 17;
797 uint32_t reserved_31_15
: 17;
799 uint32_t reserved_11
: 1;
801 uint32_t reserved_7
: 1;
803 uint32_t reserved_3
: 1;
809 union ctu_can_fd_err_capt_alc
{
811 struct ctu_can_fd_err_capt_alc_s
{
812 #ifdef __LITTLE_ENDIAN_BITFIELD
814 uint32_t err_pos
: 5;
815 uint32_t err_type
: 3;
816 uint32_t reserved_15_8
: 8;
818 uint32_t alc_bit
: 5;
819 uint32_t alc_id_field
: 3;
820 uint32_t reserved_31_24
: 8;
822 uint32_t reserved_31_24
: 8;
823 uint32_t alc_id_field
: 3;
824 uint32_t alc_bit
: 5;
825 uint32_t reserved_15_8
: 8;
826 uint32_t err_type
: 3;
827 uint32_t err_pos
: 5;
832 enum ctu_can_fd_err_capt_err_pos
{
842 ERC_POS_OTHER
= 0x1f,
845 enum ctu_can_fd_err_capt_err_type
{
853 enum ctu_can_fd_alc_alc_id_field
{
862 union ctu_can_fd_trv_delay_ssp_cfg
{
864 struct ctu_can_fd_trv_delay_ssp_cfg_s
{
865 #ifdef __LITTLE_ENDIAN_BITFIELD
867 uint32_t trv_delay_value
: 7;
868 uint32_t reserved_15_7
: 9;
870 uint32_t ssp_offset
: 8;
871 uint32_t ssp_src
: 2;
872 uint32_t reserved_31_26
: 6;
874 uint32_t reserved_31_26
: 6;
875 uint32_t ssp_src
: 2;
876 uint32_t ssp_offset
: 8;
877 uint32_t reserved_15_7
: 9;
878 uint32_t trv_delay_value
: 7;
883 enum ctu_can_fd_ssp_cfg_ssp_src
{
884 SSP_SRC_MEAS_N_OFFSET
= 0x0,
885 SSP_SRC_NO_SSP
= 0x1,
886 SSP_SRC_OFFSET
= 0x2,
889 union ctu_can_fd_rx_fr_ctr
{
891 struct ctu_can_fd_rx_fr_ctr_s
{
893 uint32_t rx_fr_ctr_val
: 32;
897 union ctu_can_fd_tx_fr_ctr
{
899 struct ctu_can_fd_tx_fr_ctr_s
{
901 uint32_t tx_fr_ctr_val
: 32;
905 union ctu_can_fd_debug_register
{
907 struct ctu_can_fd_debug_register_s
{
908 #ifdef __LITTLE_ENDIAN_BITFIELD
910 uint32_t stuff_count
: 3;
911 uint32_t destuff_count
: 3;
917 uint32_t pc_crcd
: 1;
919 uint32_t pc_ackd
: 1;
922 uint32_t pc_susp
: 1;
925 uint32_t reserved_31_19
: 13;
927 uint32_t reserved_31_19
: 13;
930 uint32_t pc_susp
: 1;
933 uint32_t pc_ackd
: 1;
935 uint32_t pc_crcd
: 1;
941 uint32_t destuff_count
: 3;
942 uint32_t stuff_count
: 3;
947 union ctu_can_fd_yolo_reg
{
949 struct ctu_can_fd_yolo_reg_s
{
951 uint32_t yolo_val
: 32;
955 union ctu_can_fd_timestamp_low
{
957 struct ctu_can_fd_timestamp_low_s
{
959 uint32_t timestamp_low
: 32;
963 union ctu_can_fd_timestamp_high
{
965 struct ctu_can_fd_timestamp_high_s
{
967 uint32_t timestamp_high
: 32;