diff options
Diffstat (limited to 'arch/powerpc/platforms/85xx/p5020_ds.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/p5020_ds.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/85xx/p5020_ds.c b/arch/powerpc/platforms/85xx/p5020_ds.c index 7467b712ee0..e8cba5004fd 100644 --- a/arch/powerpc/platforms/85xx/p5020_ds.c +++ b/arch/powerpc/platforms/85xx/p5020_ds.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/of_platform.h> | 30 | #include <linux/of_platform.h> |
31 | #include <sysdev/fsl_soc.h> | 31 | #include <sysdev/fsl_soc.h> |
32 | #include <sysdev/fsl_pci.h> | 32 | #include <sysdev/fsl_pci.h> |
33 | #include <asm/ehv_pic.h> | ||
33 | 34 | ||
34 | #include "corenet_ds.h" | 35 | #include "corenet_ds.h" |
35 | 36 | ||
@@ -39,8 +40,32 @@ | |||
39 | static int __init p5020_ds_probe(void) | 40 | static int __init p5020_ds_probe(void) |
40 | { | 41 | { |
41 | unsigned long root = of_get_flat_dt_root(); | 42 | unsigned long root = of_get_flat_dt_root(); |
43 | #ifdef CONFIG_SMP | ||
44 | extern struct smp_ops_t smp_85xx_ops; | ||
45 | #endif | ||
46 | |||
47 | if (of_flat_dt_is_compatible(root, "fsl,P5020DS")) | ||
48 | return 1; | ||
49 | |||
50 | /* Check if we're running under the Freescale hypervisor */ | ||
51 | if (of_flat_dt_is_compatible(root, "fsl,P5020DS-hv")) { | ||
52 | ppc_md.init_IRQ = ehv_pic_init; | ||
53 | ppc_md.get_irq = ehv_pic_get_irq; | ||
54 | ppc_md.restart = fsl_hv_restart; | ||
55 | ppc_md.power_off = fsl_hv_halt; | ||
56 | ppc_md.halt = fsl_hv_halt; | ||
57 | #ifdef CONFIG_SMP | ||
58 | /* | ||
59 | * Disable the timebase sync operations because we can't write | ||
60 | * to the timebase registers under the hypervisor. | ||
61 | */ | ||
62 | smp_85xx_ops.give_timebase = NULL; | ||
63 | smp_85xx_ops.take_timebase = NULL; | ||
64 | #endif | ||
65 | return 1; | ||
66 | } | ||
42 | 67 | ||
43 | return of_flat_dt_is_compatible(root, "fsl,P5020DS"); | 68 | return 0; |
44 | } | 69 | } |
45 | 70 | ||
46 | define_machine(p5020_ds) { | 71 | define_machine(p5020_ds) { |
@@ -60,6 +85,11 @@ define_machine(p5020_ds) { | |||
60 | .restart = fsl_rstcr_restart, | 85 | .restart = fsl_rstcr_restart, |
61 | .calibrate_decr = generic_calibrate_decr, | 86 | .calibrate_decr = generic_calibrate_decr, |
62 | .progress = udbg_progress, | 87 | .progress = udbg_progress, |
88 | #ifdef CONFIG_PPC64 | ||
89 | .power_save = book3e_idle, | ||
90 | #else | ||
91 | .power_save = e500_idle, | ||
92 | #endif | ||
63 | }; | 93 | }; |
64 | 94 | ||
65 | machine_device_initcall(p5020_ds, corenet_ds_publish_devices); | 95 | machine_device_initcall(p5020_ds, corenet_ds_publish_devices); |