]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/powerpc/platforms/85xx/p2041_rdb.c
Merge branch 'uprobes/core' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg...
[karo-tx-linux.git] / arch / powerpc / platforms / 85xx / p2041_rdb.c
1 /*
2  * P2041 RDB Setup
3  *
4  * Copyright 2011 Freescale Semiconductor Inc.
5  *
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.
10  */
11
12 #include <linux/kernel.h>
13 #include <linux/pci.h>
14 #include <linux/kdev_t.h>
15 #include <linux/delay.h>
16 #include <linux/interrupt.h>
17 #include <linux/phy.h>
18
19 #include <asm/time.h>
20 #include <asm/machdep.h>
21 #include <asm/pci-bridge.h>
22 #include <mm/mmu_decl.h>
23 #include <asm/prom.h>
24 #include <asm/udbg.h>
25 #include <asm/mpic.h>
26
27 #include <linux/of_platform.h>
28 #include <sysdev/fsl_soc.h>
29 #include <sysdev/fsl_pci.h>
30 #include <asm/ehv_pic.h>
31
32 #include "corenet_ds.h"
33
34 /*
35  * Called very early, device-tree isn't unflattened
36  */
37 static int __init p2041_rdb_probe(void)
38 {
39         unsigned long root = of_get_flat_dt_root();
40 #ifdef CONFIG_SMP
41         extern struct smp_ops_t smp_85xx_ops;
42 #endif
43
44         if (of_flat_dt_is_compatible(root, "fsl,P2041RDB"))
45                 return 1;
46
47         /* Check if we're running under the Freescale hypervisor */
48         if (of_flat_dt_is_compatible(root, "fsl,P2041RDB-hv")) {
49                 ppc_md.init_IRQ = ehv_pic_init;
50                 ppc_md.get_irq = ehv_pic_get_irq;
51                 ppc_md.restart = fsl_hv_restart;
52                 ppc_md.power_off = fsl_hv_halt;
53                 ppc_md.halt = fsl_hv_halt;
54 #ifdef CONFIG_SMP
55                 /*
56                  * Disable the timebase sync operations because we can't write
57                  * to the timebase registers under the hypervisor.
58                   */
59                 smp_85xx_ops.give_timebase = NULL;
60                 smp_85xx_ops.take_timebase = NULL;
61 #endif
62                 return 1;
63         }
64
65         return 0;
66 }
67
68 define_machine(p2041_rdb) {
69         .name                   = "P2041 RDB",
70         .probe                  = p2041_rdb_probe,
71         .setup_arch             = corenet_ds_setup_arch,
72         .init_IRQ               = corenet_ds_pic_init,
73 #ifdef CONFIG_PCI
74         .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
75 #endif
76         .get_irq                = mpic_get_coreint_irq,
77         .restart                = fsl_rstcr_restart,
78         .calibrate_decr         = generic_calibrate_decr,
79         .progress               = udbg_progress,
80         .power_save             = e500_idle,
81 };
82
83 machine_arch_initcall(p2041_rdb, corenet_ds_publish_devices);
84
85 #ifdef CONFIG_SWIOTLB
86 machine_arch_initcall(p2041_rdb, swiotlb_setup_bus_notifier);
87 #endif