aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 16:42:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 16:42:59 -0400
commit235c7b9feb8779c7c289ed614324baebf3651bf9 (patch)
tree477efafb74b56eb67f35312f2967ed8f4099d22e /arch/powerpc/include
parentbdfc7cbdeef8cadba0e5793079ac0130b8e2220c (diff)
parentcd427485357c0c4b99f69719251baacf25946e11 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull main powerpc updates from Ben Herrenschmidt: "This time around, the powerpc merges are going to be a little bit more complicated than usual. This is the main pull request with most of the work for this merge window. I will describe it a bit more further down. There is some additional cpuidle driver work, however I haven't included it in this tree as it depends on some work in tip/timer-core which Thomas accidentally forgot to put in a topic branch. Since I didn't want to carry all of that tip timer stuff in powerpc -next, I setup a separate branch on top of Thomas tree with just that cpuidle driver in it, and Stephen has been carrying that in next separately for a while now. I'll send a separate pull request for it. Additionally, two new pieces in this tree add users for a sysfs API that Tejun and Greg have been deprecating in drivers-core-next. Thankfully Greg reverted the patch that removes the old API so this merge can happen cleanly, but once merged, I will send a patch adjusting our new code to the new API so that Greg can send you the removal patch. Now as for the content of this branch, we have a lot of perf work for power8 new counters including support for our new "nest" counters (also called 24x7) under pHyp (not natively yet). We have new functionality when running under the OPAL firmware (non-virtualized or KVM host), such as access to the firmware error logs and service processor dumps, system parameters and sensors, along with a hwmon driver for the latter. There's also a bunch of bug fixes accross the board, some LE fixes, and a nice set of selftests for validating our various types of copy loops. On the Freescale side, we see mostly new chip/board revisions, some clock updates, better support for machine checks and debug exceptions, etc..." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (70 commits) powerpc/book3s: Fix CFAR clobbering issue in machine check handler. powerpc/compat: 32-bit little endian machine name is ppcle, not ppc powerpc/le: Big endian arguments for ppc_rtas() powerpc: Use default set of netfilter modules (CONFIG_NETFILTER_ADVANCED=n) powerpc/defconfigs: Enable THP in pseries defconfig powerpc/mm: Make sure a local_irq_disable prevent a parallel THP split powerpc: Rate-limit users spamming kernel log buffer powerpc/perf: Fix handling of L3 events with bank == 1 powerpc/perf/hv_{gpci, 24x7}: Add documentation of device attributes powerpc/perf: Add kconfig option for hypervisor provided counters powerpc/perf: Add support for the hv 24x7 interface powerpc/perf: Add support for the hv gpci (get performance counter info) interface powerpc/perf: Add macros for defining event fields & formats powerpc/perf: Add a shared interface to get gpci version and capabilities powerpc/perf: Add 24x7 interface headers powerpc/perf: Add hv_gpci interface header powerpc: Add hvcalls for 24x7 and gpci (Get Performance Counter Info) sysfs: create bin_attributes under the requested group powerpc/perf: Enable BHRB access for EBB events powerpc/perf: Add BHRB constraint and IFM MMCRA handling for EBB ...
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/compat.h4
-rw-r--r--arch/powerpc/include/asm/cputable.h6
-rw-r--r--arch/powerpc/include/asm/exception-64e.h15
-rw-r--r--arch/powerpc/include/asm/exception-64s.h8
-rw-r--r--arch/powerpc/include/asm/hvcall.h5
-rw-r--r--arch/powerpc/include/asm/kvm_booke_hv_asm.h17
-rw-r--r--arch/powerpc/include/asm/machdep.h7
-rw-r--r--arch/powerpc/include/asm/mce.h3
-rw-r--r--arch/powerpc/include/asm/mmu-book3e.h9
-rw-r--r--arch/powerpc/include/asm/opal.h60
-rw-r--r--arch/powerpc/include/asm/paca.h9
-rw-r--r--arch/powerpc/include/asm/perf_event_server.h1
-rw-r--r--arch/powerpc/include/asm/reg.h18
-rw-r--r--arch/powerpc/include/asm/rtas.h1
14 files changed, 126 insertions, 37 deletions
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index a613d2c82fd9..b142b8e0ed9e 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -8,7 +8,11 @@
8#include <linux/sched.h> 8#include <linux/sched.h>
9 9
10#define COMPAT_USER_HZ 100 10#define COMPAT_USER_HZ 100
11#ifdef __BIG_ENDIAN__
11#define COMPAT_UTS_MACHINE "ppc\0\0" 12#define COMPAT_UTS_MACHINE "ppc\0\0"
13#else
14#define COMPAT_UTS_MACHINE "ppcle\0\0"
15#endif
12 16
13typedef u32 compat_size_t; 17typedef u32 compat_size_t;
14typedef s32 compat_ssize_t; 18typedef s32 compat_ssize_t;
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 617cc767c076..bc2347774f0a 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -189,6 +189,7 @@ extern const char *powerpc_base_platform;
189#define CPU_FTR_HAS_PPR LONG_ASM_CONST(0x0200000000000000) 189#define CPU_FTR_HAS_PPR LONG_ASM_CONST(0x0200000000000000)
190#define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000) 190#define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000)
191#define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000) 191#define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000)
192#define CPU_FTR_PMAO_BUG LONG_ASM_CONST(0x1000000000000000)
192 193
193#ifndef __ASSEMBLY__ 194#ifndef __ASSEMBLY__
194 195
@@ -445,6 +446,7 @@ extern const char *powerpc_base_platform;
445 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \ 446 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
446 CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \ 447 CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
447 CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP) 448 CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP)
449#define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG)
448#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 450#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
449 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 451 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
450 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 452 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -466,8 +468,8 @@ extern const char *powerpc_base_platform;
466#define CPU_FTRS_POSSIBLE \ 468#define CPU_FTRS_POSSIBLE \
467 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 469 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
468 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 470 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \
469 CPU_FTRS_POWER7 | CPU_FTRS_POWER8 | CPU_FTRS_CELL | \ 471 CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \
470 CPU_FTRS_PA6T | CPU_FTR_VSX) 472 CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_VSX)
471#endif 473#endif
472#else 474#else
473enum { 475enum {
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h
index 51fa43e536b9..a563d9afd179 100644
--- a/arch/powerpc/include/asm/exception-64e.h
+++ b/arch/powerpc/include/asm/exception-64e.h
@@ -46,9 +46,8 @@
46#define EX_CR (1 * 8) 46#define EX_CR (1 * 8)
47#define EX_R10 (2 * 8) 47#define EX_R10 (2 * 8)
48#define EX_R11 (3 * 8) 48#define EX_R11 (3 * 8)
49#define EX_R13 (4 * 8) 49#define EX_R14 (4 * 8)
50#define EX_R14 (5 * 8) 50#define EX_R15 (5 * 8)
51#define EX_R15 (6 * 8)
52 51
53/* 52/*
54 * The TLB miss exception uses different slots. 53 * The TLB miss exception uses different slots.
@@ -173,16 +172,6 @@ exc_##label##_book3e:
173 ld r9,EX_TLB_R9(r12); \ 172 ld r9,EX_TLB_R9(r12); \
174 ld r8,EX_TLB_R8(r12); \ 173 ld r8,EX_TLB_R8(r12); \
175 mtlr r16; 174 mtlr r16;
176#define TLB_MISS_PROLOG_STATS_BOLTED \
177 mflr r10; \
178 std r8,PACA_EXTLB+EX_TLB_R8(r13); \
179 std r9,PACA_EXTLB+EX_TLB_R9(r13); \
180 std r10,PACA_EXTLB+EX_TLB_LR(r13);
181#define TLB_MISS_RESTORE_STATS_BOLTED \
182 ld r16,PACA_EXTLB+EX_TLB_LR(r13); \
183 ld r9,PACA_EXTLB+EX_TLB_R9(r13); \
184 ld r8,PACA_EXTLB+EX_TLB_R8(r13); \
185 mtlr r16;
186#define TLB_MISS_STATS_D(name) \ 175#define TLB_MISS_STATS_D(name) \
187 addi r9,r13,MMSTAT_DSTATS+name; \ 176 addi r9,r13,MMSTAT_DSTATS+name; \
188 bl .tlb_stat_inc; 177 bl .tlb_stat_inc;
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 66830618cc19..aeaa56cd9b54 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -147,6 +147,14 @@ BEGIN_FTR_SECTION_NESTED(943) \
147END_FTR_SECTION_NESTED(ftr,ftr,943) 147END_FTR_SECTION_NESTED(ftr,ftr,943)
148 148
149/* 149/*
150 * Set an SPR from a register if the CPU has the given feature
151 */
152#define OPT_SET_SPR(ra, spr, ftr) \
153BEGIN_FTR_SECTION_NESTED(943) \
154 mtspr spr,ra; \
155END_FTR_SECTION_NESTED(ftr,ftr,943)
156
157/*
150 * Save a register to the PACA if the CPU has the given feature 158 * Save a register to the PACA if the CPU has the given feature
151 */ 159 */
152#define OPT_SAVE_REG_TO_PACA(offset, ra, ftr) \ 160#define OPT_SAVE_REG_TO_PACA(offset, ra, ftr) \
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index d8b600b3f058..5dbbb29f5c3e 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -274,6 +274,11 @@
274/* Platform specific hcalls, used by KVM */ 274/* Platform specific hcalls, used by KVM */
275#define H_RTAS 0xf000 275#define H_RTAS 0xf000
276 276
277/* "Platform specific hcalls", provided by PHYP */
278#define H_GET_24X7_CATALOG_PAGE 0xF078
279#define H_GET_24X7_DATA 0xF07C
280#define H_GET_PERF_COUNTER_INFO 0xF080
281
277#ifndef __ASSEMBLY__ 282#ifndef __ASSEMBLY__
278 283
279/** 284/**
diff --git a/arch/powerpc/include/asm/kvm_booke_hv_asm.h b/arch/powerpc/include/asm/kvm_booke_hv_asm.h
index 3a79f5325712..e5f048bbcb7c 100644
--- a/arch/powerpc/include/asm/kvm_booke_hv_asm.h
+++ b/arch/powerpc/include/asm/kvm_booke_hv_asm.h
@@ -36,26 +36,21 @@
36 * *(r8 + GPR11) = saved r11 36 * *(r8 + GPR11) = saved r11
37 * 37 *
38 * 64-bit host 38 * 64-bit host
39 * Expected inputs (GEN/GDBELL/DBG/MC exception types): 39 * Expected inputs (GEN/GDBELL/DBG/CRIT/MC exception types):
40 * r10 = saved CR 40 * r10 = saved CR
41 * r13 = PACA_POINTER 41 * r13 = PACA_POINTER
42 * *(r13 + PACA_EX##type + EX_R10) = saved r10 42 * *(r13 + PACA_EX##type + EX_R10) = saved r10
43 * *(r13 + PACA_EX##type + EX_R11) = saved r11 43 * *(r13 + PACA_EX##type + EX_R11) = saved r11
44 * SPRN_SPRG_##type##_SCRATCH = saved r13 44 * SPRN_SPRG_##type##_SCRATCH = saved r13
45 * 45 *
46 * Expected inputs (CRIT exception type):
47 * r10 = saved CR
48 * r13 = PACA_POINTER
49 * *(r13 + PACA_EX##type + EX_R10) = saved r10
50 * *(r13 + PACA_EX##type + EX_R11) = saved r11
51 * *(r13 + PACA_EX##type + EX_R13) = saved r13
52 *
53 * Expected inputs (TLB exception type): 46 * Expected inputs (TLB exception type):
54 * r10 = saved CR 47 * r10 = saved CR
48 * r12 = extlb pointer
55 * r13 = PACA_POINTER 49 * r13 = PACA_POINTER
56 * *(r13 + PACA_EX##type + EX_TLB_R10) = saved r10 50 * *(r12 + EX_TLB_R10) = saved r10
57 * *(r13 + PACA_EX##type + EX_TLB_R11) = saved r11 51 * *(r12 + EX_TLB_R11) = saved r11
58 * SPRN_SPRG_GEN_SCRATCH = saved r13 52 * *(r12 + EX_TLB_R13) = saved r13
53 * SPRN_SPRG_GEN_SCRATCH = saved r12
59 * 54 *
60 * Only the bolted version of TLB miss exception handlers is supported now. 55 * Only the bolted version of TLB miss exception handlers is supported now.
61 */ 56 */
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index ad3025d0880b..5b6c03f1058f 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -170,6 +170,9 @@ struct machdep_calls {
170 int (*system_reset_exception)(struct pt_regs *regs); 170 int (*system_reset_exception)(struct pt_regs *regs);
171 int (*machine_check_exception)(struct pt_regs *regs); 171 int (*machine_check_exception)(struct pt_regs *regs);
172 172
173 /* Called during machine check exception to retrive fixup address. */
174 bool (*mce_check_early_recovery)(struct pt_regs *regs);
175
173 /* Motherboard/chipset features. This is a kind of general purpose 176 /* Motherboard/chipset features. This is a kind of general purpose
174 * hook used to control some machine specific features (like reset 177 * hook used to control some machine specific features (like reset
175 * lines, chip power control, etc...). 178 * lines, chip power control, etc...).
@@ -279,6 +282,10 @@ struct machdep_calls {
279#ifdef CONFIG_ARCH_RANDOM 282#ifdef CONFIG_ARCH_RANDOM
280 int (*get_random_long)(unsigned long *v); 283 int (*get_random_long)(unsigned long *v);
281#endif 284#endif
285
286#ifdef CONFIG_MEMORY_HOTREMOVE
287 int (*remove_memory)(u64, u64);
288#endif
282}; 289};
283 290
284extern void e500_idle(void); 291extern void e500_idle(void);
diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm/mce.h
index 8e99edf6d966..f97d8cb6bdf6 100644
--- a/arch/powerpc/include/asm/mce.h
+++ b/arch/powerpc/include/asm/mce.h
@@ -187,7 +187,8 @@ struct mce_error_info {
187#define MCE_EVENT_DONTRELEASE false 187#define MCE_EVENT_DONTRELEASE false
188 188
189extern void save_mce_event(struct pt_regs *regs, long handled, 189extern void save_mce_event(struct pt_regs *regs, long handled,
190 struct mce_error_info *mce_err, uint64_t addr); 190 struct mce_error_info *mce_err, uint64_t nip,
191 uint64_t addr);
191extern int get_mce_event(struct machine_check_event *mce, bool release); 192extern int get_mce_event(struct machine_check_event *mce, bool release);
192extern void release_mce_event(void); 193extern void release_mce_event(void);
193extern void machine_check_queue_event(void); 194extern void machine_check_queue_event(void);
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h
index 89b785d16846..901dac6b6cb7 100644
--- a/arch/powerpc/include/asm/mmu-book3e.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -287,11 +287,14 @@ extern int mmu_linear_psize;
287extern int mmu_vmemmap_psize; 287extern int mmu_vmemmap_psize;
288 288
289struct tlb_core_data { 289struct tlb_core_data {
290 /*
291 * Per-core spinlock for e6500 TLB handlers (no tlbsrx.)
292 * Must be the first struct element.
293 */
294 u8 lock;
295
290 /* For software way selection, as on Freescale TLB1 */ 296 /* For software way selection, as on Freescale TLB1 */
291 u8 esel_next, esel_max, esel_first; 297 u8 esel_next, esel_max, esel_first;
292
293 /* Per-core spinlock for e6500 TLB handlers (no tlbsrx.) */
294 u8 lock;
295}; 298};
296 299
297#ifdef CONFIG_PPC64 300#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index ed82142a3251..ffafab037ba8 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -83,6 +83,8 @@ extern int opal_enter_rtas(struct rtas_args *args,
83#define OPAL_INTERNAL_ERROR -11 83#define OPAL_INTERNAL_ERROR -11
84#define OPAL_BUSY_EVENT -12 84#define OPAL_BUSY_EVENT -12
85#define OPAL_HARDWARE_FROZEN -13 85#define OPAL_HARDWARE_FROZEN -13
86#define OPAL_WRONG_STATE -14
87#define OPAL_ASYNC_COMPLETION -15
86 88
87/* API Tokens (in r0) */ 89/* API Tokens (in r0) */
88#define OPAL_CONSOLE_WRITE 1 90#define OPAL_CONSOLE_WRITE 1
@@ -151,12 +153,26 @@ extern int opal_enter_rtas(struct rtas_args *args,
151#define OPAL_LPC_READ 67 153#define OPAL_LPC_READ 67
152#define OPAL_LPC_WRITE 68 154#define OPAL_LPC_WRITE 68
153#define OPAL_RETURN_CPU 69 155#define OPAL_RETURN_CPU 69
156#define OPAL_ELOG_READ 71
157#define OPAL_ELOG_WRITE 72
158#define OPAL_ELOG_ACK 73
159#define OPAL_ELOG_RESEND 74
160#define OPAL_ELOG_SIZE 75
154#define OPAL_FLASH_VALIDATE 76 161#define OPAL_FLASH_VALIDATE 76
155#define OPAL_FLASH_MANAGE 77 162#define OPAL_FLASH_MANAGE 77
156#define OPAL_FLASH_UPDATE 78 163#define OPAL_FLASH_UPDATE 78
164#define OPAL_DUMP_INIT 81
165#define OPAL_DUMP_INFO 82
166#define OPAL_DUMP_READ 83
167#define OPAL_DUMP_ACK 84
157#define OPAL_GET_MSG 85 168#define OPAL_GET_MSG 85
158#define OPAL_CHECK_ASYNC_COMPLETION 86 169#define OPAL_CHECK_ASYNC_COMPLETION 86
159#define OPAL_SYNC_HOST_REBOOT 87 170#define OPAL_SYNC_HOST_REBOOT 87
171#define OPAL_SENSOR_READ 88
172#define OPAL_GET_PARAM 89
173#define OPAL_SET_PARAM 90
174#define OPAL_DUMP_RESEND 91
175#define OPAL_DUMP_INFO2 94
160 176
161#ifndef __ASSEMBLY__ 177#ifndef __ASSEMBLY__
162 178
@@ -237,11 +253,14 @@ enum OpalPendingState {
237 OPAL_EVENT_EPOW = 0x80, 253 OPAL_EVENT_EPOW = 0x80,
238 OPAL_EVENT_LED_STATUS = 0x100, 254 OPAL_EVENT_LED_STATUS = 0x100,
239 OPAL_EVENT_PCI_ERROR = 0x200, 255 OPAL_EVENT_PCI_ERROR = 0x200,
256 OPAL_EVENT_DUMP_AVAIL = 0x400,
240 OPAL_EVENT_MSG_PENDING = 0x800, 257 OPAL_EVENT_MSG_PENDING = 0x800,
241}; 258};
242 259
243enum OpalMessageType { 260enum OpalMessageType {
244 OPAL_MSG_ASYNC_COMP = 0, 261 OPAL_MSG_ASYNC_COMP = 0, /* params[0] = token, params[1] = rc,
262 * additional params function-specific
263 */
245 OPAL_MSG_MEM_ERR, 264 OPAL_MSG_MEM_ERR,
246 OPAL_MSG_EPOW, 265 OPAL_MSG_EPOW,
247 OPAL_MSG_SHUTDOWN, 266 OPAL_MSG_SHUTDOWN,
@@ -394,6 +413,13 @@ enum OpalLPCAddressType {
394 OPAL_LPC_FW = 2, 413 OPAL_LPC_FW = 2,
395}; 414};
396 415
416/* System parameter permission */
417enum OpalSysparamPerm {
418 OPAL_SYSPARAM_READ = 0x1,
419 OPAL_SYSPARAM_WRITE = 0x2,
420 OPAL_SYSPARAM_RW = (OPAL_SYSPARAM_READ | OPAL_SYSPARAM_WRITE),
421};
422
397struct opal_msg { 423struct opal_msg {
398 uint32_t msg_type; 424 uint32_t msg_type;
399 uint32_t reserved; 425 uint32_t reserved;
@@ -823,16 +849,37 @@ int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type,
823 uint32_t addr, uint32_t data, uint32_t sz); 849 uint32_t addr, uint32_t data, uint32_t sz);
824int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, 850int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type,
825 uint32_t addr, __be32 *data, uint32_t sz); 851 uint32_t addr, __be32 *data, uint32_t sz);
852
853int64_t opal_read_elog(uint64_t buffer, size_t size, uint64_t log_id);
854int64_t opal_get_elog_size(uint64_t *log_id, size_t *size, uint64_t *elog_type);
855int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset);
856int64_t opal_send_ack_elog(uint64_t log_id);
857void opal_resend_pending_logs(void);
858
826int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); 859int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result);
827int64_t opal_manage_flash(uint8_t op); 860int64_t opal_manage_flash(uint8_t op);
828int64_t opal_update_flash(uint64_t blk_list); 861int64_t opal_update_flash(uint64_t blk_list);
862int64_t opal_dump_init(uint8_t dump_type);
863int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size);
864int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type);
865int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
866int64_t opal_dump_ack(uint32_t dump_id);
867int64_t opal_dump_resend_notification(void);
829 868
830int64_t opal_get_msg(uint64_t buffer, size_t size); 869int64_t opal_get_msg(uint64_t buffer, size_t size);
831int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token); 870int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token);
832int64_t opal_sync_host_reboot(void); 871int64_t opal_sync_host_reboot(void);
872int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer,
873 size_t length);
874int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer,
875 size_t length);
876int64_t opal_sensor_read(uint32_t sensor_hndl, int token,
877 uint32_t *sensor_data);
833 878
834/* Internal functions */ 879/* Internal functions */
835extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data); 880extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data);
881extern int early_init_dt_scan_recoverable_ranges(unsigned long node,
882 const char *uname, int depth, void *data);
836 883
837extern int opal_get_chars(uint32_t vtermno, char *buf, int count); 884extern int opal_get_chars(uint32_t vtermno, char *buf, int count);
838extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); 885extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len);
@@ -853,6 +900,13 @@ extern void opal_notifier_update_evt(uint64_t evt_mask, uint64_t evt_val);
853extern int opal_get_chars(uint32_t vtermno, char *buf, int count); 900extern int opal_get_chars(uint32_t vtermno, char *buf, int count);
854extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); 901extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len);
855 902
903extern int __opal_async_get_token(void);
904extern int opal_async_get_token_interruptible(void);
905extern int __opal_async_release_token(int token);
906extern int opal_async_release_token(int token);
907extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg);
908extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data);
909
856extern void hvc_opal_init_early(void); 910extern void hvc_opal_init_early(void);
857 911
858struct rtc_time; 912struct rtc_time;
@@ -861,8 +915,12 @@ extern void opal_get_rtc_time(struct rtc_time *tm);
861extern unsigned long opal_get_boot_time(void); 915extern unsigned long opal_get_boot_time(void);
862extern void opal_nvram_init(void); 916extern void opal_nvram_init(void);
863extern void opal_flash_init(void); 917extern void opal_flash_init(void);
918extern int opal_elog_init(void);
919extern void opal_platform_dump_init(void);
920extern void opal_sys_param_init(void);
864 921
865extern int opal_machine_check(struct pt_regs *regs); 922extern int opal_machine_check(struct pt_regs *regs);
923extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
866 924
867extern void opal_shutdown(void); 925extern void opal_shutdown(void);
868 926
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 9c5dbc3833fb..8e956a0b6e85 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -116,8 +116,11 @@ struct paca_struct {
116 /* Shared by all threads of a core -- points to tcd of first thread */ 116 /* Shared by all threads of a core -- points to tcd of first thread */
117 struct tlb_core_data *tcd_ptr; 117 struct tlb_core_data *tcd_ptr;
118 118
119 /* We can have up to 3 levels of reentrancy in the TLB miss handler */ 119 /*
120 u64 extlb[3][EX_TLB_SIZE / sizeof(u64)]; 120 * We can have up to 3 levels of reentrancy in the TLB miss handler,
121 * in each of four exception levels (normal, crit, mcheck, debug).
122 */
123 u64 extlb[12][EX_TLB_SIZE / sizeof(u64)];
121 u64 exmc[8]; /* used for machine checks */ 124 u64 exmc[8]; /* used for machine checks */
122 u64 excrit[8]; /* used for crit interrupts */ 125 u64 excrit[8]; /* used for crit interrupts */
123 u64 exdbg[8]; /* used for debug interrupts */ 126 u64 exdbg[8]; /* used for debug interrupts */
@@ -146,7 +149,7 @@ struct paca_struct {
146 u8 io_sync; /* writel() needs spin_unlock sync */ 149 u8 io_sync; /* writel() needs spin_unlock sync */
147 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */ 150 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */
148 u8 nap_state_lost; /* NV GPR values lost in power7_idle */ 151 u8 nap_state_lost; /* NV GPR values lost in power7_idle */
149 u64 sprg3; /* Saved user-visible sprg */ 152 u64 sprg_vdso; /* Saved user-visible sprg */
150#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 153#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
151 u64 tm_scratch; /* TM scratch area for reclaim */ 154 u64 tm_scratch; /* TM scratch area for reclaim */
152#endif 155#endif
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index 3fd2f1b6f906..9ed737146dbb 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -14,6 +14,7 @@
14#include <linux/device.h> 14#include <linux/device.h>
15#include <uapi/asm/perf_event.h> 15#include <uapi/asm/perf_event.h>
16 16
17/* Update perf_event_print_debug() if this changes */
17#define MAX_HWEVENTS 8 18#define MAX_HWEVENTS 8
18#define MAX_EVENT_ALTERNATIVES 8 19#define MAX_EVENT_ALTERNATIVES 8
19#define MAX_LIMITED_HWCOUNTERS 2 20#define MAX_LIMITED_HWCOUNTERS 2
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 90c06ec6eff5..1a36b8ede417 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -577,9 +577,13 @@
577#define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ 577#define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */
578#define SPRN_USPRG3 0x103 /* SPRG3 userspace read */ 578#define SPRN_USPRG3 0x103 /* SPRG3 userspace read */
579#define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */ 579#define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */
580#define SPRN_USPRG4 0x104 /* SPRG4 userspace read */
580#define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */ 581#define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */
582#define SPRN_USPRG5 0x105 /* SPRG5 userspace read */
581#define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */ 583#define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */
584#define SPRN_USPRG6 0x106 /* SPRG6 userspace read */
582#define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */ 585#define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */
586#define SPRN_USPRG7 0x107 /* SPRG7 userspace read */
583#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ 587#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */
584#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ 588#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */
585#define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */ 589#define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */
@@ -664,12 +668,14 @@
664#define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */ 668#define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */
665#define MMCR0_FCECE 0x02000000UL /* freeze ctrs on enabled cond or event */ 669#define MMCR0_FCECE 0x02000000UL /* freeze ctrs on enabled cond or event */
666#define MMCR0_TBEE 0x00400000UL /* time base exception enable */ 670#define MMCR0_TBEE 0x00400000UL /* time base exception enable */
671#define MMCR0_BHRBA 0x00200000UL /* BHRB Access allowed in userspace */
667#define MMCR0_EBE 0x00100000UL /* Event based branch enable */ 672#define MMCR0_EBE 0x00100000UL /* Event based branch enable */
668#define MMCR0_PMCC 0x000c0000UL /* PMC control */ 673#define MMCR0_PMCC 0x000c0000UL /* PMC control */
669#define MMCR0_PMCC_U6 0x00080000UL /* PMC1-6 are R/W by user (PR) */ 674#define MMCR0_PMCC_U6 0x00080000UL /* PMC1-6 are R/W by user (PR) */
670#define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/ 675#define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/
671#define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/ 676#define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/
672#define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */ 677#define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */
678#define MMCR0_PMAO_SYNC 0x00000800UL /* PMU interrupt is synchronous */
673#define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */ 679#define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */
674#define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */ 680#define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */
675#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */ 681#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */
@@ -703,6 +709,7 @@
703#define SPRN_EBBHR 804 /* Event based branch handler register */ 709#define SPRN_EBBHR 804 /* Event based branch handler register */
704#define SPRN_EBBRR 805 /* Event based branch return register */ 710#define SPRN_EBBRR 805 /* Event based branch return register */
705#define SPRN_BESCR 806 /* Branch event status and control register */ 711#define SPRN_BESCR 806 /* Branch event status and control register */
712#define BESCR_GE 0x8000000000000000ULL /* Global Enable */
706#define SPRN_WORT 895 /* Workload optimization register - thread */ 713#define SPRN_WORT 895 /* Workload optimization register - thread */
707 714
708#define SPRN_PMC1 787 715#define SPRN_PMC1 787
@@ -879,11 +886,10 @@
879 * 64-bit embedded 886 * 64-bit embedded
880 * - SPRG0 generic exception scratch 887 * - SPRG0 generic exception scratch
881 * - SPRG2 TLB exception stack 888 * - SPRG2 TLB exception stack
882 * - SPRG3 critical exception scratch and 889 * - SPRG3 critical exception scratch (user visible, sorry!)
883 * CPU and NUMA node for VDSO getcpu (user visible)
884 * - SPRG4 unused (user visible) 890 * - SPRG4 unused (user visible)
885 * - SPRG6 TLB miss scratch (user visible, sorry !) 891 * - SPRG6 TLB miss scratch (user visible, sorry !)
886 * - SPRG7 critical exception scratch 892 * - SPRG7 CPU and NUMA node for VDSO getcpu (user visible)
887 * - SPRG8 machine check exception scratch 893 * - SPRG8 machine check exception scratch
888 * - SPRG9 debug exception scratch 894 * - SPRG9 debug exception scratch
889 * 895 *
@@ -940,6 +946,8 @@
940#define SPRN_SPRG_SCRATCH0 SPRN_SPRG2 946#define SPRN_SPRG_SCRATCH0 SPRN_SPRG2
941#define SPRN_SPRG_HPACA SPRN_HSPRG0 947#define SPRN_SPRG_HPACA SPRN_HSPRG0
942#define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1 948#define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1
949#define SPRN_SPRG_VDSO_READ SPRN_USPRG3
950#define SPRN_SPRG_VDSO_WRITE SPRN_SPRG3
943 951
944#define GET_PACA(rX) \ 952#define GET_PACA(rX) \
945 BEGIN_FTR_SECTION_NESTED(66); \ 953 BEGIN_FTR_SECTION_NESTED(66); \
@@ -983,6 +991,8 @@
983#define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6 991#define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6
984#define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0 992#define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0
985#define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH 993#define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH
994#define SPRN_SPRG_VDSO_READ SPRN_USPRG7
995#define SPRN_SPRG_VDSO_WRITE SPRN_SPRG7
986 996
987#define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX 997#define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX
988#define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA 998#define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA
@@ -1102,6 +1112,8 @@
1102#define PVR_8560 0x80200000 1112#define PVR_8560 0x80200000
1103#define PVR_VER_E500V1 0x8020 1113#define PVR_VER_E500V1 0x8020
1104#define PVR_VER_E500V2 0x8021 1114#define PVR_VER_E500V2 0x8021
1115#define PVR_VER_E500MC 0x8023
1116#define PVR_VER_E5500 0x8024
1105#define PVR_VER_E6500 0x8040 1117#define PVR_VER_E6500 0x8040
1106 1118
1107/* 1119/*
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 9bd52c65e66f..a0e1add01ef5 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -283,6 +283,7 @@ extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
283 283
284#ifdef CONFIG_PPC_PSERIES 284#ifdef CONFIG_PPC_PSERIES
285extern int pseries_devicetree_update(s32 scope); 285extern int pseries_devicetree_update(s32 scope);
286extern void post_mobility_fixup(void);
286#endif 287#endif
287 288
288#ifdef CONFIG_PPC_RTAS_DAEMON 289#ifdef CONFIG_PPC_RTAS_DAEMON