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 | |
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')
-rw-r--r-- | arch/powerpc/Kconfig | 5 | ||||
-rw-r--r-- | arch/powerpc/boot/install.sh | 3 | ||||
-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 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/time.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/axon_msi.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 37 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/dt.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/mf.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/mm.c | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/os-area.c | 142 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/platform.h | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/system-bus.c | 15 |
22 files changed, 250 insertions, 131 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 93a61898b259..9fb344d5a86a 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -93,10 +93,6 @@ config GENERIC_HWEIGHT | |||
93 | bool | 93 | bool |
94 | default y | 94 | default y |
95 | 95 | ||
96 | config GENERIC_CALIBRATE_DELAY | ||
97 | bool | ||
98 | default y | ||
99 | |||
100 | config GENERIC_FIND_NEXT_BIT | 96 | config GENERIC_FIND_NEXT_BIT |
101 | bool | 97 | bool |
102 | default y | 98 | default y |
@@ -129,6 +125,7 @@ config PPC | |||
129 | select USE_GENERIC_SMP_HELPERS if SMP | 125 | select USE_GENERIC_SMP_HELPERS if SMP |
130 | select HAVE_OPROFILE | 126 | select HAVE_OPROFILE |
131 | select HAVE_SYSCALL_WRAPPERS if PPC64 | 127 | select HAVE_SYSCALL_WRAPPERS if PPC64 |
128 | select GENERIC_ATOMIC64 if PPC32 | ||
132 | 129 | ||
133 | config EARLY_PRINTK | 130 | config EARLY_PRINTK |
134 | bool | 131 | bool |
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh index 51b2387bdba0..98312d169c85 100644 --- a/arch/powerpc/boot/install.sh +++ b/arch/powerpc/boot/install.sh | |||
@@ -18,6 +18,9 @@ | |||
18 | # $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc. | 18 | # $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc. |
19 | # | 19 | # |
20 | 20 | ||
21 | # Bail with error code if anything goes wrong | ||
22 | set -e | ||
23 | |||
21 | # User may have a custom install script | 24 | # User may have a custom install script |
22 | 25 | ||
23 | if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi | 26 | if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi |
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 |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index a7def5f90cad..612b0c4dc26d 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -125,6 +125,7 @@ PHONY += systbl_chk | |||
125 | systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i | 125 | systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i |
126 | $(call cmd,systbl_chk) | 126 | $(call cmd,systbl_chk) |
127 | 127 | ||
128 | ifeq ($(CONFIG_PPC_OF_BOOT_TRAMPOLINE),y) | ||
128 | $(obj)/built-in.o: prom_init_check | 129 | $(obj)/built-in.o: prom_init_check |
129 | 130 | ||
130 | quiet_cmd_prom_init_check = CALL $< | 131 | quiet_cmd_prom_init_check = CALL $< |
@@ -133,5 +134,6 @@ quiet_cmd_prom_init_check = CALL $< | |||
133 | PHONY += prom_init_check | 134 | PHONY += prom_init_check |
134 | prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o | 135 | prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o |
135 | $(call cmd,prom_init_check) | 136 | $(call cmd,prom_init_check) |
137 | endif | ||
136 | 138 | ||
137 | clean-files := vmlinux.lds | 139 | clean-files := vmlinux.lds |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index f46548e66045..1f6816003ebe 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -424,8 +424,8 @@ void __init setup_system(void) | |||
424 | printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); | 424 | printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); |
425 | #endif /* CONFIG_PPC_STD_MMU_64 */ | 425 | #endif /* CONFIG_PPC_STD_MMU_64 */ |
426 | if (PHYSICAL_START > 0) | 426 | if (PHYSICAL_START > 0) |
427 | printk("physical_start = 0x%lx\n", | 427 | printk("physical_start = 0x%llx\n", |
428 | PHYSICAL_START); | 428 | (unsigned long long)PHYSICAL_START); |
429 | printk("-----------------------------------------------------\n"); | 429 | printk("-----------------------------------------------------\n"); |
430 | 430 | ||
431 | DBG(" <- setup_system()\n"); | 431 | DBG(" <- setup_system()\n"); |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index bee1443da763..15391c2ab013 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/jiffies.h> | 52 | #include <linux/jiffies.h> |
53 | #include <linux/posix-timers.h> | 53 | #include <linux/posix-timers.h> |
54 | #include <linux/irq.h> | 54 | #include <linux/irq.h> |
55 | #include <linux/delay.h> | ||
55 | 56 | ||
56 | #include <asm/io.h> | 57 | #include <asm/io.h> |
57 | #include <asm/processor.h> | 58 | #include <asm/processor.h> |
@@ -1143,6 +1144,15 @@ void div128_by_32(u64 dividend_high, u64 dividend_low, | |||
1143 | 1144 | ||
1144 | } | 1145 | } |
1145 | 1146 | ||
1147 | /* We don't need to calibrate delay, we use the CPU timebase for that */ | ||
1148 | void calibrate_delay(void) | ||
1149 | { | ||
1150 | /* Some generic code (such as spinlock debug) use loops_per_jiffy | ||
1151 | * as the number of __delay(1) in a jiffy, so make it so | ||
1152 | */ | ||
1153 | loops_per_jiffy = tb_ticks_per_jiffy; | ||
1154 | } | ||
1155 | |||
1146 | static int __init rtc_init(void) | 1156 | static int __init rtc_init(void) |
1147 | { | 1157 | { |
1148 | struct platform_device *pdev; | 1158 | struct platform_device *pdev; |
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 0ce45c2b42f8..c71498dbf211 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c | |||
@@ -329,7 +329,7 @@ static struct irq_host_ops msic_host_ops = { | |||
329 | 329 | ||
330 | static int axon_msi_shutdown(struct of_device *device) | 330 | static int axon_msi_shutdown(struct of_device *device) |
331 | { | 331 | { |
332 | struct axon_msic *msic = device->dev.platform_data; | 332 | struct axon_msic *msic = dev_get_drvdata(&device->dev); |
333 | u32 tmp; | 333 | u32 tmp; |
334 | 334 | ||
335 | pr_debug("axon_msi: disabling %s\n", | 335 | pr_debug("axon_msi: disabling %s\n", |
@@ -416,7 +416,7 @@ static int axon_msi_probe(struct of_device *device, | |||
416 | msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG) | 416 | msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG) |
417 | & MSIC_FIFO_SIZE_MASK; | 417 | & MSIC_FIFO_SIZE_MASK; |
418 | 418 | ||
419 | device->dev.platform_data = msic; | 419 | dev_set_drvdata(&device->dev, msic); |
420 | 420 | ||
421 | ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs; | 421 | ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs; |
422 | ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs; | 422 | ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs; |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index bed4690de394..5b34fc211f35 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -100,16 +100,6 @@ | |||
100 | #define IOSTE_PS_1M 0x0000000000000005ul /* - 1MB */ | 100 | #define IOSTE_PS_1M 0x0000000000000005ul /* - 1MB */ |
101 | #define IOSTE_PS_16M 0x0000000000000007ul /* - 16MB */ | 101 | #define IOSTE_PS_16M 0x0000000000000007ul /* - 16MB */ |
102 | 102 | ||
103 | /* Page table entries */ | ||
104 | #define IOPTE_PP_W 0x8000000000000000ul /* protection: write */ | ||
105 | #define IOPTE_PP_R 0x4000000000000000ul /* protection: read */ | ||
106 | #define IOPTE_M 0x2000000000000000ul /* coherency required */ | ||
107 | #define IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */ | ||
108 | #define IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */ | ||
109 | #define IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */ | ||
110 | #define IOPTE_H 0x0000000000000800ul /* cache hint */ | ||
111 | #define IOPTE_IOID_Mask 0x00000000000007fful /* ioid */ | ||
112 | |||
113 | 103 | ||
114 | /* IOMMU sizing */ | 104 | /* IOMMU sizing */ |
115 | #define IO_SEGMENT_SHIFT 28 | 105 | #define IO_SEGMENT_SHIFT 28 |
@@ -193,19 +183,21 @@ static int tce_build_cell(struct iommu_table *tbl, long index, long npages, | |||
193 | */ | 183 | */ |
194 | const unsigned long prot = 0xc48; | 184 | const unsigned long prot = 0xc48; |
195 | base_pte = | 185 | base_pte = |
196 | ((prot << (52 + 4 * direction)) & (IOPTE_PP_W | IOPTE_PP_R)) | 186 | ((prot << (52 + 4 * direction)) & |
197 | | IOPTE_M | IOPTE_SO_RW | (window->ioid & IOPTE_IOID_Mask); | 187 | (CBE_IOPTE_PP_W | CBE_IOPTE_PP_R)) | |
188 | CBE_IOPTE_M | CBE_IOPTE_SO_RW | | ||
189 | (window->ioid & CBE_IOPTE_IOID_Mask); | ||
198 | #else | 190 | #else |
199 | base_pte = IOPTE_PP_W | IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW | | 191 | base_pte = CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_M | |
200 | (window->ioid & IOPTE_IOID_Mask); | 192 | CBE_IOPTE_SO_RW | (window->ioid & CBE_IOPTE_IOID_Mask); |
201 | #endif | 193 | #endif |
202 | if (unlikely(dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs))) | 194 | if (unlikely(dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs))) |
203 | base_pte &= ~IOPTE_SO_RW; | 195 | base_pte &= ~CBE_IOPTE_SO_RW; |
204 | 196 | ||
205 | io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset); | 197 | io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset); |
206 | 198 | ||
207 | for (i = 0; i < npages; i++, uaddr += IOMMU_PAGE_SIZE) | 199 | for (i = 0; i < npages; i++, uaddr += IOMMU_PAGE_SIZE) |
208 | io_pte[i] = base_pte | (__pa(uaddr) & IOPTE_RPN_Mask); | 200 | io_pte[i] = base_pte | (__pa(uaddr) & CBE_IOPTE_RPN_Mask); |
209 | 201 | ||
210 | mb(); | 202 | mb(); |
211 | 203 | ||
@@ -231,8 +223,9 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages) | |||
231 | #else | 223 | #else |
232 | /* spider bridge does PCI reads after freeing - insert a mapping | 224 | /* spider bridge does PCI reads after freeing - insert a mapping |
233 | * to a scratch page instead of an invalid entry */ | 225 | * to a scratch page instead of an invalid entry */ |
234 | pte = IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW | __pa(window->iommu->pad_page) | 226 | pte = CBE_IOPTE_PP_R | CBE_IOPTE_M | CBE_IOPTE_SO_RW | |
235 | | (window->ioid & IOPTE_IOID_Mask); | 227 | __pa(window->iommu->pad_page) | |
228 | (window->ioid & CBE_IOPTE_IOID_Mask); | ||
236 | #endif | 229 | #endif |
237 | 230 | ||
238 | io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset); | 231 | io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset); |
@@ -1001,7 +994,7 @@ static void insert_16M_pte(unsigned long addr, unsigned long *ptab, | |||
1001 | pr_debug("iommu: addr %lx ptab %p segment %lx offset %lx\n", | 994 | pr_debug("iommu: addr %lx ptab %p segment %lx offset %lx\n", |
1002 | addr, ptab, segment, offset); | 995 | addr, ptab, segment, offset); |
1003 | 996 | ||
1004 | ptab[offset] = base_pte | (__pa(addr) & IOPTE_RPN_Mask); | 997 | ptab[offset] = base_pte | (__pa(addr) & CBE_IOPTE_RPN_Mask); |
1005 | } | 998 | } |
1006 | 999 | ||
1007 | static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu, | 1000 | static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu, |
@@ -1016,14 +1009,14 @@ static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu, | |||
1016 | 1009 | ||
1017 | pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n", fsize, fbase); | 1010 | pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n", fsize, fbase); |
1018 | 1011 | ||
1019 | base_pte = IOPTE_PP_W | IOPTE_PP_R | IOPTE_M | 1012 | base_pte = CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_M | |
1020 | | (cell_iommu_get_ioid(np) & IOPTE_IOID_Mask); | 1013 | (cell_iommu_get_ioid(np) & CBE_IOPTE_IOID_Mask); |
1021 | 1014 | ||
1022 | if (iommu_fixed_is_weak) | 1015 | if (iommu_fixed_is_weak) |
1023 | pr_info("IOMMU: Using weak ordering for fixed mapping\n"); | 1016 | pr_info("IOMMU: Using weak ordering for fixed mapping\n"); |
1024 | else { | 1017 | else { |
1025 | pr_info("IOMMU: Using strong ordering for fixed mapping\n"); | 1018 | pr_info("IOMMU: Using strong ordering for fixed mapping\n"); |
1026 | base_pte |= IOPTE_SO_RW; | 1019 | base_pte |= CBE_IOPTE_SO_RW; |
1027 | } | 1020 | } |
1028 | 1021 | ||
1029 | for (uaddr = 0; uaddr < fsize; uaddr += (1 << 24)) { | 1022 | for (uaddr = 0; uaddr < fsize; uaddr += (1 << 24)) { |
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c index 4543c4bc3a56..c5a87a72057b 100644 --- a/arch/powerpc/platforms/iseries/dt.c +++ b/arch/powerpc/platforms/iseries/dt.c | |||
@@ -204,7 +204,8 @@ static void __init dt_prop_u32(struct iseries_flat_dt *dt, const char *name, | |||
204 | dt_prop(dt, name, &data, sizeof(u32)); | 204 | dt_prop(dt, name, &data, sizeof(u32)); |
205 | } | 205 | } |
206 | 206 | ||
207 | static void __init dt_prop_u64(struct iseries_flat_dt *dt, const char *name, | 207 | static void __init __maybe_unused dt_prop_u64(struct iseries_flat_dt *dt, |
208 | const char *name, | ||
208 | u64 data) | 209 | u64 data) |
209 | { | 210 | { |
210 | dt_prop(dt, name, &data, sizeof(u64)); | 211 | dt_prop(dt, name, &data, sizeof(u64)); |
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 3689c2413d24..fef4d5150517 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c | |||
@@ -267,7 +267,8 @@ static struct pending_event *new_pending_event(void) | |||
267 | return ev; | 267 | return ev; |
268 | } | 268 | } |
269 | 269 | ||
270 | static int signal_vsp_instruction(struct vsp_cmd_data *vsp_cmd) | 270 | static int __maybe_unused |
271 | signal_vsp_instruction(struct vsp_cmd_data *vsp_cmd) | ||
271 | { | 272 | { |
272 | struct pending_event *ev = new_pending_event(); | 273 | struct pending_event *ev = new_pending_event(); |
273 | int rc; | 274 | int rc; |
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c index 9a2b6d948610..846eb8b57fd1 100644 --- a/arch/powerpc/platforms/ps3/mm.c +++ b/arch/powerpc/platforms/ps3/mm.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/lmb.h> | 24 | #include <linux/lmb.h> |
25 | 25 | ||
26 | #include <asm/firmware.h> | 26 | #include <asm/firmware.h> |
27 | #include <asm/iommu.h> | ||
27 | #include <asm/prom.h> | 28 | #include <asm/prom.h> |
28 | #include <asm/udbg.h> | 29 | #include <asm/udbg.h> |
29 | #include <asm/lv1call.h> | 30 | #include <asm/lv1call.h> |
@@ -605,9 +606,8 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr, | |||
605 | r->ioid, | 606 | r->ioid, |
606 | iopte_flag); | 607 | iopte_flag); |
607 | if (result) { | 608 | if (result) { |
608 | printk(KERN_WARNING "%s:%d: lv1_map_device_dma_region " | 609 | pr_warning("%s:%d: lv1_put_iopte failed: %s\n", |
609 | "failed: %s\n", __func__, __LINE__, | 610 | __func__, __LINE__, ps3_result(result)); |
610 | ps3_result(result)); | ||
611 | goto fail_map; | 611 | goto fail_map; |
612 | } | 612 | } |
613 | DBG("%s: pg=%d bus=%#lx, lpar=%#lx, ioid=%#x\n", __func__, | 613 | DBG("%s: pg=%d bus=%#lx, lpar=%#lx, ioid=%#x\n", __func__, |
@@ -1001,7 +1001,8 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r) | |||
1001 | if (len > r->len) | 1001 | if (len > r->len) |
1002 | len = r->len; | 1002 | len = r->len; |
1003 | result = dma_sb_map_area(r, virt_addr, len, &tmp, | 1003 | result = dma_sb_map_area(r, virt_addr, len, &tmp, |
1004 | IOPTE_PP_W | IOPTE_PP_R | IOPTE_SO_RW | IOPTE_M); | 1004 | CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_SO_RW | |
1005 | CBE_IOPTE_M); | ||
1005 | BUG_ON(result); | 1006 | BUG_ON(result); |
1006 | } | 1007 | } |
1007 | 1008 | ||
@@ -1014,7 +1015,8 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r) | |||
1014 | else | 1015 | else |
1015 | len -= map.rm.size - r->offset; | 1016 | len -= map.rm.size - r->offset; |
1016 | result = dma_sb_map_area(r, virt_addr, len, &tmp, | 1017 | result = dma_sb_map_area(r, virt_addr, len, &tmp, |
1017 | IOPTE_PP_W | IOPTE_PP_R | IOPTE_SO_RW | IOPTE_M); | 1018 | CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_SO_RW | |
1019 | CBE_IOPTE_M); | ||
1018 | BUG_ON(result); | 1020 | BUG_ON(result); |
1019 | } | 1021 | } |
1020 | 1022 | ||
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c index cf1cd0f8c18f..d6487a9c8019 100644 --- a/arch/powerpc/platforms/ps3/os-area.c +++ b/arch/powerpc/platforms/ps3/os-area.c | |||
@@ -226,6 +226,44 @@ static struct property property_av_multi_out = { | |||
226 | .value = &saved_params.av_multi_out, | 226 | .value = &saved_params.av_multi_out, |
227 | }; | 227 | }; |
228 | 228 | ||
229 | |||
230 | static DEFINE_MUTEX(os_area_flash_mutex); | ||
231 | |||
232 | static const struct ps3_os_area_flash_ops *os_area_flash_ops; | ||
233 | |||
234 | void ps3_os_area_flash_register(const struct ps3_os_area_flash_ops *ops) | ||
235 | { | ||
236 | mutex_lock(&os_area_flash_mutex); | ||
237 | os_area_flash_ops = ops; | ||
238 | mutex_unlock(&os_area_flash_mutex); | ||
239 | } | ||
240 | EXPORT_SYMBOL_GPL(ps3_os_area_flash_register); | ||
241 | |||
242 | static ssize_t os_area_flash_read(void *buf, size_t count, loff_t pos) | ||
243 | { | ||
244 | ssize_t res = -ENODEV; | ||
245 | |||
246 | mutex_lock(&os_area_flash_mutex); | ||
247 | if (os_area_flash_ops) | ||
248 | res = os_area_flash_ops->read(buf, count, pos); | ||
249 | mutex_unlock(&os_area_flash_mutex); | ||
250 | |||
251 | return res; | ||
252 | } | ||
253 | |||
254 | static ssize_t os_area_flash_write(const void *buf, size_t count, loff_t pos) | ||
255 | { | ||
256 | ssize_t res = -ENODEV; | ||
257 | |||
258 | mutex_lock(&os_area_flash_mutex); | ||
259 | if (os_area_flash_ops) | ||
260 | res = os_area_flash_ops->write(buf, count, pos); | ||
261 | mutex_unlock(&os_area_flash_mutex); | ||
262 | |||
263 | return res; | ||
264 | } | ||
265 | |||
266 | |||
229 | /** | 267 | /** |
230 | * os_area_set_property - Add or overwrite a saved_params value to the device tree. | 268 | * os_area_set_property - Add or overwrite a saved_params value to the device tree. |
231 | * | 269 | * |
@@ -352,12 +390,12 @@ static int db_verify(const struct os_area_db *db) | |||
352 | if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM, | 390 | if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM, |
353 | sizeof(db->magic_num))) { | 391 | sizeof(db->magic_num))) { |
354 | pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); | 392 | pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); |
355 | return -1; | 393 | return -EINVAL; |
356 | } | 394 | } |
357 | 395 | ||
358 | if (db->version != 1) { | 396 | if (db->version != 1) { |
359 | pr_debug("%s:%d version failed\n", __func__, __LINE__); | 397 | pr_debug("%s:%d version failed\n", __func__, __LINE__); |
360 | return -1; | 398 | return -EINVAL; |
361 | } | 399 | } |
362 | 400 | ||
363 | return 0; | 401 | return 0; |
@@ -578,59 +616,48 @@ static void os_area_db_init(struct os_area_db *db) | |||
578 | * | 616 | * |
579 | */ | 617 | */ |
580 | 618 | ||
581 | static void __maybe_unused update_flash_db(void) | 619 | static int update_flash_db(void) |
582 | { | 620 | { |
583 | int result; | 621 | const unsigned int buf_len = 8 * OS_AREA_SEGMENT_SIZE; |
584 | int file; | 622 | struct os_area_header *header; |
585 | off_t offset; | ||
586 | ssize_t count; | 623 | ssize_t count; |
587 | static const unsigned int buf_len = 8 * OS_AREA_SEGMENT_SIZE; | 624 | int error; |
588 | const struct os_area_header *header; | 625 | loff_t pos; |
589 | struct os_area_db* db; | 626 | struct os_area_db* db; |
590 | 627 | ||
591 | /* Read in header and db from flash. */ | 628 | /* Read in header and db from flash. */ |
592 | 629 | ||
593 | file = sys_open("/dev/ps3flash", O_RDWR, 0); | ||
594 | |||
595 | if (file < 0) { | ||
596 | pr_debug("%s:%d sys_open failed\n", __func__, __LINE__); | ||
597 | goto fail_open; | ||
598 | } | ||
599 | |||
600 | header = kmalloc(buf_len, GFP_KERNEL); | 630 | header = kmalloc(buf_len, GFP_KERNEL); |
601 | |||
602 | if (!header) { | 631 | if (!header) { |
603 | pr_debug("%s:%d kmalloc failed\n", __func__, __LINE__); | 632 | pr_debug("%s: kmalloc failed\n", __func__); |
604 | goto fail_malloc; | 633 | return -ENOMEM; |
605 | } | 634 | } |
606 | 635 | ||
607 | offset = sys_lseek(file, 0, SEEK_SET); | 636 | count = os_area_flash_read(header, buf_len, 0); |
608 | 637 | if (count < 0) { | |
609 | if (offset != 0) { | 638 | pr_debug("%s: os_area_flash_read failed %zd\n", __func__, |
610 | pr_debug("%s:%d sys_lseek failed\n", __func__, __LINE__); | 639 | count); |
611 | goto fail_header_seek; | 640 | error = count; |
641 | goto fail; | ||
612 | } | 642 | } |
613 | 643 | ||
614 | count = sys_read(file, (char __user *)header, buf_len); | 644 | pos = header->db_area_offset * OS_AREA_SEGMENT_SIZE; |
615 | 645 | if (count < OS_AREA_SEGMENT_SIZE || verify_header(header) || | |
616 | result = count < OS_AREA_SEGMENT_SIZE || verify_header(header) | 646 | count < pos) { |
617 | || count < header->db_area_offset * OS_AREA_SEGMENT_SIZE; | 647 | pr_debug("%s: verify_header failed\n", __func__); |
618 | |||
619 | if (result) { | ||
620 | pr_debug("%s:%d verify_header failed\n", __func__, __LINE__); | ||
621 | dump_header(header); | 648 | dump_header(header); |
622 | goto fail_header; | 649 | error = -EINVAL; |
650 | goto fail; | ||
623 | } | 651 | } |
624 | 652 | ||
625 | /* Now got a good db offset and some maybe good db data. */ | 653 | /* Now got a good db offset and some maybe good db data. */ |
626 | 654 | ||
627 | db = (void*)header + header->db_area_offset * OS_AREA_SEGMENT_SIZE; | 655 | db = (void *)header + pos; |
628 | 656 | ||
629 | result = db_verify(db); | 657 | error = db_verify(db); |
630 | 658 | if (error) { | |
631 | if (result) { | 659 | pr_notice("%s: Verify of flash database failed, formatting.\n", |
632 | printk(KERN_NOTICE "%s:%d: Verify of flash database failed, " | 660 | __func__); |
633 | "formatting.\n", __func__, __LINE__); | ||
634 | dump_db(db); | 661 | dump_db(db); |
635 | os_area_db_init(db); | 662 | os_area_db_init(db); |
636 | } | 663 | } |
@@ -639,29 +666,16 @@ static void __maybe_unused update_flash_db(void) | |||
639 | 666 | ||
640 | db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff); | 667 | db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff); |
641 | 668 | ||
642 | offset = sys_lseek(file, header->db_area_offset * OS_AREA_SEGMENT_SIZE, | 669 | count = os_area_flash_write(db, sizeof(struct os_area_db), pos); |
643 | SEEK_SET); | ||
644 | |||
645 | if (offset != header->db_area_offset * OS_AREA_SEGMENT_SIZE) { | ||
646 | pr_debug("%s:%d sys_lseek failed\n", __func__, __LINE__); | ||
647 | goto fail_db_seek; | ||
648 | } | ||
649 | |||
650 | count = sys_write(file, (const char __user *)db, | ||
651 | sizeof(struct os_area_db)); | ||
652 | |||
653 | if (count < sizeof(struct os_area_db)) { | 670 | if (count < sizeof(struct os_area_db)) { |
654 | pr_debug("%s:%d sys_write failed\n", __func__, __LINE__); | 671 | pr_debug("%s: os_area_flash_write failed %zd\n", __func__, |
672 | count); | ||
673 | error = count < 0 ? count : -EIO; | ||
655 | } | 674 | } |
656 | 675 | ||
657 | fail_db_seek: | 676 | fail: |
658 | fail_header: | ||
659 | fail_header_seek: | ||
660 | kfree(header); | 677 | kfree(header); |
661 | fail_malloc: | 678 | return error; |
662 | sys_close(file); | ||
663 | fail_open: | ||
664 | return; | ||
665 | } | 679 | } |
666 | 680 | ||
667 | /** | 681 | /** |
@@ -674,11 +688,11 @@ fail_open: | |||
674 | static void os_area_queue_work_handler(struct work_struct *work) | 688 | static void os_area_queue_work_handler(struct work_struct *work) |
675 | { | 689 | { |
676 | struct device_node *node; | 690 | struct device_node *node; |
691 | int error; | ||
677 | 692 | ||
678 | pr_debug(" -> %s:%d\n", __func__, __LINE__); | 693 | pr_debug(" -> %s:%d\n", __func__, __LINE__); |
679 | 694 | ||
680 | node = of_find_node_by_path("/"); | 695 | node = of_find_node_by_path("/"); |
681 | |||
682 | if (node) { | 696 | if (node) { |
683 | os_area_set_property(node, &property_rtc_diff); | 697 | os_area_set_property(node, &property_rtc_diff); |
684 | of_node_put(node); | 698 | of_node_put(node); |
@@ -686,12 +700,10 @@ static void os_area_queue_work_handler(struct work_struct *work) | |||
686 | pr_debug("%s:%d of_find_node_by_path failed\n", | 700 | pr_debug("%s:%d of_find_node_by_path failed\n", |
687 | __func__, __LINE__); | 701 | __func__, __LINE__); |
688 | 702 | ||
689 | #if defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE) | 703 | error = update_flash_db(); |
690 | update_flash_db(); | 704 | if (error) |
691 | #else | 705 | pr_warning("%s: Could not update FLASH ROM\n", __func__); |
692 | printk(KERN_WARNING "%s:%d: No flash rom driver configured.\n", | 706 | |
693 | __func__, __LINE__); | ||
694 | #endif | ||
695 | pr_debug(" <- %s:%d\n", __func__, __LINE__); | 707 | pr_debug(" <- %s:%d\n", __func__, __LINE__); |
696 | } | 708 | } |
697 | 709 | ||
@@ -808,7 +820,7 @@ u64 ps3_os_area_get_rtc_diff(void) | |||
808 | { | 820 | { |
809 | return saved_params.rtc_diff; | 821 | return saved_params.rtc_diff; |
810 | } | 822 | } |
811 | EXPORT_SYMBOL(ps3_os_area_get_rtc_diff); | 823 | EXPORT_SYMBOL_GPL(ps3_os_area_get_rtc_diff); |
812 | 824 | ||
813 | /** | 825 | /** |
814 | * ps3_os_area_set_rtc_diff - Set the rtc diff value. | 826 | * ps3_os_area_set_rtc_diff - Set the rtc diff value. |
@@ -824,7 +836,7 @@ void ps3_os_area_set_rtc_diff(u64 rtc_diff) | |||
824 | os_area_queue_work(); | 836 | os_area_queue_work(); |
825 | } | 837 | } |
826 | } | 838 | } |
827 | EXPORT_SYMBOL(ps3_os_area_set_rtc_diff); | 839 | EXPORT_SYMBOL_GPL(ps3_os_area_set_rtc_diff); |
828 | 840 | ||
829 | /** | 841 | /** |
830 | * ps3_os_area_get_av_multi_out - Returns the default video mode. | 842 | * ps3_os_area_get_av_multi_out - Returns the default video mode. |
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h index 136aa0637d9c..9a196a88eda7 100644 --- a/arch/powerpc/platforms/ps3/platform.h +++ b/arch/powerpc/platforms/ps3/platform.h | |||
@@ -232,14 +232,4 @@ int ps3_repository_read_spu_resource_id(unsigned int res_index, | |||
232 | int ps3_repository_read_vuart_av_port(unsigned int *port); | 232 | int ps3_repository_read_vuart_av_port(unsigned int *port); |
233 | int ps3_repository_read_vuart_sysmgr_port(unsigned int *port); | 233 | int ps3_repository_read_vuart_sysmgr_port(unsigned int *port); |
234 | 234 | ||
235 | /* Page table entries */ | ||
236 | #define IOPTE_PP_W 0x8000000000000000ul /* protection: write */ | ||
237 | #define IOPTE_PP_R 0x4000000000000000ul /* protection: read */ | ||
238 | #define IOPTE_M 0x2000000000000000ul /* coherency required */ | ||
239 | #define IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */ | ||
240 | #define IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */ | ||
241 | #define IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */ | ||
242 | #define IOPTE_H 0x0000000000000800ul /* cache hint */ | ||
243 | #define IOPTE_IOID_Mask 0x00000000000007fful /* ioid */ | ||
244 | |||
245 | #endif | 235 | #endif |
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 1a7b5ae0c83e..149bea2ce583 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/udbg.h> | 32 | #include <asm/udbg.h> |
33 | #include <asm/prom.h> | 33 | #include <asm/prom.h> |
34 | #include <asm/lv1call.h> | 34 | #include <asm/lv1call.h> |
35 | #include <asm/ps3gpu.h> | ||
35 | 36 | ||
36 | #include "platform.h" | 37 | #include "platform.h" |
37 | 38 | ||
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 9a73d0238639..9fead0faf38b 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/udbg.h> | 27 | #include <asm/udbg.h> |
28 | #include <asm/lv1call.h> | 28 | #include <asm/lv1call.h> |
29 | #include <asm/firmware.h> | 29 | #include <asm/firmware.h> |
30 | #include <asm/iommu.h> | ||
30 | 31 | ||
31 | #include "platform.h" | 32 | #include "platform.h" |
32 | 33 | ||
@@ -531,7 +532,8 @@ static void * ps3_alloc_coherent(struct device *_dev, size_t size, | |||
531 | } | 532 | } |
532 | 533 | ||
533 | result = ps3_dma_map(dev->d_region, virt_addr, size, dma_handle, | 534 | result = ps3_dma_map(dev->d_region, virt_addr, size, dma_handle, |
534 | IOPTE_PP_W | IOPTE_PP_R | IOPTE_SO_RW | IOPTE_M); | 535 | CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | |
536 | CBE_IOPTE_SO_RW | CBE_IOPTE_M); | ||
535 | 537 | ||
536 | if (result) { | 538 | if (result) { |
537 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", | 539 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", |
@@ -575,7 +577,8 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page, | |||
575 | 577 | ||
576 | result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, | 578 | result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, |
577 | &bus_addr, | 579 | &bus_addr, |
578 | IOPTE_PP_R | IOPTE_PP_W | IOPTE_SO_RW | IOPTE_M); | 580 | CBE_IOPTE_PP_R | CBE_IOPTE_PP_W | |
581 | CBE_IOPTE_SO_RW | CBE_IOPTE_M); | ||
579 | 582 | ||
580 | if (result) { | 583 | if (result) { |
581 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", | 584 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", |
@@ -596,16 +599,16 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page, | |||
596 | u64 iopte_flag; | 599 | u64 iopte_flag; |
597 | void *ptr = page_address(page) + offset; | 600 | void *ptr = page_address(page) + offset; |
598 | 601 | ||
599 | iopte_flag = IOPTE_M; | 602 | iopte_flag = CBE_IOPTE_M; |
600 | switch (direction) { | 603 | switch (direction) { |
601 | case DMA_BIDIRECTIONAL: | 604 | case DMA_BIDIRECTIONAL: |
602 | iopte_flag |= IOPTE_PP_R | IOPTE_PP_W | IOPTE_SO_RW; | 605 | iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW; |
603 | break; | 606 | break; |
604 | case DMA_TO_DEVICE: | 607 | case DMA_TO_DEVICE: |
605 | iopte_flag |= IOPTE_PP_R | IOPTE_SO_R; | 608 | iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_SO_R; |
606 | break; | 609 | break; |
607 | case DMA_FROM_DEVICE: | 610 | case DMA_FROM_DEVICE: |
608 | iopte_flag |= IOPTE_PP_W | IOPTE_SO_RW; | 611 | iopte_flag |= CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW; |
609 | break; | 612 | break; |
610 | default: | 613 | default: |
611 | /* not happned */ | 614 | /* not happned */ |