aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-07 11:50:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-07 11:50:34 -0400
commitf536b3cae84eb7c9f3495285ad048d13a397ed0b (patch)
treeb53eee1c45eb080168786e2f103e76d6706cbbb0 /arch/powerpc/include
parente669830526a0abaf301bf408df69cde33901ac63 (diff)
parent537e5400a0a05c4efe70e7b372c19cfcd0179362 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc updates from Ben Herrenschmidt: "This is the powerpc new goodies for 3.17. The short story: The biggest bit is Michael removing all of pre-POWER4 processor support from the 64-bit kernel. POWER3 and rs64. This gets rid of a ton of old cruft that has been bitrotting in a long while. It was broken for quite a few versions already and nobody noticed. Nobody uses those machines anymore. While at it, he cleaned up a bunch of old dusty cabinets, getting rid of a skeletton or two. Then, we have some base VFIO support for KVM, which allows assigning of PCI devices to KVM guests, support for large 64-bit BARs on "powernv" platforms, support for HMI (Hardware Management Interrupts) on those same platforms, some sparse-vmemmap improvements (for memory hotplug), There is the usual batch of Freescale embedded updates (summary in the merge commit) and fixes here or there, I think that's it for the highlights" * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (102 commits) powerpc/eeh: Export eeh_iommu_group_to_pe() powerpc/eeh: Add missing #ifdef CONFIG_IOMMU_API powerpc: Reduce scariness of interrupt frames in stack traces powerpc: start loop at section start of start in vmemmap_populated() powerpc: implement vmemmap_free() powerpc: implement vmemmap_remove_mapping() for BOOK3S powerpc: implement vmemmap_list_free() powerpc: Fail remap_4k_pfn() if PFN doesn't fit inside PTE powerpc/book3s: Fix endianess issue for HMI handling on napping cpus. powerpc/book3s: handle HMIs for cpus in nap mode. powerpc/powernv: Invoke opal call to handle hmi. powerpc/book3s: Add basic infrastructure to handle HMI in Linux. powerpc/iommu: Fix comments with it_page_shift powerpc/powernv: Handle compound PE in config accessors powerpc/powernv: Handle compound PE for EEH powerpc/powernv: Handle compound PE powerpc/powernv: Split ioda_eeh_get_state() powerpc/powernv: Allow to freeze PE powerpc/powernv: Enable M64 aperatus for PHB3 powerpc/eeh: Aux PE data for error log ...
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/cputable.h31
-rw-r--r--arch/powerpc/include/asm/eeh.h62
-rw-r--r--arch/powerpc/include/asm/exception-64s.h14
-rw-r--r--arch/powerpc/include/asm/fs_pd.h1
-rw-r--r--arch/powerpc/include/asm/hardirq.h1
-rw-r--r--arch/powerpc/include/asm/hw_irq.h1
-rw-r--r--arch/powerpc/include/asm/irqflags.h8
-rw-r--r--arch/powerpc/include/asm/jump_label.h9
-rw-r--r--arch/powerpc/include/asm/kvm_asm.h1
-rw-r--r--arch/powerpc/include/asm/machdep.h5
-rw-r--r--arch/powerpc/include/asm/mmu-hash64.h22
-rw-r--r--arch/powerpc/include/asm/mmu.h8
-rw-r--r--arch/powerpc/include/asm/mmu_context.h6
-rw-r--r--arch/powerpc/include/asm/mpc85xx.h2
-rw-r--r--arch/powerpc/include/asm/mpc8xx.h12
-rw-r--r--arch/powerpc/include/asm/opal.h194
-rw-r--r--arch/powerpc/include/asm/oprofile_impl.h1
-rw-r--r--arch/powerpc/include/asm/paca.h5
-rw-r--r--arch/powerpc/include/asm/perf_event_server.h5
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h9
-rw-r--r--arch/powerpc/include/asm/pte-fsl-booke.h2
-rw-r--r--arch/powerpc/include/asm/pte-hash64-64k.h5
-rw-r--r--arch/powerpc/include/asm/reg.h2
-rw-r--r--arch/powerpc/include/asm/reg_booke.h57
-rw-r--r--arch/powerpc/include/asm/systbl.h4
-rw-r--r--arch/powerpc/include/asm/trace.h45
26 files changed, 326 insertions, 186 deletions
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 0fdd7eece6d9..642e436d4595 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -195,8 +195,7 @@ extern const char *powerpc_base_platform;
195 195
196#define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN) 196#define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN)
197 197
198#define MMU_FTR_PPCAS_ARCH_V2 (MMU_FTR_SLB | MMU_FTR_TLBIEL | \ 198#define MMU_FTR_PPCAS_ARCH_V2 (MMU_FTR_TLBIEL | MMU_FTR_16M_PAGE)
199 MMU_FTR_16M_PAGE)
200 199
201/* We only set the altivec features if the kernel was compiled with altivec 200/* We only set the altivec features if the kernel was compiled with altivec
202 * support 201 * support
@@ -268,10 +267,6 @@ extern const char *powerpc_base_platform;
268#define CPU_FTR_MAYBE_CAN_NAP 0 267#define CPU_FTR_MAYBE_CAN_NAP 0
269#endif 268#endif
270 269
271#define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \
272 !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \
273 !defined(CONFIG_BOOKE))
274
275#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | \ 270#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | \
276 CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE) 271 CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE)
277#define CPU_FTRS_603 (CPU_FTR_COMMON | \ 272#define CPU_FTRS_603 (CPU_FTR_COMMON | \
@@ -396,15 +391,10 @@ extern const char *powerpc_base_platform;
396 CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \ 391 CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
397 CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ 392 CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
398 CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \ 393 CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \
399 CPU_FTR_CELL_TB_BUG) 394 CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT)
400#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 395#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
401 396
402/* 64-bit CPUs */ 397/* 64-bit CPUs */
403#define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | \
404 CPU_FTR_IABR | CPU_FTR_PPC_LE)
405#define CPU_FTRS_RS64 (CPU_FTR_USE_TB | \
406 CPU_FTR_IABR | \
407 CPU_FTR_MMCRA | CPU_FTR_CTRL)
408#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 398#define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
409 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 399 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
410 CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \ 400 CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \
@@ -467,15 +457,14 @@ extern const char *powerpc_base_platform;
467#define CPU_FTRS_POSSIBLE (CPU_FTRS_E6500 | CPU_FTRS_E5500 | CPU_FTRS_A2) 457#define CPU_FTRS_POSSIBLE (CPU_FTRS_E6500 | CPU_FTRS_E5500 | CPU_FTRS_A2)
468#else 458#else
469#define CPU_FTRS_POSSIBLE \ 459#define CPU_FTRS_POSSIBLE \
470 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 460 (CPU_FTRS_POWER4 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \
471 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 461 CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
472 CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \ 462 CPU_FTRS_POWER8 | CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_VSX)
473 CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_VSX)
474#endif 463#endif
475#else 464#else
476enum { 465enum {
477 CPU_FTRS_POSSIBLE = 466 CPU_FTRS_POSSIBLE =
478#if CLASSIC_PPC 467#ifdef CONFIG_PPC_BOOK3S_32
479 CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU | 468 CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU |
480 CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 | 469 CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 |
481 CPU_FTRS_750FX2 | CPU_FTRS_750FX | CPU_FTRS_750GX | 470 CPU_FTRS_750FX2 | CPU_FTRS_750FX | CPU_FTRS_750GX |
@@ -518,14 +507,14 @@ enum {
518#define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500 & CPU_FTRS_A2) 507#define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500 & CPU_FTRS_A2)
519#else 508#else
520#define CPU_FTRS_ALWAYS \ 509#define CPU_FTRS_ALWAYS \
521 (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ 510 (CPU_FTRS_POWER4 & CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \
522 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \ 511 CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \
523 CPU_FTRS_POWER7 & CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE) 512 CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE)
524#endif 513#endif
525#else 514#else
526enum { 515enum {
527 CPU_FTRS_ALWAYS = 516 CPU_FTRS_ALWAYS =
528#if CLASSIC_PPC 517#ifdef CONFIG_PPC_BOOK3S_32
529 CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU & 518 CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU &
530 CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 & 519 CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 &
531 CPU_FTRS_750FX2 & CPU_FTRS_750FX & CPU_FTRS_750GX & 520 CPU_FTRS_750FX2 & CPU_FTRS_750FX & CPU_FTRS_750GX &
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index fab7743c2640..9983c3d26bca 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -25,6 +25,7 @@
25#include <linux/list.h> 25#include <linux/list.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/time.h> 27#include <linux/time.h>
28#include <linux/atomic.h>
28 29
29struct pci_dev; 30struct pci_dev;
30struct pci_bus; 31struct pci_bus;
@@ -33,10 +34,11 @@ struct device_node;
33#ifdef CONFIG_EEH 34#ifdef CONFIG_EEH
34 35
35/* EEH subsystem flags */ 36/* EEH subsystem flags */
36#define EEH_ENABLED 0x1 /* EEH enabled */ 37#define EEH_ENABLED 0x01 /* EEH enabled */
37#define EEH_FORCE_DISABLED 0x2 /* EEH disabled */ 38#define EEH_FORCE_DISABLED 0x02 /* EEH disabled */
38#define EEH_PROBE_MODE_DEV 0x4 /* From PCI device */ 39#define EEH_PROBE_MODE_DEV 0x04 /* From PCI device */
39#define EEH_PROBE_MODE_DEVTREE 0x8 /* From device tree */ 40#define EEH_PROBE_MODE_DEVTREE 0x08 /* From device tree */
41#define EEH_ENABLE_IO_FOR_LOG 0x10 /* Enable IO for log */
40 42
41/* 43/*
42 * Delay for PE reset, all in ms 44 * Delay for PE reset, all in ms
@@ -84,7 +86,9 @@ struct eeh_pe {
84 int freeze_count; /* Times of froze up */ 86 int freeze_count; /* Times of froze up */
85 struct timeval tstamp; /* Time on first-time freeze */ 87 struct timeval tstamp; /* Time on first-time freeze */
86 int false_positives; /* Times of reported #ff's */ 88 int false_positives; /* Times of reported #ff's */
89 atomic_t pass_dev_cnt; /* Count of passed through devs */
87 struct eeh_pe *parent; /* Parent PE */ 90 struct eeh_pe *parent; /* Parent PE */
91 void *data; /* PE auxillary data */
88 struct list_head child_list; /* Link PE to the child list */ 92 struct list_head child_list; /* Link PE to the child list */
89 struct list_head edevs; /* Link list of EEH devices */ 93 struct list_head edevs; /* Link list of EEH devices */
90 struct list_head child; /* Child PEs */ 94 struct list_head child; /* Child PEs */
@@ -93,6 +97,11 @@ struct eeh_pe {
93#define eeh_pe_for_each_dev(pe, edev, tmp) \ 97#define eeh_pe_for_each_dev(pe, edev, tmp) \
94 list_for_each_entry_safe(edev, tmp, &pe->edevs, list) 98 list_for_each_entry_safe(edev, tmp, &pe->edevs, list)
95 99
100static inline bool eeh_pe_passed(struct eeh_pe *pe)
101{
102 return pe ? !!atomic_read(&pe->pass_dev_cnt) : false;
103}
104
96/* 105/*
97 * The struct is used to trace EEH state for the associated 106 * The struct is used to trace EEH state for the associated
98 * PCI device node or PCI device. In future, it might 107 * PCI device node or PCI device. In future, it might
@@ -165,6 +174,11 @@ enum {
165#define EEH_STATE_DMA_ACTIVE (1 << 4) /* Active DMA */ 174#define EEH_STATE_DMA_ACTIVE (1 << 4) /* Active DMA */
166#define EEH_STATE_MMIO_ENABLED (1 << 5) /* MMIO enabled */ 175#define EEH_STATE_MMIO_ENABLED (1 << 5) /* MMIO enabled */
167#define EEH_STATE_DMA_ENABLED (1 << 6) /* DMA enabled */ 176#define EEH_STATE_DMA_ENABLED (1 << 6) /* DMA enabled */
177#define EEH_PE_STATE_NORMAL 0 /* Normal state */
178#define EEH_PE_STATE_RESET 1 /* PE reset asserted */
179#define EEH_PE_STATE_STOPPED_IO_DMA 2 /* Frozen PE */
180#define EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA, Enabled IO */
181#define EEH_PE_STATE_UNAVAIL 5 /* Unavailable */
168#define EEH_RESET_DEACTIVATE 0 /* Deactivate the PE reset */ 182#define EEH_RESET_DEACTIVATE 0 /* Deactivate the PE reset */
169#define EEH_RESET_HOT 1 /* Hot reset */ 183#define EEH_RESET_HOT 1 /* Hot reset */
170#define EEH_RESET_FUNDAMENTAL 3 /* Fundamental reset */ 184#define EEH_RESET_FUNDAMENTAL 3 /* Fundamental reset */
@@ -194,36 +208,28 @@ extern int eeh_subsystem_flags;
194extern struct eeh_ops *eeh_ops; 208extern struct eeh_ops *eeh_ops;
195extern raw_spinlock_t confirm_error_lock; 209extern raw_spinlock_t confirm_error_lock;
196 210
197static inline bool eeh_enabled(void) 211static inline void eeh_add_flag(int flag)
198{ 212{
199 if ((eeh_subsystem_flags & EEH_FORCE_DISABLED) || 213 eeh_subsystem_flags |= flag;
200 !(eeh_subsystem_flags & EEH_ENABLED))
201 return false;
202
203 return true;
204} 214}
205 215
206static inline void eeh_set_enable(bool mode) 216static inline void eeh_clear_flag(int flag)
207{ 217{
208 if (mode) 218 eeh_subsystem_flags &= ~flag;
209 eeh_subsystem_flags |= EEH_ENABLED;
210 else
211 eeh_subsystem_flags &= ~EEH_ENABLED;
212} 219}
213 220
214static inline void eeh_probe_mode_set(int flag) 221static inline bool eeh_has_flag(int flag)
215{ 222{
216 eeh_subsystem_flags |= flag; 223 return !!(eeh_subsystem_flags & flag);
217} 224}
218 225
219static inline int eeh_probe_mode_devtree(void) 226static inline bool eeh_enabled(void)
220{ 227{
221 return (eeh_subsystem_flags & EEH_PROBE_MODE_DEVTREE); 228 if (eeh_has_flag(EEH_FORCE_DISABLED) ||
222} 229 !eeh_has_flag(EEH_ENABLED))
230 return false;
223 231
224static inline int eeh_probe_mode_dev(void) 232 return true;
225{
226 return (eeh_subsystem_flags & EEH_PROBE_MODE_DEV);
227} 233}
228 234
229static inline void eeh_serialize_lock(unsigned long *flags) 235static inline void eeh_serialize_lock(unsigned long *flags)
@@ -243,6 +249,7 @@ static inline void eeh_serialize_unlock(unsigned long flags)
243#define EEH_MAX_ALLOWED_FREEZES 5 249#define EEH_MAX_ALLOWED_FREEZES 5
244 250
245typedef void *(*eeh_traverse_func)(void *data, void *flag); 251typedef void *(*eeh_traverse_func)(void *data, void *flag);
252void eeh_set_pe_aux_size(int size);
246int eeh_phb_pe_create(struct pci_controller *phb); 253int eeh_phb_pe_create(struct pci_controller *phb);
247struct eeh_pe *eeh_phb_pe_get(struct pci_controller *phb); 254struct eeh_pe *eeh_phb_pe_get(struct pci_controller *phb);
248struct eeh_pe *eeh_pe_get(struct eeh_dev *edev); 255struct eeh_pe *eeh_pe_get(struct eeh_dev *edev);
@@ -272,6 +279,13 @@ void eeh_add_device_late(struct pci_dev *);
272void eeh_add_device_tree_late(struct pci_bus *); 279void eeh_add_device_tree_late(struct pci_bus *);
273void eeh_add_sysfs_files(struct pci_bus *); 280void eeh_add_sysfs_files(struct pci_bus *);
274void eeh_remove_device(struct pci_dev *); 281void eeh_remove_device(struct pci_dev *);
282int eeh_dev_open(struct pci_dev *pdev);
283void eeh_dev_release(struct pci_dev *pdev);
284struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group);
285int eeh_pe_set_option(struct eeh_pe *pe, int option);
286int eeh_pe_get_state(struct eeh_pe *pe);
287int eeh_pe_reset(struct eeh_pe *pe, int option);
288int eeh_pe_configure(struct eeh_pe *pe);
275 289
276/** 290/**
277 * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure. 291 * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure.
@@ -295,8 +309,6 @@ static inline bool eeh_enabled(void)
295 return false; 309 return false;
296} 310}
297 311
298static inline void eeh_set_enable(bool mode) { }
299
300static inline int eeh_init(void) 312static inline int eeh_init(void)
301{ 313{
302 return 0; 314 return 0;
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 8f35cd7d59cc..77f52b26dad6 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -425,6 +425,8 @@ label##_relon_hv: \
425#define SOFTEN_VALUE_0xa00 PACA_IRQ_DBELL 425#define SOFTEN_VALUE_0xa00 PACA_IRQ_DBELL
426#define SOFTEN_VALUE_0xe80 PACA_IRQ_DBELL 426#define SOFTEN_VALUE_0xe80 PACA_IRQ_DBELL
427#define SOFTEN_VALUE_0xe82 PACA_IRQ_DBELL 427#define SOFTEN_VALUE_0xe82 PACA_IRQ_DBELL
428#define SOFTEN_VALUE_0xe60 PACA_IRQ_HMI
429#define SOFTEN_VALUE_0xe62 PACA_IRQ_HMI
428 430
429#define __SOFTEN_TEST(h, vec) \ 431#define __SOFTEN_TEST(h, vec) \
430 lbz r10,PACASOFTIRQEN(r13); \ 432 lbz r10,PACASOFTIRQEN(r13); \
@@ -513,8 +515,11 @@ label##_relon_hv: \
513 * runlatch, etc... 515 * runlatch, etc...
514 */ 516 */
515 517
516/* Exception addition: Hard disable interrupts */ 518/*
517#define DISABLE_INTS RECONCILE_IRQ_STATE(r10,r11) 519 * This addition reconciles our actual IRQ state with the various software
520 * flags that track it. This may call C code.
521 */
522#define ADD_RECONCILE RECONCILE_IRQ_STATE(r10,r11)
518 523
519#define ADD_NVGPRS \ 524#define ADD_NVGPRS \
520 bl save_nvgprs 525 bl save_nvgprs
@@ -532,6 +537,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
532 .globl label##_common; \ 537 .globl label##_common; \
533label##_common: \ 538label##_common: \
534 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ 539 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
540 /* Volatile regs are potentially clobbered here */ \
535 additions; \ 541 additions; \
536 addi r3,r1,STACK_FRAME_OVERHEAD; \ 542 addi r3,r1,STACK_FRAME_OVERHEAD; \
537 bl hdlr; \ 543 bl hdlr; \
@@ -539,7 +545,7 @@ label##_common: \
539 545
540#define STD_EXCEPTION_COMMON(trap, label, hdlr) \ 546#define STD_EXCEPTION_COMMON(trap, label, hdlr) \
541 EXCEPTION_COMMON(trap, label, hdlr, ret_from_except, \ 547 EXCEPTION_COMMON(trap, label, hdlr, ret_from_except, \
542 ADD_NVGPRS;DISABLE_INTS) 548 ADD_NVGPRS;ADD_RECONCILE)
543 549
544/* 550/*
545 * Like STD_EXCEPTION_COMMON, but for exceptions that can occur 551 * Like STD_EXCEPTION_COMMON, but for exceptions that can occur
@@ -548,7 +554,7 @@ label##_common: \
548 */ 554 */
549#define STD_EXCEPTION_COMMON_ASYNC(trap, label, hdlr) \ 555#define STD_EXCEPTION_COMMON_ASYNC(trap, label, hdlr) \
550 EXCEPTION_COMMON(trap, label, hdlr, ret_from_except_lite, \ 556 EXCEPTION_COMMON(trap, label, hdlr, ret_from_except_lite, \
551 FINISH_NAP;DISABLE_INTS;RUNLATCH_ON) 557 FINISH_NAP;ADD_RECONCILE;RUNLATCH_ON)
552 558
553/* 559/*
554 * When the idle code in power4_idle puts the CPU into NAP mode, 560 * When the idle code in power4_idle puts the CPU into NAP mode,
diff --git a/arch/powerpc/include/asm/fs_pd.h b/arch/powerpc/include/asm/fs_pd.h
index 9361cd5342cc..f79d6c74eb2a 100644
--- a/arch/powerpc/include/asm/fs_pd.h
+++ b/arch/powerpc/include/asm/fs_pd.h
@@ -28,7 +28,6 @@
28 28
29#ifdef CONFIG_8xx 29#ifdef CONFIG_8xx
30#include <asm/8xx_immap.h> 30#include <asm/8xx_immap.h>
31#include <asm/mpc8xx.h>
32 31
33extern immap_t __iomem *mpc8xx_immr; 32extern immap_t __iomem *mpc8xx_immr;
34 33
diff --git a/arch/powerpc/include/asm/hardirq.h b/arch/powerpc/include/asm/hardirq.h
index 418fb654370d..1bbb3013d6aa 100644
--- a/arch/powerpc/include/asm/hardirq.h
+++ b/arch/powerpc/include/asm/hardirq.h
@@ -11,6 +11,7 @@ typedef struct {
11 unsigned int pmu_irqs; 11 unsigned int pmu_irqs;
12 unsigned int mce_exceptions; 12 unsigned int mce_exceptions;
13 unsigned int spurious_irqs; 13 unsigned int spurious_irqs;
14 unsigned int hmi_exceptions;
14#ifdef CONFIG_PPC_DOORBELL 15#ifdef CONFIG_PPC_DOORBELL
15 unsigned int doorbell_irqs; 16 unsigned int doorbell_irqs;
16#endif 17#endif
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 10be1dd01c6b..b59ac27a6b7d 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -25,6 +25,7 @@
25#define PACA_IRQ_EE 0x04 25#define PACA_IRQ_EE 0x04
26#define PACA_IRQ_DEC 0x08 /* Or FIT */ 26#define PACA_IRQ_DEC 0x08 /* Or FIT */
27#define PACA_IRQ_EE_EDGE 0x10 /* BookE only */ 27#define PACA_IRQ_EE_EDGE 0x10 /* BookE only */
28#define PACA_IRQ_HMI 0x20
28 29
29#endif /* CONFIG_PPC64 */ 30#endif /* CONFIG_PPC64 */
30 31
diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h
index e20eb95429a8..f2149066fe5d 100644
--- a/arch/powerpc/include/asm/irqflags.h
+++ b/arch/powerpc/include/asm/irqflags.h
@@ -32,9 +32,8 @@
32#endif 32#endif
33 33
34/* 34/*
35 * Most of the CPU's IRQ-state tracing is done from assembly code; we 35 * These are calls to C code, so the caller must be prepared for volatiles to
36 * have to call a C function so call a wrapper that saves all the 36 * be clobbered.
37 * C-clobbered registers.
38 */ 37 */
39#define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_on) 38#define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_on)
40#define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_off) 39#define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_off)
@@ -42,6 +41,9 @@
42/* 41/*
43 * This is used by assembly code to soft-disable interrupts first and 42 * This is used by assembly code to soft-disable interrupts first and
44 * reconcile irq state. 43 * reconcile irq state.
44 *
45 * NB: This may call C code, so the caller must be prepared for volatiles to
46 * be clobbered.
45 */ 47 */
46#define RECONCILE_IRQ_STATE(__rA, __rB) \ 48#define RECONCILE_IRQ_STATE(__rA, __rB) \
47 lbz __rA,PACASOFTIRQEN(r13); \ 49 lbz __rA,PACASOFTIRQEN(r13); \
diff --git a/arch/powerpc/include/asm/jump_label.h b/arch/powerpc/include/asm/jump_label.h
index f016bb699b5f..efbf9a322a23 100644
--- a/arch/powerpc/include/asm/jump_label.h
+++ b/arch/powerpc/include/asm/jump_label.h
@@ -10,6 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#ifndef __ASSEMBLY__
13#include <linux/types.h> 14#include <linux/types.h>
14 15
15#include <asm/feature-fixups.h> 16#include <asm/feature-fixups.h>
@@ -42,4 +43,12 @@ struct jump_entry {
42 jump_label_t key; 43 jump_label_t key;
43}; 44};
44 45
46#else
47#define ARCH_STATIC_BRANCH(LABEL, KEY) \
481098: nop; \
49 .pushsection __jump_table, "aw"; \
50 FTR_ENTRY_LONG 1098b, LABEL, KEY; \
51 .popsection
52#endif
53
45#endif /* _ASM_POWERPC_JUMP_LABEL_H */ 54#endif /* _ASM_POWERPC_JUMP_LABEL_H */
diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
index 9601741080e5..ecf7e133a4f2 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -98,6 +98,7 @@
98#define BOOK3S_INTERRUPT_H_DATA_STORAGE 0xe00 98#define BOOK3S_INTERRUPT_H_DATA_STORAGE 0xe00
99#define BOOK3S_INTERRUPT_H_INST_STORAGE 0xe20 99#define BOOK3S_INTERRUPT_H_INST_STORAGE 0xe20
100#define BOOK3S_INTERRUPT_H_EMUL_ASSIST 0xe40 100#define BOOK3S_INTERRUPT_H_EMUL_ASSIST 0xe40
101#define BOOK3S_INTERRUPT_HMI 0xe60
101#define BOOK3S_INTERRUPT_H_DOORBELL 0xe80 102#define BOOK3S_INTERRUPT_H_DOORBELL 0xe80
102#define BOOK3S_INTERRUPT_PERFMON 0xf00 103#define BOOK3S_INTERRUPT_PERFMON 0xf00
103#define BOOK3S_INTERRUPT_ALTIVEC 0xf20 104#define BOOK3S_INTERRUPT_ALTIVEC 0xf20
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index f92b0b54e921..44e90516519b 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -174,6 +174,10 @@ struct machdep_calls {
174 /* Exception handlers */ 174 /* Exception handlers */
175 int (*system_reset_exception)(struct pt_regs *regs); 175 int (*system_reset_exception)(struct pt_regs *regs);
176 int (*machine_check_exception)(struct pt_regs *regs); 176 int (*machine_check_exception)(struct pt_regs *regs);
177 int (*handle_hmi_exception)(struct pt_regs *regs);
178
179 /* Early exception handlers called in realmode */
180 int (*hmi_exception_early)(struct pt_regs *regs);
177 181
178 /* Called during machine check exception to retrive fixup address. */ 182 /* Called during machine check exception to retrive fixup address. */
179 bool (*mce_check_early_recovery)(struct pt_regs *regs); 183 bool (*mce_check_early_recovery)(struct pt_regs *regs);
@@ -366,6 +370,7 @@ static inline void log_error(char *buf, unsigned int err_type, int fatal)
366 } \ 370 } \
367 __define_initcall(__machine_initcall_##mach##_##fn, id); 371 __define_initcall(__machine_initcall_##mach##_##fn, id);
368 372
373#define machine_early_initcall(mach, fn) __define_machine_initcall(mach, fn, early)
369#define machine_core_initcall(mach, fn) __define_machine_initcall(mach, fn, 1) 374#define machine_core_initcall(mach, fn) __define_machine_initcall(mach, fn, 1)
370#define machine_core_initcall_sync(mach, fn) __define_machine_initcall(mach, fn, 1s) 375#define machine_core_initcall_sync(mach, fn) __define_machine_initcall(mach, fn, 1s)
371#define machine_postcore_initcall(mach, fn) __define_machine_initcall(mach, fn, 2) 376#define machine_postcore_initcall(mach, fn) __define_machine_initcall(mach, fn, 2)
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index c2b4dcf23d03..d76514487d6f 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -25,26 +25,6 @@
25#include <asm/processor.h> 25#include <asm/processor.h>
26 26
27/* 27/*
28 * Segment table
29 */
30
31#define STE_ESID_V 0x80
32#define STE_ESID_KS 0x20
33#define STE_ESID_KP 0x10
34#define STE_ESID_N 0x08
35
36#define STE_VSID_SHIFT 12
37
38/* Location of cpu0's segment table */
39#define STAB0_PAGE 0x8
40#define STAB0_OFFSET (STAB0_PAGE << 12)
41#define STAB0_PHYS_ADDR (STAB0_OFFSET + PHYSICAL_START)
42
43#ifndef __ASSEMBLY__
44extern char initial_stab[];
45#endif /* ! __ASSEMBLY */
46
47/*
48 * SLB 28 * SLB
49 */ 29 */
50 30
@@ -370,10 +350,8 @@ extern void hpte_init_lpar(void);
370extern void hpte_init_beat(void); 350extern void hpte_init_beat(void);
371extern void hpte_init_beat_v3(void); 351extern void hpte_init_beat_v3(void);
372 352
373extern void stabs_alloc(void);
374extern void slb_initialize(void); 353extern void slb_initialize(void);
375extern void slb_flush_and_rebolt(void); 354extern void slb_flush_and_rebolt(void);
376extern void stab_initialize(unsigned long stab);
377 355
378extern void slb_vmalloc_update(void); 356extern void slb_vmalloc_update(void);
379extern void slb_set_size(u16 size); 357extern void slb_set_size(u16 size);
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index e61f24ed4e65..3d5abfe6ba67 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -64,9 +64,9 @@
64 */ 64 */
65#define MMU_FTR_USE_PAIRED_MAS ASM_CONST(0x01000000) 65#define MMU_FTR_USE_PAIRED_MAS ASM_CONST(0x01000000)
66 66
67/* MMU is SLB-based 67/* Doesn't support the B bit (1T segment) in SLBIE
68 */ 68 */
69#define MMU_FTR_SLB ASM_CONST(0x02000000) 69#define MMU_FTR_NO_SLBIE_B ASM_CONST(0x02000000)
70 70
71/* Support 16M large pages 71/* Support 16M large pages
72 */ 72 */
@@ -88,10 +88,6 @@
88 */ 88 */
89#define MMU_FTR_1T_SEGMENT ASM_CONST(0x40000000) 89#define MMU_FTR_1T_SEGMENT ASM_CONST(0x40000000)
90 90
91/* Doesn't support the B bit (1T segment) in SLBIE
92 */
93#define MMU_FTR_NO_SLBIE_B ASM_CONST(0x80000000)
94
95/* MMU feature bit sets for various CPUs */ 91/* MMU feature bit sets for various CPUs */
96#define MMU_FTRS_DEFAULT_HPTE_ARCH_V2 \ 92#define MMU_FTRS_DEFAULT_HPTE_ARCH_V2 \
97 MMU_FTR_HPTE_TABLE | MMU_FTR_PPCAS_ARCH_V2 93 MMU_FTR_HPTE_TABLE | MMU_FTR_PPCAS_ARCH_V2
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h
index b467530e2485..73382eba02dc 100644
--- a/arch/powerpc/include/asm/mmu_context.h
+++ b/arch/powerpc/include/asm/mmu_context.h
@@ -18,7 +18,6 @@ extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
18extern void destroy_context(struct mm_struct *mm); 18extern void destroy_context(struct mm_struct *mm);
19 19
20extern void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next); 20extern void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next);
21extern void switch_stab(struct task_struct *tsk, struct mm_struct *mm);
22extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm); 21extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm);
23extern void set_context(unsigned long id, pgd_t *pgd); 22extern void set_context(unsigned long id, pgd_t *pgd);
24 23
@@ -77,10 +76,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
77 * sub architectures. 76 * sub architectures.
78 */ 77 */
79#ifdef CONFIG_PPC_STD_MMU_64 78#ifdef CONFIG_PPC_STD_MMU_64
80 if (mmu_has_feature(MMU_FTR_SLB)) 79 switch_slb(tsk, next);
81 switch_slb(tsk, next);
82 else
83 switch_stab(tsk, next);
84#else 80#else
85 /* Out of line for now */ 81 /* Out of line for now */
86 switch_mmu_context(prev, next); 82 switch_mmu_context(prev, next);
diff --git a/arch/powerpc/include/asm/mpc85xx.h b/arch/powerpc/include/asm/mpc85xx.h
index 736d4acc05a8..3bef74a9914b 100644
--- a/arch/powerpc/include/asm/mpc85xx.h
+++ b/arch/powerpc/include/asm/mpc85xx.h
@@ -77,6 +77,8 @@
77#define SVR_T1020 0x852100 77#define SVR_T1020 0x852100
78#define SVR_T1021 0x852101 78#define SVR_T1021 0x852101
79#define SVR_T1022 0x852102 79#define SVR_T1022 0x852102
80#define SVR_T2080 0x853000
81#define SVR_T2081 0x853100
80 82
81#define SVR_8610 0x80A000 83#define SVR_8610 0x80A000
82#define SVR_8641 0x809000 84#define SVR_8641 0x809000
diff --git a/arch/powerpc/include/asm/mpc8xx.h b/arch/powerpc/include/asm/mpc8xx.h
deleted file mode 100644
index 98f3c4f17328..000000000000
--- a/arch/powerpc/include/asm/mpc8xx.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/* This is the single file included by all MPC8xx build options.
2 * Since there are many different boards and no standard configuration,
3 * we have a unique include file for each. Rather than change every
4 * file that has to include MPC8xx configuration, they all include
5 * this one and the configuration switching is done here.
6 */
7#ifndef __CONFIG_8xx_DEFS
8#define __CONFIG_8xx_DEFS
9
10extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
11
12#endif /* __CONFIG_8xx_DEFS */
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 0da1dbd42e02..b2f8ce1fd0d7 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -147,6 +147,8 @@ struct opal_sg_list {
147#define OPAL_SET_PARAM 90 147#define OPAL_SET_PARAM 90
148#define OPAL_DUMP_RESEND 91 148#define OPAL_DUMP_RESEND 91
149#define OPAL_DUMP_INFO2 94 149#define OPAL_DUMP_INFO2 94
150#define OPAL_PCI_EEH_FREEZE_SET 97
151#define OPAL_HANDLE_HMI 98
150 152
151#ifndef __ASSEMBLY__ 153#ifndef __ASSEMBLY__
152 154
@@ -170,7 +172,11 @@ enum OpalFreezeState {
170enum OpalEehFreezeActionToken { 172enum OpalEehFreezeActionToken {
171 OPAL_EEH_ACTION_CLEAR_FREEZE_MMIO = 1, 173 OPAL_EEH_ACTION_CLEAR_FREEZE_MMIO = 1,
172 OPAL_EEH_ACTION_CLEAR_FREEZE_DMA = 2, 174 OPAL_EEH_ACTION_CLEAR_FREEZE_DMA = 2,
173 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL = 3 175 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL = 3,
176
177 OPAL_EEH_ACTION_SET_FREEZE_MMIO = 1,
178 OPAL_EEH_ACTION_SET_FREEZE_DMA = 2,
179 OPAL_EEH_ACTION_SET_FREEZE_ALL = 3
174}; 180};
175 181
176enum OpalPciStatusToken { 182enum OpalPciStatusToken {
@@ -240,6 +246,7 @@ enum OpalMessageType {
240 OPAL_MSG_MEM_ERR, 246 OPAL_MSG_MEM_ERR,
241 OPAL_MSG_EPOW, 247 OPAL_MSG_EPOW,
242 OPAL_MSG_SHUTDOWN, 248 OPAL_MSG_SHUTDOWN,
249 OPAL_MSG_HMI_EVT,
243 OPAL_MSG_TYPE_MAX, 250 OPAL_MSG_TYPE_MAX,
244}; 251};
245 252
@@ -340,6 +347,12 @@ enum OpalMveEnableAction {
340 OPAL_ENABLE_MVE = 1 347 OPAL_ENABLE_MVE = 1
341}; 348};
342 349
350enum OpalM64EnableAction {
351 OPAL_DISABLE_M64 = 0,
352 OPAL_ENABLE_M64_SPLIT = 1,
353 OPAL_ENABLE_M64_NON_SPLIT = 2
354};
355
343enum OpalPciResetScope { 356enum OpalPciResetScope {
344 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3, 357 OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3,
345 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5, 358 OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5,
@@ -502,6 +515,50 @@ struct OpalMemoryErrorData {
502 } u; 515 } u;
503}; 516};
504 517
518/* HMI interrupt event */
519enum OpalHMI_Version {
520 OpalHMIEvt_V1 = 1,
521};
522
523enum OpalHMI_Severity {
524 OpalHMI_SEV_NO_ERROR = 0,
525 OpalHMI_SEV_WARNING = 1,
526 OpalHMI_SEV_ERROR_SYNC = 2,
527 OpalHMI_SEV_FATAL = 3,
528};
529
530enum OpalHMI_Disposition {
531 OpalHMI_DISPOSITION_RECOVERED = 0,
532 OpalHMI_DISPOSITION_NOT_RECOVERED = 1,
533};
534
535enum OpalHMI_ErrType {
536 OpalHMI_ERROR_MALFUNC_ALERT = 0,
537 OpalHMI_ERROR_PROC_RECOV_DONE,
538 OpalHMI_ERROR_PROC_RECOV_DONE_AGAIN,
539 OpalHMI_ERROR_PROC_RECOV_MASKED,
540 OpalHMI_ERROR_TFAC,
541 OpalHMI_ERROR_TFMR_PARITY,
542 OpalHMI_ERROR_HA_OVERFLOW_WARN,
543 OpalHMI_ERROR_XSCOM_FAIL,
544 OpalHMI_ERROR_XSCOM_DONE,
545 OpalHMI_ERROR_SCOM_FIR,
546 OpalHMI_ERROR_DEBUG_TRIG_FIR,
547 OpalHMI_ERROR_HYP_RESOURCE,
548};
549
550struct OpalHMIEvent {
551 uint8_t version; /* 0x00 */
552 uint8_t severity; /* 0x01 */
553 uint8_t type; /* 0x02 */
554 uint8_t disposition; /* 0x03 */
555 uint8_t reserved_1[4]; /* 0x04 */
556
557 __be64 hmer;
558 /* TFMR register. Valid only for TFAC and TFMR_PARITY error type. */
559 __be64 tfmr;
560};
561
505enum { 562enum {
506 OPAL_P7IOC_DIAG_TYPE_NONE = 0, 563 OPAL_P7IOC_DIAG_TYPE_NONE = 0,
507 OPAL_P7IOC_DIAG_TYPE_RGC = 1, 564 OPAL_P7IOC_DIAG_TYPE_RGC = 1,
@@ -513,40 +570,40 @@ enum {
513}; 570};
514 571
515struct OpalIoP7IOCErrorData { 572struct OpalIoP7IOCErrorData {
516 uint16_t type; 573 __be16 type;
517 574
518 /* GEM */ 575 /* GEM */
519 uint64_t gemXfir; 576 __be64 gemXfir;
520 uint64_t gemRfir; 577 __be64 gemRfir;
521 uint64_t gemRirqfir; 578 __be64 gemRirqfir;
522 uint64_t gemMask; 579 __be64 gemMask;
523 uint64_t gemRwof; 580 __be64 gemRwof;
524 581
525 /* LEM */ 582 /* LEM */
526 uint64_t lemFir; 583 __be64 lemFir;
527 uint64_t lemErrMask; 584 __be64 lemErrMask;
528 uint64_t lemAction0; 585 __be64 lemAction0;
529 uint64_t lemAction1; 586 __be64 lemAction1;
530 uint64_t lemWof; 587 __be64 lemWof;
531 588
532 union { 589 union {
533 struct OpalIoP7IOCRgcErrorData { 590 struct OpalIoP7IOCRgcErrorData {
534 uint64_t rgcStatus; /* 3E1C10 */ 591 __be64 rgcStatus; /* 3E1C10 */
535 uint64_t rgcLdcp; /* 3E1C18 */ 592 __be64 rgcLdcp; /* 3E1C18 */
536 }rgc; 593 }rgc;
537 struct OpalIoP7IOCBiErrorData { 594 struct OpalIoP7IOCBiErrorData {
538 uint64_t biLdcp0; /* 3C0100, 3C0118 */ 595 __be64 biLdcp0; /* 3C0100, 3C0118 */
539 uint64_t biLdcp1; /* 3C0108, 3C0120 */ 596 __be64 biLdcp1; /* 3C0108, 3C0120 */
540 uint64_t biLdcp2; /* 3C0110, 3C0128 */ 597 __be64 biLdcp2; /* 3C0110, 3C0128 */
541 uint64_t biFenceStatus; /* 3C0130, 3C0130 */ 598 __be64 biFenceStatus; /* 3C0130, 3C0130 */
542 599
543 uint8_t biDownbound; /* BI Downbound or Upbound */ 600 u8 biDownbound; /* BI Downbound or Upbound */
544 }bi; 601 }bi;
545 struct OpalIoP7IOCCiErrorData { 602 struct OpalIoP7IOCCiErrorData {
546 uint64_t ciPortStatus; /* 3Dn008 */ 603 __be64 ciPortStatus; /* 3Dn008 */
547 uint64_t ciPortLdcp; /* 3Dn010 */ 604 __be64 ciPortLdcp; /* 3Dn010 */
548 605
549 uint8_t ciPort; /* Index of CI port: 0/1 */ 606 u8 ciPort; /* Index of CI port: 0/1 */
550 }ci; 607 }ci;
551 }; 608 };
552}; 609};
@@ -578,60 +635,60 @@ struct OpalIoPhbErrorCommon {
578struct OpalIoP7IOCPhbErrorData { 635struct OpalIoP7IOCPhbErrorData {
579 struct OpalIoPhbErrorCommon common; 636 struct OpalIoPhbErrorCommon common;
580 637
581 uint32_t brdgCtl; 638 __be32 brdgCtl;
582 639
583 // P7IOC utl regs 640 // P7IOC utl regs
584 uint32_t portStatusReg; 641 __be32 portStatusReg;
585 uint32_t rootCmplxStatus; 642 __be32 rootCmplxStatus;
586 uint32_t busAgentStatus; 643 __be32 busAgentStatus;
587 644
588 // P7IOC cfg regs 645 // P7IOC cfg regs
589 uint32_t deviceStatus; 646 __be32 deviceStatus;
590 uint32_t slotStatus; 647 __be32 slotStatus;
591 uint32_t linkStatus; 648 __be32 linkStatus;
592 uint32_t devCmdStatus; 649 __be32 devCmdStatus;
593 uint32_t devSecStatus; 650 __be32 devSecStatus;
594 651
595 // cfg AER regs 652 // cfg AER regs
596 uint32_t rootErrorStatus; 653 __be32 rootErrorStatus;
597 uint32_t uncorrErrorStatus; 654 __be32 uncorrErrorStatus;
598 uint32_t corrErrorStatus; 655 __be32 corrErrorStatus;
599 uint32_t tlpHdr1; 656 __be32 tlpHdr1;
600 uint32_t tlpHdr2; 657 __be32 tlpHdr2;
601 uint32_t tlpHdr3; 658 __be32 tlpHdr3;
602 uint32_t tlpHdr4; 659 __be32 tlpHdr4;
603 uint32_t sourceId; 660 __be32 sourceId;
604 661
605 uint32_t rsv3; 662 __be32 rsv3;
606 663
607 // Record data about the call to allocate a buffer. 664 // Record data about the call to allocate a buffer.
608 uint64_t errorClass; 665 __be64 errorClass;
609 uint64_t correlator; 666 __be64 correlator;
610 667
611 //P7IOC MMIO Error Regs 668 //P7IOC MMIO Error Regs
612 uint64_t p7iocPlssr; // n120 669 __be64 p7iocPlssr; // n120
613 uint64_t p7iocCsr; // n110 670 __be64 p7iocCsr; // n110
614 uint64_t lemFir; // nC00 671 __be64 lemFir; // nC00
615 uint64_t lemErrorMask; // nC18 672 __be64 lemErrorMask; // nC18
616 uint64_t lemWOF; // nC40 673 __be64 lemWOF; // nC40
617 uint64_t phbErrorStatus; // nC80 674 __be64 phbErrorStatus; // nC80
618 uint64_t phbFirstErrorStatus; // nC88 675 __be64 phbFirstErrorStatus; // nC88
619 uint64_t phbErrorLog0; // nCC0 676 __be64 phbErrorLog0; // nCC0
620 uint64_t phbErrorLog1; // nCC8 677 __be64 phbErrorLog1; // nCC8
621 uint64_t mmioErrorStatus; // nD00 678 __be64 mmioErrorStatus; // nD00
622 uint64_t mmioFirstErrorStatus; // nD08 679 __be64 mmioFirstErrorStatus; // nD08
623 uint64_t mmioErrorLog0; // nD40 680 __be64 mmioErrorLog0; // nD40
624 uint64_t mmioErrorLog1; // nD48 681 __be64 mmioErrorLog1; // nD48
625 uint64_t dma0ErrorStatus; // nD80 682 __be64 dma0ErrorStatus; // nD80
626 uint64_t dma0FirstErrorStatus; // nD88 683 __be64 dma0FirstErrorStatus; // nD88
627 uint64_t dma0ErrorLog0; // nDC0 684 __be64 dma0ErrorLog0; // nDC0
628 uint64_t dma0ErrorLog1; // nDC8 685 __be64 dma0ErrorLog1; // nDC8
629 uint64_t dma1ErrorStatus; // nE00 686 __be64 dma1ErrorStatus; // nE00
630 uint64_t dma1FirstErrorStatus; // nE08 687 __be64 dma1FirstErrorStatus; // nE08
631 uint64_t dma1ErrorLog0; // nE40 688 __be64 dma1ErrorLog0; // nE40
632 uint64_t dma1ErrorLog1; // nE48 689 __be64 dma1ErrorLog1; // nE48
633 uint64_t pestA[OPAL_P7IOC_NUM_PEST_REGS]; 690 __be64 pestA[OPAL_P7IOC_NUM_PEST_REGS];
634 uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS]; 691 __be64 pestB[OPAL_P7IOC_NUM_PEST_REGS];
635}; 692};
636 693
637struct OpalIoPhb3ErrorData { 694struct OpalIoPhb3ErrorData {
@@ -758,6 +815,8 @@ int64_t opal_pci_eeh_freeze_status(uint64_t phb_id, uint64_t pe_number,
758 __be64 *phb_status); 815 __be64 *phb_status);
759int64_t opal_pci_eeh_freeze_clear(uint64_t phb_id, uint64_t pe_number, 816int64_t opal_pci_eeh_freeze_clear(uint64_t phb_id, uint64_t pe_number,
760 uint64_t eeh_action_token); 817 uint64_t eeh_action_token);
818int64_t opal_pci_eeh_freeze_set(uint64_t phb_id, uint64_t pe_number,
819 uint64_t eeh_action_token);
761int64_t opal_pci_shpc(uint64_t phb_id, uint64_t shpc_action, uint8_t *state); 820int64_t opal_pci_shpc(uint64_t phb_id, uint64_t shpc_action, uint8_t *state);
762 821
763 822
@@ -768,7 +827,7 @@ int64_t opal_pci_set_phb_mem_window(uint64_t phb_id, uint16_t window_type,
768 uint16_t window_num, 827 uint16_t window_num,
769 uint64_t starting_real_address, 828 uint64_t starting_real_address,
770 uint64_t starting_pci_address, 829 uint64_t starting_pci_address,
771 uint16_t segment_size); 830 uint64_t size);
772int64_t opal_pci_map_pe_mmio_window(uint64_t phb_id, uint16_t pe_number, 831int64_t opal_pci_map_pe_mmio_window(uint64_t phb_id, uint16_t pe_number,
773 uint16_t window_type, uint16_t window_num, 832 uint16_t window_type, uint16_t window_num,
774 uint16_t segment_num); 833 uint16_t segment_num);
@@ -860,6 +919,7 @@ int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer,
860int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer, 919int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer,
861 uint64_t length); 920 uint64_t length);
862int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data); 921int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data);
922int64_t opal_handle_hmi(void);
863 923
864/* Internal functions */ 924/* Internal functions */
865extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 925extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
@@ -902,6 +962,8 @@ extern void opal_msglog_init(void);
902 962
903extern int opal_machine_check(struct pt_regs *regs); 963extern int opal_machine_check(struct pt_regs *regs);
904extern bool opal_mce_check_early_recovery(struct pt_regs *regs); 964extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
965extern int opal_hmi_exception_early(struct pt_regs *regs);
966extern int opal_handle_hmi_exception(struct pt_regs *regs);
905 967
906extern void opal_shutdown(void); 968extern void opal_shutdown(void);
907extern int opal_resync_timebase(void); 969extern int opal_resync_timebase(void);
diff --git a/arch/powerpc/include/asm/oprofile_impl.h b/arch/powerpc/include/asm/oprofile_impl.h
index d697b08994c9..61fe5d6f18e1 100644
--- a/arch/powerpc/include/asm/oprofile_impl.h
+++ b/arch/powerpc/include/asm/oprofile_impl.h
@@ -61,7 +61,6 @@ struct op_powerpc_model {
61}; 61};
62 62
63extern struct op_powerpc_model op_model_fsl_emb; 63extern struct op_powerpc_model op_model_fsl_emb;
64extern struct op_powerpc_model op_model_rs64;
65extern struct op_powerpc_model op_model_power4; 64extern struct op_powerpc_model op_model_power4;
66extern struct op_powerpc_model op_model_7450; 65extern struct op_powerpc_model op_model_7450;
67extern struct op_powerpc_model op_model_cell; 66extern struct op_powerpc_model op_model_cell;
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index bb0bd25f20d0..a5139ea6910b 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -78,10 +78,6 @@ struct paca_struct {
78 u64 kernel_toc; /* Kernel TOC address */ 78 u64 kernel_toc; /* Kernel TOC address */
79 u64 kernelbase; /* Base address of kernel */ 79 u64 kernelbase; /* Base address of kernel */
80 u64 kernel_msr; /* MSR while running in kernel */ 80 u64 kernel_msr; /* MSR while running in kernel */
81#ifdef CONFIG_PPC_STD_MMU_64
82 u64 stab_real; /* Absolute address of segment table */
83 u64 stab_addr; /* Virtual address of segment table */
84#endif /* CONFIG_PPC_STD_MMU_64 */
85 void *emergency_sp; /* pointer to emergency stack */ 81 void *emergency_sp; /* pointer to emergency stack */
86 u64 data_offset; /* per cpu data offset */ 82 u64 data_offset; /* per cpu data offset */
87 s16 hw_cpu_id; /* Physical processor number */ 83 s16 hw_cpu_id; /* Physical processor number */
@@ -171,6 +167,7 @@ struct paca_struct {
171 * and already using emergency stack. 167 * and already using emergency stack.
172 */ 168 */
173 u16 in_mce; 169 u16 in_mce;
170 u8 hmi_event_available; /* HMI event is available */
174#endif 171#endif
175 172
176 /* Stuff for accurate time accounting */ 173 /* Stuff for accurate time accounting */
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index b3e936027b26..814622146d5a 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -19,6 +19,8 @@
19#define MAX_EVENT_ALTERNATIVES 8 19#define MAX_EVENT_ALTERNATIVES 8
20#define MAX_LIMITED_HWCOUNTERS 2 20#define MAX_LIMITED_HWCOUNTERS 2
21 21
22struct perf_event;
23
22/* 24/*
23 * This struct provides the constants and functions needed to 25 * This struct provides the constants and functions needed to
24 * describe the PMU on a particular POWER-family CPU. 26 * describe the PMU on a particular POWER-family CPU.
@@ -30,7 +32,8 @@ struct power_pmu {
30 unsigned long add_fields; 32 unsigned long add_fields;
31 unsigned long test_adder; 33 unsigned long test_adder;
32 int (*compute_mmcr)(u64 events[], int n_ev, 34 int (*compute_mmcr)(u64 events[], int n_ev,
33 unsigned int hwc[], unsigned long mmcr[]); 35 unsigned int hwc[], unsigned long mmcr[],
36 struct perf_event *pevents[]);
34 int (*get_constraint)(u64 event_id, unsigned long *mskp, 37 int (*get_constraint)(u64 event_id, unsigned long *mskp,
35 unsigned long *valp); 38 unsigned long *valp);
36 int (*get_alternatives)(u64 event_id, unsigned int flags, 39 int (*get_alternatives)(u64 event_id, unsigned int flags,
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 3132bb9365f3..e316dad6ba76 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -150,8 +150,10 @@
150#define PPC_INST_MCRXR_MASK 0xfc0007fe 150#define PPC_INST_MCRXR_MASK 0xfc0007fe
151#define PPC_INST_MFSPR_PVR 0x7c1f42a6 151#define PPC_INST_MFSPR_PVR 0x7c1f42a6
152#define PPC_INST_MFSPR_PVR_MASK 0xfc1fffff 152#define PPC_INST_MFSPR_PVR_MASK 0xfc1fffff
153#define PPC_INST_MFTMR 0x7c0002dc
153#define PPC_INST_MSGSND 0x7c00019c 154#define PPC_INST_MSGSND 0x7c00019c
154#define PPC_INST_MSGSNDP 0x7c00011c 155#define PPC_INST_MSGSNDP 0x7c00011c
156#define PPC_INST_MTTMR 0x7c0003dc
155#define PPC_INST_NOP 0x60000000 157#define PPC_INST_NOP 0x60000000
156#define PPC_INST_POPCNTB 0x7c0000f4 158#define PPC_INST_POPCNTB 0x7c0000f4
157#define PPC_INST_POPCNTB_MASK 0xfc0007fe 159#define PPC_INST_POPCNTB_MASK 0xfc0007fe
@@ -369,4 +371,11 @@
369#define TABORT(r) stringify_in_c(.long PPC_INST_TABORT \ 371#define TABORT(r) stringify_in_c(.long PPC_INST_TABORT \
370 | __PPC_RA(r)) 372 | __PPC_RA(r))
371 373
374/* book3e thread control instructions */
375#define TMRN(x) ((((x) & 0x1f) << 16) | (((x) & 0x3e0) << 6))
376#define MTTMR(tmr, r) stringify_in_c(.long PPC_INST_MTTMR | \
377 TMRN(tmr) | ___PPC_RS(r))
378#define MFTMR(tmr, r) stringify_in_c(.long PPC_INST_MFTMR | \
379 TMRN(tmr) | ___PPC_RT(r))
380
372#endif /* _ASM_POWERPC_PPC_OPCODE_H */ 381#endif /* _ASM_POWERPC_PPC_OPCODE_H */
diff --git a/arch/powerpc/include/asm/pte-fsl-booke.h b/arch/powerpc/include/asm/pte-fsl-booke.h
index 2c12be5f677a..e84dd7ed505e 100644
--- a/arch/powerpc/include/asm/pte-fsl-booke.h
+++ b/arch/powerpc/include/asm/pte-fsl-booke.h
@@ -37,5 +37,7 @@
37#define _PMD_PRESENT_MASK (PAGE_MASK) 37#define _PMD_PRESENT_MASK (PAGE_MASK)
38#define _PMD_BAD (~PAGE_MASK) 38#define _PMD_BAD (~PAGE_MASK)
39 39
40#define PTE_WIMGE_SHIFT (6)
41
40#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
41#endif /* _ASM_POWERPC_PTE_FSL_BOOKE_H */ 43#endif /* _ASM_POWERPC_PTE_FSL_BOOKE_H */
diff --git a/arch/powerpc/include/asm/pte-hash64-64k.h b/arch/powerpc/include/asm/pte-hash64-64k.h
index d836d945068d..b6d2d42f84b5 100644
--- a/arch/powerpc/include/asm/pte-hash64-64k.h
+++ b/arch/powerpc/include/asm/pte-hash64-64k.h
@@ -75,7 +75,8 @@
75 (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K) 75 (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K)
76 76
77#define remap_4k_pfn(vma, addr, pfn, prot) \ 77#define remap_4k_pfn(vma, addr, pfn, prot) \
78 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \ 78 (WARN_ON(((pfn) >= (1UL << (64 - PTE_RPN_SHIFT)))) ? -EINVAL : \
79 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN)) 79 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \
80 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN)))
80 81
81#endif /* __ASSEMBLY__ */ 82#endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index bffd89d27301..f7b97b895708 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -254,7 +254,7 @@
254#define DSISR_PROTFAULT 0x08000000 /* protection fault */ 254#define DSISR_PROTFAULT 0x08000000 /* protection fault */
255#define DSISR_ISSTORE 0x02000000 /* access was a store */ 255#define DSISR_ISSTORE 0x02000000 /* access was a store */
256#define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ 256#define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */
257#define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ 257#define DSISR_NOSEGMENT 0x00200000 /* SLB miss */
258#define DSISR_KEYFAULT 0x00200000 /* Key fault */ 258#define DSISR_KEYFAULT 0x00200000 /* Key fault */
259#define SPRN_TBRL 0x10C /* Time Base Read Lower Register (user, R/O) */ 259#define SPRN_TBRL 0x10C /* Time Base Read Lower Register (user, R/O) */
260#define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */ 260#define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 464f1089b532..1d653308a33c 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -15,16 +15,28 @@
15#ifndef __ASM_POWERPC_REG_BOOKE_H__ 15#ifndef __ASM_POWERPC_REG_BOOKE_H__
16#define __ASM_POWERPC_REG_BOOKE_H__ 16#define __ASM_POWERPC_REG_BOOKE_H__
17 17
18#include <asm/ppc-opcode.h>
19
18/* Machine State Register (MSR) Fields */ 20/* Machine State Register (MSR) Fields */
19#define MSR_GS (1<<28) /* Guest state */ 21#define MSR_GS_LG 28 /* Guest state */
20#define MSR_UCLE (1<<26) /* User-mode cache lock enable */ 22#define MSR_UCLE_LG 26 /* User-mode cache lock enable */
21#define MSR_SPE (1<<25) /* Enable SPE */ 23#define MSR_SPE_LG 25 /* Enable SPE */
22#define MSR_DWE (1<<10) /* Debug Wait Enable */ 24#define MSR_DWE_LG 10 /* Debug Wait Enable */
23#define MSR_UBLE (1<<10) /* BTB lock enable (e500) */ 25#define MSR_UBLE_LG 10 /* BTB lock enable (e500) */
24#define MSR_IS MSR_IR /* Instruction Space */ 26#define MSR_IS_LG MSR_IR_LG /* Instruction Space */
25#define MSR_DS MSR_DR /* Data Space */ 27#define MSR_DS_LG MSR_DR_LG /* Data Space */
26#define MSR_PMM (1<<2) /* Performance monitor mark bit */ 28#define MSR_PMM_LG 2 /* Performance monitor mark bit */
27#define MSR_CM (1<<31) /* Computation Mode (0=32-bit, 1=64-bit) */ 29#define MSR_CM_LG 31 /* Computation Mode (0=32-bit, 1=64-bit) */
30
31#define MSR_GS __MASK(MSR_GS_LG)
32#define MSR_UCLE __MASK(MSR_UCLE_LG)
33#define MSR_SPE __MASK(MSR_SPE_LG)
34#define MSR_DWE __MASK(MSR_DWE_LG)
35#define MSR_UBLE __MASK(MSR_UBLE_LG)
36#define MSR_IS __MASK(MSR_IS_LG)
37#define MSR_DS __MASK(MSR_DS_LG)
38#define MSR_PMM __MASK(MSR_PMM_LG)
39#define MSR_CM __MASK(MSR_CM_LG)
28 40
29#if defined(CONFIG_PPC_BOOK3E_64) 41#if defined(CONFIG_PPC_BOOK3E_64)
30#define MSR_64BIT MSR_CM 42#define MSR_64BIT MSR_CM
@@ -260,7 +272,7 @@
260 272
261/* e500mc */ 273/* e500mc */
262#define MCSR_DCPERR_MC 0x20000000UL /* D-Cache Parity Error */ 274#define MCSR_DCPERR_MC 0x20000000UL /* D-Cache Parity Error */
263#define MCSR_L2MMU_MHIT 0x04000000UL /* Hit on multiple TLB entries */ 275#define MCSR_L2MMU_MHIT 0x08000000UL /* Hit on multiple TLB entries */
264#define MCSR_NMI 0x00100000UL /* Non-Maskable Interrupt */ 276#define MCSR_NMI 0x00100000UL /* Non-Maskable Interrupt */
265#define MCSR_MAV 0x00080000UL /* MCAR address valid */ 277#define MCSR_MAV 0x00080000UL /* MCAR address valid */
266#define MCSR_MEA 0x00040000UL /* MCAR is effective address */ 278#define MCSR_MEA 0x00040000UL /* MCAR is effective address */
@@ -598,6 +610,13 @@
598/* Bit definitions for L1CSR2. */ 610/* Bit definitions for L1CSR2. */
599#define L1CSR2_DCWS 0x40000000 /* Data Cache write shadow */ 611#define L1CSR2_DCWS 0x40000000 /* Data Cache write shadow */
600 612
613/* Bit definitions for BUCSR. */
614#define BUCSR_STAC_EN 0x01000000 /* Segment Target Address Cache */
615#define BUCSR_LS_EN 0x00400000 /* Link Stack */
616#define BUCSR_BBFI 0x00000200 /* Branch Buffer flash invalidate */
617#define BUCSR_BPEN 0x00000001 /* Branch prediction enable */
618#define BUCSR_INIT (BUCSR_STAC_EN | BUCSR_LS_EN | BUCSR_BBFI | BUCSR_BPEN)
619
601/* Bit definitions for L2CSR0. */ 620/* Bit definitions for L2CSR0. */
602#define L2CSR0_L2E 0x80000000 /* L2 Cache Enable */ 621#define L2CSR0_L2E 0x80000000 /* L2 Cache Enable */
603#define L2CSR0_L2PE 0x40000000 /* L2 Cache Parity/ECC Enable */ 622#define L2CSR0_L2PE 0x40000000 /* L2 Cache Parity/ECC Enable */
@@ -721,5 +740,23 @@
721#define MMUBE1_VBE4 0x00000002 740#define MMUBE1_VBE4 0x00000002
722#define MMUBE1_VBE5 0x00000001 741#define MMUBE1_VBE5 0x00000001
723 742
743#define TMRN_IMSR0 0x120 /* Initial MSR Register 0 (e6500) */
744#define TMRN_IMSR1 0x121 /* Initial MSR Register 1 (e6500) */
745#define TMRN_INIA0 0x140 /* Next Instruction Address Register 0 */
746#define TMRN_INIA1 0x141 /* Next Instruction Address Register 1 */
747#define SPRN_TENSR 0x1b5 /* Thread Enable Status Register */
748#define SPRN_TENS 0x1b6 /* Thread Enable Set Register */
749#define SPRN_TENC 0x1b7 /* Thread Enable Clear Register */
750
751#define TEN_THREAD(x) (1 << (x))
752
753#ifndef __ASSEMBLY__
754#define mftmr(rn) ({unsigned long rval; \
755 asm volatile(MFTMR(rn, %0) : "=r" (rval)); rval;})
756#define mttmr(rn, v) asm volatile(MTTMR(rn, %0) : \
757 : "r" ((unsigned long)(v)) \
758 : "memory")
759#endif /* !__ASSEMBLY__ */
760
724#endif /* __ASM_POWERPC_REG_BOOKE_H__ */ 761#endif /* __ASM_POWERPC_REG_BOOKE_H__ */
725#endif /* __KERNEL__ */ 762#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index babbeca6850f..542bc0f0673f 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -77,10 +77,10 @@ SYSCALL_SPU(setreuid)
77SYSCALL_SPU(setregid) 77SYSCALL_SPU(setregid)
78#define compat_sys_sigsuspend sys_sigsuspend 78#define compat_sys_sigsuspend sys_sigsuspend
79SYS32ONLY(sigsuspend) 79SYS32ONLY(sigsuspend)
80COMPAT_SYS(sigpending) 80SYSX(sys_ni_syscall,compat_sys_sigpending,sys_sigpending)
81SYSCALL_SPU(sethostname) 81SYSCALL_SPU(sethostname)
82COMPAT_SYS_SPU(setrlimit) 82COMPAT_SYS_SPU(setrlimit)
83COMPAT_SYS(old_getrlimit) 83SYSX(sys_ni_syscall,compat_sys_old_getrlimit,sys_old_getrlimit)
84COMPAT_SYS_SPU(getrusage) 84COMPAT_SYS_SPU(getrusage)
85COMPAT_SYS_SPU(gettimeofday) 85COMPAT_SYS_SPU(gettimeofday)
86COMPAT_SYS_SPU(settimeofday) 86COMPAT_SYS_SPU(settimeofday)
diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h
index 5712f06905a9..c15da6073cb8 100644
--- a/arch/powerpc/include/asm/trace.h
+++ b/arch/powerpc/include/asm/trace.h
@@ -99,6 +99,51 @@ TRACE_EVENT_FN(hcall_exit,
99); 99);
100#endif 100#endif
101 101
102#ifdef CONFIG_PPC_POWERNV
103extern void opal_tracepoint_regfunc(void);
104extern void opal_tracepoint_unregfunc(void);
105
106TRACE_EVENT_FN(opal_entry,
107
108 TP_PROTO(unsigned long opcode, unsigned long *args),
109
110 TP_ARGS(opcode, args),
111
112 TP_STRUCT__entry(
113 __field(unsigned long, opcode)
114 ),
115
116 TP_fast_assign(
117 __entry->opcode = opcode;
118 ),
119
120 TP_printk("opcode=%lu", __entry->opcode),
121
122 opal_tracepoint_regfunc, opal_tracepoint_unregfunc
123);
124
125TRACE_EVENT_FN(opal_exit,
126
127 TP_PROTO(unsigned long opcode, unsigned long retval),
128
129 TP_ARGS(opcode, retval),
130
131 TP_STRUCT__entry(
132 __field(unsigned long, opcode)
133 __field(unsigned long, retval)
134 ),
135
136 TP_fast_assign(
137 __entry->opcode = opcode;
138 __entry->retval = retval;
139 ),
140
141 TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
142
143 opal_tracepoint_regfunc, opal_tracepoint_unregfunc
144);
145#endif
146
102#endif /* _TRACE_POWERPC_H */ 147#endif /* _TRACE_POWERPC_H */
103 148
104#undef TRACE_INCLUDE_PATH 149#undef TRACE_INCLUDE_PATH