1 /* SPDX-License-Identifier: GPL-2.0 */
6 * This file is autogenerated from
7 * file: ../../inst/timer/rtl/timer_regs.r
8 * id: timer_regs.r,v 1.7 2003/03/11 11:16:59 perz Exp
9 * last modfied: Mon Apr 11 16:09:53 2005
11 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile timer_defs.h ../../inst/timer/rtl/timer_regs.r
12 * id: $Id: timer_defs.h,v 1.1 2007/04/11 13:51:01 ricardw Exp $
13 * Any changes here will be lost.
15 * -*- buffer-read-only: t -*-
17 /* Main access macros */
19 #define REG_RD( scope, inst, reg ) \
20 REG_READ( reg_##scope##_##reg, \
21 (inst) + REG_RD_ADDR_##scope##_##reg )
25 #define REG_WR( scope, inst, reg, val ) \
26 REG_WRITE( reg_##scope##_##reg, \
27 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
31 #define REG_RD_VECT( scope, inst, reg, index ) \
32 REG_READ( reg_##scope##_##reg, \
33 (inst) + REG_RD_ADDR_##scope##_##reg + \
34 (index) * STRIDE_##scope##_##reg )
38 #define REG_WR_VECT( scope, inst, reg, index, val ) \
39 REG_WRITE( reg_##scope##_##reg, \
40 (inst) + REG_WR_ADDR_##scope##_##reg + \
41 (index) * STRIDE_##scope##_##reg, (val) )
45 #define REG_RD_INT( scope, inst, reg ) \
46 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
50 #define REG_WR_INT( scope, inst, reg, val ) \
51 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
54 #ifndef REG_RD_INT_VECT
55 #define REG_RD_INT_VECT( scope, inst, reg, index ) \
56 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
57 (index) * STRIDE_##scope##_##reg )
60 #ifndef REG_WR_INT_VECT
61 #define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
62 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
63 (index) * STRIDE_##scope##_##reg, (val) )
67 #define REG_TYPE_CONV( type, orgtype, val ) \
68 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
72 #define reg_page_size 8192
76 #define REG_ADDR( scope, inst, reg ) \
77 ( (inst) + REG_RD_ADDR_##scope##_##reg )
81 #define REG_ADDR_VECT( scope, inst, reg, index ) \
82 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
83 (index) * STRIDE_##scope##_##reg )
86 /* C-code for register scope timer */
88 /* Register rw_tmr0_div, scope timer, type rw */
89 typedef unsigned int reg_timer_rw_tmr0_div
;
90 #define REG_RD_ADDR_timer_rw_tmr0_div 0
91 #define REG_WR_ADDR_timer_rw_tmr0_div 0
93 /* Register r_tmr0_data, scope timer, type r */
94 typedef unsigned int reg_timer_r_tmr0_data
;
95 #define REG_RD_ADDR_timer_r_tmr0_data 4
97 /* Register rw_tmr0_ctrl, scope timer, type rw */
100 unsigned int freq
: 3;
101 unsigned int dummy1
: 27;
102 } reg_timer_rw_tmr0_ctrl
;
103 #define REG_RD_ADDR_timer_rw_tmr0_ctrl 8
104 #define REG_WR_ADDR_timer_rw_tmr0_ctrl 8
106 /* Register rw_tmr1_div, scope timer, type rw */
107 typedef unsigned int reg_timer_rw_tmr1_div
;
108 #define REG_RD_ADDR_timer_rw_tmr1_div 16
109 #define REG_WR_ADDR_timer_rw_tmr1_div 16
111 /* Register r_tmr1_data, scope timer, type r */
112 typedef unsigned int reg_timer_r_tmr1_data
;
113 #define REG_RD_ADDR_timer_r_tmr1_data 20
115 /* Register rw_tmr1_ctrl, scope timer, type rw */
118 unsigned int freq
: 3;
119 unsigned int dummy1
: 27;
120 } reg_timer_rw_tmr1_ctrl
;
121 #define REG_RD_ADDR_timer_rw_tmr1_ctrl 24
122 #define REG_WR_ADDR_timer_rw_tmr1_ctrl 24
124 /* Register rs_cnt_data, scope timer, type rs */
126 unsigned int tmr
: 24;
127 unsigned int cnt
: 8;
128 } reg_timer_rs_cnt_data
;
129 #define REG_RD_ADDR_timer_rs_cnt_data 32
131 /* Register r_cnt_data, scope timer, type r */
133 unsigned int tmr
: 24;
134 unsigned int cnt
: 8;
135 } reg_timer_r_cnt_data
;
136 #define REG_RD_ADDR_timer_r_cnt_data 36
138 /* Register rw_cnt_cfg, scope timer, type rw */
140 unsigned int clk
: 2;
141 unsigned int dummy1
: 30;
142 } reg_timer_rw_cnt_cfg
;
143 #define REG_RD_ADDR_timer_rw_cnt_cfg 40
144 #define REG_WR_ADDR_timer_rw_cnt_cfg 40
146 /* Register rw_trig, scope timer, type rw */
147 typedef unsigned int reg_timer_rw_trig
;
148 #define REG_RD_ADDR_timer_rw_trig 48
149 #define REG_WR_ADDR_timer_rw_trig 48
151 /* Register rw_trig_cfg, scope timer, type rw */
153 unsigned int tmr
: 2;
154 unsigned int dummy1
: 30;
155 } reg_timer_rw_trig_cfg
;
156 #define REG_RD_ADDR_timer_rw_trig_cfg 52
157 #define REG_WR_ADDR_timer_rw_trig_cfg 52
159 /* Register r_time, scope timer, type r */
160 typedef unsigned int reg_timer_r_time
;
161 #define REG_RD_ADDR_timer_r_time 56
163 /* Register rw_out, scope timer, type rw */
165 unsigned int tmr
: 2;
166 unsigned int dummy1
: 30;
168 #define REG_RD_ADDR_timer_rw_out 60
169 #define REG_WR_ADDR_timer_rw_out 60
171 /* Register rw_wd_ctrl, scope timer, type rw */
173 unsigned int cnt
: 8;
174 unsigned int cmd
: 1;
175 unsigned int key
: 7;
176 unsigned int dummy1
: 16;
177 } reg_timer_rw_wd_ctrl
;
178 #define REG_RD_ADDR_timer_rw_wd_ctrl 64
179 #define REG_WR_ADDR_timer_rw_wd_ctrl 64
181 /* Register r_wd_stat, scope timer, type r */
183 unsigned int cnt
: 8;
184 unsigned int cmd
: 1;
185 unsigned int dummy1
: 23;
186 } reg_timer_r_wd_stat
;
187 #define REG_RD_ADDR_timer_r_wd_stat 68
189 /* Register rw_intr_mask, scope timer, type rw */
191 unsigned int tmr0
: 1;
192 unsigned int tmr1
: 1;
193 unsigned int cnt
: 1;
194 unsigned int trig
: 1;
195 unsigned int dummy1
: 28;
196 } reg_timer_rw_intr_mask
;
197 #define REG_RD_ADDR_timer_rw_intr_mask 72
198 #define REG_WR_ADDR_timer_rw_intr_mask 72
200 /* Register rw_ack_intr, scope timer, type rw */
202 unsigned int tmr0
: 1;
203 unsigned int tmr1
: 1;
204 unsigned int cnt
: 1;
205 unsigned int trig
: 1;
206 unsigned int dummy1
: 28;
207 } reg_timer_rw_ack_intr
;
208 #define REG_RD_ADDR_timer_rw_ack_intr 76
209 #define REG_WR_ADDR_timer_rw_ack_intr 76
211 /* Register r_intr, scope timer, type r */
213 unsigned int tmr0
: 1;
214 unsigned int tmr1
: 1;
215 unsigned int cnt
: 1;
216 unsigned int trig
: 1;
217 unsigned int dummy1
: 28;
219 #define REG_RD_ADDR_timer_r_intr 80
221 /* Register r_masked_intr, scope timer, type r */
223 unsigned int tmr0
: 1;
224 unsigned int tmr1
: 1;
225 unsigned int cnt
: 1;
226 unsigned int trig
: 1;
227 unsigned int dummy1
: 28;
228 } reg_timer_r_masked_intr
;
229 #define REG_RD_ADDR_timer_r_masked_intr 84
231 /* Register rw_test, scope timer, type rw */
233 unsigned int dis
: 1;
235 unsigned int dummy1
: 30;
237 #define REG_RD_ADDR_timer_rw_test 88
238 #define REG_WR_ADDR_timer_rw_test 88
243 regk_timer_ext
= 0x00000001,
244 regk_timer_f100
= 0x00000007,
245 regk_timer_f29_493
= 0x00000004,
246 regk_timer_f32
= 0x00000005,
247 regk_timer_f32_768
= 0x00000006,
248 regk_timer_hold
= 0x00000001,
249 regk_timer_ld
= 0x00000000,
250 regk_timer_no
= 0x00000000,
251 regk_timer_off
= 0x00000000,
252 regk_timer_run
= 0x00000002,
253 regk_timer_rw_cnt_cfg_default
= 0x00000000,
254 regk_timer_rw_intr_mask_default
= 0x00000000,
255 regk_timer_rw_out_default
= 0x00000000,
256 regk_timer_rw_test_default
= 0x00000000,
257 regk_timer_rw_tmr0_ctrl_default
= 0x00000000,
258 regk_timer_rw_tmr1_ctrl_default
= 0x00000000,
259 regk_timer_rw_trig_cfg_default
= 0x00000000,
260 regk_timer_start
= 0x00000001,
261 regk_timer_stop
= 0x00000000,
262 regk_timer_time
= 0x00000001,
263 regk_timer_tmr0
= 0x00000002,
264 regk_timer_tmr1
= 0x00000003,
265 regk_timer_yes
= 0x00000001
267 #endif /* __timer_defs_h */