diff options
author | Yu Ning <yu.ning@intel.com> | 2015-04-02 18:28:24 +0800 |
---|---|---|
committer | Yu Ning <yu.ning@intel.com> | 2015-04-28 18:00:50 +0800 |
commit | 3f8331aff7a214575fb29b197c234beafd0b0210 (patch) | |
tree | 4f3d380c2d0ab5cb48ab7675b157407300c7ae09 | |
parent | 7e51381dd851cc7cc5fcb462f9c4430b6e41141a (diff) | |
download | qemu-android-3f8331aff7a214575fb29b197c234beafd0b0210.tar.gz |
hw/i386: Enable goldfish audio
Follow the same way in which goldfish battery, events, etc. were added
to the default virtual board for x86/x86_64. See commit 16a8f17 for
details.
N.B. While there is no known issue with audio output, audio input does
not work reliably/correctly at this point. Nevertheless, enable both
functions and gradually fix the latter.
Change-Id: Ib0a253c0f73f8fdd44d727504cfddb325056dc2b
Signed-off-by: Yu Ning <yu.ning@intel.com>
-rw-r--r-- | hw/i386/acpi-dsdt-goldfish.dsl | 15 | ||||
-rw-r--r-- | hw/i386/acpi-dsdt.hex.generated | 104 | ||||
-rw-r--r-- | hw/i386/pc_piix.c | 1 | ||||
-rw-r--r-- | include/hw/acpi/goldfish_defs.h | 5 |
4 files changed, 120 insertions, 5 deletions
diff --git a/hw/i386/acpi-dsdt-goldfish.dsl b/hw/i386/acpi-dsdt-goldfish.dsl index 703669e4b4..bed182e3b5 100644 --- a/hw/i386/acpi-dsdt-goldfish.dsl +++ b/hw/i386/acpi-dsdt-goldfish.dsl @@ -78,4 +78,19 @@ Scope(\_SB) { } }) } + + /* Audio */ + Device(GFAU) { + Name(_HID, "GFSH0005") + Name(_STR, Unicode("goldfish audio")) + Name(_CRS, ResourceTemplate() { + Memory32Fixed(ReadWrite, + GF_AUDIO_IOMEM_BASE, + GF_AUDIO_IOMEM_SIZE + ) + Interrupt(, Edge, ActiveHigh) { + GF_AUDIO_IRQ + } + }) + } } diff --git a/hw/i386/acpi-dsdt.hex.generated b/hw/i386/acpi-dsdt.hex.generated index 8b910433f6..b01d3b35a3 100644 --- a/hw/i386/acpi-dsdt.hex.generated +++ b/hw/i386/acpi-dsdt.hex.generated @@ -3,12 +3,12 @@ static unsigned char AcpiDsdtAmlCode[] = { 0x53, 0x44, 0x54, -0x95, +0xf3, 0xf, 0x0, 0x0, 0x1, -0xff, +0x5e, 0x42, 0x58, 0x50, @@ -110,8 +110,8 @@ static unsigned char AcpiDsdtAmlCode[] = { 0x47, 0x42, 0x10, -0x4c, -0x18, +0x4a, +0x1e, 0x5f, 0x53, 0x42, @@ -506,6 +506,100 @@ static unsigned char AcpiDsdtAmlCode[] = { 0x0, 0x79, 0x0, +0x5b, +0x82, +0x4c, +0x5, +0x47, +0x46, +0x41, +0x55, +0x8, +0x5f, +0x48, +0x49, +0x44, +0xd, +0x47, +0x46, +0x53, +0x48, +0x30, +0x30, +0x30, +0x35, +0x0, +0x8, +0x5f, +0x53, +0x54, +0x52, +0x11, +0x21, +0xa, +0x1e, +0x67, +0x0, +0x6f, +0x0, +0x6c, +0x0, +0x64, +0x0, +0x66, +0x0, +0x69, +0x0, +0x73, +0x0, +0x68, +0x0, +0x20, +0x0, +0x61, +0x0, +0x75, +0x0, +0x64, +0x0, +0x69, +0x0, +0x6f, +0x0, +0x0, +0x0, +0x8, +0x5f, +0x43, +0x52, +0x53, +0x11, +0x1a, +0xa, +0x17, +0x86, +0x9, +0x0, +0x1, +0x0, +0x30, +0x1, +0xff, +0x0, +0x1, +0x0, +0x0, +0x89, +0x6, +0x0, +0x3, +0x1, +0x14, +0x0, +0x0, +0x0, +0x79, +0x0, 0x10, 0x22, 0x5f, @@ -3990,5 +4084,5 @@ static unsigned char AcpiDsdtAmlCode[] = { 0x0 }; static unsigned short piix_dsdt_applesmc_sta[] = { -0x4e0 +0x53e }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5a07418be1..be07d3ba15 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -242,6 +242,7 @@ static void pc_init1(MachineState *machine, gsi[GF_EVENTS_IRQ]); sysbus_create_simple("android_pipe", GF_PIPE_IOMEM_BASE, gsi[GF_PIPE_IRQ]); sysbus_create_simple("goldfish_fb", GF_FB_IOMEM_BASE, gsi[GF_FB_IRQ]); + sysbus_create_simple("goldfish_audio", GF_AUDIO_IOMEM_BASE, gsi[GF_AUDIO_IRQ]); #endif /* CONFIG_ANDROID */ pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL); diff --git a/include/hw/acpi/goldfish_defs.h b/include/hw/acpi/goldfish_defs.h index bd37cf2ad6..9f95f64262 100644 --- a/include/hw/acpi/goldfish_defs.h +++ b/include/hw/acpi/goldfish_defs.h @@ -42,4 +42,9 @@ #define GF_FB_IOMEM_SIZE 0x00000100 #define GF_FB_IRQ 19 +/* goldfish audio */ +#define GF_AUDIO_IOMEM_BASE 0xff013000 +#define GF_AUDIO_IOMEM_SIZE 0x00000100 +#define GF_AUDIO_IRQ 20 + #endif /* !ACPI_GOLDFISH_DEFS_H */ |