1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#include <linux/kernel.h>
19#include <linux/of_fdt.h>
20#include <asm/machdep.h>
21#include <asm/pgtable.h>
22#include <asm/time.h>
23#include <asm/udbg.h>
24#include <asm/mpic.h>
25#include <sysdev/fsl_soc.h>
26#include <sysdev/fsl_pci.h>
27#include "smp.h"
28#include "mpc85xx.h"
29
30void __init qemu_e500_pic_init(void)
31{
32 struct mpic *mpic;
33 unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU |
34 MPIC_ENABLE_COREINT;
35
36 mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
37
38 BUG_ON(mpic == NULL);
39 mpic_init(mpic);
40}
41
42static void __init qemu_e500_setup_arch(void)
43{
44 ppc_md.progress("qemu_e500_setup_arch()", 0);
45
46 fsl_pci_assign_primary();
47 swiotlb_detect_4g();
48#if defined(CONFIG_FSL_PCI) && defined(CONFIG_ZONE_DMA32)
49
50
51
52
53
54
55 limit_zone_pfn(ZONE_DMA32, 1UL << (31 - PAGE_SHIFT));
56#endif
57 mpc85xx_smp_init();
58}
59
60
61
62
63static int __init qemu_e500_probe(void)
64{
65 unsigned long root = of_get_flat_dt_root();
66
67 return !!of_flat_dt_is_compatible(root, "fsl,qemu-e500");
68}
69
70machine_arch_initcall(qemu_e500, mpc85xx_common_publish_devices);
71
72define_machine(qemu_e500) {
73 .name = "QEMU e500",
74 .probe = qemu_e500_probe,
75 .setup_arch = qemu_e500_setup_arch,
76 .init_IRQ = qemu_e500_pic_init,
77#ifdef CONFIG_PCI
78 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
79 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
80#endif
81 .get_irq = mpic_get_coreint_irq,
82 .restart = fsl_rstcr_restart,
83 .calibrate_decr = generic_calibrate_decr,
84 .progress = udbg_progress,
85};
86