1 diff --git a/arch/mips/include/asm/xtalk/xwidget.h b/arch/mips/include/asm/xtalk/xwidget.h
2 index 9f71148f9ff4..cb0bf300b437 100644
3 --- a/arch/mips/include/asm/xtalk/xwidget.h
4 +++ b/arch/mips/include/asm/xtalk/xwidget.h
5 @@ -196,41 +196,257 @@ static const struct widget_ident __initconst widget_idents[] = {
10 - * according to the crosstalk spec, only 32-bits access to the widget
11 - * configuration registers is allowed. some widgets may allow 64-bits
12 - * access but software should not depend on it. registers beyond the
13 - * widget target flush register are widget dependent thus will not be
15 +/* Common widget bits */
16 +#define XTALK_NODEV 0xffffffff
18 +/* Common Xbow bits */
19 +#define XBOW_REG_LINK_STAT_0 0x114
20 +#define XBOW_REG_LINK_BLK_SIZE 0x40
21 +#define XBOW_REG_LINK_ALIVE 0x80000000
24 + * xwidget_platform_data - platform data for xtalk widgets.
25 + * @nasid: signed short for the NUMA node ID.
26 + * @masterwid: master xtalk widget for this xwidget (HUB, HEART, BEDROCK)
27 + * @bridge_pdata: pointer to struct bridge_platform_data.
29 +struct xwidget_platform_data {
32 + struct bridge_platform_data *bridge_pdata;
36 -typedef u32 widgetreg_t;
38 -/* widget configuration registers */
39 -typedef volatile struct widget_cfg {
40 - widgetreg_t w_pad_0; /* 0x00 */
41 - widgetreg_t w_id; /* 0x04 */
42 - widgetreg_t w_pad_1; /* 0x08 */
43 - widgetreg_t w_status; /* 0x0c */
44 - widgetreg_t w_pad_2; /* 0x10 */
45 - widgetreg_t w_err_upper_addr; /* 0x14 */
46 - widgetreg_t w_pad_3; /* 0x18 */
47 - widgetreg_t w_err_lower_addr; /* 0x1c */
48 - widgetreg_t w_pad_4; /* 0x20 */
49 - widgetreg_t w_control; /* 0x24 */
50 - widgetreg_t w_pad_5; /* 0x28 */
51 - widgetreg_t w_req_timeout; /* 0x2c */
52 - widgetreg_t w_pad_6; /* 0x30 */
53 - widgetreg_t w_intdest_upper_addr; /* 0x34 */
54 - widgetreg_t w_pad_7; /* 0x38 */
55 - widgetreg_t w_intdest_lower_addr; /* 0x3c */
56 - widgetreg_t w_pad_8; /* 0x40 */
57 - widgetreg_t w_err_cmd_word; /* 0x44 */
58 - widgetreg_t w_pad_9; /* 0x48 */
59 - widgetreg_t w_llp_cfg; /* 0x4c */
60 - widgetreg_t w_pad_10; /* 0x50 */
61 - widgetreg_t w_tflush; /* 0x54 */
63 +/* ----------------------------------------------------------------------- */
67 + * union xbow_reg - 64-bit/32-bit access to Crossbow/XBOW registers.
68 + * @q: 64-bit register access; uncommon, but may exist on certain widgets.
69 + * @l.__pad: upper 32-bits of padding.
70 + * @l.data: lower 32-bits of register data.
72 + * Per the Crosstalk specification, all registers are 32-bits or less in size
73 + * and are aligned to a 64-bit boundary. Register data begins at bits 31:0
74 + * and can only be accessed by a Crosstalk double-word packet type.
76 + * However, some Crosstalk widgets may allow for 64-bit register access, so
77 + * this union provides for a u64 data type specifically for these rare
81 + u64 q; /* 64-bit access */
83 + u32 __pad; /* upper 32-bits padding */
84 + u32 data; /* lower 32-bits data */
90 + * struct xwidget_cmn_regs - Crosstalk common widget config registers.
92 + * @status: widget 0 status (read-only).
93 + * @err_upper: upper 32-bits of error address.
94 + * @err_lower: lower 32-bits of error address.
95 + * @wid_ctrl: widget 0 control.
96 + * @pkt_timo: packet timeout.
97 + * @int_upper: upper 32-bits of interrupt destination address.
98 + * @int_lower: lower 32-bits of interrupt destination address.
99 + * @err_cmdword: error command
100 + * @llp_ctrl: Link Level Protocol (LLP) control.
101 + * @stat_clr: widget 0 status (read & clear).
102 + * @arb_reload: arbitration reload.
103 + * @perf_ctr_a: perf counter A.
104 + * @perf_ctr_b: perf counter B.
105 + * @nic: Number-In-a-Can (NIC).
107 + * Crossbow registers beyond the 'stat_clr' register are widget-dependent and
108 + * were originally not specified. However, this struct defines all registers
109 + * up to offset 0x78. Widget-specific code will need to rename the 'stat_clr'
110 + * widget and beyond to whatever purpose it serves. See asm/pci/bridge.h for
111 + * example macros after the definition of 'struct bridge_regs'.
113 +struct xwidget_cmn_regs {
114 + union xbow_reg id; /* 0x00000000 */
115 + union xbow_reg status; /* +008 */
116 + union xbow_reg err_upper; /* +010 */
117 + union xbow_reg err_lower; /* +018 */
118 + union xbow_reg wid_ctrl; /* +020 */
119 + union xbow_reg pkt_timo; /* +028 */
120 + union xbow_reg int_upper; /* +030 */
121 + union xbow_reg int_lower; /* +038 */
122 + union xbow_reg err_cmdword; /* +040 */
123 + union xbow_reg llp_ctrl; /* +048 */
124 + union xbow_reg stat_clr; /* +050 */
125 + union xbow_reg arb_reload; /* +058 */
126 + union xbow_reg perf_ctr_a; /* +060 */
127 + union xbow_reg perf_ctr_b; /* +068 */
128 + union xbow_reg nic; /* +070 */
133 + * struct xwidget_link_regs - Crosstalk per-link widget registers.
134 + * @ibuf_flush: link input buffer flush.
135 + * @ctrl: link control.
136 + * @status: link status (read-only).
137 + * @arb_upper: upper 32-bits of link arbitration address.
138 + * @arb_lower: lower 32-bits of link arbitration address.
139 + * @stat_clr: link status (read & clear).
140 + * @reset: link reset.
141 + * @aux_stat: link auxiliary control.
143 + * There are eight sets of these registers, starting at offset +0x100 in
144 + * crosstalk address space. Each set of registers is 0x40 in size. They
145 + * are labeled in hex as 'link 8' to 'link f', representing the eight
146 + * possible crosstalk widgets per XBOW ASIC.
148 +struct xwidget_link_regs {
149 + union xbow_reg ibuf_flush; /* 0x0000 */
150 + union xbow_reg ctrl; /* +08 */
151 + union xbow_reg status; /* +10 */
152 + union xbow_reg arb_upper; /* +18 */
153 + union xbow_reg arb_lower; /* +20 */
154 + union xbow_reg stat_clr; /* +28 */
155 + union xbow_reg reset; /* +30 */
156 + union xbow_reg aux_stat; /* +38 */
161 + * struct xwidget_regs - Crosstalk widget register access.
162 + * @common: common widget registers.
163 + * @link_8: link-specific widget registers for widget 0x8.
164 + * @link_9: ... widget 0x9.
165 + * @link_a: ... widget 0xa.
166 + * @link_b: ... widget 0xb.
167 + * @link_c: ... widget 0xc.
168 + * @link_d: ... widget 0xd.
169 + * @link_e: ... widget 0xe.
170 + * @link_f: ... widget 0xf.
171 + * @rsvd: reserved address space from 0x00000300 to 0x00ffffff.
173 +struct xwidget_regs {
174 + struct xwidget_cmn_regs common; /* 0x00000000 */
175 + struct xwidget_link_regs link_8; /* 0x00000100 */
176 + struct xwidget_link_regs link_9; /* 0x00000140 */
177 + struct xwidget_link_regs link_a; /* 0x00000180 */
178 + struct xwidget_link_regs link_b; /* 0x000001c0 */
179 + struct xwidget_link_regs link_c; /* 0x00000200 */
180 + struct xwidget_link_regs link_d; /* 0x00000240 */
181 + struct xwidget_link_regs link_e; /* 0x00000280 */
182 + struct xwidget_link_regs link_f; /* 0x000002c0 */
183 + u64 rsvd[0x1fffa0]; /* 0x00000300 */
187 + * Shortcut macros to access bits 31:0 of each Crosstalk common config
188 + * registers. They cannot be used by themselves, but must be accessed off of
189 + * a defined 'struct xwidget_regs' variable. 64-bit access should access
190 + * the 'q' member directly if needed. Some known widgets (e.g. BRIDGE) use
191 + * parts of this structure for its own widget register accesses.
193 +#define xw_id common.id.l.data /* ro */
194 +#define xw_status common.status.l.data /* ro */
195 +#define xw_err_upper common.err_upper.l.data /* ro */
196 +#define xw_err_lower common.err_lower.l.data /* ro */
197 +#define xw_wid_ctrl common.wid_ctrl.l.data /* rw */
198 +#define xw_pkt_timo common.pkt_timo.l.data /* rw */
199 +#define xw_int_upper common.int_upper.l.data /* rw */
200 +#define xw_int_lower common.int_lower.l.data /* rw */
201 +#define xw_err_cmdword common.err_cmdword.l.data /* rw */
202 +#define xw_llp_ctrl common.llp_ctrl.l.data /* rw */
203 +#define xw_stat_clr common.stat_clr.l.data /* ro/clr */
204 +#define xw_arb_reload common.arb_reload.l.data /* rw */
205 +#define xw_perf_ctr_a common.perf_ctr_a.l.data /* rw */
206 +#define xw_perf_ctr_b common.perf_ctr_b.l.data /* rw */
207 +#define xw_nic common.nic.l.data /* rw */
210 + * Shortcut macros to access bits 31:0 of each Crosstalk link-specific config
211 + * register. They cannot be used by themselves, but must be accessed off of
212 + * a defined 'struct xwidget_regs' variable.
214 +#define xw_link_8_ibuf_flush link_8.ibuf_flush.l.data /* ro */
215 +#define xw_link_8_ctrl link_8.ctrl.l.data /* rw */
216 +#define xw_link_8_status link_8.status.l.data /* ro */
217 +#define xw_link_8_arb_upper link_8.arb_upper.l.data /* rw */
218 +#define xw_link_8_arb_lower link_8.arb_lower.l.data /* rw */
219 +#define xw_link_8_stat_clr link_8.stat_clr.l.data /* ro/clr */
220 +#define xw_link_8_reset link_8.reset.l.data /* wo */
221 +#define xw_link_8_aux_stat link_8.aux_stat.l.data /* ro */
223 +#define xw_link_9_ibuf_flush link_9.ibuf_flush.l.data /* ro */
224 +#define xw_link_9_ctrl link_9.ctrl.l.data /* rw */
225 +#define xw_link_9_status link_9.status.l.data /* ro */
226 +#define xw_link_9_arb_upper link_9.arb_upper.l.data /* rw */
227 +#define xw_link_9_arb_lower link_9.arb_lower.l.data /* rw */
228 +#define xw_link_9_stat_clr link_9.stat_clr.l.data /* ro/clr */
229 +#define xw_link_9_reset link_9.reset.l.data /* wo */
230 +#define xw_link_9_aux_stat link_9.aux_stat.l.data /* ro */
232 +#define xw_link_a_ibuf_flush link_a.ibuf_flush.l.data /* ro */
233 +#define xw_link_a_ctrl link_a.ctrl.l.data /* rw */
234 +#define xw_link_a_status link_a.status.l.data /* ro */
235 +#define xw_link_a_arb_upper link_a.arb_upper.l.data /* rw */
236 +#define xw_link_a_arb_lower link_a.arb_lower.l.data /* rw */
237 +#define xw_link_a_stat_clr link_a.stat_clr.l.data /* ro/clr */
238 +#define xw_link_a_reset link_a.reset.l.data /* wo */
239 +#define xw_link_a_aux_stat link_a.aux_stat.l.data /* ro */
241 +#define xw_link_b_ibuf_flush link_b.ibuf_flush.l.data /* ro */
242 +#define xw_link_b_ctrl link_b.ctrl.l.data /* rw */
243 +#define xw_link_b_status link_b.status.l.data /* ro */
244 +#define xw_link_b_arb_upper link_b.arb_upper.l.data /* rw */
245 +#define xw_link_b_arb_lower link_b.arb_lower.l.data /* rw */
246 +#define xw_link_b_stat_clr link_b.stat_clr.l.data /* ro/clr */
247 +#define xw_link_b_reset link_b.reset.l.data /* wo */
248 +#define xw_link_b_aux_stat link_b.aux_stat.l.data /* ro */
250 +#define xw_link_c_ibuf_flush link_c.ibuf_flush.l.data /* ro */
251 +#define xw_link_c_ctrl link_c.ctrl.l.data /* rw */
252 +#define xw_link_c_status link_c.status.l.data /* ro */
253 +#define xw_link_c_arb_upper link_c.arb_upper.l.data /* rw */
254 +#define xw_link_c_arb_lower link_c.arb_lower.l.data /* rw */
255 +#define xw_link_c_stat_clr link_c.stat_clr.l.data /* ro/clr */
256 +#define xw_link_c_reset link_c.reset.l.data /* wo */
257 +#define xw_link_c_aux_stat link_c.aux_stat.l.data /* ro */
259 +#define xw_link_d_ibuf_flush link_d.ibuf_flush.l.data /* ro */
260 +#define xw_link_d_ctrl link_d.ctrl.l.data /* rw */
261 +#define xw_link_d_status link_d.status.l.data /* ro */
262 +#define xw_link_d_arb_upper link_d.arb_upper.l.data /* rw */
263 +#define xw_link_d_arb_lower link_d.arb_lower.l.data /* rw */
264 +#define xw_link_d_stat_clr link_d.stat_clr.l.data /* ro/clr */
265 +#define xw_link_d_reset link_d.reset.l.data /* wo */
266 +#define xw_link_d_aux_stat link_d.aux_stat.l.data /* ro */
268 +#define xw_link_e_ibuf_flush link_e.ibuf_flush.l.data /* ro */
269 +#define xw_link_e_ctrl link_e.ctrl.l.data /* rw */
270 +#define xw_link_e_status link_e.status.l.data /* ro */
271 +#define xw_link_e_arb_upper link_e.arb_upper.l.data /* rw */
272 +#define xw_link_e_arb_lower link_e.arb_lower.l.data /* rw */
273 +#define xw_link_e_stat_clr link_e.stat_clr.l.data /* ro/clr */
274 +#define xw_link_e_reset link_e.reset.l.data /* wo */
275 +#define xw_link_e_aux_stat link_e.aux_stat.l.data /* ro */
277 +#define xw_link_f_ibuf_flush link_f.ibuf_flush.l.data /* ro */
278 +#define xw_link_f_ctrl link_f.ctrl.l.data /* rw */
279 +#define xw_link_f_status link_f.status.l.data /* ro */
280 +#define xw_link_f_arb_upper link_f.arb_upper.l.data /* rw */
281 +#define xw_link_f_arb_lower link_f.arb_lower.l.data /* rw */
282 +#define xw_link_f_stat_clr link_f.stat_clr.l.data /* ro/clr */
283 +#define xw_link_f_reset link_f.reset.l.data /* wo */
284 +#define xw_link_f_aux_stat link_f.aux_stat.l.data /* ro */
288 +/* ----------------------------------------------------------------------- */
289 +/* XXX: Old/pre-existing Crosstalk data types. Keep/rewrite later. */
291 +typedef u32 widgetreg_t;
295 @@ -274,6 +490,8 @@ typedef struct xwidget_hwid_s {
296 ((hwid2)->mfg_num == XWIDGET_MFG_NUM_NONE) || \
297 ((hwid1)->mfg_num == (hwid2)->mfg_num)))
299 +/* ----------------------------------------------------------------------- */
301 #endif /* !__ASSEMBLY__ */
303 #endif /* _ASM_XTALK_XWIDGET_H */