diff options
author | Masakazu Mokuno <mokuno@sm.sony.co.jp> | 2008-08-20 16:18:56 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-25 20:24:46 -0400 |
commit | b47027795a22fe61f93de6010c120f26273fc693 (patch) | |
tree | 5656337fbada29bd6cdb8d7c8fcaa0372fd4ba8e /arch/powerpc | |
parent | 9cfeb74e93cf3549b7fa67ffe407192da625c777 (diff) |
powerpc/ps3: Fix ioremap of spu shadow regs
Fix the ioremap of the spu shadow regs on the PS3.
The current PS3 hypervisor requires the spu shadow regs to be
mapped with the PTE page protection bits set as read-only (PP=3).
This implementation uses the low level __ioremap() to bypass the
page protection settings inforced by ioremap_flags() to get the
needed PTE bits set for the shadow regs.
This fixes a runtime failure on the PS3 introduced by the powerpc
ioremap_prot rework of commit a1f242ff460e4b50a045fa237c3c56cce9eabf83
("powerpc ioremap_prot").
Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/ps3/spu.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c index d135cef9ed6a..ccae3d446b98 100644 --- a/arch/powerpc/platforms/ps3/spu.c +++ b/arch/powerpc/platforms/ps3/spu.c | |||
@@ -186,14 +186,24 @@ static void spu_unmap(struct spu *spu) | |||
186 | iounmap(spu_pdata(spu)->shadow); | 186 | iounmap(spu_pdata(spu)->shadow); |
187 | } | 187 | } |
188 | 188 | ||
189 | /** | ||
190 | * setup_areas - Map the spu regions into the address space. | ||
191 | * | ||
192 | * The current HV requires the spu shadow regs to be mapped with the | ||
193 | * PTE page protection bits set as read-only (PP=3). This implementation | ||
194 | * uses the low level __ioremap() to bypass the page protection settings | ||
195 | * inforced by ioremap_flags() to get the needed PTE bits set for the | ||
196 | * shadow regs. | ||
197 | */ | ||
198 | |||
189 | static int __init setup_areas(struct spu *spu) | 199 | static int __init setup_areas(struct spu *spu) |
190 | { | 200 | { |
191 | struct table {char* name; unsigned long addr; unsigned long size;}; | 201 | struct table {char* name; unsigned long addr; unsigned long size;}; |
202 | static const unsigned long shadow_flags = _PAGE_NO_CACHE | 3; | ||
192 | 203 | ||
193 | spu_pdata(spu)->shadow = ioremap_flags(spu_pdata(spu)->shadow_addr, | 204 | spu_pdata(spu)->shadow = __ioremap(spu_pdata(spu)->shadow_addr, |
194 | sizeof(struct spe_shadow), | 205 | sizeof(struct spe_shadow), |
195 | pgprot_val(PAGE_READONLY) | | 206 | shadow_flags); |
196 | _PAGE_NO_CACHE); | ||
197 | if (!spu_pdata(spu)->shadow) { | 207 | if (!spu_pdata(spu)->shadow) { |
198 | pr_debug("%s:%d: ioremap shadow failed\n", __func__, __LINE__); | 208 | pr_debug("%s:%d: ioremap shadow failed\n", __func__, __LINE__); |
199 | goto fail_ioremap; | 209 | goto fail_ioremap; |