xref: /openbmc/linux/arch/powerpc/include/asm/cell-regs.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2b8b572e1SStephen Rothwell /*
3b8b572e1SStephen Rothwell  * cbe_regs.h
4b8b572e1SStephen Rothwell  *
5b8b572e1SStephen Rothwell  * This file is intended to hold the various register definitions for CBE
6b8b572e1SStephen Rothwell  * on-chip system devices (memory controller, IO controller, etc...)
7b8b572e1SStephen Rothwell  *
8b8b572e1SStephen Rothwell  * (C) Copyright IBM Corporation 2001,2006
9b8b572e1SStephen Rothwell  *
10b8b572e1SStephen Rothwell  * Authors: Maximino Aguilar (maguilar@us.ibm.com)
11b8b572e1SStephen Rothwell  *          David J. Erb (djerb@us.ibm.com)
12b8b572e1SStephen Rothwell  *
13b8b572e1SStephen Rothwell  * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
14b8b572e1SStephen Rothwell  */
15b8b572e1SStephen Rothwell 
16b8b572e1SStephen Rothwell #ifndef CBE_REGS_H
17b8b572e1SStephen Rothwell #define CBE_REGS_H
18b8b572e1SStephen Rothwell 
19b8b572e1SStephen Rothwell #include <asm/cell-pmu.h>
20b8b572e1SStephen Rothwell 
21b8b572e1SStephen Rothwell /*
22b8b572e1SStephen Rothwell  *
23b8b572e1SStephen Rothwell  * Some HID register definitions
24b8b572e1SStephen Rothwell  *
25b8b572e1SStephen Rothwell  */
26b8b572e1SStephen Rothwell 
27b8b572e1SStephen Rothwell /* CBE specific HID0 bits */
28b8b572e1SStephen Rothwell #define HID0_CBE_THERM_WAKEUP	0x0000020000000000ul
29b8b572e1SStephen Rothwell #define HID0_CBE_SYSERR_WAKEUP	0x0000008000000000ul
30b8b572e1SStephen Rothwell #define HID0_CBE_THERM_INT_EN	0x0000000400000000ul
31b8b572e1SStephen Rothwell #define HID0_CBE_SYSERR_INT_EN	0x0000000200000000ul
32b8b572e1SStephen Rothwell 
33b8b572e1SStephen Rothwell #define MAX_CBE		2
34b8b572e1SStephen Rothwell 
35b8b572e1SStephen Rothwell /*
36b8b572e1SStephen Rothwell  *
37b8b572e1SStephen Rothwell  * Pervasive unit register definitions
38b8b572e1SStephen Rothwell  *
39b8b572e1SStephen Rothwell  */
40b8b572e1SStephen Rothwell 
41b8b572e1SStephen Rothwell union spe_reg {
42b8b572e1SStephen Rothwell 	u64 val;
43b8b572e1SStephen Rothwell 	u8 spe[8];
44b8b572e1SStephen Rothwell };
45b8b572e1SStephen Rothwell 
46b8b572e1SStephen Rothwell union ppe_spe_reg {
47b8b572e1SStephen Rothwell 	u64 val;
48b8b572e1SStephen Rothwell 	struct {
49b8b572e1SStephen Rothwell 		u32 ppe;
50b8b572e1SStephen Rothwell 		u32 spe;
51b8b572e1SStephen Rothwell 	};
52b8b572e1SStephen Rothwell };
53b8b572e1SStephen Rothwell 
54b8b572e1SStephen Rothwell 
55b8b572e1SStephen Rothwell struct cbe_pmd_regs {
56b8b572e1SStephen Rothwell 	/* Debug Bus Control */
57b8b572e1SStephen Rothwell 	u64	pad_0x0000;					/* 0x0000 */
58b8b572e1SStephen Rothwell 
59b8b572e1SStephen Rothwell 	u64	group_control;					/* 0x0008 */
60b8b572e1SStephen Rothwell 
61b8b572e1SStephen Rothwell 	u8	pad_0x0010_0x00a8 [0x00a8 - 0x0010];		/* 0x0010 */
62b8b572e1SStephen Rothwell 
63b8b572e1SStephen Rothwell 	u64	debug_bus_control;				/* 0x00a8 */
64b8b572e1SStephen Rothwell 
65b8b572e1SStephen Rothwell 	u8	pad_0x00b0_0x0100 [0x0100 - 0x00b0];		/* 0x00b0 */
66b8b572e1SStephen Rothwell 
67b8b572e1SStephen Rothwell 	u64	trace_aux_data;					/* 0x0100 */
68b8b572e1SStephen Rothwell 	u64	trace_buffer_0_63;				/* 0x0108 */
69b8b572e1SStephen Rothwell 	u64	trace_buffer_64_127;				/* 0x0110 */
70b8b572e1SStephen Rothwell 	u64	trace_address;					/* 0x0118 */
71b8b572e1SStephen Rothwell 	u64	ext_tr_timer;					/* 0x0120 */
72b8b572e1SStephen Rothwell 
73b8b572e1SStephen Rothwell 	u8	pad_0x0128_0x0400 [0x0400 - 0x0128];		/* 0x0128 */
74b8b572e1SStephen Rothwell 
75b8b572e1SStephen Rothwell 	/* Performance Monitor */
76b8b572e1SStephen Rothwell 	u64	pm_status;					/* 0x0400 */
77b8b572e1SStephen Rothwell 	u64	pm_control;					/* 0x0408 */
78b8b572e1SStephen Rothwell 	u64	pm_interval;					/* 0x0410 */
79b8b572e1SStephen Rothwell 	u64	pm_ctr[4];					/* 0x0418 */
80b8b572e1SStephen Rothwell 	u64	pm_start_stop;					/* 0x0438 */
81b8b572e1SStephen Rothwell 	u64	pm07_control[8];				/* 0x0440 */
82b8b572e1SStephen Rothwell 
83b8b572e1SStephen Rothwell 	u8	pad_0x0480_0x0800 [0x0800 - 0x0480];		/* 0x0480 */
84b8b572e1SStephen Rothwell 
85b8b572e1SStephen Rothwell 	/* Thermal Sensor Registers */
86b8b572e1SStephen Rothwell 	union	spe_reg	ts_ctsr1;				/* 0x0800 */
87b8b572e1SStephen Rothwell 	u64	ts_ctsr2;					/* 0x0808 */
88b8b572e1SStephen Rothwell 	union	spe_reg	ts_mtsr1;				/* 0x0810 */
89b8b572e1SStephen Rothwell 	u64	ts_mtsr2;					/* 0x0818 */
90b8b572e1SStephen Rothwell 	union	spe_reg	ts_itr1;				/* 0x0820 */
91b8b572e1SStephen Rothwell 	u64	ts_itr2;					/* 0x0828 */
92b8b572e1SStephen Rothwell 	u64	ts_gitr;					/* 0x0830 */
93b8b572e1SStephen Rothwell 	u64	ts_isr;						/* 0x0838 */
94b8b572e1SStephen Rothwell 	u64	ts_imr;						/* 0x0840 */
95b8b572e1SStephen Rothwell 	union	spe_reg	tm_cr1;					/* 0x0848 */
96b8b572e1SStephen Rothwell 	u64	tm_cr2;						/* 0x0850 */
97b8b572e1SStephen Rothwell 	u64	tm_simr;					/* 0x0858 */
98b8b572e1SStephen Rothwell 	union	ppe_spe_reg tm_tpr;				/* 0x0860 */
99b8b572e1SStephen Rothwell 	union	spe_reg	tm_str1;				/* 0x0868 */
100b8b572e1SStephen Rothwell 	u64	tm_str2;					/* 0x0870 */
101b8b572e1SStephen Rothwell 	union	ppe_spe_reg tm_tsr;				/* 0x0878 */
102b8b572e1SStephen Rothwell 
103b8b572e1SStephen Rothwell 	/* Power Management */
104b8b572e1SStephen Rothwell 	u64	pmcr;						/* 0x0880 */
105b8b572e1SStephen Rothwell #define CBE_PMD_PAUSE_ZERO_CONTROL	0x10000
106b8b572e1SStephen Rothwell 	u64	pmsr;						/* 0x0888 */
107b8b572e1SStephen Rothwell 
108b8b572e1SStephen Rothwell 	/* Time Base Register */
109b8b572e1SStephen Rothwell 	u64	tbr;						/* 0x0890 */
110b8b572e1SStephen Rothwell 
111b8b572e1SStephen Rothwell 	u8	pad_0x0898_0x0c00 [0x0c00 - 0x0898];		/* 0x0898 */
112b8b572e1SStephen Rothwell 
113b8b572e1SStephen Rothwell 	/* Fault Isolation Registers */
114b8b572e1SStephen Rothwell 	u64	checkstop_fir;					/* 0x0c00 */
115b8b572e1SStephen Rothwell 	u64	recoverable_fir;				/* 0x0c08 */
116b8b572e1SStephen Rothwell 	u64	spec_att_mchk_fir;				/* 0x0c10 */
117b8b572e1SStephen Rothwell 	u32	fir_mode_reg;					/* 0x0c18 */
118b8b572e1SStephen Rothwell 	u8	pad_0x0c1c_0x0c20 [4];				/* 0x0c1c */
119b8b572e1SStephen Rothwell #define CBE_PMD_FIR_MODE_M8		0x00800
120b8b572e1SStephen Rothwell 	u64	fir_enable_mask;				/* 0x0c20 */
121b8b572e1SStephen Rothwell 
122b8b572e1SStephen Rothwell 	u8	pad_0x0c28_0x0ca8 [0x0ca8 - 0x0c28];		/* 0x0c28 */
123b8b572e1SStephen Rothwell 	u64	ras_esc_0;					/* 0x0ca8 */
124b8b572e1SStephen Rothwell 	u8	pad_0x0cb0_0x1000 [0x1000 - 0x0cb0];		/* 0x0cb0 */
125b8b572e1SStephen Rothwell };
126b8b572e1SStephen Rothwell 
127b8b572e1SStephen Rothwell extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np);
128b8b572e1SStephen Rothwell extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu);
129b8b572e1SStephen Rothwell 
130b8b572e1SStephen Rothwell /*
131b8b572e1SStephen Rothwell  * PMU shadow registers
132b8b572e1SStephen Rothwell  *
133b8b572e1SStephen Rothwell  * Many of the registers in the performance monitoring unit are write-only,
134b8b572e1SStephen Rothwell  * so we need to save a copy of what we write to those registers.
135b8b572e1SStephen Rothwell  *
136b8b572e1SStephen Rothwell  * The actual data counters are read/write. However, writing to the counters
137b8b572e1SStephen Rothwell  * only takes effect if the PMU is enabled. Otherwise the value is stored in
138b8b572e1SStephen Rothwell  * a hardware latch until the next time the PMU is enabled. So we save a copy
139b8b572e1SStephen Rothwell  * of the counter values if we need to read them back while the PMU is
140b8b572e1SStephen Rothwell  * disabled. The counter_value_in_latch field is a bitmap indicating which
141b8b572e1SStephen Rothwell  * counters currently have a value waiting to be written.
142b8b572e1SStephen Rothwell  */
143b8b572e1SStephen Rothwell 
144b8b572e1SStephen Rothwell struct cbe_pmd_shadow_regs {
145b8b572e1SStephen Rothwell 	u32 group_control;
146b8b572e1SStephen Rothwell 	u32 debug_bus_control;
147b8b572e1SStephen Rothwell 	u32 trace_address;
148b8b572e1SStephen Rothwell 	u32 ext_tr_timer;
149b8b572e1SStephen Rothwell 	u32 pm_status;
150b8b572e1SStephen Rothwell 	u32 pm_control;
151b8b572e1SStephen Rothwell 	u32 pm_interval;
152b8b572e1SStephen Rothwell 	u32 pm_start_stop;
153b8b572e1SStephen Rothwell 	u32 pm07_control[NR_CTRS];
154b8b572e1SStephen Rothwell 
155b8b572e1SStephen Rothwell 	u32 pm_ctr[NR_PHYS_CTRS];
156b8b572e1SStephen Rothwell 	u32 counter_value_in_latch;
157b8b572e1SStephen Rothwell };
158b8b572e1SStephen Rothwell 
159b8b572e1SStephen Rothwell extern struct cbe_pmd_shadow_regs *cbe_get_pmd_shadow_regs(struct device_node *np);
160b8b572e1SStephen Rothwell extern struct cbe_pmd_shadow_regs *cbe_get_cpu_pmd_shadow_regs(int cpu);
161b8b572e1SStephen Rothwell 
162b8b572e1SStephen Rothwell /*
163b8b572e1SStephen Rothwell  *
164b8b572e1SStephen Rothwell  * IIC unit register definitions
165b8b572e1SStephen Rothwell  *
166b8b572e1SStephen Rothwell  */
167b8b572e1SStephen Rothwell 
168b8b572e1SStephen Rothwell struct cbe_iic_pending_bits {
169b8b572e1SStephen Rothwell 	u32 data;
170b8b572e1SStephen Rothwell 	u8 flags;
171b8b572e1SStephen Rothwell 	u8 class;
172b8b572e1SStephen Rothwell 	u8 source;
173b8b572e1SStephen Rothwell 	u8 prio;
174b8b572e1SStephen Rothwell };
175b8b572e1SStephen Rothwell 
176b8b572e1SStephen Rothwell #define CBE_IIC_IRQ_VALID	0x80
177b8b572e1SStephen Rothwell #define CBE_IIC_IRQ_IPI		0x40
178b8b572e1SStephen Rothwell 
179b8b572e1SStephen Rothwell struct cbe_iic_thread_regs {
180b8b572e1SStephen Rothwell 	struct cbe_iic_pending_bits pending;
181b8b572e1SStephen Rothwell 	struct cbe_iic_pending_bits pending_destr;
182b8b572e1SStephen Rothwell 	u64 generate;
183b8b572e1SStephen Rothwell 	u64 prio;
184b8b572e1SStephen Rothwell };
185b8b572e1SStephen Rothwell 
186b8b572e1SStephen Rothwell struct cbe_iic_regs {
187b8b572e1SStephen Rothwell 	u8	pad_0x0000_0x0400[0x0400 - 0x0000];		/* 0x0000 */
188b8b572e1SStephen Rothwell 
189b8b572e1SStephen Rothwell 	/* IIC interrupt registers */
190b8b572e1SStephen Rothwell 	struct	cbe_iic_thread_regs thread[2];			/* 0x0400 */
191b8b572e1SStephen Rothwell 
192b8b572e1SStephen Rothwell 	u64	iic_ir;						/* 0x0440 */
193b8b572e1SStephen Rothwell #define CBE_IIC_IR_PRIO(x)      (((x) & 0xf) << 12)
194b8b572e1SStephen Rothwell #define CBE_IIC_IR_DEST_NODE(x) (((x) & 0xf) << 4)
195b8b572e1SStephen Rothwell #define CBE_IIC_IR_DEST_UNIT(x) ((x) & 0xf)
196b8b572e1SStephen Rothwell #define CBE_IIC_IR_IOC_0        0x0
197b8b572e1SStephen Rothwell #define CBE_IIC_IR_IOC_1S       0xb
198b8b572e1SStephen Rothwell #define CBE_IIC_IR_PT_0         0xe
199b8b572e1SStephen Rothwell #define CBE_IIC_IR_PT_1         0xf
200b8b572e1SStephen Rothwell 
201b8b572e1SStephen Rothwell 	u64	iic_is;						/* 0x0448 */
202b8b572e1SStephen Rothwell #define CBE_IIC_IS_PMI		0x2
203b8b572e1SStephen Rothwell 
204b8b572e1SStephen Rothwell 	u8	pad_0x0450_0x0500[0x0500 - 0x0450];		/* 0x0450 */
205b8b572e1SStephen Rothwell 
206b8b572e1SStephen Rothwell 	/* IOC FIR */
207b8b572e1SStephen Rothwell 	u64	ioc_fir_reset;					/* 0x0500 */
208b8b572e1SStephen Rothwell 	u64	ioc_fir_set;					/* 0x0508 */
209b8b572e1SStephen Rothwell 	u64	ioc_checkstop_enable;				/* 0x0510 */
210b8b572e1SStephen Rothwell 	u64	ioc_fir_error_mask;				/* 0x0518 */
211b8b572e1SStephen Rothwell 	u64	ioc_syserr_enable;				/* 0x0520 */
212b8b572e1SStephen Rothwell 	u64	ioc_fir;					/* 0x0528 */
213b8b572e1SStephen Rothwell 
214b8b572e1SStephen Rothwell 	u8	pad_0x0530_0x1000[0x1000 - 0x0530];		/* 0x0530 */
215b8b572e1SStephen Rothwell };
216b8b572e1SStephen Rothwell 
217b8b572e1SStephen Rothwell extern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np);
218b8b572e1SStephen Rothwell extern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu);
219b8b572e1SStephen Rothwell 
220b8b572e1SStephen Rothwell 
221b8b572e1SStephen Rothwell struct cbe_mic_tm_regs {
222b8b572e1SStephen Rothwell 	u8	pad_0x0000_0x0040[0x0040 - 0x0000];		/* 0x0000 */
223b8b572e1SStephen Rothwell 
224b8b572e1SStephen Rothwell 	u64	mic_ctl_cnfg2;					/* 0x0040 */
225b8b572e1SStephen Rothwell #define CBE_MIC_ENABLE_AUX_TRC		0x8000000000000000LL
226b8b572e1SStephen Rothwell #define CBE_MIC_DISABLE_PWR_SAV_2	0x0200000000000000LL
227b8b572e1SStephen Rothwell #define CBE_MIC_DISABLE_AUX_TRC_WRAP	0x0100000000000000LL
228b8b572e1SStephen Rothwell #define CBE_MIC_ENABLE_AUX_TRC_INT	0x0080000000000000LL
229b8b572e1SStephen Rothwell 
230b8b572e1SStephen Rothwell 	u64	pad_0x0048;					/* 0x0048 */
231b8b572e1SStephen Rothwell 
232b8b572e1SStephen Rothwell 	u64	mic_aux_trc_base;				/* 0x0050 */
233b8b572e1SStephen Rothwell 	u64	mic_aux_trc_max_addr;				/* 0x0058 */
234b8b572e1SStephen Rothwell 	u64	mic_aux_trc_cur_addr;				/* 0x0060 */
235b8b572e1SStephen Rothwell 	u64	mic_aux_trc_grf_addr;				/* 0x0068 */
236b8b572e1SStephen Rothwell 	u64	mic_aux_trc_grf_data;				/* 0x0070 */
237b8b572e1SStephen Rothwell 
238b8b572e1SStephen Rothwell 	u64	pad_0x0078;					/* 0x0078 */
239b8b572e1SStephen Rothwell 
240b8b572e1SStephen Rothwell 	u64	mic_ctl_cnfg_0;					/* 0x0080 */
241b8b572e1SStephen Rothwell #define CBE_MIC_DISABLE_PWR_SAV_0	0x8000000000000000LL
242b8b572e1SStephen Rothwell 
243b8b572e1SStephen Rothwell 	u64	pad_0x0088;					/* 0x0088 */
244b8b572e1SStephen Rothwell 
245b8b572e1SStephen Rothwell 	u64	slow_fast_timer_0;				/* 0x0090 */
246b8b572e1SStephen Rothwell 	u64	slow_next_timer_0;				/* 0x0098 */
247b8b572e1SStephen Rothwell 
248b8b572e1SStephen Rothwell 	u8	pad_0x00a0_0x00f8[0x00f8 - 0x00a0];		/* 0x00a0 */
249b8b572e1SStephen Rothwell 	u64    	mic_df_ecc_address_0;				/* 0x00f8 */
250b8b572e1SStephen Rothwell 
251b8b572e1SStephen Rothwell 	u8	pad_0x0100_0x01b8[0x01b8 - 0x0100];		/* 0x0100 */
252b8b572e1SStephen Rothwell 	u64    	mic_df_ecc_address_1;				/* 0x01b8 */
253b8b572e1SStephen Rothwell 
254b8b572e1SStephen Rothwell 	u64	mic_ctl_cnfg_1;					/* 0x01c0 */
255b8b572e1SStephen Rothwell #define CBE_MIC_DISABLE_PWR_SAV_1	0x8000000000000000LL
256b8b572e1SStephen Rothwell 
257b8b572e1SStephen Rothwell 	u64	pad_0x01c8;					/* 0x01c8 */
258b8b572e1SStephen Rothwell 
259b8b572e1SStephen Rothwell 	u64	slow_fast_timer_1;				/* 0x01d0 */
260b8b572e1SStephen Rothwell 	u64	slow_next_timer_1;				/* 0x01d8 */
261b8b572e1SStephen Rothwell 
262b8b572e1SStephen Rothwell 	u8	pad_0x01e0_0x0208[0x0208 - 0x01e0];		/* 0x01e0 */
263b8b572e1SStephen Rothwell 	u64	mic_exc;					/* 0x0208 */
264b8b572e1SStephen Rothwell #define CBE_MIC_EXC_BLOCK_SCRUB		0x0800000000000000ULL
265b8b572e1SStephen Rothwell #define CBE_MIC_EXC_FAST_SCRUB		0x0100000000000000ULL
266b8b572e1SStephen Rothwell 
267b8b572e1SStephen Rothwell 	u64	mic_mnt_cfg;					/* 0x0210 */
268b8b572e1SStephen Rothwell #define CBE_MIC_MNT_CFG_CHAN_0_POP	0x0002000000000000ULL
269b8b572e1SStephen Rothwell #define CBE_MIC_MNT_CFG_CHAN_1_POP	0x0004000000000000ULL
270b8b572e1SStephen Rothwell 
271b8b572e1SStephen Rothwell 	u64	mic_df_config;					/* 0x0218 */
272b8b572e1SStephen Rothwell #define CBE_MIC_ECC_DISABLE_0		0x4000000000000000ULL
273b8b572e1SStephen Rothwell #define CBE_MIC_ECC_REP_SINGLE_0	0x2000000000000000ULL
274b8b572e1SStephen Rothwell #define CBE_MIC_ECC_DISABLE_1		0x0080000000000000ULL
275b8b572e1SStephen Rothwell #define CBE_MIC_ECC_REP_SINGLE_1	0x0040000000000000ULL
276b8b572e1SStephen Rothwell 
277b8b572e1SStephen Rothwell 	u8	pad_0x0220_0x0230[0x0230 - 0x0220];		/* 0x0220 */
278b8b572e1SStephen Rothwell 	u64	mic_fir;					/* 0x0230 */
279b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_0_ERR	0x0200000000000000ULL
280b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_0_ERR	0x0100000000000000ULL
281b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_1_ERR	0x0080000000000000ULL
282b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_1_ERR	0x0040000000000000ULL
283b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_ERR_MASK	0xffff000000000000ULL
284b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_0_CTE	0x0000020000000000ULL
285b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_0_CTE	0x0000010000000000ULL
286b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_1_CTE	0x0000008000000000ULL
287b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_1_CTE	0x0000004000000000ULL
288b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_CTE_MASK	0x0000ffff00000000ULL
289b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_0_RESET	0x0000000002000000ULL
290b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_0_RESET	0x0000000001000000ULL
291b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_1_RESET	0x0000000000800000ULL
292b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_1_RESET	0x0000000000400000ULL
293b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_RESET_MASK	0x00000000ffff0000ULL
294b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_0_SET	0x0000000000000200ULL
295b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_0_SET	0x0000000000000100ULL
296b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SINGLE_1_SET	0x0000000000000080ULL
297b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_MULTI_1_SET	0x0000000000000040ULL
298b8b572e1SStephen Rothwell #define CBE_MIC_FIR_ECC_SET_MASK	0x000000000000ffffULL
299b8b572e1SStephen Rothwell 	u64	mic_fir_debug;					/* 0x0238 */
300b8b572e1SStephen Rothwell 
301b8b572e1SStephen Rothwell 	u8	pad_0x0240_0x1000[0x1000 - 0x0240];		/* 0x0240 */
302b8b572e1SStephen Rothwell };
303b8b572e1SStephen Rothwell 
304b8b572e1SStephen Rothwell extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
305b8b572e1SStephen Rothwell extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu);
306b8b572e1SStephen Rothwell 
3079413c883SGeert Uytterhoeven 
3089413c883SGeert Uytterhoeven /* Cell page table entries */
3099413c883SGeert Uytterhoeven #define CBE_IOPTE_PP_W		0x8000000000000000ul /* protection: write */
3109413c883SGeert Uytterhoeven #define CBE_IOPTE_PP_R		0x4000000000000000ul /* protection: read */
3119413c883SGeert Uytterhoeven #define CBE_IOPTE_M		0x2000000000000000ul /* coherency required */
3129413c883SGeert Uytterhoeven #define CBE_IOPTE_SO_R		0x1000000000000000ul /* ordering: writes */
3139413c883SGeert Uytterhoeven #define CBE_IOPTE_SO_RW		0x1800000000000000ul /* ordering: r & w */
3149413c883SGeert Uytterhoeven #define CBE_IOPTE_RPN_Mask	0x07fffffffffff000ul /* RPN */
3159413c883SGeert Uytterhoeven #define CBE_IOPTE_H		0x0000000000000800ul /* cache hint */
3169413c883SGeert Uytterhoeven #define CBE_IOPTE_IOID_Mask	0x00000000000007fful /* ioid */
3179413c883SGeert Uytterhoeven 
318b8b572e1SStephen Rothwell /* some utility functions to deal with SMT */
319b8b572e1SStephen Rothwell extern u32 cbe_get_hw_thread_id(int cpu);
320b8b572e1SStephen Rothwell extern u32 cbe_cpu_to_node(int cpu);
321b8b572e1SStephen Rothwell extern u32 cbe_node_to_cpu(int node);
322b8b572e1SStephen Rothwell 
323b8b572e1SStephen Rothwell /* Init this module early */
324b8b572e1SStephen Rothwell extern void cbe_regs_init(void);
325b8b572e1SStephen Rothwell 
326b8b572e1SStephen Rothwell 
327b8b572e1SStephen Rothwell #endif /* CBE_REGS_H */
328