-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Jun Nakajima
authored and
H. Peter Anvin
committed
Jan 21, 2013
1 parent
7d1f9ae
commit ddd70cf
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
obj-$(CONFIG_GOLDFISH) += goldfish.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2007 Google, Inc. | ||
* Copyright (C) 2011 Intel, Inc. | ||
* Copyright (C) 2013 Intel, Inc. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/irq.h> | ||
#include <linux/platform_device.h> | ||
|
||
/* | ||
* Where in virtual device memory the IO devices (timers, system controllers | ||
* and so on) | ||
*/ | ||
|
||
#define GOLDFISH_PDEV_BUS_BASE (0xff001000) | ||
#define GOLDFISH_PDEV_BUS_END (0xff7fffff) | ||
#define GOLDFISH_PDEV_BUS_IRQ (4) | ||
|
||
#define GOLDFISH_TTY_BASE (0x2000) | ||
|
||
static struct resource goldfish_pdev_bus_resources[] = { | ||
{ | ||
.start = GOLDFISH_PDEV_BUS_BASE, | ||
.end = GOLDFISH_PDEV_BUS_END, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
{ | ||
.start = GOLDFISH_PDEV_BUS_IRQ, | ||
.end = GOLDFISH_PDEV_BUS_IRQ, | ||
.flags = IORESOURCE_IRQ, | ||
} | ||
}; | ||
|
||
static int __init goldfish_init(void) | ||
{ | ||
platform_device_register_simple("goldfish_pdev_bus", -1, | ||
goldfish_pdev_bus_resources, 2); | ||
return 0; | ||
} | ||
device_initcall(goldfish_init); |