diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 14:30:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 14:30:37 -0400 |
commit | 609106b9ac968adbc76ce78c979fc3903a56e16c (patch) | |
tree | 4af8b305ab4095870a927ffdb9a5e14eb2107401 /arch/powerpc/include | |
parent | 69257cae20640a396f03aa0bf169b815ba66a58a (diff) | |
parent | 42e27bfc4bfa42bd905e53be93d862b8e3d80a00 (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (38 commits)
ps3flash: Always read chunks of 256 KiB, and cache them
ps3flash: Cache the last accessed FLASH chunk
ps3: Replace direct file operations by callback
ps3: Switch ps3_os_area_[gs]et_rtc_diff to EXPORT_SYMBOL_GPL()
ps3: Correct debug message in dma_ioc0_map_pages()
drivers/ps3: Add missing annotations
ps3fb: Use ps3_system_bus_[gs]et_drvdata() instead of direct access
ps3flash: Use ps3_system_bus_[gs]et_drvdata() instead of direct access
ps3: shorten ps3_system_bus_[gs]et_driver_data to ps3_system_bus_[gs]et_drvdata
ps3: Use dev_[gs]et_drvdata() instead of direct access for system bus devices
block/ps3: remove driver_data direct access of struct device
ps3vram: Make ps3vram_priv.reports a void *
ps3vram: Remove no longer used ps3vram_priv.ddr_base
ps3vram: Replace mutex by spinlock + bio_list
block: Add bio_list_peek()
powerpc: Use generic atomic64_t implementation on 32-bit processors
lib: Provide generic atomic64_t implementation
powerpc: Add compiler memory barrier to mtmsr macro
powerpc/iseries: Mark signal_vsp_instruction() as maybe unused
powerpc/iseries: Fix unused function warning in iSeries DT code
...
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/atomic.h | 3 | ||||
-rw-r--r-- | arch/powerpc/include/asm/hw_irq.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/iommu.h | 10 | ||||
-rw-r--r-- | arch/powerpc/include/asm/ps3.h | 18 | ||||
-rw-r--r-- | arch/powerpc/include/asm/ps3gpu.h | 86 | ||||
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 4 | ||||
-rw-r--r-- | arch/powerpc/include/asm/systbl.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/unistd.h | 3 |
8 files changed, 117 insertions, 13 deletions
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/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h index 53512374e1c9..b7f8f4a87cc0 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/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/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/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/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 |