diff options
-rw-r--r-- | arch/powerpc/platforms/85xx/Kconfig | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/qemu_e500.c | 72 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 4 |
4 files changed, 93 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig index dddb3e51b91..159c01e9146 100644 --- a/arch/powerpc/platforms/85xx/Kconfig +++ b/arch/powerpc/platforms/85xx/Kconfig | |||
@@ -254,6 +254,22 @@ config P5020_DS | |||
254 | help | 254 | help |
255 | This option enables support for the P5020 DS board | 255 | This option enables support for the P5020 DS board |
256 | 256 | ||
257 | config PPC_QEMU_E500 | ||
258 | bool "QEMU generic e500 platform" | ||
259 | depends on EXPERIMENTAL | ||
260 | select DEFAULT_UIMAGE | ||
261 | help | ||
262 | This option enables support for running as a QEMU guest using | ||
263 | QEMU's generic e500 machine. This is not required if you're | ||
264 | using a QEMU machine that targets a specific board, such as | ||
265 | mpc8544ds. | ||
266 | |||
267 | Unlike most e500 boards that target a specific CPU, this | ||
268 | platform works with any e500-family CPU that QEMU supports. | ||
269 | Thus, you'll need to make sure CONFIG_PPC_E500MC is set or | ||
270 | unset based on the emulated CPU (or actual host CPU in the case | ||
271 | of KVM). | ||
272 | |||
257 | endif # FSL_SOC_BOOKE | 273 | endif # FSL_SOC_BOOKE |
258 | 274 | ||
259 | config TQM85xx | 275 | config TQM85xx |
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile index 30652e0bfb7..3dfe8117503 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile | |||
@@ -27,3 +27,4 @@ obj-$(CONFIG_SOCRATES) += socrates.o socrates_fpga_pic.o | |||
27 | obj-$(CONFIG_KSI8560) += ksi8560.o | 27 | obj-$(CONFIG_KSI8560) += ksi8560.o |
28 | obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o | 28 | obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o |
29 | obj-$(CONFIG_GE_IMP3A) += ge_imp3a.o | 29 | obj-$(CONFIG_GE_IMP3A) += ge_imp3a.o |
30 | obj-$(CONFIG_PPC_QEMU_E500) += qemu_e500.o | ||
diff --git a/arch/powerpc/platforms/85xx/qemu_e500.c b/arch/powerpc/platforms/85xx/qemu_e500.c new file mode 100644 index 00000000000..95a2e53af71 --- /dev/null +++ b/arch/powerpc/platforms/85xx/qemu_e500.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * Paravirt target for a generic QEMU e500 machine | ||
3 | * | ||
4 | * This is intended to be a flexible device-tree-driven platform, not fixed | ||
5 | * to a particular piece of hardware or a particular spec of virtual hardware, | ||
6 | * beyond the assumption of an e500-family CPU. Some things are still hardcoded | ||
7 | * here, such as MPIC, but this is a limitation of the current code rather than | ||
8 | * an interface contract with QEMU. | ||
9 | * | ||
10 | * Copyright 2012 Freescale Semiconductor Inc. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License as published by the | ||
14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
15 | * option) any later version. | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/of_fdt.h> | ||
20 | #include <asm/machdep.h> | ||
21 | #include <asm/time.h> | ||
22 | #include <asm/udbg.h> | ||
23 | #include <asm/mpic.h> | ||
24 | #include <sysdev/fsl_soc.h> | ||
25 | #include <sysdev/fsl_pci.h> | ||
26 | #include "smp.h" | ||
27 | #include "mpc85xx.h" | ||
28 | |||
29 | void __init qemu_e500_pic_init(void) | ||
30 | { | ||
31 | struct mpic *mpic; | ||
32 | |||
33 | mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU, | ||
34 | 0, 256, " OpenPIC "); | ||
35 | |||
36 | BUG_ON(mpic == NULL); | ||
37 | mpic_init(mpic); | ||
38 | } | ||
39 | |||
40 | static void __init qemu_e500_setup_arch(void) | ||
41 | { | ||
42 | ppc_md.progress("qemu_e500_setup_arch()", 0); | ||
43 | |||
44 | fsl_pci_init(); | ||
45 | mpc85xx_smp_init(); | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * Called very early, device-tree isn't unflattened | ||
50 | */ | ||
51 | static int __init qemu_e500_probe(void) | ||
52 | { | ||
53 | unsigned long root = of_get_flat_dt_root(); | ||
54 | |||
55 | return !!of_flat_dt_is_compatible(root, "fsl,qemu-e500"); | ||
56 | } | ||
57 | |||
58 | machine_device_initcall(qemu_e500, mpc85xx_common_publish_devices); | ||
59 | |||
60 | define_machine(qemu_e500) { | ||
61 | .name = "QEMU e500", | ||
62 | .probe = qemu_e500_probe, | ||
63 | .setup_arch = qemu_e500_setup_arch, | ||
64 | .init_IRQ = qemu_e500_pic_init, | ||
65 | #ifdef CONFIG_PCI | ||
66 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
67 | #endif | ||
68 | .get_irq = mpic_get_irq, | ||
69 | .restart = fsl_rstcr_restart, | ||
70 | .calibrate_decr = generic_calibrate_decr, | ||
71 | .progress = udbg_progress, | ||
72 | }; | ||
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 61c9550819a..30fd01de6be 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -159,6 +159,10 @@ config PPC_E500MC | |||
159 | bool "e500mc Support" | 159 | bool "e500mc Support" |
160 | select PPC_FPU | 160 | select PPC_FPU |
161 | depends on E500 | 161 | depends on E500 |
162 | help | ||
163 | This must be enabled for running on e500mc (and derivatives | ||
164 | such as e5500/e6500), and must be disabled for running on | ||
165 | e500v1 or e500v2. | ||
162 | 166 | ||
163 | config PPC_FPU | 167 | config PPC_FPU |
164 | bool | 168 | bool |