Upstream merge of core of Goldfish AVD support
Subsystems (8)
cover Upstream merge of core of Goldfish AVD support
This is a port and clean up of the core platform and driver code for the Goldfish AVD (Android Virtual Device).
With these patches applied you can boot Debian on Goldfish for minimal testing purposes. It won't boot Android as there are other drivers needed, some of which still need out of tree Android code.
Goldfish is both an ARM and an x86 platform. These patches add the x86 code but they also add all the cleanups done to make most of the code portable. All the drivers therefore are put into drivers/platform/goldfish or into the relevant driver directories so they can be shared by other processors as needed in future.
Once these drivers are in an upstream acceptable shape I'll look at feeding the other bits in.
Alan
---
Arve Hjønnevåg (4):
goldfish: tty driver
goldfish: framebuffer
goldfish: real time clock
goldfish: NAND flash driver
Brian Swetland (1):
goldfish: virtual input event driver
Jun Nakajima (2):
goldfish: definitions for Goldfish on x86 platforms
goldfish: add the goldfish virtual bus
Mike Lockwood (2):
goldfish: emulated MMC device
goldfish: power device
arch/x86/Kconfig | 12 + arch/x86/include/asm/goldfish.h | 43 ++ drivers/input/keyboard/Kconfig | 11 + drivers/input/keyboard/Makefile | 1 drivers/input/keyboard/goldfish_events.c | 201 ++++++++++ drivers/mmc/host/Kconfig | 7 drivers/mmc/host/Makefile | 1 drivers/mmc/host/goldfish.c | 579 ++++++++++++++++++++++++++++++ drivers/mtd/devices/Kconfig | 7 drivers/mtd/devices/Makefile | 3 drivers/mtd/devices/goldfish_nand.c | 475 +++++++++++++++++++++++++ drivers/mtd/devices/goldfish_nand_reg.h | 72 ++++ drivers/platform/Makefile | 1 drivers/platform/goldfish/Makefile | 4 drivers/platform/goldfish/pdev_bus.c | 267 ++++++++++++++ drivers/power/Kconfig | 8 drivers/power/Makefile | 1 drivers/power/goldfish_battery.c | 263 ++++++++++++++ drivers/rtc/Kconfig | 9 drivers/rtc/Makefile | 1 drivers/rtc/rtc-goldfish.c | 146 ++++++++ drivers/tty/Kconfig | 6 drivers/tty/Makefile | 1 drivers/tty/goldfish.c | 342 ++++++++++++++++++ drivers/video/Kconfig | 9 drivers/video/Makefile | 1 drivers/video/goldfishfb.c | 327 +++++++++++++++++ 27 files changed, 2796 insertions(+), 2 deletions(-) create mode 100644 arch/x86/include/asm/goldfish.h create mode 100644 drivers/input/keyboard/goldfish_events.c create mode 100644 drivers/mmc/host/goldfish.c create mode 100644 drivers/mtd/devices/goldfish_nand.c create mode 100644 drivers/mtd/devices/goldfish_nand_reg.h create mode 100644 drivers/platform/goldfish/Makefile create mode 100644 drivers/platform/goldfish/pdev_bus.c create mode 100644 drivers/power/goldfish_battery.c create mode 100644 drivers/rtc/rtc-goldfish.c create mode 100644 drivers/tty/goldfish.c create mode 100644 drivers/video/goldfishfb.c
Signature · 1 line
Moo!
PATCH 1/9 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 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 arch/x86/include/asm/goldfish.h
arch/x86/Kconfig +12 -0
@@ -326,6 +326,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"
@@ -407,6 +411,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 +36 -0
@@ -0,0 +1,36 @@ +/* +* +* arch/x86/include/asm/mach-goldfish/hardware.h +* +* 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
Re: [PATCH 1/9] goldfish: definitions for Goldfish on x86 platforms
arch/x86/include/asm/goldfish.h line 3
Quoted 6 lines · Alan Cox
arch/x86/include/asm/goldfish.h new file +3
-0@@ -0,0 +1,36 @@ +/* +* +* arch/x86/include/asm/mach-goldfish/hardware.h
Please don't put file names in header files, they get out of sync too easily.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
PATCH 2/9 goldfish: add the goldfish virtual bus
In reply to Alan CoxFrom: 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 | 267 ++++++++++++++++++++++++++++++++++ 3 files changed, 272 insertions(+) create mode 100644 drivers/platform/goldfish/Makefile create mode 100644 drivers/platform/goldfish/pdev_bus.c
drivers/platform/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-$(CONFIG_X86) += x86/ obj-$(CONFIG_OLPC) += olpc/ +obj-$(CONFIG_GOLDFISH) += goldfish/
drivers/platform/goldfish/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# +# Makefile for Goldfish platform specific drivers +# +obj-$(CONFIG_GOLDFISH) += pdev_bus.o
drivers/platform/goldfish/pdev_bus.c new file +267 -0
267 lines not on this page · raw message
PATCH 3/9 goldfish: tty driver
In reply to Alan CoxFrom: Arve Hjønnevåg <[email protected]>
This provides a console driver for the Goldfish virtual platform. The original is from Arve with changes from Jun Nakajima and Tom Keel. This has been then been ported to the current kernel and to the tty port mechanism by Alan Cox. In the process it gained proper POSIX semantics and vhangup works. The default name is not ttyS as this belongs to the 8250 driver. Instead ttyGFx is now used.
In the normal usage case the first port serves as a kernel logging console and the second one carries various other data streams for the emulation.
---
drivers/tty/Kconfig | 6 + drivers/tty/Makefile | 1 drivers/tty/goldfish.c | 342 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 349 insertions(+) create mode 100644 drivers/tty/goldfish.c
drivers/tty/Kconfig +6 -0
@@ -388,3 +388,9 @@ config PPC_EARLY_DEBUG_EHV_BC_HANDLE If the number you specify is not a valid byte channel handle, then there simply will be no early console output. This is true also if you don't boot under a hypervisor at all. + +config GOLDFISH_TTY + tristate "Goldfish TTY Driver" + depends on GOLDFISH + help + Console and system TTY driver for the Goldfish virtual platform.
drivers/tty/Makefile +1 -0
@@ -27,5 +27,6 @@ obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o obj-$(CONFIG_SYNCLINK) += synclink.o obj-$(CONFIG_PPC_EPAPR_HV_BYTECHAN) += ehv_bytechan.o +obj-$(CONFIG_GOLDFISH_TTY) += goldfish.o obj-y += ipwireless/
drivers/tty/goldfish.c new file +342 -0
342 lines not on this page · raw message
PATCH 4/9 goldfish: virtual input event driver
In reply to Alan CoxFrom: Brian Swetland <[email protected]>
This device is a direct pipe from "hardware" to the input event subsystem, allowing us to avoid having to route "keypad" style events through an AT keyboard driver (gross!)
As with the other submissions this driver is cross architecture.
---
drivers/input/keyboard/Kconfig | 11 ++ drivers/input/keyboard/Makefile | 1 drivers/input/keyboard/goldfish_events.c | 201 ++++++++++++++++++++++++++++++ 3 files changed, 213 insertions(+) create mode 100644 drivers/input/keyboard/goldfish_events.c
drivers/input/keyboard/Kconfig +11 -0
@@ -479,6 +479,17 @@ config KEYBOARD_SAMSUNG To compile this driver as a module, choose M here: the module will be called samsung-keypad. +config KEYBOARD_GOLDFISH_EVENTS + depends on GOLDFISH + tristate "Generic Input Event device for Goldfish" + help + Say Y here to get an input event device for the Goldfish virtual + device emulator. + + To compile this driver as a module, choose M here: the + module will be called goldfish-events. + + config KEYBOARD_STOWAWAY tristate "Stowaway keyboard" select SERIO
drivers/input/keyboard/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o +obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o obj-$(CONFIG_KEYBOARD_GPIO_POLLED) += gpio_keys_polled.o obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o
drivers/input/keyboard/goldfish_events.c new file +201 -0
201 lines not on this page · raw message
PATCH 5/9 goldfish: framebuffer
In reply to Alan CoxFrom: Arve Hjønnevåg <[email protected]>
Framebuffer support for the Goldfish emulator. This takes the Google emulator and applies the x86 cleanups as well as moving the blank methods to the usual Linux place and dropping the Android early suspend logic (for now at least, that can be looked at as Android and upstream converge). Dropped various oddities like setting MTRRs on a virtual frame buffer emulation...
With the drivers so far you can now boot a Linux initrd and have fun.
---
drivers/video/Kconfig | 9 + drivers/video/Makefile | 1 drivers/video/goldfishfb.c | 327 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 337 insertions(+) create mode 100644 drivers/video/goldfishfb.c
drivers/video/Kconfig +9 -0
@@ -2183,6 +2183,15 @@ config FB_XILINX framebuffer. ML300 carries a 640*480 LCD display on the board, ML403 uses a standard DB15 VGA connector. +config FB_GOLDFISH + tristate "Goldfish Framebuffer" + depends on FB + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + Framebuffer driver for Goldfish Virtual Platform + config FB_COBALT tristate "Cobalt server LCD frame buffer support" depends on FB && (MIPS_COBALT || MIPS_SEAD3)
drivers/video/Makefile +1 -0
@@ -98,6 +98,7 @@ obj-$(CONFIG_FB_ATMEL) += atmel_lcdfb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o obj-$(CONFIG_FB_VOODOO1) += sstfb.o obj-$(CONFIG_FB_ARMCLCD) += amba-clcd.o +obj-$(CONFIG_FB_GOLDFISH) += goldfishfb.o obj-$(CONFIG_FB_68328) += 68328fb.o obj-$(CONFIG_FB_GBE) += gbefb.o obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o
drivers/video/goldfishfb.c new file +327 -0
327 lines not on this page · raw message
PATCH 6/9 goldfish: emulated MMC device
In reply to Alan CoxFrom: Mike Lockwood <[email protected]>
This driver handles the virtual MMC device present in the Goldfish emulator. The patch folds together initial work from Mike Lockwood and patches by San Mehat, Jun Nakajima and Tom Keel <[email protected]> plus cleanups by Alan Cox to get it all into 3.6 shape.
---
drivers/mmc/host/Kconfig | 7 + drivers/mmc/host/Makefile | 1 drivers/mmc/host/goldfish.c | 579 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 587 insertions(+) create mode 100644 drivers/mmc/host/goldfish.c
drivers/mmc/host/Kconfig +7 -0
@@ -361,6 +361,13 @@ config MMC_DAVINCI If you have an DAVINCI board with a Multimedia Card slot, say Y or M here. If unsure, say N. +config MMC_GOLDFISH + tristate "goldfish qemu Multimedia Card Interface support" + depends on GOLDFISH + help + This selects the Goldfish Multimedia card Interface emulation + found on the Goldfish Android virtual device emulation. + config MMC_SPI tristate "MMC/SD/SDIO over SPI" depends on SPI_MASTER && !HIGHMEM && HAS_DMA
drivers/mmc/host/Makefile +1 -0
@@ -23,6 +23,7 @@ obj-$(CONFIG_MMC_TIFM_SD) += tifm_sd.o obj-$(CONFIG_MMC_MSM) += msm_sdcc.o obj-$(CONFIG_MMC_MVSDIO) += mvsdio.o obj-$(CONFIG_MMC_DAVINCI) += davinci_mmc.o +obj-$(CONFIG_MMC_GOLDFISH) += goldfish.o obj-$(CONFIG_MMC_SPI) += mmc_spi.o ifeq ($(CONFIG_OF),y) obj-$(CONFIG_MMC_SPI) += of_mmc_spi.o
drivers/mmc/host/goldfish.c new file +579 -0
579 lines not on this page · raw message
PATCH 7/9 goldfish: power device
In reply to Alan CoxFrom: Mike Lockwood <[email protected]>
Add the emulated power driver for the Goldfish platform.
This folds together the code from the Google tree, Jun Nakajima's cleanups and x86 porting work, and then a tidy up to pass checkpatch.
---
drivers/power/Kconfig | 8 + drivers/power/Makefile | 1 drivers/power/goldfish_battery.c | 263 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 drivers/power/goldfish_battery.c
drivers/power/Kconfig +7 -1
@@ -346,8 +346,14 @@ config AB8500_BM help Say Y to include support for AB8500 battery management. -source "drivers/power/reset/Kconfig" +config BATTERY_GOLDFISH + tristate "Goldfish battery driver" + depends on GOLDFISH + help + Say Y to enable support for the battery and AC power in the + Goldfish emulator. +source "drivers/power/reset/Kconfig" endif # POWER_SUPPLY source "drivers/power/avs/Kconfig"
drivers/power/Makefile +1 -0
@@ -20,6 +20,7 @@ obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o obj-$(CONFIG_BATTERY_DS2780) += ds2780_battery.o obj-$(CONFIG_BATTERY_DS2781) += ds2781_battery.o obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o +obj-$(CONFIG_BATTERY_GOLDFISH) += goldfish_battery.o obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o
drivers/power/goldfish_battery.c new file +263 -0
263 lines not on this page · raw message
PATCH 8/9 goldfish: real time clock
In reply to Alan CoxFrom: Arve Hjønnevåg <[email protected]>
Gets the current time from the host. Alarms are not supported yet.
---
arch/x86/include/asm/goldfish.h | 7 ++ drivers/rtc/Kconfig | 9 ++ drivers/rtc/Makefile | 1 drivers/rtc/rtc-goldfish.c | 146 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+) create mode 100644 drivers/rtc/rtc-goldfish.c
arch/x86/include/asm/goldfish.h +7 -0
@@ -33,4 +33,11 @@#define GOLDFISH_TTY_BASE (0x2000) +#define GOLDFISH_TIME_LOW 0x00 +#define GOLDFISH_TIME_HIGH 0x04 +#define GOLDFISH_ALARM_LOW 0x08 +#define GOLDFISH_ALARM_HIGH 0x0C +#define GOLDFISH_CLEAR_TIMER_INT 0x10 +#define GOLDFISH_CLEAR_ALARM 0x14 +#endif
drivers/rtc/Kconfig +9 -0
@@ -948,6 +948,15 @@ config RTC_DRV_BFIN This driver can also be built as a module. If so, the module will be called rtc-bfin. +config RTC_DRV_GOLDFISH + tristate "GOLDFISH" + depends on GOLDFISH + help + RTC driver for Goldfish Virtual Platform + + This driver can also be built as a module. If so, the module + will be called rtc-goldfish. + config RTC_DRV_RS5C313 tristate "Ricoh RS5C313" depends on SH_LANDISK
drivers/rtc/Makefile +1 -0
@@ -51,6 +51,7 @@ obj-$(CONFIG_RTC_DRV_EM3027) += rtc-em3027.o obj-$(CONFIG_RTC_DRV_EP93XX) += rtc-ep93xx.o obj-$(CONFIG_RTC_DRV_FM3130) += rtc-fm3130.o obj-$(CONFIG_RTC_DRV_GENERIC) += rtc-generic.o +obj-$(CONFIG_RTC_DRV_GOLDFISH) += rtc-goldfish.o obj-$(CONFIG_RTC_DRV_IMXDI) += rtc-imxdi.o obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o obj-$(CONFIG_RTC_DRV_ISL12022) += rtc-isl12022.o
drivers/rtc/rtc-goldfish.c new file +146 -0
146 lines not on this page · raw message
PATCH 9/9 goldfish: NAND flash driver
In reply to Alan CoxFrom: Arve Hjønnevåg <[email protected]>
Fold together the NAND driver for Goldfish from Arve with cleanups by Jun Nakajima and a tidy up to 3.7 and checkpatch.
---
drivers/mtd/devices/Kconfig | 7 drivers/mtd/devices/Makefile | 3 drivers/mtd/devices/goldfish_nand.c | 475 +++++++++++++++++++++++++++++++ drivers/mtd/devices/goldfish_nand_reg.h | 72 +++++ 4 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 drivers/mtd/devices/goldfish_nand.c create mode 100644 drivers/mtd/devices/goldfish_nand_reg.h
drivers/mtd/devices/Kconfig +7 -0
@@ -342,4 +342,11 @@ config MTD_DOCPROBE_55AA LinuxBIOS or if you need to recover a DiskOnChip Millennium on which you have managed to wipe the first block. +config MTD_GOLDFISH_NAND + tristate "Goldfish NAND device" + depends on GOLDFISH + help + Drives the emulated NAND flash device on the Google Goldfish + Android virtual device. + endmenu
drivers/mtd/devices/Makefile +2 -1
@@ -20,5 +20,6 @@ obj-$(CONFIG_MTD_M25P80) += m25p80.o obj-$(CONFIG_MTD_SPEAR_SMI) += spear_smi.o obj-$(CONFIG_MTD_SST25L) += sst25l.o obj-$(CONFIG_MTD_BCM47XXSFLASH) += bcm47xxsflash.o +obj-$(CONFIG_MTD_GOLDFISH_NAND) += goldfish_nand.o -CFLAGS_docg3.o += -I$(src) +CFLAGS_docg3.o += -I$(src)
drivers/mtd/devices/goldfish_nand.c new file +475 -0
475 lines not on this page · raw message
drivers/mtd/devices/goldfish_nand_reg.h new file +72 -0
72 lines not on this page · raw message