Skip to contentSkip to conversation

goldfish: base support

PATCH New Alan Cox 1 participant 3 messages Dec 19, 2012 x86

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

cover goldfish: base support

Add the base component of the Goldfish virtual android device on x86 systems.

These need to be merged first so the driver support can follow

---

Jun Nakajima (2):
goldfish: definitions for Goldfish on x86 platforms
goldfish: add the goldfish virtual bus

 arch/x86/Kconfig                     |   12 ++
 arch/x86/include/asm/goldfish.h      |   33 ++++
 drivers/platform/Makefile            |    1 
 drivers/platform/goldfish/Makefile   |    4 +
 drivers/platform/goldfish/pdev_bus.c |  265 ++++++++++++++++++++++++++++++++++
 5 files changed, 315 insertions(+)
 create mode 100644 arch/x86/include/asm/goldfish.h
 create mode 100644 drivers/platform/goldfish/Makefile
 create mode 100644 drivers/platform/goldfish/pdev_bus.c
Signature · 1 line
Signature
author
#1 lore raw

PATCH 1/2 goldfish: definitions for Goldfish on x86 platforms

From: Jun Nakajima <[email protected]>

Based on code by Jun Nakajima but stripped of all the old x86 mach-foo stuff and turned into a single include file for the Goldfish virtual bus layer

[Ported to 3.7 and reorganised so that we can keep most of the code
shared properly]

---

 arch/x86/Kconfig                |   12 ++++++++++++
 arch/x86/include/asm/goldfish.h |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 arch/x86/include/asm/goldfish.h
arch/x86/Kconfig +12 -0
index 2b8f547..df468c3 100644
@@ -321,6 +321,10 @@ config X86_BIGSMP
 	---help---
 	  This option is needed for the systems that have more than 8 CPUs
 
+config GOLDFISH
+       def_bool y
+       depends on X86_GOLDFISH
+
 if X86_32
 config X86_EXTENDED_PLATFORM
 	bool "Support for extended (non-PC) x86 platforms"
@@ -403,6 +407,14 @@ config X86_UV
 # Following is an alphabetically sorted list of 32 bit extended platforms
 # Please maintain the alphabetic order if and when there are additions
 
+config X86_GOLDFISH
+       bool "Goldfish (Virtual Platform)"
+       depends on X86_32
+       ---help---
+	 Enable support for the Goldfish virtual platform used primarily
+	 for Android development. Unless you are building for the Android
+	 Goldfish emulator say N here.
+
 config X86_INTEL_CE
 	bool "CE4100 TV platform"
 	depends on PCI
arch/x86/include/asm/goldfish.h new file +33 -0
new file mode 100644
index 0000000..8d2c559
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2007 Google, Inc.
+ * Copyright (C) 2012 Intel, Corp.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __X86_ARCH_HARDWARE_H
+#define __X86_ARCH_HARDWARE_H
+
+/*
+ * Where in virtual memory the IO devices (timers, system controllers
+ * and so on)
+ */
+
+#define GOLDFISH_IO_SIZE	0x00800000	/* How much? */
+#define GOLDFISH_IO_START	0xff000000	/* PA of IO */
+
+#define GOLDFISH_PDEV_BUS_BASE	(0x1000)
+#define GOLDFISH_PDEV_BUS_END	(0x100)
+#define GOLDFISH_PDEV_BUS_IRQ	(4)
+
+#define GOLDFISH_TTY_BASE	(0x2000)
+
+#endif
author
#2 lore raw

PATCH 2/2 goldfish: add the goldfish virtual bus

In reply to Alan Cox

From: Jun Nakajima <[email protected]>

This imports the current Google code and cleans it up slightly to use pr_ and to properly request its resources.

Goldfish is an emulator used for Android development. It has a virtual bus where the emulator passes platform device information to the guest which then creates the appropriate devices.

This part of the emulation is not architecture specific so should not be hiding in architecture trees as it does in the Google Android tree. The constants it uses do depend on the platform and so live in arch/goldfish.h

---

 drivers/platform/Makefile            |    1 
 drivers/platform/goldfish/Makefile   |    4 +
 drivers/platform/goldfish/pdev_bus.c |  265 ++++++++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+)
 create mode 100644 drivers/platform/goldfish/Makefile
 create mode 100644 drivers/platform/goldfish/pdev_bus.c
drivers/platform/Makefile +1 -0
index b17c16c..8a44a4c 100644
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_X86)		+= x86/
 obj-$(CONFIG_OLPC)		+= olpc/
+obj-$(CONFIG_GOLDFISH)		+= goldfish/
drivers/platform/goldfish/Makefile new file +4 -0
new file mode 100644
index 0000000..6c591f6
@@ -0,0 +1,4 @@
+#
+# Makefile for Goldfish platform specific drivers
+#
+obj-$(CONFIG_GOLDFISH)	+=	pdev_bus.o
drivers/platform/goldfish/pdev_bus.c new file +265 -0

265 lines not on this page · raw message