diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-17 07:06:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-17 07:06:17 -0400 |
commit | a3d06cc6aa3e765dc2bf98626f87272dcf641dca (patch) | |
tree | aa3e49b58f08d6c0ea55cdca4fb5e6c8ba6ae333 /arch/powerpc/include | |
parent | 0990b1c65729012a63e0eeca93aaaafea4e9a064 (diff) | |
parent | 65795efbd380a832ae508b04dba8f8e53f0b84d9 (diff) |
Merge branch 'linus' into perfcounters/core
Conflicts:
arch/x86/include/asm/kmap_types.h
include/linux/mm.h
include/asm-generic/kmap_types.h
Merge reason: We crossed changes with kmap_types.h cleanups in mainline.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc/include')
30 files changed, 355 insertions, 104 deletions
diff --git a/arch/powerpc/include/asm/8253pit.h b/arch/powerpc/include/asm/8253pit.h index b70d6e53b303..a71c9c1455a7 100644 --- a/arch/powerpc/include/asm/8253pit.h +++ b/arch/powerpc/include/asm/8253pit.h | |||
@@ -1,10 +1,3 @@ | |||
1 | #ifndef _ASM_POWERPC_8253PIT_H | ||
2 | #define _ASM_POWERPC_8253PIT_H | ||
3 | |||
4 | /* | 1 | /* |
5 | * 8253/8254 Programmable Interval Timer | 2 | * 8253/8254 Programmable Interval Timer |
6 | */ | 3 | */ |
7 | |||
8 | #define PIT_TICK_RATE 1193182UL | ||
9 | |||
10 | #endif /* _ASM_POWERPC_8253PIT_H */ | ||
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h index b7d2d07b6f96..4012483b1899 100644 --- a/arch/powerpc/include/asm/atomic.h +++ b/arch/powerpc/include/asm/atomic.h | |||
@@ -470,6 +470,9 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | |||
470 | 470 | ||
471 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) | 471 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) |
472 | 472 | ||
473 | #else /* __powerpc64__ */ | ||
474 | #include <asm-generic/atomic64.h> | ||
475 | |||
473 | #endif /* __powerpc64__ */ | 476 | #endif /* __powerpc64__ */ |
474 | 477 | ||
475 | #include <asm-generic/atomic-long.h> | 478 | #include <asm-generic/atomic-long.h> |
diff --git a/arch/powerpc/include/asm/cpm2.h b/arch/powerpc/include/asm/cpm2.h index 0f5e8ff59a85..990ff191da8b 100644 --- a/arch/powerpc/include/asm/cpm2.h +++ b/arch/powerpc/include/asm/cpm2.h | |||
@@ -14,10 +14,6 @@ | |||
14 | #include <asm/cpm.h> | 14 | #include <asm/cpm.h> |
15 | #include <sysdev/fsl_soc.h> | 15 | #include <sysdev/fsl_soc.h> |
16 | 16 | ||
17 | #ifdef CONFIG_PPC_85xx | ||
18 | #define CPM_MAP_ADDR (get_immrbase() + 0x80000) | ||
19 | #endif | ||
20 | |||
21 | /* CPM Command register. | 17 | /* CPM Command register. |
22 | */ | 18 | */ |
23 | #define CPM_CR_RST ((uint)0x80000000) | 19 | #define CPM_CR_RST ((uint)0x80000000) |
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index cb448d68452c..3d9e887c3c0c 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h | |||
@@ -15,9 +15,18 @@ | |||
15 | #include <linux/scatterlist.h> | 15 | #include <linux/scatterlist.h> |
16 | #include <linux/dma-attrs.h> | 16 | #include <linux/dma-attrs.h> |
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include <asm/swiotlb.h> | ||
18 | 19 | ||
19 | #define DMA_ERROR_CODE (~(dma_addr_t)0x0) | 20 | #define DMA_ERROR_CODE (~(dma_addr_t)0x0) |
20 | 21 | ||
22 | /* Some dma direct funcs must be visible for use in other dma_ops */ | ||
23 | extern void *dma_direct_alloc_coherent(struct device *dev, size_t size, | ||
24 | dma_addr_t *dma_handle, gfp_t flag); | ||
25 | extern void dma_direct_free_coherent(struct device *dev, size_t size, | ||
26 | void *vaddr, dma_addr_t dma_handle); | ||
27 | |||
28 | extern unsigned long get_dma_direct_offset(struct device *dev); | ||
29 | |||
21 | #ifdef CONFIG_NOT_COHERENT_CACHE | 30 | #ifdef CONFIG_NOT_COHERENT_CACHE |
22 | /* | 31 | /* |
23 | * DMA-consistent mapping functions for PowerPCs that don't support | 32 | * DMA-consistent mapping functions for PowerPCs that don't support |
@@ -78,6 +87,8 @@ struct dma_mapping_ops { | |||
78 | dma_addr_t dma_address, size_t size, | 87 | dma_addr_t dma_address, size_t size, |
79 | enum dma_data_direction direction, | 88 | enum dma_data_direction direction, |
80 | struct dma_attrs *attrs); | 89 | struct dma_attrs *attrs); |
90 | int (*addr_needs_map)(struct device *dev, dma_addr_t addr, | ||
91 | size_t size); | ||
81 | #ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS | 92 | #ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS |
82 | void (*sync_single_range_for_cpu)(struct device *hwdev, | 93 | void (*sync_single_range_for_cpu)(struct device *hwdev, |
83 | dma_addr_t dma_handle, unsigned long offset, | 94 | dma_addr_t dma_handle, unsigned long offset, |
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h index d6b4a12cdeff..014a624f4c8e 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h | |||
@@ -256,11 +256,11 @@ do { \ | |||
256 | * even if we have an executable stack. | 256 | * even if we have an executable stack. |
257 | */ | 257 | */ |
258 | # define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \ | 258 | # define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \ |
259 | (exec_stk != EXSTACK_DISABLE_X) : 0) | 259 | (exec_stk == EXSTACK_DEFAULT) : 0) |
260 | #else | 260 | #else |
261 | # define SET_PERSONALITY(ex) \ | 261 | # define SET_PERSONALITY(ex) \ |
262 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | 262 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) |
263 | # define elf_read_implies_exec(ex, exec_stk) (exec_stk != EXSTACK_DISABLE_X) | 263 | # define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT) |
264 | #endif /* __powerpc64__ */ | 264 | #endif /* __powerpc64__ */ |
265 | 265 | ||
266 | extern int dcache_bsize; | 266 | extern int dcache_bsize; |
diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h new file mode 100644 index 000000000000..9154e8526732 --- /dev/null +++ b/arch/powerpc/include/asm/emulated_ops.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * Copyright 2007 Sony Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; version 2 of the License. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. | ||
15 | * If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #ifndef _ASM_POWERPC_EMULATED_OPS_H | ||
19 | #define _ASM_POWERPC_EMULATED_OPS_H | ||
20 | |||
21 | #include <asm/atomic.h> | ||
22 | |||
23 | |||
24 | #ifdef CONFIG_PPC_EMULATED_STATS | ||
25 | |||
26 | struct ppc_emulated_entry { | ||
27 | const char *name; | ||
28 | atomic_t val; | ||
29 | }; | ||
30 | |||
31 | extern struct ppc_emulated { | ||
32 | #ifdef CONFIG_ALTIVEC | ||
33 | struct ppc_emulated_entry altivec; | ||
34 | #endif | ||
35 | struct ppc_emulated_entry dcba; | ||
36 | struct ppc_emulated_entry dcbz; | ||
37 | struct ppc_emulated_entry fp_pair; | ||
38 | struct ppc_emulated_entry isel; | ||
39 | struct ppc_emulated_entry mcrxr; | ||
40 | struct ppc_emulated_entry mfpvr; | ||
41 | struct ppc_emulated_entry multiple; | ||
42 | struct ppc_emulated_entry popcntb; | ||
43 | struct ppc_emulated_entry spe; | ||
44 | struct ppc_emulated_entry string; | ||
45 | struct ppc_emulated_entry unaligned; | ||
46 | #ifdef CONFIG_MATH_EMULATION | ||
47 | struct ppc_emulated_entry math; | ||
48 | #elif defined(CONFIG_8XX_MINIMAL_FPEMU) | ||
49 | struct ppc_emulated_entry 8xx; | ||
50 | #endif | ||
51 | #ifdef CONFIG_VSX | ||
52 | struct ppc_emulated_entry vsx; | ||
53 | #endif | ||
54 | } ppc_emulated; | ||
55 | |||
56 | extern u32 ppc_warn_emulated; | ||
57 | |||
58 | extern void ppc_warn_emulated_print(const char *type); | ||
59 | |||
60 | #define PPC_WARN_EMULATED(type) \ | ||
61 | do { \ | ||
62 | atomic_inc(&ppc_emulated.type.val); \ | ||
63 | if (ppc_warn_emulated) \ | ||
64 | ppc_warn_emulated_print(ppc_emulated.type.name); \ | ||
65 | } while (0) | ||
66 | |||
67 | #else /* !CONFIG_PPC_EMULATED_STATS */ | ||
68 | |||
69 | #define PPC_WARN_EMULATED(type) do { } while (0) | ||
70 | |||
71 | #endif /* !CONFIG_PPC_EMULATED_STATS */ | ||
72 | |||
73 | #endif /* _ASM_POWERPC_EMULATED_OPS_H */ | ||
diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h index e4094a5cb05b..cbd4dfa4bce2 100644 --- a/arch/powerpc/include/asm/feature-fixups.h +++ b/arch/powerpc/include/asm/feature-fixups.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * 2 of the License, or (at your option) any later version. | 8 | * 2 of the License, or (at your option) any later version. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifdef __ASSEMBLY__ | ||
12 | |||
13 | /* | 11 | /* |
14 | * Feature section common macros | 12 | * Feature section common macros |
15 | * | 13 | * |
@@ -23,10 +21,12 @@ | |||
23 | /* 64 bits kernel, 32 bits code (ie. vdso32) */ | 21 | /* 64 bits kernel, 32 bits code (ie. vdso32) */ |
24 | #define FTR_ENTRY_LONG .llong | 22 | #define FTR_ENTRY_LONG .llong |
25 | #define FTR_ENTRY_OFFSET .long 0xffffffff; .long | 23 | #define FTR_ENTRY_OFFSET .long 0xffffffff; .long |
24 | #elif defined(CONFIG_PPC64) | ||
25 | #define FTR_ENTRY_LONG .llong | ||
26 | #define FTR_ENTRY_OFFSET .llong | ||
26 | #else | 27 | #else |
27 | /* 64 bit kernel 64 bit code, or 32 bit kernel 32 bit code */ | 28 | #define FTR_ENTRY_LONG .long |
28 | #define FTR_ENTRY_LONG PPC_LONG | 29 | #define FTR_ENTRY_OFFSET .long |
29 | #define FTR_ENTRY_OFFSET PPC_LONG | ||
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define START_FTR_SECTION(label) label##1: | 32 | #define START_FTR_SECTION(label) label##1: |
@@ -141,6 +141,21 @@ label##5: \ | |||
141 | #define ALT_FW_FTR_SECTION_END_IFCLR(msk) \ | 141 | #define ALT_FW_FTR_SECTION_END_IFCLR(msk) \ |
142 | ALT_FW_FTR_SECTION_END_NESTED_IFCLR(msk, 97) | 142 | ALT_FW_FTR_SECTION_END_NESTED_IFCLR(msk, 97) |
143 | 143 | ||
144 | #ifndef __ASSEMBLY__ | ||
145 | |||
146 | #define ASM_MMU_FTR_IF(section_if, section_else, msk, val) \ | ||
147 | stringify_in_c(BEGIN_MMU_FTR_SECTION) \ | ||
148 | section_if "; " \ | ||
149 | stringify_in_c(MMU_FTR_SECTION_ELSE) \ | ||
150 | section_else "; " \ | ||
151 | stringify_in_c(ALT_MMU_FTR_SECTION_END((msk), (val))) | ||
152 | |||
153 | #define ASM_MMU_FTR_IFSET(section_if, section_else, msk) \ | ||
154 | ASM_MMU_FTR_IF(section_if, section_else, (msk), (msk)) | ||
155 | |||
156 | #define ASM_MMU_FTR_IFCLR(section_if, section_else, msk) \ | ||
157 | ASM_MMU_FTR_IF(section_if, section_else, (msk), 0) | ||
158 | |||
144 | #endif /* __ASSEMBLY__ */ | 159 | #endif /* __ASSEMBLY__ */ |
145 | 160 | ||
146 | /* LWSYNC feature sections */ | 161 | /* LWSYNC feature sections */ |
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h index 1974cf191b03..10a642df014e 100644 --- a/arch/powerpc/include/asm/hw_irq.h +++ b/arch/powerpc/include/asm/hw_irq.h | |||
@@ -80,7 +80,7 @@ static inline void local_irq_disable(void) | |||
80 | __asm__ __volatile__("wrteei 0": : :"memory"); | 80 | __asm__ __volatile__("wrteei 0": : :"memory"); |
81 | #else | 81 | #else |
82 | unsigned long msr; | 82 | unsigned long msr; |
83 | __asm__ __volatile__("": : :"memory"); | 83 | |
84 | msr = mfmsr(); | 84 | msr = mfmsr(); |
85 | SET_MSR_EE(msr & ~MSR_EE); | 85 | SET_MSR_EE(msr & ~MSR_EE); |
86 | #endif | 86 | #endif |
@@ -92,7 +92,7 @@ static inline void local_irq_enable(void) | |||
92 | __asm__ __volatile__("wrteei 1": : :"memory"); | 92 | __asm__ __volatile__("wrteei 1": : :"memory"); |
93 | #else | 93 | #else |
94 | unsigned long msr; | 94 | unsigned long msr; |
95 | __asm__ __volatile__("": : :"memory"); | 95 | |
96 | msr = mfmsr(); | 96 | msr = mfmsr(); |
97 | SET_MSR_EE(msr | MSR_EE); | 97 | SET_MSR_EE(msr | MSR_EE); |
98 | #endif | 98 | #endif |
@@ -108,7 +108,6 @@ static inline void local_irq_save_ptr(unsigned long *flags) | |||
108 | #else | 108 | #else |
109 | SET_MSR_EE(msr & ~MSR_EE); | 109 | SET_MSR_EE(msr & ~MSR_EE); |
110 | #endif | 110 | #endif |
111 | __asm__ __volatile__("": : :"memory"); | ||
112 | } | 111 | } |
113 | 112 | ||
114 | #define local_save_flags(flags) ((flags) = mfmsr()) | 113 | #define local_save_flags(flags) ((flags) = mfmsr()) |
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h index 7464c0daddd1..7ead7c16fb7c 100644 --- a/arch/powerpc/include/asm/iommu.h +++ b/arch/powerpc/include/asm/iommu.h | |||
@@ -35,6 +35,16 @@ | |||
35 | #define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1)) | 35 | #define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1)) |
36 | #define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE) | 36 | #define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE) |
37 | 37 | ||
38 | /* Cell page table entries */ | ||
39 | #define CBE_IOPTE_PP_W 0x8000000000000000ul /* protection: write */ | ||
40 | #define CBE_IOPTE_PP_R 0x4000000000000000ul /* protection: read */ | ||
41 | #define CBE_IOPTE_M 0x2000000000000000ul /* coherency required */ | ||
42 | #define CBE_IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */ | ||
43 | #define CBE_IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */ | ||
44 | #define CBE_IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */ | ||
45 | #define CBE_IOPTE_H 0x0000000000000800ul /* cache hint */ | ||
46 | #define CBE_IOPTE_IOID_Mask 0x00000000000007fful /* ioid */ | ||
47 | |||
38 | /* Boot time flags */ | 48 | /* Boot time flags */ |
39 | extern int iommu_is_off; | 49 | extern int iommu_is_off; |
40 | extern int iommu_force_on; | 50 | extern int iommu_force_on; |
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h index d2a65e8ca6ae..f78f65c38f05 100644 --- a/arch/powerpc/include/asm/lppaca.h +++ b/arch/powerpc/include/asm/lppaca.h | |||
@@ -20,6 +20,11 @@ | |||
20 | #define _ASM_POWERPC_LPPACA_H | 20 | #define _ASM_POWERPC_LPPACA_H |
21 | #ifdef __KERNEL__ | 21 | #ifdef __KERNEL__ |
22 | 22 | ||
23 | /* These definitions relate to hypervisors that only exist when using | ||
24 | * a server type processor | ||
25 | */ | ||
26 | #ifdef CONFIG_PPC_BOOK3S | ||
27 | |||
23 | //============================================================================= | 28 | //============================================================================= |
24 | // | 29 | // |
25 | // This control block contains the data that is shared between the | 30 | // This control block contains the data that is shared between the |
@@ -158,5 +163,6 @@ struct slb_shadow { | |||
158 | 163 | ||
159 | extern struct slb_shadow slb_shadow[]; | 164 | extern struct slb_shadow slb_shadow[]; |
160 | 165 | ||
166 | #endif /* CONFIG_PPC_BOOK3S */ | ||
161 | #endif /* __KERNEL__ */ | 167 | #endif /* __KERNEL__ */ |
162 | #endif /* _ASM_POWERPC_LPPACA_H */ | 168 | #endif /* _ASM_POWERPC_LPPACA_H */ |
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 0efdb1dfdc5f..11d1fc3a8962 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -110,6 +110,10 @@ struct machdep_calls { | |||
110 | void (*show_percpuinfo)(struct seq_file *m, int i); | 110 | void (*show_percpuinfo)(struct seq_file *m, int i); |
111 | 111 | ||
112 | void (*init_IRQ)(void); | 112 | void (*init_IRQ)(void); |
113 | |||
114 | /* Return an irq, or NO_IRQ to indicate there are none pending. | ||
115 | * If for some reason there is no irq, but the interrupt | ||
116 | * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */ | ||
113 | unsigned int (*get_irq)(void); | 117 | unsigned int (*get_irq)(void); |
114 | #ifdef CONFIG_KEXEC | 118 | #ifdef CONFIG_KEXEC |
115 | void (*kexec_cpu_down)(int crash_shutdown, int secondary); | 119 | void (*kexec_cpu_down)(int crash_shutdown, int secondary); |
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index cbf154387091..fb57ded592f9 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h | |||
@@ -52,6 +52,11 @@ | |||
52 | */ | 52 | */ |
53 | #define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000) | 53 | #define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000) |
54 | 54 | ||
55 | /* This indicates that the processor uses the ISA 2.06 server tlbie | ||
56 | * mnemonics | ||
57 | */ | ||
58 | #define MMU_FTR_TLBIE_206 ASM_CONST(0x00400000) | ||
59 | |||
55 | #ifndef __ASSEMBLY__ | 60 | #ifndef __ASSEMBLY__ |
56 | #include <asm/cputable.h> | 61 | #include <asm/cputable.h> |
57 | 62 | ||
@@ -69,10 +74,10 @@ extern void early_init_mmu_secondary(void); | |||
69 | #endif /* !__ASSEMBLY__ */ | 74 | #endif /* !__ASSEMBLY__ */ |
70 | 75 | ||
71 | 76 | ||
72 | #ifdef CONFIG_PPC64 | 77 | #if defined(CONFIG_PPC_STD_MMU_64) |
73 | /* 64-bit classic hash table MMU */ | 78 | /* 64-bit classic hash table MMU */ |
74 | # include <asm/mmu-hash64.h> | 79 | # include <asm/mmu-hash64.h> |
75 | #elif defined(CONFIG_PPC_STD_MMU) | 80 | #elif defined(CONFIG_PPC_STD_MMU_32) |
76 | /* 32-bit classic hash table MMU */ | 81 | /* 32-bit classic hash table MMU */ |
77 | # include <asm/mmu-hash32.h> | 82 | # include <asm/mmu-hash32.h> |
78 | #elif defined(CONFIG_40x) | 83 | #elif defined(CONFIG_40x) |
diff --git a/arch/powerpc/include/asm/mpc86xx.h b/arch/powerpc/include/asm/mpc86xx.h deleted file mode 100644 index 15f650f987e7..000000000000 --- a/arch/powerpc/include/asm/mpc86xx.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * MPC86xx definitions | ||
3 | * | ||
4 | * Author: Jeff Brown | ||
5 | * | ||
6 | * Copyright 2004 Freescale Semiconductor, Inc | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifdef __KERNEL__ | ||
15 | #ifndef __ASM_POWERPC_MPC86xx_H__ | ||
16 | #define __ASM_POWERPC_MPC86xx_H__ | ||
17 | |||
18 | #include <asm/mmu.h> | ||
19 | |||
20 | #ifdef CONFIG_PPC_86xx | ||
21 | |||
22 | #define CPU0_BOOT_RELEASE 0x01000000 | ||
23 | #define CPU1_BOOT_RELEASE 0x02000000 | ||
24 | #define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE) | ||
25 | #define MCM_PORT_CONFIG_OFFSET 0x1010 | ||
26 | |||
27 | /* Offset from CCSRBAR */ | ||
28 | #define MPC86xx_MCM_OFFSET (0x00000) | ||
29 | #define MPC86xx_MCM_SIZE (0x02000) | ||
30 | |||
31 | #endif /* CONFIG_PPC_86xx */ | ||
32 | #endif /* __ASM_POWERPC_MPC86xx_H__ */ | ||
33 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index 6ef055723019..c8a3cbfe02ff 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h | |||
@@ -43,6 +43,7 @@ struct task_struct; | |||
43 | * processor. | 43 | * processor. |
44 | */ | 44 | */ |
45 | struct paca_struct { | 45 | struct paca_struct { |
46 | #ifdef CONFIG_PPC_BOOK3S | ||
46 | /* | 47 | /* |
47 | * Because hw_cpu_id, unlike other paca fields, is accessed | 48 | * Because hw_cpu_id, unlike other paca fields, is accessed |
48 | * routinely from other CPUs (from the IRQ code), we stick to | 49 | * routinely from other CPUs (from the IRQ code), we stick to |
@@ -51,7 +52,7 @@ struct paca_struct { | |||
51 | */ | 52 | */ |
52 | 53 | ||
53 | struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */ | 54 | struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */ |
54 | 55 | #endif /* CONFIG_PPC_BOOK3S */ | |
55 | /* | 56 | /* |
56 | * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c | 57 | * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c |
57 | * load lock_token and paca_index with a single lwz | 58 | * load lock_token and paca_index with a single lwz |
@@ -64,13 +65,16 @@ struct paca_struct { | |||
64 | u64 kernel_toc; /* Kernel TOC address */ | 65 | u64 kernel_toc; /* Kernel TOC address */ |
65 | u64 kernelbase; /* Base address of kernel */ | 66 | u64 kernelbase; /* Base address of kernel */ |
66 | u64 kernel_msr; /* MSR while running in kernel */ | 67 | u64 kernel_msr; /* MSR while running in kernel */ |
68 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
67 | u64 stab_real; /* Absolute address of segment table */ | 69 | u64 stab_real; /* Absolute address of segment table */ |
68 | u64 stab_addr; /* Virtual address of segment table */ | 70 | u64 stab_addr; /* Virtual address of segment table */ |
71 | #endif /* CONFIG_PPC_STD_MMU_64 */ | ||
69 | void *emergency_sp; /* pointer to emergency stack */ | 72 | void *emergency_sp; /* pointer to emergency stack */ |
70 | u64 data_offset; /* per cpu data offset */ | 73 | u64 data_offset; /* per cpu data offset */ |
71 | s16 hw_cpu_id; /* Physical processor number */ | 74 | s16 hw_cpu_id; /* Physical processor number */ |
72 | u8 cpu_start; /* At startup, processor spins until */ | 75 | u8 cpu_start; /* At startup, processor spins until */ |
73 | /* this becomes non-zero. */ | 76 | /* this becomes non-zero. */ |
77 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
74 | struct slb_shadow *slb_shadow_ptr; | 78 | struct slb_shadow *slb_shadow_ptr; |
75 | 79 | ||
76 | /* | 80 | /* |
@@ -81,11 +85,13 @@ struct paca_struct { | |||
81 | u64 exmc[10]; /* used for machine checks */ | 85 | u64 exmc[10]; /* used for machine checks */ |
82 | u64 exslb[10]; /* used for SLB/segment table misses | 86 | u64 exslb[10]; /* used for SLB/segment table misses |
83 | * on the linear mapping */ | 87 | * on the linear mapping */ |
84 | 88 | /* SLB related definitions */ | |
85 | mm_context_t context; | ||
86 | u16 vmalloc_sllp; | 89 | u16 vmalloc_sllp; |
87 | u16 slb_cache_ptr; | 90 | u16 slb_cache_ptr; |
88 | u16 slb_cache[SLB_CACHE_ENTRIES]; | 91 | u16 slb_cache[SLB_CACHE_ENTRIES]; |
92 | #endif /* CONFIG_PPC_STD_MMU_64 */ | ||
93 | |||
94 | mm_context_t context; | ||
89 | 95 | ||
90 | /* | 96 | /* |
91 | * then miscellaneous read-write fields | 97 | * then miscellaneous read-write fields |
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index 32cbf16f10ea..4940662ee87e 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h | |||
@@ -231,6 +231,11 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr, | |||
231 | struct page *p); | 231 | struct page *p); |
232 | extern int page_is_ram(unsigned long pfn); | 232 | extern int page_is_ram(unsigned long pfn); |
233 | 233 | ||
234 | #ifdef CONFIG_PPC_SMLPAR | ||
235 | void arch_free_page(struct page *page, int order); | ||
236 | #define HAVE_ARCH_FREE_PAGE | ||
237 | #endif | ||
238 | |||
234 | struct vm_area_struct; | 239 | struct vm_area_struct; |
235 | 240 | ||
236 | typedef struct page *pgtable_t; | 241 | typedef struct page *pgtable_t; |
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 84007afabdb5..4c61fa0b8d75 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h | |||
@@ -86,17 +86,12 @@ struct pci_controller { | |||
86 | void *io_base_alloc; | 86 | void *io_base_alloc; |
87 | #endif | 87 | #endif |
88 | resource_size_t io_base_phys; | 88 | resource_size_t io_base_phys; |
89 | #ifndef CONFIG_PPC64 | ||
90 | resource_size_t pci_io_size; | 89 | resource_size_t pci_io_size; |
91 | #endif | ||
92 | 90 | ||
93 | /* Some machines (PReP) have a non 1:1 mapping of | 91 | /* Some machines (PReP) have a non 1:1 mapping of |
94 | * the PCI memory space in the CPU bus space | 92 | * the PCI memory space in the CPU bus space |
95 | */ | 93 | */ |
96 | resource_size_t pci_mem_offset; | 94 | resource_size_t pci_mem_offset; |
97 | #ifdef CONFIG_PPC64 | ||
98 | unsigned long pci_io_size; | ||
99 | #endif | ||
100 | 95 | ||
101 | /* Some machines have a special region to forward the ISA | 96 | /* Some machines have a special region to forward the ISA |
102 | * "memory" cycles such as VGA memory regions. Left to 0 | 97 | * "memory" cycles such as VGA memory regions. Left to 0 |
@@ -140,10 +135,12 @@ struct pci_controller { | |||
140 | struct resource io_resource; | 135 | struct resource io_resource; |
141 | struct resource mem_resources[3]; | 136 | struct resource mem_resources[3]; |
142 | int global_number; /* PCI domain number */ | 137 | int global_number; /* PCI domain number */ |
138 | |||
139 | resource_size_t dma_window_base_cur; | ||
140 | resource_size_t dma_window_size; | ||
141 | |||
143 | #ifdef CONFIG_PPC64 | 142 | #ifdef CONFIG_PPC64 |
144 | unsigned long buid; | 143 | unsigned long buid; |
145 | unsigned long dma_window_base_cur; | ||
146 | unsigned long dma_window_size; | ||
147 | 144 | ||
148 | void *private_data; | 145 | void *private_data; |
149 | #endif /* CONFIG_PPC64 */ | 146 | #endif /* CONFIG_PPC64 */ |
@@ -185,7 +182,6 @@ extern int early_find_capability(struct pci_controller *hose, int bus, | |||
185 | extern void setup_indirect_pci(struct pci_controller* hose, | 182 | extern void setup_indirect_pci(struct pci_controller* hose, |
186 | resource_size_t cfg_addr, | 183 | resource_size_t cfg_addr, |
187 | resource_size_t cfg_data, u32 flags); | 184 | resource_size_t cfg_data, u32 flags); |
188 | extern void setup_grackle(struct pci_controller *hose); | ||
189 | #else /* CONFIG_PPC64 */ | 185 | #else /* CONFIG_PPC64 */ |
190 | 186 | ||
191 | /* | 187 | /* |
@@ -221,6 +217,7 @@ struct pci_dn { | |||
221 | #define PCI_DN(dn) ((struct pci_dn *) (dn)->data) | 217 | #define PCI_DN(dn) ((struct pci_dn *) (dn)->data) |
222 | 218 | ||
223 | extern struct device_node *fetch_dev_dn(struct pci_dev *dev); | 219 | extern struct device_node *fetch_dev_dn(struct pci_dev *dev); |
220 | extern void * update_dn_pci_info(struct device_node *dn, void *data); | ||
224 | 221 | ||
225 | /* Get a device_node from a pci_dev. This code must be fast except | 222 | /* Get a device_node from a pci_dev. This code must be fast except |
226 | * in the case where the sysdata is incorrect and needs to be fixed | 223 | * in the case where the sysdata is incorrect and needs to be fixed |
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index c40db05f21e0..8cd083c61503 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h | |||
@@ -31,9 +31,11 @@ | |||
31 | #error TASK_SIZE_USER64 exceeds pagetable range | 31 | #error TASK_SIZE_USER64 exceeds pagetable range |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
34 | #if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT)) | 35 | #if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT)) |
35 | #error TASK_SIZE_USER64 exceeds user VSID range | 36 | #error TASK_SIZE_USER64 exceeds user VSID range |
36 | #endif | 37 | #endif |
38 | #endif | ||
37 | 39 | ||
38 | /* | 40 | /* |
39 | * Define the address range of the vmalloc VM area. | 41 | * Define the address range of the vmalloc VM area. |
@@ -199,8 +201,11 @@ static inline unsigned long pte_update(struct mm_struct *mm, | |||
199 | if (!huge) | 201 | if (!huge) |
200 | assert_pte_locked(mm, addr); | 202 | assert_pte_locked(mm, addr); |
201 | 203 | ||
204 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
202 | if (old & _PAGE_HASHPTE) | 205 | if (old & _PAGE_HASHPTE) |
203 | hpte_need_flush(mm, addr, ptep, old, huge); | 206 | hpte_need_flush(mm, addr, ptep, old, huge); |
207 | #endif | ||
208 | |||
204 | return old; | 209 | return old; |
205 | } | 210 | } |
206 | 211 | ||
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 640ccbbc0977..b74f16d45cb4 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define PPC_INST_LSWI 0x7c0004aa | 25 | #define PPC_INST_LSWI 0x7c0004aa |
26 | #define PPC_INST_LSWX 0x7c00042a | 26 | #define PPC_INST_LSWX 0x7c00042a |
27 | #define PPC_INST_LWSYNC 0x7c2004ac | 27 | #define PPC_INST_LWSYNC 0x7c2004ac |
28 | #define PPC_INST_LXVD2X 0x7c000698 | ||
28 | #define PPC_INST_MCRXR 0x7c000400 | 29 | #define PPC_INST_MCRXR 0x7c000400 |
29 | #define PPC_INST_MCRXR_MASK 0xfc0007fe | 30 | #define PPC_INST_MCRXR_MASK 0xfc0007fe |
30 | #define PPC_INST_MFSPR_PVR 0x7c1f42a6 | 31 | #define PPC_INST_MFSPR_PVR 0x7c1f42a6 |
@@ -43,14 +44,18 @@ | |||
43 | 44 | ||
44 | #define PPC_INST_STSWI 0x7c0005aa | 45 | #define PPC_INST_STSWI 0x7c0005aa |
45 | #define PPC_INST_STSWX 0x7c00052a | 46 | #define PPC_INST_STSWX 0x7c00052a |
47 | #define PPC_INST_STXVD2X 0x7c000798 | ||
48 | #define PPC_INST_TLBIE 0x7c000264 | ||
46 | #define PPC_INST_TLBILX 0x7c000024 | 49 | #define PPC_INST_TLBILX 0x7c000024 |
47 | #define PPC_INST_WAIT 0x7c00007c | 50 | #define PPC_INST_WAIT 0x7c00007c |
48 | 51 | ||
49 | /* macros to insert fields into opcodes */ | 52 | /* macros to insert fields into opcodes */ |
50 | #define __PPC_RA(a) ((a & 0x1f) << 16) | 53 | #define __PPC_RA(a) (((a) & 0x1f) << 16) |
51 | #define __PPC_RB(b) ((b & 0x1f) << 11) | 54 | #define __PPC_RB(b) (((b) & 0x1f) << 11) |
52 | #define __PPC_T_TLB(t) ((t & 0x3) << 21) | 55 | #define __PPC_RS(s) (((s) & 0x1f) << 21) |
53 | #define __PPC_WC(w) ((w & 0x3) << 21) | 56 | #define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5)) |
57 | #define __PPC_T_TLB(t) (((t) & 0x3) << 21) | ||
58 | #define __PPC_WC(w) (((w) & 0x3) << 21) | ||
54 | 59 | ||
55 | /* Deal with instructions that older assemblers aren't aware of */ | 60 | /* Deal with instructions that older assemblers aren't aware of */ |
56 | #define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ | 61 | #define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ |
@@ -69,5 +74,17 @@ | |||
69 | #define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b) | 74 | #define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b) |
70 | #define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \ | 75 | #define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \ |
71 | __PPC_WC(w)) | 76 | __PPC_WC(w)) |
77 | #define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \ | ||
78 | __PPC_RB(a) | __PPC_RS(lp)) | ||
79 | |||
80 | /* | ||
81 | * Define what the VSX XX1 form instructions will look like, then add | ||
82 | * the 128 bit load store instructions based on that. | ||
83 | */ | ||
84 | #define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b)) | ||
85 | #define STXVD2X(s, a, b) stringify_in_c(.long PPC_INST_STXVD2X | \ | ||
86 | VSX_XX1((s), (a), (b))) | ||
87 | #define LXVD2X(s, a, b) stringify_in_c(.long PPC_INST_LXVD2X | \ | ||
88 | VSX_XX1((s), (a), (b))) | ||
72 | 89 | ||
73 | #endif /* _ASM_POWERPC_PPC_OPCODE_H */ | 90 | #endif /* _ASM_POWERPC_PPC_OPCODE_H */ |
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 384d90c9c272..f9729529c20d 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h | |||
@@ -76,16 +76,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ | |||
76 | REST_10GPRS(22, base) | 76 | REST_10GPRS(22, base) |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | /* | ||
80 | * Define what the VSX XX1 form instructions will look like, then add | ||
81 | * the 128 bit load store instructions based on that. | ||
82 | */ | ||
83 | #define VSX_XX1(xs, ra, rb) (((xs) & 0x1f) << 21 | ((ra) << 16) | \ | ||
84 | ((rb) << 11) | (((xs) >> 5))) | ||
85 | |||
86 | #define STXVD2X(xs, ra, rb) .long (0x7c000798 | VSX_XX1((xs), (ra), (rb))) | ||
87 | #define LXVD2X(xs, ra, rb) .long (0x7c000698 | VSX_XX1((xs), (ra), (rb))) | ||
88 | |||
89 | #define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) | 79 | #define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) |
90 | #define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) | 80 | #define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) |
91 | #define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) | 81 | #define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) |
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h index cdb6fd814de8..7f065e178ec4 100644 --- a/arch/powerpc/include/asm/ps3.h +++ b/arch/powerpc/include/asm/ps3.h | |||
@@ -53,6 +53,13 @@ enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); | |||
53 | extern u64 ps3_os_area_get_rtc_diff(void); | 53 | extern u64 ps3_os_area_get_rtc_diff(void); |
54 | extern void ps3_os_area_set_rtc_diff(u64 rtc_diff); | 54 | extern void ps3_os_area_set_rtc_diff(u64 rtc_diff); |
55 | 55 | ||
56 | struct ps3_os_area_flash_ops { | ||
57 | ssize_t (*read)(void *buf, size_t count, loff_t pos); | ||
58 | ssize_t (*write)(const void *buf, size_t count, loff_t pos); | ||
59 | }; | ||
60 | |||
61 | extern void ps3_os_area_flash_register(const struct ps3_os_area_flash_ops *ops); | ||
62 | |||
56 | /* dma routines */ | 63 | /* dma routines */ |
57 | 64 | ||
58 | enum ps3_dma_page_size { | 65 | enum ps3_dma_page_size { |
@@ -418,15 +425,15 @@ static inline struct ps3_system_bus_driver * | |||
418 | * @data: Data to set | 425 | * @data: Data to set |
419 | */ | 426 | */ |
420 | 427 | ||
421 | static inline void ps3_system_bus_set_driver_data( | 428 | static inline void ps3_system_bus_set_drvdata( |
422 | struct ps3_system_bus_device *dev, void *data) | 429 | struct ps3_system_bus_device *dev, void *data) |
423 | { | 430 | { |
424 | dev->core.driver_data = data; | 431 | dev_set_drvdata(&dev->core, data); |
425 | } | 432 | } |
426 | static inline void *ps3_system_bus_get_driver_data( | 433 | static inline void *ps3_system_bus_get_drvdata( |
427 | struct ps3_system_bus_device *dev) | 434 | struct ps3_system_bus_device *dev) |
428 | { | 435 | { |
429 | return dev->core.driver_data; | 436 | return dev_get_drvdata(&dev->core); |
430 | } | 437 | } |
431 | 438 | ||
432 | /* These two need global scope for get_dma_ops(). */ | 439 | /* These two need global scope for get_dma_ops(). */ |
@@ -520,7 +527,4 @@ void ps3_sync_irq(int node); | |||
520 | u32 ps3_get_hw_thread_id(int cpu); | 527 | u32 ps3_get_hw_thread_id(int cpu); |
521 | u64 ps3_get_spe_id(void *arg); | 528 | u64 ps3_get_spe_id(void *arg); |
522 | 529 | ||
523 | /* mutex synchronizing GPU accesses and video mode changes */ | ||
524 | extern struct mutex ps3_gpu_mutex; | ||
525 | |||
526 | #endif | 530 | #endif |
diff --git a/arch/powerpc/include/asm/ps3gpu.h b/arch/powerpc/include/asm/ps3gpu.h new file mode 100644 index 000000000000..b2b89591907c --- /dev/null +++ b/arch/powerpc/include/asm/ps3gpu.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * PS3 GPU declarations. | ||
3 | * | ||
4 | * Copyright 2009 Sony Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. | ||
17 | * If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef _ASM_POWERPC_PS3GPU_H | ||
21 | #define _ASM_POWERPC_PS3GPU_H | ||
22 | |||
23 | #include <linux/mutex.h> | ||
24 | |||
25 | #include <asm/lv1call.h> | ||
26 | |||
27 | |||
28 | #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC 0x101 | ||
29 | #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP 0x102 | ||
30 | |||
31 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600 | ||
32 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601 | ||
33 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602 | ||
34 | #define L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE 0x603 | ||
35 | |||
36 | #define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32) | ||
37 | |||
38 | #define L1GPU_DISPLAY_SYNC_HSYNC 1 | ||
39 | #define L1GPU_DISPLAY_SYNC_VSYNC 2 | ||
40 | |||
41 | |||
42 | /* mutex synchronizing GPU accesses and video mode changes */ | ||
43 | extern struct mutex ps3_gpu_mutex; | ||
44 | |||
45 | |||
46 | static inline int lv1_gpu_display_sync(u64 context_handle, u64 head, | ||
47 | u64 ddr_offset) | ||
48 | { | ||
49 | return lv1_gpu_context_attribute(context_handle, | ||
50 | L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, | ||
51 | head, ddr_offset, 0, 0); | ||
52 | } | ||
53 | |||
54 | static inline int lv1_gpu_display_flip(u64 context_handle, u64 head, | ||
55 | u64 ddr_offset) | ||
56 | { | ||
57 | return lv1_gpu_context_attribute(context_handle, | ||
58 | L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, | ||
59 | head, ddr_offset, 0, 0); | ||
60 | } | ||
61 | |||
62 | static inline int lv1_gpu_fb_setup(u64 context_handle, u64 xdr_lpar, | ||
63 | u64 xdr_size, u64 ioif_offset) | ||
64 | { | ||
65 | return lv1_gpu_context_attribute(context_handle, | ||
66 | L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP, | ||
67 | xdr_lpar, xdr_size, ioif_offset, 0); | ||
68 | } | ||
69 | |||
70 | static inline int lv1_gpu_fb_blit(u64 context_handle, u64 ddr_offset, | ||
71 | u64 ioif_offset, u64 sync_width, u64 pitch) | ||
72 | { | ||
73 | return lv1_gpu_context_attribute(context_handle, | ||
74 | L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, | ||
75 | ddr_offset, ioif_offset, sync_width, | ||
76 | pitch); | ||
77 | } | ||
78 | |||
79 | static inline int lv1_gpu_fb_close(u64 context_handle) | ||
80 | { | ||
81 | return lv1_gpu_context_attribute(context_handle, | ||
82 | L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE, 0, | ||
83 | 0, 0, 0); | ||
84 | } | ||
85 | |||
86 | #endif /* _ASM_POWERPC_PS3GPU_H */ | ||
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index c9c678fb2538..8c341490cfc5 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
@@ -135,7 +135,9 @@ do { \ | |||
135 | * These are defined as per linux/ptrace.h, which see. | 135 | * These are defined as per linux/ptrace.h, which see. |
136 | */ | 136 | */ |
137 | #define arch_has_single_step() (1) | 137 | #define arch_has_single_step() (1) |
138 | #define arch_has_block_step() (!cpu_has_feature(CPU_FTR_601)) | ||
138 | extern void user_enable_single_step(struct task_struct *); | 139 | extern void user_enable_single_step(struct task_struct *); |
140 | extern void user_enable_block_step(struct task_struct *); | ||
139 | extern void user_disable_single_step(struct task_struct *); | 141 | extern void user_disable_single_step(struct task_struct *); |
140 | 142 | ||
141 | #endif /* __ASSEMBLY__ */ | 143 | #endif /* __ASSEMBLY__ */ |
@@ -288,4 +290,6 @@ extern void user_disable_single_step(struct task_struct *); | |||
288 | #define PPC_PTRACE_PEEKUSR_3264 0x91 | 290 | #define PPC_PTRACE_PEEKUSR_3264 0x91 |
289 | #define PPC_PTRACE_POKEUSR_3264 0x90 | 291 | #define PPC_PTRACE_POKEUSR_3264 0x90 |
290 | 292 | ||
293 | #define PTRACE_SINGLEBLOCK 0x100 /* resume execution until next branch */ | ||
294 | |||
291 | #endif /* _ASM_POWERPC_PTRACE_H */ | 295 | #endif /* _ASM_POWERPC_PTRACE_H */ |
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h index 2701753d9937..157c5ca581c8 100644 --- a/arch/powerpc/include/asm/qe.h +++ b/arch/powerpc/include/asm/qe.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <asm/cpm.h> | 22 | #include <asm/cpm.h> |
23 | #include <asm/immap_qe.h> | 23 | #include <asm/immap_qe.h> |
24 | 24 | ||
25 | #define QE_NUM_OF_SNUM 28 | 25 | #define QE_NUM_OF_SNUM 256 /* There are 256 serial number in QE */ |
26 | #define QE_NUM_OF_BRGS 16 | 26 | #define QE_NUM_OF_BRGS 16 |
27 | #define QE_NUM_OF_PORTS 1024 | 27 | #define QE_NUM_OF_PORTS 1024 |
28 | 28 | ||
@@ -152,6 +152,9 @@ unsigned int qe_get_brg_clk(void); | |||
152 | int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); | 152 | int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); |
153 | int qe_get_snum(void); | 153 | int qe_get_snum(void); |
154 | void qe_put_snum(u8 snum); | 154 | void qe_put_snum(u8 snum); |
155 | unsigned int qe_get_num_of_risc(void); | ||
156 | unsigned int qe_get_num_of_snums(void); | ||
157 | |||
155 | /* we actually use cpm_muram implementation, define this for convenience */ | 158 | /* we actually use cpm_muram implementation, define this for convenience */ |
156 | #define qe_muram_init cpm_muram_init | 159 | #define qe_muram_init cpm_muram_init |
157 | #define qe_muram_alloc cpm_muram_alloc | 160 | #define qe_muram_alloc cpm_muram_alloc |
@@ -231,12 +234,16 @@ struct qe_bd { | |||
231 | #define QE_ALIGNMENT_OF_PRAM 64 | 234 | #define QE_ALIGNMENT_OF_PRAM 64 |
232 | 235 | ||
233 | /* RISC allocation */ | 236 | /* RISC allocation */ |
234 | enum qe_risc_allocation { | 237 | #define QE_RISC_ALLOCATION_RISC1 0x1 /* RISC 1 */ |
235 | QE_RISC_ALLOCATION_RISC1 = 1, /* RISC 1 */ | 238 | #define QE_RISC_ALLOCATION_RISC2 0x2 /* RISC 2 */ |
236 | QE_RISC_ALLOCATION_RISC2 = 2, /* RISC 2 */ | 239 | #define QE_RISC_ALLOCATION_RISC3 0x4 /* RISC 3 */ |
237 | QE_RISC_ALLOCATION_RISC1_AND_RISC2 = 3 /* Dynamically choose | 240 | #define QE_RISC_ALLOCATION_RISC4 0x8 /* RISC 4 */ |
238 | RISC 1 or RISC 2 */ | 241 | #define QE_RISC_ALLOCATION_RISC1_AND_RISC2 (QE_RISC_ALLOCATION_RISC1 | \ |
239 | }; | 242 | QE_RISC_ALLOCATION_RISC2) |
243 | #define QE_RISC_ALLOCATION_FOUR_RISCS (QE_RISC_ALLOCATION_RISC1 | \ | ||
244 | QE_RISC_ALLOCATION_RISC2 | \ | ||
245 | QE_RISC_ALLOCATION_RISC3 | \ | ||
246 | QE_RISC_ALLOCATION_RISC4) | ||
240 | 247 | ||
241 | /* QE extended filtering Table Lookup Key Size */ | 248 | /* QE extended filtering Table Lookup Key Size */ |
242 | enum qe_fltr_tbl_lookup_key_size { | 249 | enum qe_fltr_tbl_lookup_key_size { |
@@ -668,6 +675,8 @@ struct ucc_slow_pram { | |||
668 | #define UCC_GETH_UPSMR_RMM 0x00001000 | 675 | #define UCC_GETH_UPSMR_RMM 0x00001000 |
669 | #define UCC_GETH_UPSMR_CAM 0x00000400 | 676 | #define UCC_GETH_UPSMR_CAM 0x00000400 |
670 | #define UCC_GETH_UPSMR_BRO 0x00000200 | 677 | #define UCC_GETH_UPSMR_BRO 0x00000200 |
678 | #define UCC_GETH_UPSMR_SMM 0x00000080 | ||
679 | #define UCC_GETH_UPSMR_SGMM 0x00000020 | ||
671 | 680 | ||
672 | /* UCC Transmit On Demand Register (UTODR) */ | 681 | /* UCC Transmit On Demand Register (UTODR) */ |
673 | #define UCC_SLOW_TOD 0x8000 | 682 | #define UCC_SLOW_TOD 0x8000 |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index fb359b0a6937..a3c28e46947c 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -745,11 +745,11 @@ | |||
745 | asm volatile("mfmsr %0" : "=r" (rval)); rval;}) | 745 | asm volatile("mfmsr %0" : "=r" (rval)); rval;}) |
746 | #ifdef CONFIG_PPC64 | 746 | #ifdef CONFIG_PPC64 |
747 | #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ | 747 | #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ |
748 | : : "r" (v)) | 748 | : : "r" (v) : "memory") |
749 | #define mtmsrd(v) __mtmsrd((v), 0) | 749 | #define mtmsrd(v) __mtmsrd((v), 0) |
750 | #define mtmsr(v) mtmsrd(v) | 750 | #define mtmsr(v) mtmsrd(v) |
751 | #else | 751 | #else |
752 | #define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v)) | 752 | #define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v) : "memory") |
753 | #endif | 753 | #endif |
754 | 754 | ||
755 | #define mfspr(rn) ({unsigned long rval; \ | 755 | #define mfspr(rn) ({unsigned long rval; \ |
diff --git a/arch/powerpc/include/asm/scatterlist.h b/arch/powerpc/include/asm/scatterlist.h index fcf7d55afe45..912bf597870f 100644 --- a/arch/powerpc/include/asm/scatterlist.h +++ b/arch/powerpc/include/asm/scatterlist.h | |||
@@ -21,7 +21,7 @@ struct scatterlist { | |||
21 | unsigned int offset; | 21 | unsigned int offset; |
22 | unsigned int length; | 22 | unsigned int length; |
23 | 23 | ||
24 | /* For TCE support */ | 24 | /* For TCE or SWIOTLB support */ |
25 | dma_addr_t dma_address; | 25 | dma_addr_t dma_address; |
26 | u32 dma_length; | 26 | u32 dma_length; |
27 | }; | 27 | }; |
@@ -34,11 +34,7 @@ struct scatterlist { | |||
34 | * is 0. | 34 | * is 0. |
35 | */ | 35 | */ |
36 | #define sg_dma_address(sg) ((sg)->dma_address) | 36 | #define sg_dma_address(sg) ((sg)->dma_address) |
37 | #ifdef __powerpc64__ | ||
38 | #define sg_dma_len(sg) ((sg)->dma_length) | 37 | #define sg_dma_len(sg) ((sg)->dma_length) |
39 | #else | ||
40 | #define sg_dma_len(sg) ((sg)->length) | ||
41 | #endif | ||
42 | 38 | ||
43 | #ifdef __powerpc64__ | 39 | #ifdef __powerpc64__ |
44 | #define ISA_DMA_THRESHOLD (~0UL) | 40 | #define ISA_DMA_THRESHOLD (~0UL) |
diff --git a/arch/powerpc/include/asm/swiotlb.h b/arch/powerpc/include/asm/swiotlb.h new file mode 100644 index 000000000000..30891d6e2bc1 --- /dev/null +++ b/arch/powerpc/include/asm/swiotlb.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Becky Bruce, Freescale Semiconductor | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the | ||
6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
7 | * option) any later version. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_SWIOTLB_H | ||
12 | #define __ASM_SWIOTLB_H | ||
13 | |||
14 | #include <linux/swiotlb.h> | ||
15 | |||
16 | extern struct dma_mapping_ops swiotlb_dma_ops; | ||
17 | extern struct dma_mapping_ops swiotlb_pci_dma_ops; | ||
18 | |||
19 | int swiotlb_arch_address_needs_mapping(struct device *, dma_addr_t, | ||
20 | size_t size); | ||
21 | |||
22 | static inline void dma_mark_clean(void *addr, size_t size) {} | ||
23 | |||
24 | extern unsigned int ppc_swiotlb_enable; | ||
25 | int __init swiotlb_setup_bus_notifier(void); | ||
26 | |||
27 | #endif /* __ASM_SWIOTLB_H */ | ||
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index a0b92de51c7e..370600ca2765 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -325,3 +325,4 @@ SYSCALL(inotify_init1) | |||
325 | SYSCALL_SPU(perf_counter_open) | 325 | SYSCALL_SPU(perf_counter_open) |
326 | COMPAT_SYS_SPU(preadv) | 326 | COMPAT_SYS_SPU(preadv) |
327 | COMPAT_SYS_SPU(pwritev) | 327 | COMPAT_SYS_SPU(pwritev) |
328 | COMPAT_SYS(rt_tgsigqueueinfo) | ||
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h index 2b2420a49884..bb8e006a47c6 100644 --- a/arch/powerpc/include/asm/system.h +++ b/arch/powerpc/include/asm/system.h | |||
@@ -211,7 +211,7 @@ extern struct task_struct *_switch(struct thread_struct *prev, | |||
211 | 211 | ||
212 | extern unsigned int rtas_data; | 212 | extern unsigned int rtas_data; |
213 | extern int mem_init_done; /* set on boot once kmalloc can be called */ | 213 | extern int mem_init_done; /* set on boot once kmalloc can be called */ |
214 | extern int init_bootmem_done; /* set on !NUMA once bootmem is available */ | 214 | extern int init_bootmem_done; /* set once bootmem is available */ |
215 | extern phys_addr_t memory_limit; | 215 | extern phys_addr_t memory_limit; |
216 | extern unsigned long klimit; | 216 | extern unsigned long klimit; |
217 | 217 | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index 4badac2d11d1..cef080bfc607 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
@@ -344,10 +344,11 @@ | |||
344 | #define __NR_perf_counter_open 319 | 344 | #define __NR_perf_counter_open 319 |
345 | #define __NR_preadv 320 | 345 | #define __NR_preadv 320 |
346 | #define __NR_pwritev 321 | 346 | #define __NR_pwritev 321 |
347 | #define __NR_rt_tgsigqueueinfo 322 | ||
347 | 348 | ||
348 | #ifdef __KERNEL__ | 349 | #ifdef __KERNEL__ |
349 | 350 | ||
350 | #define __NR_syscalls 322 | 351 | #define __NR_syscalls 323 |
351 | 352 | ||
352 | #define __NR__exit __NR_exit | 353 | #define __NR__exit __NR_exit |
353 | #define NR_syscalls __NR_syscalls | 354 | #define NR_syscalls __NR_syscalls |
diff --git a/arch/powerpc/include/asm/xilinx_pci.h b/arch/powerpc/include/asm/xilinx_pci.h new file mode 100644 index 000000000000..7a8275caf6af --- /dev/null +++ b/arch/powerpc/include/asm/xilinx_pci.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Xilinx pci external definitions | ||
3 | * | ||
4 | * Copyright 2009 Roderick Colenbrander | ||
5 | * Copyright 2009 Secret Lab Technologies Ltd. | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public License | ||
8 | * version 2. This program is licensed "as is" without any warranty of any | ||
9 | * kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef INCLUDE_XILINX_PCI | ||
13 | #define INCLUDE_XILINX_PCI | ||
14 | |||
15 | #ifdef CONFIG_XILINX_PCI | ||
16 | extern void __init xilinx_pci_init(void); | ||
17 | #else | ||
18 | static inline void __init xilinx_pci_init(void) { return; } | ||
19 | #endif | ||
20 | |||
21 | #endif /* INCLUDE_XILINX_PCI */ | ||