aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries/lpardata.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/iseries/lpardata.c')
-rw-r--r--arch/powerpc/platforms/iseries/lpardata.c121
1 files changed, 106 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c
index 8162049bb04d..98bd2d37038a 100644
--- a/arch/powerpc/platforms/iseries/lpardata.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -14,10 +14,10 @@
14#include <asm/ptrace.h> 14#include <asm/ptrace.h>
15#include <asm/abs_addr.h> 15#include <asm/abs_addr.h>
16#include <asm/lppaca.h> 16#include <asm/lppaca.h>
17#include <asm/iseries/it_lp_reg_save.h>
18#include <asm/paca.h> 17#include <asm/paca.h>
19#include <asm/iseries/lpar_map.h> 18#include <asm/iseries/lpar_map.h>
20#include <asm/iseries/it_lp_queue.h> 19#include <asm/iseries/it_lp_queue.h>
20#include <asm/iseries/alpaca.h>
21 21
22#include "naca.h" 22#include "naca.h"
23#include "vpd_areas.h" 23#include "vpd_areas.h"
@@ -31,7 +31,7 @@
31/* The HvReleaseData is the root of the information shared between 31/* The HvReleaseData is the root of the information shared between
32 * the hypervisor and Linux. 32 * the hypervisor and Linux.
33 */ 33 */
34struct HvReleaseData hvReleaseData = { 34const struct HvReleaseData hvReleaseData = {
35 .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */ 35 .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */
36 .xSize = sizeof(struct HvReleaseData), 36 .xSize = sizeof(struct HvReleaseData),
37 .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas), 37 .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas),
@@ -61,6 +61,63 @@ struct naca_struct naca = {
61 .xRamDiskSize = 0, 61 .xRamDiskSize = 0,
62}; 62};
63 63
64struct ItLpRegSave {
65 u32 xDesc; // Eye catcher "LpRS" ebcdic 000-003
66 u16 xSize; // Size of this class 004-005
67 u8 xInUse; // Area is live 006-007
68 u8 xRsvd1[9]; // Reserved 007-00F
69
70 u8 xFixedRegSave[352]; // Fixed Register Save Area 010-16F
71 u32 xCTRL; // Control Register 170-173
72 u32 xDEC; // Decrementer 174-177
73 u32 xFPSCR; // FP Status and Control Reg 178-17B
74 u32 xPVR; // Processor Version Number 17C-17F
75
76 u64 xMMCR0; // Monitor Mode Control Reg 0 180-187
77 u32 xPMC1; // Perf Monitor Counter 1 188-18B
78 u32 xPMC2; // Perf Monitor Counter 2 18C-18F
79 u32 xPMC3; // Perf Monitor Counter 3 190-193
80 u32 xPMC4; // Perf Monitor Counter 4 194-197
81 u32 xPIR; // Processor ID Reg 198-19B
82
83 u32 xMMCR1; // Monitor Mode Control Reg 1 19C-19F
84 u32 xMMCRA; // Monitor Mode Control Reg A 1A0-1A3
85 u32 xPMC5; // Perf Monitor Counter 5 1A4-1A7
86 u32 xPMC6; // Perf Monitor Counter 6 1A8-1AB
87 u32 xPMC7; // Perf Monitor Counter 7 1AC-1AF
88 u32 xPMC8; // Perf Monitor Counter 8 1B0-1B3
89 u32 xTSC; // Thread Switch Control 1B4-1B7
90 u32 xTST; // Thread Switch Timeout 1B8-1BB
91 u32 xRsvd; // Reserved 1BC-1BF
92
93 u64 xACCR; // Address Compare Control Reg 1C0-1C7
94 u64 xIMR; // Instruction Match Register 1C8-1CF
95 u64 xSDR1; // Storage Description Reg 1 1D0-1D7
96 u64 xSPRG0; // Special Purpose Reg General0 1D8-1DF
97 u64 xSPRG1; // Special Purpose Reg General1 1E0-1E7
98 u64 xSPRG2; // Special Purpose Reg General2 1E8-1EF
99 u64 xSPRG3; // Special Purpose Reg General3 1F0-1F7
100 u64 xTB; // Time Base Register 1F8-1FF
101
102 u64 xFPR[32]; // Floating Point Registers 200-2FF
103
104 u64 xMSR; // Machine State Register 300-307
105 u64 xNIA; // Next Instruction Address 308-30F
106
107 u64 xDABR; // Data Address Breakpoint Reg 310-317
108 u64 xIABR; // Inst Address Breakpoint Reg 318-31F
109
110 u64 xHID0; // HW Implementation Dependent0 320-327
111
112 u64 xHID4; // HW Implementation Dependent4 328-32F
113 u64 xSCOMd; // SCON Data Reg (SPRG4) 330-337
114 u64 xSCOMc; // SCON Command Reg (SPRG5) 338-33F
115 u64 xSDAR; // Sample Data Address Register 340-347
116 u64 xSIAR; // Sample Inst Address Register 348-34F
117
118 u8 xRsvd3[176]; // Reserved 350-3FF
119};
120
64extern void system_reset_iSeries(void); 121extern void system_reset_iSeries(void);
65extern void machine_check_iSeries(void); 122extern void machine_check_iSeries(void);
66extern void data_access_iSeries(void); 123extern void data_access_iSeries(void);
@@ -129,7 +186,7 @@ struct ItLpNaca itLpNaca = {
129}; 186};
130 187
131/* May be filled in by the hypervisor so cannot end up in the BSS */ 188/* May be filled in by the hypervisor so cannot end up in the BSS */
132struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data"))); 189static struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
133 190
134/* May be filled in by the hypervisor so cannot end up in the BSS */ 191/* May be filled in by the hypervisor so cannot end up in the BSS */
135struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data"))); 192struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
@@ -152,13 +209,54 @@ u64 xMsVpd[3400] __attribute__((__section__(".data")));
152 209
153/* Space for Recovery Log Buffer */ 210/* Space for Recovery Log Buffer */
154/* May be filled in by the hypervisor so cannot end up in the BSS */ 211/* May be filled in by the hypervisor so cannot end up in the BSS */
155u64 xRecoveryLogBuffer[32] __attribute__((__section__(".data"))); 212static u64 xRecoveryLogBuffer[32] __attribute__((__section__(".data")));
156 213
157struct SpCommArea xSpCommArea = { 214static const struct SpCommArea xSpCommArea = {
158 .xDesc = 0xE2D7C3C2, 215 .xDesc = 0xE2D7C3C2,
159 .xFormat = 1, 216 .xFormat = 1,
160}; 217};
161 218
219static const struct ItLpRegSave iseries_reg_save[] = {
220 [0 ... (NR_CPUS-1)] = {
221 .xDesc = 0xd397d9e2, /* "LpRS" */
222 .xSize = sizeof(struct ItLpRegSave),
223 },
224};
225
226#define ALPACA_INIT(number) \
227{ \
228 .lppaca_ptr = &lppaca[number], \
229 .reg_save_ptr = &iseries_reg_save[number], \
230}
231
232const struct alpaca alpaca[] = {
233 ALPACA_INIT( 0),
234#if NR_CPUS > 1
235 ALPACA_INIT( 1), ALPACA_INIT( 2), ALPACA_INIT( 3),
236#if NR_CPUS > 4
237 ALPACA_INIT( 4), ALPACA_INIT( 5), ALPACA_INIT( 6), ALPACA_INIT( 7),
238#if NR_CPUS > 8
239 ALPACA_INIT( 8), ALPACA_INIT( 9), ALPACA_INIT(10), ALPACA_INIT(11),
240 ALPACA_INIT(12), ALPACA_INIT(13), ALPACA_INIT(14), ALPACA_INIT(15),
241 ALPACA_INIT(16), ALPACA_INIT(17), ALPACA_INIT(18), ALPACA_INIT(19),
242 ALPACA_INIT(20), ALPACA_INIT(21), ALPACA_INIT(22), ALPACA_INIT(23),
243 ALPACA_INIT(24), ALPACA_INIT(25), ALPACA_INIT(26), ALPACA_INIT(27),
244 ALPACA_INIT(28), ALPACA_INIT(29), ALPACA_INIT(30), ALPACA_INIT(31),
245#if NR_CPUS > 32
246 ALPACA_INIT(32), ALPACA_INIT(33), ALPACA_INIT(34), ALPACA_INIT(35),
247 ALPACA_INIT(36), ALPACA_INIT(37), ALPACA_INIT(38), ALPACA_INIT(39),
248 ALPACA_INIT(40), ALPACA_INIT(41), ALPACA_INIT(42), ALPACA_INIT(43),
249 ALPACA_INIT(44), ALPACA_INIT(45), ALPACA_INIT(46), ALPACA_INIT(47),
250 ALPACA_INIT(48), ALPACA_INIT(49), ALPACA_INIT(50), ALPACA_INIT(51),
251 ALPACA_INIT(52), ALPACA_INIT(53), ALPACA_INIT(54), ALPACA_INIT(55),
252 ALPACA_INIT(56), ALPACA_INIT(57), ALPACA_INIT(58), ALPACA_INIT(59),
253 ALPACA_INIT(60), ALPACA_INIT(61), ALPACA_INIT(62), ALPACA_INIT(63),
254#endif
255#endif
256#endif
257#endif
258};
259
162/* The LparMap data is now located at offset 0x6000 in head.S 260/* The LparMap data is now located at offset 0x6000 in head.S
163 * It was put there so that the HvReleaseData could address it 261 * It was put there so that the HvReleaseData could address it
164 * with a 32-bit offset as required by the iSeries hypervisor 262 * with a 32-bit offset as required by the iSeries hypervisor
@@ -167,7 +265,7 @@ struct SpCommArea xSpCommArea = {
167 * the Naca via the HvReleaseData area. The HvReleaseData has the 265 * the Naca via the HvReleaseData area. The HvReleaseData has the
168 * offset into the Naca of the pointer to the ItVpdAreas. 266 * offset into the Naca of the pointer to the ItVpdAreas.
169 */ 267 */
170struct ItVpdAreas itVpdAreas = { 268const struct ItVpdAreas itVpdAreas = {
171 .xSlicDesc = 0xc9a3e5c1, /* "ItVA" */ 269 .xSlicDesc = 0xc9a3e5c1, /* "ItVA" */
172 .xSlicSize = sizeof(struct ItVpdAreas), 270 .xSlicSize = sizeof(struct ItVpdAreas),
173 .xSlicVpdEntries = ItVpdMaxEntries, /* # VPD array entries */ 271 .xSlicVpdEntries = ItVpdMaxEntries, /* # VPD array entries */
@@ -185,7 +283,7 @@ struct ItVpdAreas itVpdAreas = {
185 .xSlicVpdLens = { /* VPD lengths */ 283 .xSlicVpdLens = { /* VPD lengths */
186 0,0,0, /* 0 - 2 */ 284 0,0,0, /* 0 - 2 */
187 sizeof(xItExtVpdPanel), /* 3 Extended VPD */ 285 sizeof(xItExtVpdPanel), /* 3 Extended VPD */
188 sizeof(struct paca_struct), /* 4 length of Paca */ 286 sizeof(struct alpaca), /* 4 length of (fake) Paca */
189 0, /* 5 */ 287 0, /* 5 */
190 sizeof(struct ItIplParmsReal),/* 6 length of IPL parms */ 288 sizeof(struct ItIplParmsReal),/* 6 length of IPL parms */
191 26992, /* 7 length of MS VPD */ 289 26992, /* 7 length of MS VPD */
@@ -203,7 +301,7 @@ struct ItVpdAreas itVpdAreas = {
203 .xSlicVpdAdrs = { /* VPD addresses */ 301 .xSlicVpdAdrs = { /* VPD addresses */
204 0,0,0, /* 0 - 2 */ 302 0,0,0, /* 0 - 2 */
205 &xItExtVpdPanel, /* 3 Extended VPD */ 303 &xItExtVpdPanel, /* 3 Extended VPD */
206 &paca[0], /* 4 first Paca */ 304 &alpaca[0], /* 4 first (fake) Paca */
207 0, /* 5 */ 305 0, /* 5 */
208 &xItIplParmsReal, /* 6 IPL parms */ 306 &xItIplParmsReal, /* 6 IPL parms */
209 &xMsVpd, /* 7 MS Vpd */ 307 &xMsVpd, /* 7 MS Vpd */
@@ -219,10 +317,3 @@ struct ItVpdAreas itVpdAreas = {
219 0,0 317 0,0
220 } 318 }
221}; 319};
222
223struct ItLpRegSave iseries_reg_save[] = {
224 [0 ... (NR_CPUS-1)] = {
225 .xDesc = 0xd397d9e2, /* "LpRS" */
226 .xSize = sizeof(struct ItLpRegSave),
227 },
228};