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>
19 #include <linux/memblock.h>
22 #include <asm/machdep.h>
23 #include <asm/pci-bridge.h>
24 #include <asm/ppc-pci.h>
25 #include <mm/mmu_decl.h>
30 #include <linux/of_platform.h>
31 #include <sysdev/fsl_soc.h>
32 #include <sysdev/fsl_pci.h>
35 void __init
corenet_ds_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, 256, " OpenPIC ");
51 * Setup the architecture
53 void __init
corenet_ds_setup_arch(void)
56 struct device_node
*np
;
57 struct pci_controller
*hose
;
59 dma_addr_t max
= 0xffffffff;
64 for_each_node_by_type(np
, "pci") {
65 if (of_device_is_compatible(np
, "fsl,p4080-pcie") ||
66 of_device_is_compatible(np
, "fsl,qoriq-pcie-v2.2")) {
67 fsl_add_bridge(np
, 0);
68 hose
= pci_find_hose_for_OF_device(np
);
69 max
= min(max
, hose
->dma_window_base_cur
+
70 hose
->dma_window_size
);
80 if ((memblock_end_of_DRAM() - 1) > max
) {
81 ppc_swiotlb_enable
= 1;
82 set_pci_dma_ops(&swiotlb_dma_ops
);
83 ppc_md
.pci_dma_dev_setup
= pci_dma_dev_setup_swiotlb
;
86 pr_info("%s board from Freescale Semiconductor\n", ppc_md
.name
);
89 static const struct of_device_id of_device_ids
[] __devinitconst
= {
91 .compatible
= "simple-bus"
94 .compatible
= "fsl,srio",
97 .compatible
= "fsl,p4080-pcie",
100 .compatible
= "fsl,qoriq-pcie-v2.2",
102 /* The following two are for the Freescale hypervisor */
104 .name
= "hypervisor",
112 int __init
corenet_ds_publish_devices(void)
114 return of_platform_bus_probe(NULL
, of_device_ids
, NULL
);