2 * Corenet based SoC DS Setup
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
6 * Copyright 2009-2011 Freescale Semiconductor Inc.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
14 #include <linux/kernel.h>
15 #include <linux/pci.h>
16 #include <linux/kdev_t.h>
17 #include <linux/delay.h>
18 #include <linux/interrupt.h>
21 #include <asm/machdep.h>
22 #include <asm/pci-bridge.h>
23 #include <asm/ppc-pci.h>
24 #include <mm/mmu_decl.h>
28 #include <asm/ehv_pic.h>
30 #include <linux/of_platform.h>
31 #include <sysdev/fsl_soc.h>
32 #include <sysdev/fsl_pci.h>
35 void __init
corenet_gen_pic_init(void)
38 unsigned int flags
= MPIC_BIG_ENDIAN
| MPIC_SINGLE_DEST_CPU
|
41 if (ppc_md
.get_irq
== mpic_get_coreint_irq
)
42 flags
|= MPIC_ENABLE_COREINT
;
44 mpic
= mpic_alloc(NULL
, 0, flags
, 0, 512, " OpenPIC ");
51 * Setup the architecture
53 void __init
corenet_gen_setup_arch(void)
59 pr_info("%s board from Freescale Semiconductor\n", ppc_md
.name
);
62 static const struct of_device_id of_device_ids
[] = {
64 .compatible
= "simple-bus"
67 .compatible
= "fsl,srio",
70 .compatible
= "fsl,p4080-pcie",
73 .compatible
= "fsl,qoriq-pcie-v2.2",
76 .compatible
= "fsl,qoriq-pcie-v2.3",
79 .compatible
= "fsl,qoriq-pcie-v2.4",
82 .compatible
= "fsl,qoriq-pcie-v3.0",
84 /* The following two are for the Freescale hypervisor */
94 int __init
corenet_gen_publish_devices(void)
96 return of_platform_bus_probe(NULL
, of_device_ids
, NULL
);
99 static const char * const boards
[] __initconst
= {
112 static const char * const hv_boards
[] __initconst
= {
126 * Called very early, device-tree isn't unflattened
128 static int __init
corenet_generic_probe(void)
130 unsigned long root
= of_get_flat_dt_root();
132 extern struct smp_ops_t smp_85xx_ops
;
135 if (of_flat_dt_match(root
, boards
))
138 /* Check if we're running under the Freescale hypervisor */
139 if (of_flat_dt_match(root
, hv_boards
)) {
140 ppc_md
.init_IRQ
= ehv_pic_init
;
141 ppc_md
.get_irq
= ehv_pic_get_irq
;
142 ppc_md
.restart
= fsl_hv_restart
;
143 ppc_md
.power_off
= fsl_hv_halt
;
144 ppc_md
.halt
= fsl_hv_halt
;
147 * Disable the timebase sync operations because we can't write
148 * to the timebase registers under the hypervisor.
150 smp_85xx_ops
.give_timebase
= NULL
;
151 smp_85xx_ops
.take_timebase
= NULL
;
159 define_machine(corenet_generic
) {
160 .name
= "CoreNet Generic",
161 .probe
= corenet_generic_probe
,
162 .setup_arch
= corenet_gen_setup_arch
,
163 .init_IRQ
= corenet_gen_pic_init
,
165 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
167 .get_irq
= mpic_get_coreint_irq
,
168 .restart
= fsl_rstcr_restart
,
169 .calibrate_decr
= generic_calibrate_decr
,
170 .progress
= udbg_progress
,
172 .power_save
= book3e_idle
,
174 .power_save
= e500_idle
,
178 machine_arch_initcall(corenet_generic
, corenet_gen_publish_devices
);
180 #ifdef CONFIG_SWIOTLB
181 machine_arch_initcall(corenet_generic
, swiotlb_setup_bus_notifier
);