diff options
author | Jun Nakajima <jnakajim@gmail.com> | 2013-01-21 12:23:09 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-01-21 15:09:19 -0500 |
commit | ddd70cf93d784af3698c86315aa0ded87ca0a0c5 (patch) | |
tree | 68835c5351c42a865fc714abfda52da0416b2660 /arch/x86/platform/goldfish | |
parent | 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619 (diff) |
goldfish: platform device for x86
Based on code by Jun Nakajima but stripped of all the old x86 mach-foo
stuff and turned into a single file for the Goldfish virtual bus layer.
The actual created platform device and bus enumeration is portable between the
ARM and x86 Goldfish emulations.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Link: http://lkml.kernel.org/r/20130121172205.19517.22535.stgit@bob.linux.org.uk
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
[Ported to 3.7 and reorganised so that we can keep most of the code
shared properly]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Diffstat (limited to 'arch/x86/platform/goldfish')
-rw-r--r-- | arch/x86/platform/goldfish/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/platform/goldfish/goldfish.c | 51 |
2 files changed, 52 insertions, 0 deletions
diff --git a/arch/x86/platform/goldfish/Makefile b/arch/x86/platform/goldfish/Makefile new file mode 100644 index 000000000000..f030b532fdf3 --- /dev/null +++ b/arch/x86/platform/goldfish/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-$(CONFIG_GOLDFISH) += goldfish.o | |||
diff --git a/arch/x86/platform/goldfish/goldfish.c b/arch/x86/platform/goldfish/goldfish.c new file mode 100644 index 000000000000..1693107a518e --- /dev/null +++ b/arch/x86/platform/goldfish/goldfish.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Google, Inc. | ||
3 | * Copyright (C) 2011 Intel, Inc. | ||
4 | * Copyright (C) 2013 Intel, Inc. | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | |||
21 | /* | ||
22 | * Where in virtual device memory the IO devices (timers, system controllers | ||
23 | * and so on) | ||
24 | */ | ||
25 | |||
26 | #define GOLDFISH_PDEV_BUS_BASE (0xff001000) | ||
27 | #define GOLDFISH_PDEV_BUS_END (0xff7fffff) | ||
28 | #define GOLDFISH_PDEV_BUS_IRQ (4) | ||
29 | |||
30 | #define GOLDFISH_TTY_BASE (0x2000) | ||
31 | |||
32 | static struct resource goldfish_pdev_bus_resources[] = { | ||
33 | { | ||
34 | .start = GOLDFISH_PDEV_BUS_BASE, | ||
35 | .end = GOLDFISH_PDEV_BUS_END, | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }, | ||
38 | { | ||
39 | .start = GOLDFISH_PDEV_BUS_IRQ, | ||
40 | .end = GOLDFISH_PDEV_BUS_IRQ, | ||
41 | .flags = IORESOURCE_IRQ, | ||
42 | } | ||
43 | }; | ||
44 | |||
45 | static int __init goldfish_init(void) | ||
46 | { | ||
47 | platform_device_register_simple("goldfish_pdev_bus", -1, | ||
48 | goldfish_pdev_bus_resources, 2); | ||
49 | return 0; | ||
50 | } | ||
51 | device_initcall(goldfish_init); | ||