diff options
Diffstat (limited to 'arch/powerpc/include')
26 files changed, 348 insertions, 80 deletions
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index 3eb53d741070..3a39283333c3 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h | |||
@@ -133,7 +133,6 @@ extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); | |||
133 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); | 133 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); |
134 | extern void _exception(int, struct pt_regs *, int, unsigned long); | 134 | extern void _exception(int, struct pt_regs *, int, unsigned long); |
135 | extern void die(const char *, struct pt_regs *, long); | 135 | extern void die(const char *, struct pt_regs *, long); |
136 | extern void print_backtrace(unsigned long *); | ||
137 | 136 | ||
138 | #endif /* !__ASSEMBLY__ */ | 137 | #endif /* !__ASSEMBLY__ */ |
139 | 138 | ||
diff --git a/arch/powerpc/include/asm/copro.h b/arch/powerpc/include/asm/copro.h new file mode 100644 index 000000000000..ce216df31381 --- /dev/null +++ b/arch/powerpc/include/asm/copro.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright 2014 IBM Corp. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef _ASM_POWERPC_COPRO_H | ||
11 | #define _ASM_POWERPC_COPRO_H | ||
12 | |||
13 | struct copro_slb | ||
14 | { | ||
15 | u64 esid, vsid; | ||
16 | }; | ||
17 | |||
18 | int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea, | ||
19 | unsigned long dsisr, unsigned *flt); | ||
20 | |||
21 | int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb); | ||
22 | |||
23 | |||
24 | #ifdef CONFIG_PPC_COPRO_BASE | ||
25 | void copro_flush_all_slbs(struct mm_struct *mm); | ||
26 | #else | ||
27 | static inline void copro_flush_all_slbs(struct mm_struct *mm) {} | ||
28 | #endif | ||
29 | #endif /* _ASM_POWERPC_COPRO_H */ | ||
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 150866b2a3fe..894d538f3567 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h | |||
@@ -135,6 +135,7 @@ static inline int dma_supported(struct device *dev, u64 mask) | |||
135 | 135 | ||
136 | extern int dma_set_mask(struct device *dev, u64 dma_mask); | 136 | extern int dma_set_mask(struct device *dev, u64 dma_mask); |
137 | extern int __dma_set_mask(struct device *dev, u64 dma_mask); | 137 | extern int __dma_set_mask(struct device *dev, u64 dma_mask); |
138 | extern u64 __dma_get_required_mask(struct device *dev); | ||
138 | 139 | ||
139 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) | 140 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
140 | 141 | ||
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index 9983c3d26bca..3b260efbfbf9 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h | |||
@@ -146,6 +146,11 @@ static inline struct pci_dev *eeh_dev_to_pci_dev(struct eeh_dev *edev) | |||
146 | return edev ? edev->pdev : NULL; | 146 | return edev ? edev->pdev : NULL; |
147 | } | 147 | } |
148 | 148 | ||
149 | static inline struct eeh_pe *eeh_dev_to_pe(struct eeh_dev* edev) | ||
150 | { | ||
151 | return edev ? edev->pe : NULL; | ||
152 | } | ||
153 | |||
149 | /* Return values from eeh_ops::next_error */ | 154 | /* Return values from eeh_ops::next_error */ |
150 | enum { | 155 | enum { |
151 | EEH_NEXT_ERR_NONE = 0, | 156 | EEH_NEXT_ERR_NONE = 0, |
@@ -167,6 +172,7 @@ enum { | |||
167 | #define EEH_OPT_ENABLE 1 /* EEH enable */ | 172 | #define EEH_OPT_ENABLE 1 /* EEH enable */ |
168 | #define EEH_OPT_THAW_MMIO 2 /* MMIO enable */ | 173 | #define EEH_OPT_THAW_MMIO 2 /* MMIO enable */ |
169 | #define EEH_OPT_THAW_DMA 3 /* DMA enable */ | 174 | #define EEH_OPT_THAW_DMA 3 /* DMA enable */ |
175 | #define EEH_OPT_FREEZE_PE 4 /* Freeze PE */ | ||
170 | #define EEH_STATE_UNAVAILABLE (1 << 0) /* State unavailable */ | 176 | #define EEH_STATE_UNAVAILABLE (1 << 0) /* State unavailable */ |
171 | #define EEH_STATE_NOT_SUPPORT (1 << 1) /* EEH not supported */ | 177 | #define EEH_STATE_NOT_SUPPORT (1 << 1) /* EEH not supported */ |
172 | #define EEH_STATE_RESET_ACTIVE (1 << 2) /* Active reset */ | 178 | #define EEH_STATE_RESET_ACTIVE (1 << 2) /* Active reset */ |
@@ -198,6 +204,8 @@ struct eeh_ops { | |||
198 | int (*wait_state)(struct eeh_pe *pe, int max_wait); | 204 | int (*wait_state)(struct eeh_pe *pe, int max_wait); |
199 | int (*get_log)(struct eeh_pe *pe, int severity, char *drv_log, unsigned long len); | 205 | int (*get_log)(struct eeh_pe *pe, int severity, char *drv_log, unsigned long len); |
200 | int (*configure_bridge)(struct eeh_pe *pe); | 206 | int (*configure_bridge)(struct eeh_pe *pe); |
207 | int (*err_inject)(struct eeh_pe *pe, int type, int func, | ||
208 | unsigned long addr, unsigned long mask); | ||
201 | int (*read_config)(struct device_node *dn, int where, int size, u32 *val); | 209 | int (*read_config)(struct device_node *dn, int where, int size, u32 *val); |
202 | int (*write_config)(struct device_node *dn, int where, int size, u32 val); | 210 | int (*write_config)(struct device_node *dn, int where, int size, u32 val); |
203 | int (*next_error)(struct eeh_pe **pe); | 211 | int (*next_error)(struct eeh_pe **pe); |
@@ -269,8 +277,7 @@ void eeh_dev_phb_init_dynamic(struct pci_controller *phb); | |||
269 | int eeh_init(void); | 277 | int eeh_init(void); |
270 | int __init eeh_ops_register(struct eeh_ops *ops); | 278 | int __init eeh_ops_register(struct eeh_ops *ops); |
271 | int __exit eeh_ops_unregister(const char *name); | 279 | int __exit eeh_ops_unregister(const char *name); |
272 | unsigned long eeh_check_failure(const volatile void __iomem *token, | 280 | int eeh_check_failure(const volatile void __iomem *token); |
273 | unsigned long val); | ||
274 | int eeh_dev_check_failure(struct eeh_dev *edev); | 281 | int eeh_dev_check_failure(struct eeh_dev *edev); |
275 | void eeh_addr_cache_build(void); | 282 | void eeh_addr_cache_build(void); |
276 | void eeh_add_device_early(struct device_node *); | 283 | void eeh_add_device_early(struct device_node *); |
@@ -279,6 +286,8 @@ void eeh_add_device_late(struct pci_dev *); | |||
279 | void eeh_add_device_tree_late(struct pci_bus *); | 286 | void eeh_add_device_tree_late(struct pci_bus *); |
280 | void eeh_add_sysfs_files(struct pci_bus *); | 287 | void eeh_add_sysfs_files(struct pci_bus *); |
281 | void eeh_remove_device(struct pci_dev *); | 288 | void eeh_remove_device(struct pci_dev *); |
289 | int eeh_unfreeze_pe(struct eeh_pe *pe, bool sw_state); | ||
290 | int eeh_pe_reset_and_recover(struct eeh_pe *pe); | ||
282 | int eeh_dev_open(struct pci_dev *pdev); | 291 | int eeh_dev_open(struct pci_dev *pdev); |
283 | void eeh_dev_release(struct pci_dev *pdev); | 292 | void eeh_dev_release(struct pci_dev *pdev); |
284 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group); | 293 | struct eeh_pe *eeh_iommu_group_to_pe(struct iommu_group *group); |
@@ -321,9 +330,9 @@ static inline void *eeh_dev_init(struct device_node *dn, void *data) | |||
321 | 330 | ||
322 | static inline void eeh_dev_phb_init_dynamic(struct pci_controller *phb) { } | 331 | static inline void eeh_dev_phb_init_dynamic(struct pci_controller *phb) { } |
323 | 332 | ||
324 | static inline unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val) | 333 | static inline int eeh_check_failure(const volatile void __iomem *token) |
325 | { | 334 | { |
326 | return val; | 335 | return 0; |
327 | } | 336 | } |
328 | 337 | ||
329 | #define eeh_dev_check_failure(x) (0) | 338 | #define eeh_dev_check_failure(x) (0) |
@@ -354,7 +363,7 @@ static inline u8 eeh_readb(const volatile void __iomem *addr) | |||
354 | { | 363 | { |
355 | u8 val = in_8(addr); | 364 | u8 val = in_8(addr); |
356 | if (EEH_POSSIBLE_ERROR(val, u8)) | 365 | if (EEH_POSSIBLE_ERROR(val, u8)) |
357 | return eeh_check_failure(addr, val); | 366 | eeh_check_failure(addr); |
358 | return val; | 367 | return val; |
359 | } | 368 | } |
360 | 369 | ||
@@ -362,7 +371,7 @@ static inline u16 eeh_readw(const volatile void __iomem *addr) | |||
362 | { | 371 | { |
363 | u16 val = in_le16(addr); | 372 | u16 val = in_le16(addr); |
364 | if (EEH_POSSIBLE_ERROR(val, u16)) | 373 | if (EEH_POSSIBLE_ERROR(val, u16)) |
365 | return eeh_check_failure(addr, val); | 374 | eeh_check_failure(addr); |
366 | return val; | 375 | return val; |
367 | } | 376 | } |
368 | 377 | ||
@@ -370,7 +379,7 @@ static inline u32 eeh_readl(const volatile void __iomem *addr) | |||
370 | { | 379 | { |
371 | u32 val = in_le32(addr); | 380 | u32 val = in_le32(addr); |
372 | if (EEH_POSSIBLE_ERROR(val, u32)) | 381 | if (EEH_POSSIBLE_ERROR(val, u32)) |
373 | return eeh_check_failure(addr, val); | 382 | eeh_check_failure(addr); |
374 | return val; | 383 | return val; |
375 | } | 384 | } |
376 | 385 | ||
@@ -378,7 +387,7 @@ static inline u64 eeh_readq(const volatile void __iomem *addr) | |||
378 | { | 387 | { |
379 | u64 val = in_le64(addr); | 388 | u64 val = in_le64(addr); |
380 | if (EEH_POSSIBLE_ERROR(val, u64)) | 389 | if (EEH_POSSIBLE_ERROR(val, u64)) |
381 | return eeh_check_failure(addr, val); | 390 | eeh_check_failure(addr); |
382 | return val; | 391 | return val; |
383 | } | 392 | } |
384 | 393 | ||
@@ -386,7 +395,7 @@ static inline u16 eeh_readw_be(const volatile void __iomem *addr) | |||
386 | { | 395 | { |
387 | u16 val = in_be16(addr); | 396 | u16 val = in_be16(addr); |
388 | if (EEH_POSSIBLE_ERROR(val, u16)) | 397 | if (EEH_POSSIBLE_ERROR(val, u16)) |
389 | return eeh_check_failure(addr, val); | 398 | eeh_check_failure(addr); |
390 | return val; | 399 | return val; |
391 | } | 400 | } |
392 | 401 | ||
@@ -394,7 +403,7 @@ static inline u32 eeh_readl_be(const volatile void __iomem *addr) | |||
394 | { | 403 | { |
395 | u32 val = in_be32(addr); | 404 | u32 val = in_be32(addr); |
396 | if (EEH_POSSIBLE_ERROR(val, u32)) | 405 | if (EEH_POSSIBLE_ERROR(val, u32)) |
397 | return eeh_check_failure(addr, val); | 406 | eeh_check_failure(addr); |
398 | return val; | 407 | return val; |
399 | } | 408 | } |
400 | 409 | ||
@@ -402,7 +411,7 @@ static inline u64 eeh_readq_be(const volatile void __iomem *addr) | |||
402 | { | 411 | { |
403 | u64 val = in_be64(addr); | 412 | u64 val = in_be64(addr); |
404 | if (EEH_POSSIBLE_ERROR(val, u64)) | 413 | if (EEH_POSSIBLE_ERROR(val, u64)) |
405 | return eeh_check_failure(addr, val); | 414 | eeh_check_failure(addr); |
406 | return val; | 415 | return val; |
407 | } | 416 | } |
408 | 417 | ||
@@ -416,7 +425,7 @@ static inline void eeh_memcpy_fromio(void *dest, const | |||
416 | * were copied. Check all four bytes. | 425 | * were copied. Check all four bytes. |
417 | */ | 426 | */ |
418 | if (n >= 4 && EEH_POSSIBLE_ERROR(*((u32 *)(dest + n - 4)), u32)) | 427 | if (n >= 4 && EEH_POSSIBLE_ERROR(*((u32 *)(dest + n - 4)), u32)) |
419 | eeh_check_failure(src, *((u32 *)(dest + n - 4))); | 428 | eeh_check_failure(src); |
420 | } | 429 | } |
421 | 430 | ||
422 | /* in-string eeh macros */ | 431 | /* in-string eeh macros */ |
@@ -425,7 +434,7 @@ static inline void eeh_readsb(const volatile void __iomem *addr, void * buf, | |||
425 | { | 434 | { |
426 | _insb(addr, buf, ns); | 435 | _insb(addr, buf, ns); |
427 | if (EEH_POSSIBLE_ERROR((*(((u8*)buf)+ns-1)), u8)) | 436 | if (EEH_POSSIBLE_ERROR((*(((u8*)buf)+ns-1)), u8)) |
428 | eeh_check_failure(addr, *(u8*)buf); | 437 | eeh_check_failure(addr); |
429 | } | 438 | } |
430 | 439 | ||
431 | static inline void eeh_readsw(const volatile void __iomem *addr, void * buf, | 440 | static inline void eeh_readsw(const volatile void __iomem *addr, void * buf, |
@@ -433,7 +442,7 @@ static inline void eeh_readsw(const volatile void __iomem *addr, void * buf, | |||
433 | { | 442 | { |
434 | _insw(addr, buf, ns); | 443 | _insw(addr, buf, ns); |
435 | if (EEH_POSSIBLE_ERROR((*(((u16*)buf)+ns-1)), u16)) | 444 | if (EEH_POSSIBLE_ERROR((*(((u16*)buf)+ns-1)), u16)) |
436 | eeh_check_failure(addr, *(u16*)buf); | 445 | eeh_check_failure(addr); |
437 | } | 446 | } |
438 | 447 | ||
439 | static inline void eeh_readsl(const volatile void __iomem *addr, void * buf, | 448 | static inline void eeh_readsl(const volatile void __iomem *addr, void * buf, |
@@ -441,7 +450,7 @@ static inline void eeh_readsl(const volatile void __iomem *addr, void * buf, | |||
441 | { | 450 | { |
442 | _insl(addr, buf, nl); | 451 | _insl(addr, buf, nl); |
443 | if (EEH_POSSIBLE_ERROR((*(((u32*)buf)+nl-1)), u32)) | 452 | if (EEH_POSSIBLE_ERROR((*(((u32*)buf)+nl-1)), u32)) |
444 | eeh_check_failure(addr, *(u32*)buf); | 453 | eeh_check_failure(addr); |
445 | } | 454 | } |
446 | 455 | ||
447 | #endif /* CONFIG_PPC64 */ | 456 | #endif /* CONFIG_PPC64 */ |
diff --git a/arch/powerpc/include/asm/hydra.h b/arch/powerpc/include/asm/hydra.h index 5b0c98bd46ab..1cb39c96d155 100644 --- a/arch/powerpc/include/asm/hydra.h +++ b/arch/powerpc/include/asm/hydra.h | |||
@@ -95,7 +95,6 @@ extern volatile struct Hydra __iomem *Hydra; | |||
95 | #define HYDRA_INT_SPARE 19 | 95 | #define HYDRA_INT_SPARE 19 |
96 | 96 | ||
97 | extern int hydra_init(void); | 97 | extern int hydra_init(void); |
98 | extern void macio_adb_init(void); | ||
99 | 98 | ||
100 | #endif /* __KERNEL__ */ | 99 | #endif /* __KERNEL__ */ |
101 | 100 | ||
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h index 41f13cec8a8f..e8e3a0a04eb0 100644 --- a/arch/powerpc/include/asm/irq.h +++ b/arch/powerpc/include/asm/irq.h | |||
@@ -31,11 +31,6 @@ extern atomic_t ppc_n_lost_interrupts; | |||
31 | 31 | ||
32 | extern irq_hw_number_t virq_to_hw(unsigned int virq); | 32 | extern irq_hw_number_t virq_to_hw(unsigned int virq); |
33 | 33 | ||
34 | /** | ||
35 | * irq_early_init - Init irq remapping subsystem | ||
36 | */ | ||
37 | extern void irq_early_init(void); | ||
38 | |||
39 | static __inline__ int irq_canonicalize(int irq) | 34 | static __inline__ int irq_canonicalize(int irq) |
40 | { | 35 | { |
41 | return irq; | 36 | return irq; |
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index 16d7e33d35e9..19c36cba37c4 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h | |||
@@ -81,7 +81,6 @@ extern void default_machine_crash_shutdown(struct pt_regs *regs); | |||
81 | extern int crash_shutdown_register(crash_shutdown_t handler); | 81 | extern int crash_shutdown_register(crash_shutdown_t handler); |
82 | extern int crash_shutdown_unregister(crash_shutdown_t handler); | 82 | extern int crash_shutdown_unregister(crash_shutdown_t handler); |
83 | 83 | ||
84 | extern void machine_kexec_simple(struct kimage *image); | ||
85 | extern void crash_kexec_secondary(struct pt_regs *regs); | 84 | extern void crash_kexec_secondary(struct pt_regs *regs); |
86 | extern int overlaps_crashkernel(unsigned long start, unsigned long size); | 85 | extern int overlaps_crashkernel(unsigned long start, unsigned long size); |
87 | extern void reserve_crashkernel(void); | 86 | extern void reserve_crashkernel(void); |
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 3af721633618..307347f8ddbd 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -328,8 +328,6 @@ extern struct machdep_calls *machine_id; | |||
328 | 328 | ||
329 | extern void probe_machine(void); | 329 | extern void probe_machine(void); |
330 | 330 | ||
331 | extern char cmd_line[COMMAND_LINE_SIZE]; | ||
332 | |||
333 | #ifdef CONFIG_PPC_PMAC | 331 | #ifdef CONFIG_PPC_PMAC |
334 | /* | 332 | /* |
335 | * Power macintoshes have either a CUDA, PMU or SMU controlling | 333 | * Power macintoshes have either a CUDA, PMU or SMU controlling |
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h index d76514487d6f..aeebc94b2bce 100644 --- a/arch/powerpc/include/asm/mmu-hash64.h +++ b/arch/powerpc/include/asm/mmu-hash64.h | |||
@@ -190,6 +190,13 @@ static inline unsigned int mmu_psize_to_shift(unsigned int mmu_psize) | |||
190 | 190 | ||
191 | #ifndef __ASSEMBLY__ | 191 | #ifndef __ASSEMBLY__ |
192 | 192 | ||
193 | static inline int slb_vsid_shift(int ssize) | ||
194 | { | ||
195 | if (ssize == MMU_SEGSIZE_256M) | ||
196 | return SLB_VSID_SHIFT; | ||
197 | return SLB_VSID_SHIFT_1T; | ||
198 | } | ||
199 | |||
193 | static inline int segment_shift(int ssize) | 200 | static inline int segment_shift(int ssize) |
194 | { | 201 | { |
195 | if (ssize == MMU_SEGSIZE_256M) | 202 | if (ssize == MMU_SEGSIZE_256M) |
@@ -317,6 +324,7 @@ extern int __hash_page_64K(unsigned long ea, unsigned long access, | |||
317 | unsigned int local, int ssize); | 324 | unsigned int local, int ssize); |
318 | struct mm_struct; | 325 | struct mm_struct; |
319 | unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap); | 326 | unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap); |
327 | extern int hash_page_mm(struct mm_struct *mm, unsigned long ea, unsigned long access, unsigned long trap); | ||
320 | extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); | 328 | extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); |
321 | int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, | 329 | int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, |
322 | pte_t *ptep, unsigned long trap, int local, int ssize, | 330 | pte_t *ptep, unsigned long trap, int local, int ssize, |
@@ -342,6 +350,8 @@ extern void hash_failure_debug(unsigned long ea, unsigned long access, | |||
342 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | 350 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, |
343 | unsigned long pstart, unsigned long prot, | 351 | unsigned long pstart, unsigned long prot, |
344 | int psize, int ssize); | 352 | int psize, int ssize); |
353 | int htab_remove_mapping(unsigned long vstart, unsigned long vend, | ||
354 | int psize, int ssize); | ||
345 | extern void add_gpage(u64 addr, u64 page_size, unsigned long number_of_pages); | 355 | extern void add_gpage(u64 addr, u64 page_size, unsigned long number_of_pages); |
346 | extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr); | 356 | extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr); |
347 | 357 | ||
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 86055e598269..9124b0ede1fc 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
@@ -135,6 +135,7 @@ struct opal_sg_list { | |||
135 | #define OPAL_FLASH_MANAGE 77 | 135 | #define OPAL_FLASH_MANAGE 77 |
136 | #define OPAL_FLASH_UPDATE 78 | 136 | #define OPAL_FLASH_UPDATE 78 |
137 | #define OPAL_RESYNC_TIMEBASE 79 | 137 | #define OPAL_RESYNC_TIMEBASE 79 |
138 | #define OPAL_CHECK_TOKEN 80 | ||
138 | #define OPAL_DUMP_INIT 81 | 139 | #define OPAL_DUMP_INIT 81 |
139 | #define OPAL_DUMP_INFO 82 | 140 | #define OPAL_DUMP_INFO 82 |
140 | #define OPAL_DUMP_READ 83 | 141 | #define OPAL_DUMP_READ 83 |
@@ -146,7 +147,9 @@ struct opal_sg_list { | |||
146 | #define OPAL_GET_PARAM 89 | 147 | #define OPAL_GET_PARAM 89 |
147 | #define OPAL_SET_PARAM 90 | 148 | #define OPAL_SET_PARAM 90 |
148 | #define OPAL_DUMP_RESEND 91 | 149 | #define OPAL_DUMP_RESEND 91 |
150 | #define OPAL_PCI_SET_PHB_CXL_MODE 93 | ||
149 | #define OPAL_DUMP_INFO2 94 | 151 | #define OPAL_DUMP_INFO2 94 |
152 | #define OPAL_PCI_ERR_INJECT 96 | ||
150 | #define OPAL_PCI_EEH_FREEZE_SET 97 | 153 | #define OPAL_PCI_EEH_FREEZE_SET 97 |
151 | #define OPAL_HANDLE_HMI 98 | 154 | #define OPAL_HANDLE_HMI 98 |
152 | #define OPAL_REGISTER_DUMP_REGION 101 | 155 | #define OPAL_REGISTER_DUMP_REGION 101 |
@@ -199,6 +202,35 @@ enum OpalPciErrorSeverity { | |||
199 | OPAL_EEH_SEV_INF = 5 | 202 | OPAL_EEH_SEV_INF = 5 |
200 | }; | 203 | }; |
201 | 204 | ||
205 | enum OpalErrinjectType { | ||
206 | OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR = 0, | ||
207 | OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64 = 1, | ||
208 | }; | ||
209 | |||
210 | enum OpalErrinjectFunc { | ||
211 | /* IOA bus specific errors */ | ||
212 | OPAL_ERR_INJECT_FUNC_IOA_LD_MEM_ADDR = 0, | ||
213 | OPAL_ERR_INJECT_FUNC_IOA_LD_MEM_DATA = 1, | ||
214 | OPAL_ERR_INJECT_FUNC_IOA_LD_IO_ADDR = 2, | ||
215 | OPAL_ERR_INJECT_FUNC_IOA_LD_IO_DATA = 3, | ||
216 | OPAL_ERR_INJECT_FUNC_IOA_LD_CFG_ADDR = 4, | ||
217 | OPAL_ERR_INJECT_FUNC_IOA_LD_CFG_DATA = 5, | ||
218 | OPAL_ERR_INJECT_FUNC_IOA_ST_MEM_ADDR = 6, | ||
219 | OPAL_ERR_INJECT_FUNC_IOA_ST_MEM_DATA = 7, | ||
220 | OPAL_ERR_INJECT_FUNC_IOA_ST_IO_ADDR = 8, | ||
221 | OPAL_ERR_INJECT_FUNC_IOA_ST_IO_DATA = 9, | ||
222 | OPAL_ERR_INJECT_FUNC_IOA_ST_CFG_ADDR = 10, | ||
223 | OPAL_ERR_INJECT_FUNC_IOA_ST_CFG_DATA = 11, | ||
224 | OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_ADDR = 12, | ||
225 | OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_DATA = 13, | ||
226 | OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_MASTER = 14, | ||
227 | OPAL_ERR_INJECT_FUNC_IOA_DMA_RD_TARGET = 15, | ||
228 | OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_ADDR = 16, | ||
229 | OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_DATA = 17, | ||
230 | OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_MASTER = 18, | ||
231 | OPAL_ERR_INJECT_FUNC_IOA_DMA_WR_TARGET = 19, | ||
232 | }; | ||
233 | |||
202 | enum OpalShpcAction { | 234 | enum OpalShpcAction { |
203 | OPAL_SHPC_GET_LINK_STATE = 0, | 235 | OPAL_SHPC_GET_LINK_STATE = 0, |
204 | OPAL_SHPC_GET_SLOT_STATE = 1 | 236 | OPAL_SHPC_GET_SLOT_STATE = 1 |
@@ -356,9 +388,12 @@ enum OpalM64EnableAction { | |||
356 | }; | 388 | }; |
357 | 389 | ||
358 | enum OpalPciResetScope { | 390 | enum OpalPciResetScope { |
359 | OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3, | 391 | OPAL_RESET_PHB_COMPLETE = 1, |
360 | OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5, | 392 | OPAL_RESET_PCI_LINK = 2, |
361 | OPAL_PCI_IODA_TABLE_RESET = 6, | 393 | OPAL_RESET_PHB_ERROR = 3, |
394 | OPAL_RESET_PCI_HOT = 4, | ||
395 | OPAL_RESET_PCI_FUNDAMENTAL = 5, | ||
396 | OPAL_RESET_PCI_IODA_TABLE = 6 | ||
362 | }; | 397 | }; |
363 | 398 | ||
364 | enum OpalPciReinitScope { | 399 | enum OpalPciReinitScope { |
@@ -819,6 +854,8 @@ int64_t opal_pci_eeh_freeze_clear(uint64_t phb_id, uint64_t pe_number, | |||
819 | uint64_t eeh_action_token); | 854 | uint64_t eeh_action_token); |
820 | int64_t opal_pci_eeh_freeze_set(uint64_t phb_id, uint64_t pe_number, | 855 | int64_t opal_pci_eeh_freeze_set(uint64_t phb_id, uint64_t pe_number, |
821 | uint64_t eeh_action_token); | 856 | uint64_t eeh_action_token); |
857 | int64_t opal_pci_err_inject(uint64_t phb_id, uint32_t pe_no, uint32_t type, | ||
858 | uint32_t func, uint64_t addr, uint64_t mask); | ||
822 | int64_t opal_pci_shpc(uint64_t phb_id, uint64_t shpc_action, uint8_t *state); | 859 | int64_t opal_pci_shpc(uint64_t phb_id, uint64_t shpc_action, uint8_t *state); |
823 | 860 | ||
824 | 861 | ||
@@ -887,6 +924,7 @@ int64_t opal_pci_next_error(uint64_t phb_id, __be64 *first_frozen_pe, | |||
887 | __be16 *pci_error_type, __be16 *severity); | 924 | __be16 *pci_error_type, __be16 *severity); |
888 | int64_t opal_pci_poll(uint64_t phb_id); | 925 | int64_t opal_pci_poll(uint64_t phb_id); |
889 | int64_t opal_return_cpu(void); | 926 | int64_t opal_return_cpu(void); |
927 | int64_t opal_check_token(uint64_t token); | ||
890 | int64_t opal_reinit_cpus(uint64_t flags); | 928 | int64_t opal_reinit_cpus(uint64_t flags); |
891 | 929 | ||
892 | int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val); | 930 | int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val); |
@@ -924,6 +962,7 @@ int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data); | |||
924 | int64_t opal_handle_hmi(void); | 962 | int64_t opal_handle_hmi(void); |
925 | int64_t opal_register_dump_region(uint32_t id, uint64_t start, uint64_t end); | 963 | int64_t opal_register_dump_region(uint32_t id, uint64_t start, uint64_t end); |
926 | int64_t opal_unregister_dump_region(uint32_t id); | 964 | int64_t opal_unregister_dump_region(uint32_t id); |
965 | int64_t opal_pci_set_phb_cxl_mode(uint64_t phb_id, uint64_t mode, uint64_t pe_number); | ||
927 | 966 | ||
928 | /* Internal functions */ | 967 | /* Internal functions */ |
929 | extern int early_init_dt_scan_opal(unsigned long node, const char *uname, | 968 | extern int early_init_dt_scan_opal(unsigned long node, const char *uname, |
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h index 88693cef4f3d..d908a46d05c0 100644 --- a/arch/powerpc/include/asm/page_64.h +++ b/arch/powerpc/include/asm/page_64.h | |||
@@ -42,20 +42,40 @@ | |||
42 | 42 | ||
43 | typedef unsigned long pte_basic_t; | 43 | typedef unsigned long pte_basic_t; |
44 | 44 | ||
45 | static __inline__ void clear_page(void *addr) | 45 | static inline void clear_page(void *addr) |
46 | { | 46 | { |
47 | unsigned long lines, line_size; | 47 | unsigned long iterations; |
48 | 48 | unsigned long onex, twox, fourx, eightx; | |
49 | line_size = ppc64_caches.dline_size; | 49 | |
50 | lines = ppc64_caches.dlines_per_page; | 50 | iterations = ppc64_caches.dlines_per_page / 8; |
51 | 51 | ||
52 | __asm__ __volatile__( | 52 | /* |
53 | * Some verisions of gcc use multiply instructions to | ||
54 | * calculate the offsets so lets give it a hand to | ||
55 | * do better. | ||
56 | */ | ||
57 | onex = ppc64_caches.dline_size; | ||
58 | twox = onex << 1; | ||
59 | fourx = onex << 2; | ||
60 | eightx = onex << 3; | ||
61 | |||
62 | asm volatile( | ||
53 | "mtctr %1 # clear_page\n\ | 63 | "mtctr %1 # clear_page\n\ |
54 | 1: dcbz 0,%0\n\ | 64 | .balign 16\n\ |
55 | add %0,%0,%3\n\ | 65 | 1: dcbz 0,%0\n\ |
66 | dcbz %3,%0\n\ | ||
67 | dcbz %4,%0\n\ | ||
68 | dcbz %5,%0\n\ | ||
69 | dcbz %6,%0\n\ | ||
70 | dcbz %7,%0\n\ | ||
71 | dcbz %8,%0\n\ | ||
72 | dcbz %9,%0\n\ | ||
73 | add %0,%0,%10\n\ | ||
56 | bdnz+ 1b" | 74 | bdnz+ 1b" |
57 | : "=r" (addr) | 75 | : "=&r" (addr) |
58 | : "r" (lines), "0" (addr), "r" (line_size) | 76 | : "r" (iterations), "0" (addr), "b" (onex), "b" (twox), |
77 | "b" (twox+onex), "b" (fourx), "b" (fourx+onex), | ||
78 | "b" (twox+fourx), "b" (eightx-onex), "r" (eightx) | ||
59 | : "ctr", "memory"); | 79 | : "ctr", "memory"); |
60 | } | 80 | } |
61 | 81 | ||
@@ -104,7 +124,6 @@ extern unsigned long slice_get_unmapped_area(unsigned long addr, | |||
104 | extern unsigned int get_slice_psize(struct mm_struct *mm, | 124 | extern unsigned int get_slice_psize(struct mm_struct *mm, |
105 | unsigned long addr); | 125 | unsigned long addr); |
106 | 126 | ||
107 | extern void slice_init_context(struct mm_struct *mm, unsigned int psize); | ||
108 | extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); | 127 | extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); |
109 | extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start, | 128 | extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start, |
110 | unsigned long len, unsigned int psize); | 129 | unsigned long len, unsigned int psize); |
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h index 47edde8c3556..945e47adf7db 100644 --- a/arch/powerpc/include/asm/pgtable-ppc32.h +++ b/arch/powerpc/include/asm/pgtable-ppc32.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #include <linux/threads.h> | 8 | #include <linux/threads.h> |
9 | #include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */ | 9 | #include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */ |
10 | 10 | ||
11 | extern unsigned long va_to_phys(unsigned long address); | ||
12 | extern pte_t *va_to_pte(unsigned long address); | ||
13 | extern unsigned long ioremap_bot; | 11 | extern unsigned long ioremap_bot; |
14 | 12 | ||
15 | #ifdef CONFIG_44x | 13 | #ifdef CONFIG_44x |
@@ -50,10 +48,10 @@ extern int icache_44x_need_flush; | |||
50 | #define FIRST_USER_ADDRESS 0 | 48 | #define FIRST_USER_ADDRESS 0 |
51 | 49 | ||
52 | #define pte_ERROR(e) \ | 50 | #define pte_ERROR(e) \ |
53 | printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \ | 51 | pr_err("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \ |
54 | (unsigned long long)pte_val(e)) | 52 | (unsigned long long)pte_val(e)) |
55 | #define pgd_ERROR(e) \ | 53 | #define pgd_ERROR(e) \ |
56 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) | 54 | pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) |
57 | 55 | ||
58 | /* | 56 | /* |
59 | * This is the bottom of the PKMAP area with HIGHMEM or an arbitrary | 57 | * This is the bottom of the PKMAP area with HIGHMEM or an arbitrary |
diff --git a/arch/powerpc/include/asm/pgtable-ppc64-4k.h b/arch/powerpc/include/asm/pgtable-ppc64-4k.h index 12798c9d4b4b..7b935683f268 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64-4k.h +++ b/arch/powerpc/include/asm/pgtable-ppc64-4k.h | |||
@@ -64,7 +64,7 @@ | |||
64 | (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) | 64 | (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))) |
65 | 65 | ||
66 | #define pud_ERROR(e) \ | 66 | #define pud_ERROR(e) \ |
67 | printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e)) | 67 | pr_err("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e)) |
68 | 68 | ||
69 | /* | 69 | /* |
70 | * On all 4K setups, remap_4k_pfn() equates to remap_pfn_range() */ | 70 | * On all 4K setups, remap_4k_pfn() equates to remap_pfn_range() */ |
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index 7b3d54fae46f..ae153c40ab7c 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h | |||
@@ -328,11 +328,11 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry) | |||
328 | #define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) | 328 | #define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) |
329 | 329 | ||
330 | #define pte_ERROR(e) \ | 330 | #define pte_ERROR(e) \ |
331 | printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) | 331 | pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) |
332 | #define pmd_ERROR(e) \ | 332 | #define pmd_ERROR(e) \ |
333 | printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) | 333 | pr_err("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) |
334 | #define pgd_ERROR(e) \ | 334 | #define pgd_ERROR(e) \ |
335 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) | 335 | pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) |
336 | 336 | ||
337 | /* Encode and de-code a swap entry */ | 337 | /* Encode and de-code a swap entry */ |
338 | #define __swp_type(entry) (((entry).val >> 1) & 0x3f) | 338 | #define __swp_type(entry) (((entry).val >> 1) & 0x3f) |
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index f60d4ea8b50c..316f9a5da173 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #ifndef __ASSEMBLY__ | 5 | #ifndef __ASSEMBLY__ |
6 | #include <linux/mmdebug.h> | 6 | #include <linux/mmdebug.h> |
7 | #include <linux/mmzone.h> | ||
7 | #include <asm/processor.h> /* For TASK_SIZE */ | 8 | #include <asm/processor.h> /* For TASK_SIZE */ |
8 | #include <asm/mmu.h> | 9 | #include <asm/mmu.h> |
9 | #include <asm/page.h> | 10 | #include <asm/page.h> |
@@ -248,6 +249,8 @@ extern unsigned long empty_zero_page[]; | |||
248 | 249 | ||
249 | extern pgd_t swapper_pg_dir[]; | 250 | extern pgd_t swapper_pg_dir[]; |
250 | 251 | ||
252 | void limit_zone_pfn(enum zone_type zone, unsigned long max_pfn); | ||
253 | int dma_pfn_limit_to_zone(u64 pfn_limit); | ||
251 | extern void paging_init(void); | 254 | extern void paging_init(void); |
252 | 255 | ||
253 | /* | 256 | /* |
diff --git a/arch/powerpc/include/asm/plpar_wrappers.h b/arch/powerpc/include/asm/plpar_wrappers.h index 12c32c5f533d..67859edbf8fd 100644 --- a/arch/powerpc/include/asm/plpar_wrappers.h +++ b/arch/powerpc/include/asm/plpar_wrappers.h | |||
@@ -273,7 +273,7 @@ static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, | |||
273 | static inline long enable_reloc_on_exceptions(void) | 273 | static inline long enable_reloc_on_exceptions(void) |
274 | { | 274 | { |
275 | /* mflags = 3: Exceptions at 0xC000000000004000 */ | 275 | /* mflags = 3: Exceptions at 0xC000000000004000 */ |
276 | return plpar_set_mode(3, 3, 0, 0); | 276 | return plpar_set_mode(3, H_SET_MODE_RESOURCE_ADDR_TRANS_MODE, 0, 0); |
277 | } | 277 | } |
278 | 278 | ||
279 | /* | 279 | /* |
@@ -284,7 +284,7 @@ static inline long enable_reloc_on_exceptions(void) | |||
284 | * returns H_SUCCESS. | 284 | * returns H_SUCCESS. |
285 | */ | 285 | */ |
286 | static inline long disable_reloc_on_exceptions(void) { | 286 | static inline long disable_reloc_on_exceptions(void) { |
287 | return plpar_set_mode(0, 3, 0, 0); | 287 | return plpar_set_mode(0, H_SET_MODE_RESOURCE_ADDR_TRANS_MODE, 0, 0); |
288 | } | 288 | } |
289 | 289 | ||
290 | /* | 290 | /* |
@@ -297,7 +297,7 @@ static inline long disable_reloc_on_exceptions(void) { | |||
297 | static inline long enable_big_endian_exceptions(void) | 297 | static inline long enable_big_endian_exceptions(void) |
298 | { | 298 | { |
299 | /* mflags = 0: big endian exceptions */ | 299 | /* mflags = 0: big endian exceptions */ |
300 | return plpar_set_mode(0, 4, 0, 0); | 300 | return plpar_set_mode(0, H_SET_MODE_RESOURCE_LE, 0, 0); |
301 | } | 301 | } |
302 | 302 | ||
303 | /* | 303 | /* |
@@ -310,17 +310,17 @@ static inline long enable_big_endian_exceptions(void) | |||
310 | static inline long enable_little_endian_exceptions(void) | 310 | static inline long enable_little_endian_exceptions(void) |
311 | { | 311 | { |
312 | /* mflags = 1: little endian exceptions */ | 312 | /* mflags = 1: little endian exceptions */ |
313 | return plpar_set_mode(1, 4, 0, 0); | 313 | return plpar_set_mode(1, H_SET_MODE_RESOURCE_LE, 0, 0); |
314 | } | 314 | } |
315 | 315 | ||
316 | static inline long plapr_set_ciabr(unsigned long ciabr) | 316 | static inline long plapr_set_ciabr(unsigned long ciabr) |
317 | { | 317 | { |
318 | return plpar_set_mode(0, 1, ciabr, 0); | 318 | return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_CIABR, ciabr, 0); |
319 | } | 319 | } |
320 | 320 | ||
321 | static inline long plapr_set_watchpoint0(unsigned long dawr0, unsigned long dawrx0) | 321 | static inline long plapr_set_watchpoint0(unsigned long dawr0, unsigned long dawrx0) |
322 | { | 322 | { |
323 | return plpar_set_mode(0, 2, dawr0, dawrx0); | 323 | return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_DAWR, dawr0, dawrx0); |
324 | } | 324 | } |
325 | 325 | ||
326 | #endif /* _ASM_POWERPC_PLPAR_WRAPPERS_H */ | 326 | #endif /* _ASM_POWERPC_PLPAR_WRAPPERS_H */ |
diff --git a/arch/powerpc/include/asm/pnv-pci.h b/arch/powerpc/include/asm/pnv-pci.h new file mode 100644 index 000000000000..f09a22fa1bd7 --- /dev/null +++ b/arch/powerpc/include/asm/pnv-pci.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright 2014 IBM Corp. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef _ASM_PNV_PCI_H | ||
11 | #define _ASM_PNV_PCI_H | ||
12 | |||
13 | #include <linux/pci.h> | ||
14 | #include <misc/cxl.h> | ||
15 | |||
16 | int pnv_phb_to_cxl(struct pci_dev *dev); | ||
17 | int pnv_cxl_ioda_msi_setup(struct pci_dev *dev, unsigned int hwirq, | ||
18 | unsigned int virq); | ||
19 | int pnv_cxl_alloc_hwirqs(struct pci_dev *dev, int num); | ||
20 | void pnv_cxl_release_hwirqs(struct pci_dev *dev, int hwirq, int num); | ||
21 | int pnv_cxl_get_irq_count(struct pci_dev *dev); | ||
22 | struct device_node *pnv_pci_to_phb_node(struct pci_dev *dev); | ||
23 | |||
24 | #ifdef CONFIG_CXL_BASE | ||
25 | int pnv_cxl_alloc_hwirq_ranges(struct cxl_irq_ranges *irqs, | ||
26 | struct pci_dev *dev, int num); | ||
27 | void pnv_cxl_release_hwirq_ranges(struct cxl_irq_ranges *irqs, | ||
28 | struct pci_dev *dev); | ||
29 | #endif | ||
30 | |||
31 | #endif | ||
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index 74b79f07f041..7f436ba1b56f 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h | |||
@@ -76,8 +76,6 @@ void of_parse_dma_window(struct device_node *dn, const __be32 *dma_window, | |||
76 | unsigned long *busno, unsigned long *phys, | 76 | unsigned long *busno, unsigned long *phys, |
77 | unsigned long *size); | 77 | unsigned long *size); |
78 | 78 | ||
79 | extern void kdump_move_device_tree(void); | ||
80 | |||
81 | extern void of_instantiate_rtc(void); | 79 | extern void of_instantiate_rtc(void); |
82 | 80 | ||
83 | extern int of_get_ibm_chip_id(struct device_node *np); | 81 | extern int of_get_ibm_chip_id(struct device_node *np); |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 0c0505956a29..fe3f9488f321 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -947,7 +947,7 @@ | |||
947 | * 32-bit 8xx: | 947 | * 32-bit 8xx: |
948 | * - SPRG0 scratch for exception vectors | 948 | * - SPRG0 scratch for exception vectors |
949 | * - SPRG1 scratch for exception vectors | 949 | * - SPRG1 scratch for exception vectors |
950 | * - SPRG2 apparently unused but initialized | 950 | * - SPRG2 scratch for exception vectors |
951 | * | 951 | * |
952 | */ | 952 | */ |
953 | #ifdef CONFIG_PPC64 | 953 | #ifdef CONFIG_PPC64 |
@@ -1057,6 +1057,7 @@ | |||
1057 | #ifdef CONFIG_8xx | 1057 | #ifdef CONFIG_8xx |
1058 | #define SPRN_SPRG_SCRATCH0 SPRN_SPRG0 | 1058 | #define SPRN_SPRG_SCRATCH0 SPRN_SPRG0 |
1059 | #define SPRN_SPRG_SCRATCH1 SPRN_SPRG1 | 1059 | #define SPRN_SPRG_SCRATCH1 SPRN_SPRG1 |
1060 | #define SPRN_SPRG_SCRATCH2 SPRN_SPRG2 | ||
1060 | #endif | 1061 | #endif |
1061 | 1062 | ||
1062 | 1063 | ||
diff --git a/arch/powerpc/include/asm/rio.h b/arch/powerpc/include/asm/rio.h index b1d2deceeedb..ec800f28fec5 100644 --- a/arch/powerpc/include/asm/rio.h +++ b/arch/powerpc/include/asm/rio.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #ifndef ASM_PPC_RIO_H | 13 | #ifndef ASM_PPC_RIO_H |
14 | #define ASM_PPC_RIO_H | 14 | #define ASM_PPC_RIO_H |
15 | 15 | ||
16 | extern void platform_rio_init(void); | ||
17 | #ifdef CONFIG_FSL_RIO | 16 | #ifdef CONFIG_FSL_RIO |
18 | extern int fsl_rio_mcheck_exception(struct pt_regs *); | 17 | extern int fsl_rio_mcheck_exception(struct pt_regs *); |
19 | #else | 18 | #else |
diff --git a/arch/powerpc/include/asm/spu.h b/arch/powerpc/include/asm/spu.h index 37b7ca39ec9f..a6e6e2bf9d15 100644 --- a/arch/powerpc/include/asm/spu.h +++ b/arch/powerpc/include/asm/spu.h | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/device.h> | 28 | #include <linux/device.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <asm/reg.h> | ||
31 | #include <asm/copro.h> | ||
30 | 32 | ||
31 | #define LS_SIZE (256 * 1024) | 33 | #define LS_SIZE (256 * 1024) |
32 | #define LS_ADDR_MASK (LS_SIZE - 1) | 34 | #define LS_ADDR_MASK (LS_SIZE - 1) |
@@ -277,9 +279,6 @@ void spu_remove_dev_attr(struct device_attribute *attr); | |||
277 | int spu_add_dev_attr_group(struct attribute_group *attrs); | 279 | int spu_add_dev_attr_group(struct attribute_group *attrs); |
278 | void spu_remove_dev_attr_group(struct attribute_group *attrs); | 280 | void spu_remove_dev_attr_group(struct attribute_group *attrs); |
279 | 281 | ||
280 | int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea, | ||
281 | unsigned long dsisr, unsigned *flt); | ||
282 | |||
283 | /* | 282 | /* |
284 | * Notifier blocks: | 283 | * Notifier blocks: |
285 | * | 284 | * |
diff --git a/arch/powerpc/include/asm/sstep.h b/arch/powerpc/include/asm/sstep.h index f593b0f9b627..d3a42cc45a82 100644 --- a/arch/powerpc/include/asm/sstep.h +++ b/arch/powerpc/include/asm/sstep.h | |||
@@ -25,3 +25,65 @@ struct pt_regs; | |||
25 | 25 | ||
26 | /* Emulate instructions that cause a transfer of control. */ | 26 | /* Emulate instructions that cause a transfer of control. */ |
27 | extern int emulate_step(struct pt_regs *regs, unsigned int instr); | 27 | extern int emulate_step(struct pt_regs *regs, unsigned int instr); |
28 | |||
29 | enum instruction_type { | ||
30 | COMPUTE, /* arith/logical/CR op, etc. */ | ||
31 | LOAD, | ||
32 | LOAD_MULTI, | ||
33 | LOAD_FP, | ||
34 | LOAD_VMX, | ||
35 | LOAD_VSX, | ||
36 | STORE, | ||
37 | STORE_MULTI, | ||
38 | STORE_FP, | ||
39 | STORE_VMX, | ||
40 | STORE_VSX, | ||
41 | LARX, | ||
42 | STCX, | ||
43 | BRANCH, | ||
44 | MFSPR, | ||
45 | MTSPR, | ||
46 | CACHEOP, | ||
47 | BARRIER, | ||
48 | SYSCALL, | ||
49 | MFMSR, | ||
50 | MTMSR, | ||
51 | RFI, | ||
52 | INTERRUPT, | ||
53 | UNKNOWN | ||
54 | }; | ||
55 | |||
56 | #define INSTR_TYPE_MASK 0x1f | ||
57 | |||
58 | /* Load/store flags, ORed in with type */ | ||
59 | #define SIGNEXT 0x20 | ||
60 | #define UPDATE 0x40 /* matches bit in opcode 31 instructions */ | ||
61 | #define BYTEREV 0x80 | ||
62 | |||
63 | /* Cacheop values, ORed in with type */ | ||
64 | #define CACHEOP_MASK 0x700 | ||
65 | #define DCBST 0 | ||
66 | #define DCBF 0x100 | ||
67 | #define DCBTST 0x200 | ||
68 | #define DCBT 0x300 | ||
69 | #define ICBI 0x400 | ||
70 | |||
71 | /* Size field in type word */ | ||
72 | #define SIZE(n) ((n) << 8) | ||
73 | #define GETSIZE(w) ((w) >> 8) | ||
74 | |||
75 | #define MKOP(t, f, s) ((t) | (f) | SIZE(s)) | ||
76 | |||
77 | struct instruction_op { | ||
78 | int type; | ||
79 | int reg; | ||
80 | unsigned long val; | ||
81 | /* For LOAD/STORE/LARX/STCX */ | ||
82 | unsigned long ea; | ||
83 | int update_reg; | ||
84 | /* For MFSPR */ | ||
85 | int spr; | ||
86 | }; | ||
87 | |||
88 | extern int analyse_instr(struct instruction_op *op, struct pt_regs *regs, | ||
89 | unsigned int instr); | ||
diff --git a/arch/powerpc/include/asm/tsi108.h b/arch/powerpc/include/asm/tsi108.h index f8b60793b7a9..d531d9e173ef 100644 --- a/arch/powerpc/include/asm/tsi108.h +++ b/arch/powerpc/include/asm/tsi108.h | |||
@@ -84,10 +84,6 @@ | |||
84 | extern u32 tsi108_pci_cfg_base; | 84 | extern u32 tsi108_pci_cfg_base; |
85 | /* Exported functions */ | 85 | /* Exported functions */ |
86 | 86 | ||
87 | extern int tsi108_bridge_init(struct pci_controller *hose, uint phys_csr_base); | ||
88 | extern unsigned long tsi108_get_mem_size(void); | ||
89 | extern unsigned long tsi108_get_cpu_clk(void); | ||
90 | extern unsigned long tsi108_get_sdc_clk(void); | ||
91 | extern int tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfn, | 87 | extern int tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfn, |
92 | int offset, int len, u32 val); | 88 | int offset, int len, u32 val); |
93 | extern int tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, | 89 | extern int tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, |
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h index b51fba10e733..78f2675f2aac 100644 --- a/arch/powerpc/include/asm/udbg.h +++ b/arch/powerpc/include/asm/udbg.h | |||
@@ -52,7 +52,6 @@ extern void __init udbg_init_44x_as1(void); | |||
52 | extern void __init udbg_init_40x_realmode(void); | 52 | extern void __init udbg_init_40x_realmode(void); |
53 | extern void __init udbg_init_cpm(void); | 53 | extern void __init udbg_init_cpm(void); |
54 | extern void __init udbg_init_usbgecko(void); | 54 | extern void __init udbg_init_usbgecko(void); |
55 | extern void __init udbg_init_wsp(void); | ||
56 | extern void __init udbg_init_memcons(void); | 55 | extern void __init udbg_init_memcons(void); |
57 | extern void __init udbg_init_ehv_bc(void); | 56 | extern void __init udbg_init_ehv_bc(void); |
58 | extern void __init udbg_init_ps3gelic(void); | 57 | extern void __init udbg_init_ps3gelic(void); |
diff --git a/arch/powerpc/include/asm/word-at-a-time.h b/arch/powerpc/include/asm/word-at-a-time.h index 9a5c928bb3c6..5b3a903adae6 100644 --- a/arch/powerpc/include/asm/word-at-a-time.h +++ b/arch/powerpc/include/asm/word-at-a-time.h | |||
@@ -42,32 +42,65 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct | |||
42 | 42 | ||
43 | #else | 43 | #else |
44 | 44 | ||
45 | #ifdef CONFIG_64BIT | ||
46 | |||
47 | /* unused */ | ||
45 | struct word_at_a_time { | 48 | struct word_at_a_time { |
46 | const unsigned long one_bits, high_bits; | ||
47 | }; | 49 | }; |
48 | 50 | ||
49 | #define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) } | 51 | #define WORD_AT_A_TIME_CONSTANTS { } |
50 | 52 | ||
51 | #ifdef CONFIG_64BIT | 53 | /* This will give us 0xff for a NULL char and 0x00 elsewhere */ |
54 | static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c) | ||
55 | { | ||
56 | unsigned long ret; | ||
57 | unsigned long zero = 0; | ||
52 | 58 | ||
53 | /* Alan Modra's little-endian strlen tail for 64-bit */ | 59 | asm("cmpb %0,%1,%2" : "=r" (ret) : "r" (a), "r" (zero)); |
54 | #define create_zero_mask(mask) (mask) | 60 | *bits = ret; |
55 | 61 | ||
56 | static inline unsigned long find_zero(unsigned long mask) | 62 | return ret; |
63 | } | ||
64 | |||
65 | static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c) | ||
66 | { | ||
67 | return bits; | ||
68 | } | ||
69 | |||
70 | /* Alan Modra's little-endian strlen tail for 64-bit */ | ||
71 | static inline unsigned long create_zero_mask(unsigned long bits) | ||
57 | { | 72 | { |
58 | unsigned long leading_zero_bits; | 73 | unsigned long leading_zero_bits; |
59 | long trailing_zero_bit_mask; | 74 | long trailing_zero_bit_mask; |
60 | 75 | ||
61 | asm ("addi %1,%2,-1\n\t" | 76 | asm("addi %1,%2,-1\n\t" |
62 | "andc %1,%1,%2\n\t" | 77 | "andc %1,%1,%2\n\t" |
63 | "popcntd %0,%1" | 78 | "popcntd %0,%1" |
64 | : "=r" (leading_zero_bits), "=&r" (trailing_zero_bit_mask) | 79 | : "=r" (leading_zero_bits), "=&r" (trailing_zero_bit_mask) |
65 | : "r" (mask)); | 80 | : "r" (bits)); |
66 | return leading_zero_bits >> 3; | 81 | |
82 | return leading_zero_bits; | ||
83 | } | ||
84 | |||
85 | static inline unsigned long find_zero(unsigned long mask) | ||
86 | { | ||
87 | return mask >> 3; | ||
88 | } | ||
89 | |||
90 | /* This assumes that we never ask for an all 1s bitmask */ | ||
91 | static inline unsigned long zero_bytemask(unsigned long mask) | ||
92 | { | ||
93 | return (1UL << mask) - 1; | ||
67 | } | 94 | } |
68 | 95 | ||
69 | #else /* 32-bit case */ | 96 | #else /* 32-bit case */ |
70 | 97 | ||
98 | struct word_at_a_time { | ||
99 | const unsigned long one_bits, high_bits; | ||
100 | }; | ||
101 | |||
102 | #define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) } | ||
103 | |||
71 | /* | 104 | /* |
72 | * This is largely generic for little-endian machines, but the | 105 | * This is largely generic for little-endian machines, but the |
73 | * optimal byte mask counting is probably going to be something | 106 | * optimal byte mask counting is probably going to be something |
@@ -96,8 +129,6 @@ static inline unsigned long find_zero(unsigned long mask) | |||
96 | return count_masked_bytes(mask); | 129 | return count_masked_bytes(mask); |
97 | } | 130 | } |
98 | 131 | ||
99 | #endif | ||
100 | |||
101 | /* Return nonzero if it has a zero */ | 132 | /* Return nonzero if it has a zero */ |
102 | static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c) | 133 | static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c) |
103 | { | 134 | { |
@@ -114,6 +145,59 @@ static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, | |||
114 | /* The mask we created is directly usable as a bytemask */ | 145 | /* The mask we created is directly usable as a bytemask */ |
115 | #define zero_bytemask(mask) (mask) | 146 | #define zero_bytemask(mask) (mask) |
116 | 147 | ||
148 | #endif /* CONFIG_64BIT */ | ||
149 | |||
150 | #endif /* __BIG_ENDIAN__ */ | ||
151 | |||
152 | /* | ||
153 | * We use load_unaligned_zero() in a selftest, which builds a userspace | ||
154 | * program. Some linker scripts seem to discard the .fixup section, so allow | ||
155 | * the test code to use a different section name. | ||
156 | */ | ||
157 | #ifndef FIXUP_SECTION | ||
158 | #define FIXUP_SECTION ".fixup" | ||
159 | #endif | ||
160 | |||
161 | static inline unsigned long load_unaligned_zeropad(const void *addr) | ||
162 | { | ||
163 | unsigned long ret, offset, tmp; | ||
164 | |||
165 | asm( | ||
166 | "1: " PPC_LL "%[ret], 0(%[addr])\n" | ||
167 | "2:\n" | ||
168 | ".section " FIXUP_SECTION ",\"ax\"\n" | ||
169 | "3: " | ||
170 | #ifdef __powerpc64__ | ||
171 | "clrrdi %[tmp], %[addr], 3\n\t" | ||
172 | "clrlsldi %[offset], %[addr], 61, 3\n\t" | ||
173 | "ld %[ret], 0(%[tmp])\n\t" | ||
174 | #ifdef __BIG_ENDIAN__ | ||
175 | "sld %[ret], %[ret], %[offset]\n\t" | ||
176 | #else | ||
177 | "srd %[ret], %[ret], %[offset]\n\t" | ||
117 | #endif | 178 | #endif |
179 | #else | ||
180 | "clrrwi %[tmp], %[addr], 2\n\t" | ||
181 | "clrlslwi %[offset], %[addr], 30, 3\n\t" | ||
182 | "lwz %[ret], 0(%[tmp])\n\t" | ||
183 | #ifdef __BIG_ENDIAN__ | ||
184 | "slw %[ret], %[ret], %[offset]\n\t" | ||
185 | #else | ||
186 | "srw %[ret], %[ret], %[offset]\n\t" | ||
187 | #endif | ||
188 | #endif | ||
189 | "b 2b\n" | ||
190 | ".previous\n" | ||
191 | ".section __ex_table,\"a\"\n\t" | ||
192 | PPC_LONG_ALIGN "\n\t" | ||
193 | PPC_LONG "1b,3b\n" | ||
194 | ".previous" | ||
195 | : [tmp] "=&b" (tmp), [offset] "=&r" (offset), [ret] "=&r" (ret) | ||
196 | : [addr] "b" (addr), "m" (*(unsigned long *)addr)); | ||
197 | |||
198 | return ret; | ||
199 | } | ||
200 | |||
201 | #undef FIXUP_SECTION | ||
118 | 202 | ||
119 | #endif /* _ASM_WORD_AT_A_TIME_H */ | 203 | #endif /* _ASM_WORD_AT_A_TIME_H */ |
diff --git a/arch/powerpc/include/asm/xics.h b/arch/powerpc/include/asm/xics.h index 282d43a0c855..0d050ea37a04 100644 --- a/arch/powerpc/include/asm/xics.h +++ b/arch/powerpc/include/asm/xics.h | |||
@@ -29,6 +29,7 @@ | |||
29 | /* Native ICP */ | 29 | /* Native ICP */ |
30 | #ifdef CONFIG_PPC_ICP_NATIVE | 30 | #ifdef CONFIG_PPC_ICP_NATIVE |
31 | extern int icp_native_init(void); | 31 | extern int icp_native_init(void); |
32 | extern void icp_native_flush_interrupt(void); | ||
32 | #else | 33 | #else |
33 | static inline int icp_native_init(void) { return -ENODEV; } | 34 | static inline int icp_native_init(void) { return -ENODEV; } |
34 | #endif | 35 | #endif |