aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-11-02 23:30:49 -0500
committerMichael Ellerman <michael@ellerman.id.au>2005-11-02 23:30:49 -0500
commitcab0af98dfbbf8076d1af01f2927af491a76a33f (patch)
treebaf3a5cda6e4c117652667ca013db28906497e4c
parent60d4f4c6567f2be77f58838156e7b667238a9580 (diff)
powerpc: Make set_dabr() a ppc_md function
Move pSeries specific code in set_dabr() into a ppc_md function, this will allow us to keep plpar_wrappers.h private to platforms/pseries. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
-rw-r--r--arch/powerpc/kernel/process.c22
-rw-r--r--arch/powerpc/platforms/pseries/setup.c12
-rw-r--r--include/asm-powerpc/machdep.h1
3 files changed, 18 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 8f85dabe4df3..96843211cc5c 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -48,8 +48,8 @@
48#include <asm/prom.h> 48#include <asm/prom.h>
49#ifdef CONFIG_PPC64 49#ifdef CONFIG_PPC64
50#include <asm/firmware.h> 50#include <asm/firmware.h>
51#include <asm/plpar_wrappers.h>
52#include <asm/time.h> 51#include <asm/time.h>
52#include <asm/machdep.h>
53#endif 53#endif
54 54
55extern unsigned long _get_SP(void); 55extern unsigned long _get_SP(void);
@@ -201,27 +201,15 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
201} 201}
202#endif /* CONFIG_SPE */ 202#endif /* CONFIG_SPE */
203 203
204static void set_dabr_spr(unsigned long val)
205{
206 mtspr(SPRN_DABR, val);
207}
208
209int set_dabr(unsigned long dabr) 204int set_dabr(unsigned long dabr)
210{ 205{
211 int ret = 0;
212
213#ifdef CONFIG_PPC64 206#ifdef CONFIG_PPC64
214 if (firmware_has_feature(FW_FEATURE_XDABR)) { 207 if (ppc_md.set_dabr)
215 /* We want to catch accesses from kernel and userspace */ 208 return ppc_md.set_dabr(dabr);
216 unsigned long flags = H_DABRX_KERNEL|H_DABRX_USER;
217 ret = plpar_set_xdabr(dabr, flags);
218 } else if (firmware_has_feature(FW_FEATURE_DABR)) {
219 ret = plpar_set_dabr(dabr);
220 } else
221#endif 209#endif
222 set_dabr_spr(dabr);
223 210
224 return ret; 211 mtspr(SPRN_DABR, dabr);
212 return 0;
225} 213}
226 214
227#ifdef CONFIG_PPC64 215#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index c0a3d918148a..ee468f07f378 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -350,6 +350,16 @@ static void pSeries_mach_cpu_die(void)
350 for(;;); 350 for(;;);
351} 351}
352 352
353static int pseries_set_dabr(unsigned long dabr)
354{
355 if (firmware_has_feature(FW_FEATURE_XDABR)) {
356 /* We want to catch accesses from kernel and userspace */
357 return plpar_set_xdabr(dabr, H_DABRX_KERNEL | H_DABRX_USER);
358 }
359
360 return plpar_set_dabr(dabr);
361}
362
353 363
354/* 364/*
355 * Early initialization. Relocation is on but do not reference unbolted pages 365 * Early initialization. Relocation is on but do not reference unbolted pages
@@ -385,6 +395,8 @@ static void __init pSeries_init_early(void)
385 DBG("Hello World !\n"); 395 DBG("Hello World !\n");
386 } 396 }
387 397
398 if (firmware_has_feature(FW_FEATURE_XDABR | FW_FEATURE_DABR))
399 ppc_md.set_dabr = pseries_set_dabr;
388 400
389 iommu_init_early_pSeries(); 401 iommu_init_early_pSeries();
390 402
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 451b345cfc78..629ca964b974 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -80,6 +80,7 @@ struct machdep_calls {
80 void (*iommu_dev_setup)(struct pci_dev *dev); 80 void (*iommu_dev_setup)(struct pci_dev *dev);
81 void (*iommu_bus_setup)(struct pci_bus *bus); 81 void (*iommu_bus_setup)(struct pci_bus *bus);
82 void (*irq_bus_setup)(struct pci_bus *bus); 82 void (*irq_bus_setup)(struct pci_bus *bus);
83 int (*set_dabr)(unsigned long dabr);
83#endif 84#endif
84 85
85 int (*probe)(int platform); 86 int (*probe)(int platform);