blob: 02bdbc1cd6e7e519ff4246b45f41eae94fa48c3b [file] [log] [blame]
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +02001/*
2 * cbe_regs.h
3 *
4 * This file is intended to hold the various register definitions for CBE
5 * on-chip system devices (memory controller, IO controller, etc...)
6 *
David Erb22b8c9f2006-10-24 18:31:20 +02007 * (C) Copyright IBM Corporation 2001,2006
8 *
9 * Authors: Maximino Aguilar (maguilar@us.ibm.com)
10 * David J. Erb (djerb@us.ibm.com)
11 *
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +020012 * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
13 */
14
15#ifndef CBE_REGS_H
16#define CBE_REGS_H
17
18/*
19 *
20 * Some HID register definitions
21 *
22 */
23
24/* CBE specific HID0 bits */
25#define HID0_CBE_THERM_WAKEUP 0x0000020000000000ul
26#define HID0_CBE_SYSERR_WAKEUP 0x0000008000000000ul
27#define HID0_CBE_THERM_INT_EN 0x0000000400000000ul
28#define HID0_CBE_SYSERR_INT_EN 0x0000000200000000ul
29
David Erb22b8c9f2006-10-24 18:31:20 +020030#define MAX_CBE 2
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +020031
32/*
33 *
34 * Pervasive unit register definitions
35 *
36 */
37
David Erb22b8c9f2006-10-24 18:31:20 +020038union spe_reg {
39 u64 val;
40 u8 spe[8];
41};
42
43union ppe_spe_reg {
44 u64 val;
45 struct {
46 u32 ppe;
47 u32 spe;
48 };
49};
50
51
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +020052struct cbe_pmd_regs {
David Erb22b8c9f2006-10-24 18:31:20 +020053 /* Debug Bus Control */
54 u64 pad_0x0000; /* 0x0000 */
55
56 u64 group_control; /* 0x0008 */
57
58 u8 pad_0x0010_0x00a8 [0x00a8 - 0x0010]; /* 0x0010 */
59
60 u64 debug_bus_control; /* 0x00a8 */
61
62 u8 pad_0x00b0_0x0100 [0x0100 - 0x00b0]; /* 0x00b0 */
63
64 u64 trace_aux_data; /* 0x0100 */
65 u64 trace_buffer_0_63; /* 0x0108 */
66 u64 trace_buffer_64_127; /* 0x0110 */
67 u64 trace_address; /* 0x0118 */
68 u64 ext_tr_timer; /* 0x0120 */
69
70 u8 pad_0x0128_0x0400 [0x0400 - 0x0128]; /* 0x0128 */
71
72 /* Performance Monitor */
73 u64 pm_status; /* 0x0400 */
74 u64 pm_control; /* 0x0408 */
75 u64 pm_interval; /* 0x0410 */
76 u64 pm_ctr[4]; /* 0x0418 */
77 u64 pm_start_stop; /* 0x0438 */
78 u64 pm07_control[8]; /* 0x0440 */
79
80 u8 pad_0x0480_0x0800 [0x0800 - 0x0480]; /* 0x0480 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +020081
82 /* Thermal Sensor Registers */
David Erb22b8c9f2006-10-24 18:31:20 +020083 union spe_reg ts_ctsr1; /* 0x0800 */
84 u64 ts_ctsr2; /* 0x0808 */
85 union spe_reg ts_mtsr1; /* 0x0810 */
86 u64 ts_mtsr2; /* 0x0818 */
87 union spe_reg ts_itr1; /* 0x0820 */
88 u64 ts_itr2; /* 0x0828 */
89 u64 ts_gitr; /* 0x0830 */
90 u64 ts_isr; /* 0x0838 */
91 u64 ts_imr; /* 0x0840 */
92 union spe_reg tm_cr1; /* 0x0848 */
93 u64 tm_cr2; /* 0x0850 */
94 u64 tm_simr; /* 0x0858 */
95 union ppe_spe_reg tm_tpr; /* 0x0860 */
96 union spe_reg tm_str1; /* 0x0868 */
97 u64 tm_str2; /* 0x0870 */
98 union ppe_spe_reg tm_tsr; /* 0x0878 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +020099
100 /* Power Management */
David Erb22b8c9f2006-10-24 18:31:20 +0200101 u64 pmcr; /* 0x0880 */
102#define CBE_PMD_PAUSE_ZERO_CONTROL 0x10000
103 u64 pmsr; /* 0x0888 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200104
105 /* Time Base Register */
David Erb22b8c9f2006-10-24 18:31:20 +0200106 u64 tbr; /* 0x0890 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200107
David Erb22b8c9f2006-10-24 18:31:20 +0200108 u8 pad_0x0898_0x0c00 [0x0c00 - 0x0898]; /* 0x0898 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200109
110 /* Fault Isolation Registers */
David Erb22b8c9f2006-10-24 18:31:20 +0200111 u64 checkstop_fir; /* 0x0c00 */
112 u64 recoverable_fir; /* 0x0c08 */
113 u64 spec_att_mchk_fir; /* 0x0c10 */
114 u64 fir_mode_reg; /* 0x0c18 */
115 u64 fir_enable_mask; /* 0x0c20 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200116
David Erb22b8c9f2006-10-24 18:31:20 +0200117 u8 pad_0x0c28_0x1000 [0x1000 - 0x0c28]; /* 0x0c28 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200118};
119
120extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np);
121extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu);
122
123/*
124 *
125 * IIC unit register definitions
126 *
127 */
128
129struct cbe_iic_pending_bits {
130 u32 data;
131 u8 flags;
132 u8 class;
133 u8 source;
134 u8 prio;
135};
136
137#define CBE_IIC_IRQ_VALID 0x80
138#define CBE_IIC_IRQ_IPI 0x40
139
140struct cbe_iic_thread_regs {
141 struct cbe_iic_pending_bits pending;
142 struct cbe_iic_pending_bits pending_destr;
143 u64 generate;
144 u64 prio;
145};
146
147struct cbe_iic_regs {
148 u8 pad_0x0000_0x0400[0x0400 - 0x0000]; /* 0x0000 */
149
150 /* IIC interrupt registers */
151 struct cbe_iic_thread_regs thread[2]; /* 0x0400 */
David Erb22b8c9f2006-10-24 18:31:20 +0200152
153 u64 iic_ir; /* 0x0440 */
154 u64 iic_is; /* 0x0448 */
155#define CBE_IIC_IS_PMI 0x2
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200156
157 u8 pad_0x0450_0x0500[0x0500 - 0x0450]; /* 0x0450 */
158
159 /* IOC FIR */
160 u64 ioc_fir_reset; /* 0x0500 */
David Erb22b8c9f2006-10-24 18:31:20 +0200161 u64 ioc_fir_set; /* 0x0508 */
162 u64 ioc_checkstop_enable; /* 0x0510 */
163 u64 ioc_fir_error_mask; /* 0x0518 */
164 u64 ioc_syserr_enable; /* 0x0520 */
165 u64 ioc_fir; /* 0x0528 */
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200166
167 u8 pad_0x0530_0x1000[0x1000 - 0x0530]; /* 0x0530 */
168};
169
170extern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np);
171extern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu);
172
173
David Erb22b8c9f2006-10-24 18:31:20 +0200174struct cbe_mic_tm_regs {
175 u8 pad_0x0000_0x0040[0x0040 - 0x0000]; /* 0x0000 */
176
177 u64 mic_ctl_cnfg2; /* 0x0040 */
178#define CBE_MIC_ENABLE_AUX_TRC 0x8000000000000000LL
179#define CBE_MIC_DISABLE_PWR_SAV_2 0x0200000000000000LL
180#define CBE_MIC_DISABLE_AUX_TRC_WRAP 0x0100000000000000LL
181#define CBE_MIC_ENABLE_AUX_TRC_INT 0x0080000000000000LL
182
183 u64 pad_0x0048; /* 0x0048 */
184
185 u64 mic_aux_trc_base; /* 0x0050 */
186 u64 mic_aux_trc_max_addr; /* 0x0058 */
187 u64 mic_aux_trc_cur_addr; /* 0x0060 */
188 u64 mic_aux_trc_grf_addr; /* 0x0068 */
189 u64 mic_aux_trc_grf_data; /* 0x0070 */
190
191 u64 pad_0x0078; /* 0x0078 */
192
193 u64 mic_ctl_cnfg_0; /* 0x0080 */
194#define CBE_MIC_DISABLE_PWR_SAV_0 0x8000000000000000LL
195
196 u64 pad_0x0088; /* 0x0088 */
197
198 u64 slow_fast_timer_0; /* 0x0090 */
199 u64 slow_next_timer_0; /* 0x0098 */
200
201 u8 pad_0x00a0_0x01c0[0x01c0 - 0x0a0]; /* 0x00a0 */
202
203 u64 mic_ctl_cnfg_1; /* 0x01c0 */
204#define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL
205 u64 pad_0x01c8; /* 0x01c8 */
206
207 u64 slow_fast_timer_1; /* 0x01d0 */
208 u64 slow_next_timer_1; /* 0x01d8 */
209
210 u8 pad_0x01e0_0x1000[0x1000 - 0x01e0]; /* 0x01e0 */
211};
212
213extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
214extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu);
215
Benjamin Herrenschmidtacf7d762006-06-19 20:33:16 +0200216/* Init this module early */
217extern void cbe_regs_init(void);
218
219
220#endif /* CBE_REGS_H */