4 * Copyright 2009-2010 Freescale Semiconductor Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
12 #include <linux/kernel.h>
13 #include <linux/pci.h>
15 #include <asm/machdep.h>
19 #include <linux/of_fdt.h>
21 #include <sysdev/fsl_soc.h>
22 #include <sysdev/fsl_pci.h>
23 #include <asm/ehv_pic.h>
25 #include "corenet_ds.h"
28 * Called very early, device-tree isn't unflattened
30 static int __init
p5040_ds_probe(void)
32 unsigned long root
= of_get_flat_dt_root();
34 extern struct smp_ops_t smp_85xx_ops
;
37 if (of_flat_dt_is_compatible(root
, "fsl,P5040DS"))
40 /* Check if we're running under the Freescale hypervisor */
41 if (of_flat_dt_is_compatible(root
, "fsl,P5040DS-hv")) {
42 ppc_md
.init_IRQ
= ehv_pic_init
;
43 ppc_md
.get_irq
= ehv_pic_get_irq
;
44 ppc_md
.restart
= fsl_hv_restart
;
45 ppc_md
.power_off
= fsl_hv_halt
;
46 ppc_md
.halt
= fsl_hv_halt
;
49 * Disable the timebase sync operations because we can't write
50 * to the timebase registers under the hypervisor.
52 smp_85xx_ops
.give_timebase
= NULL
;
53 smp_85xx_ops
.take_timebase
= NULL
;
61 define_machine(p5040_ds
) {
63 .probe
= p5040_ds_probe
,
64 .setup_arch
= corenet_ds_setup_arch
,
65 .init_IRQ
= corenet_ds_pic_init
,
67 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
69 .get_irq
= mpic_get_coreint_irq
,
70 .restart
= fsl_rstcr_restart
,
71 .calibrate_decr
= generic_calibrate_decr
,
72 .progress
= udbg_progress
,
74 .power_save
= book3e_idle
,
76 .power_save
= e500_idle
,
80 machine_arch_initcall(p5040_ds
, corenet_ds_publish_devices
);
83 machine_arch_initcall(p5040_ds
, swiotlb_setup_bus_notifier
);