hw/i386: Enable goldfish framebuffer

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.

See also https://android-review.googlesource.com/131520 for the
corresponding kernel-side patch.

Change-Id: Iadfa05a0956f550278908c1cd89366cd7e4f3c8d
Signed-off-by: Yu Ning <yu.ning@intel.com>
diff --git a/hw/i386/acpi-dsdt-goldfish.dsl b/hw/i386/acpi-dsdt-goldfish.dsl
index d0b7847..703669e 100644
--- a/hw/i386/acpi-dsdt-goldfish.dsl
+++ b/hw/i386/acpi-dsdt-goldfish.dsl
@@ -63,4 +63,19 @@
             }
         })
     }
+
+    /* Framebuffer */
+    Device(GFFB) {
+        Name(_HID, "GFSH0004")
+        Name(_STR, Unicode("goldfish framebuffer"))
+        Name(_CRS, ResourceTemplate() {
+            Memory32Fixed(ReadWrite,
+                GF_FB_IOMEM_BASE,
+                GF_FB_IOMEM_SIZE
+                )
+            Interrupt(, Edge, ActiveHigh) {
+                GF_FB_IRQ
+            }
+        })
+    }
 }
diff --git a/hw/i386/acpi-dsdt.hex.generated b/hw/i386/acpi-dsdt.hex.generated
index ae1ce42..8b91043 100644
--- a/hw/i386/acpi-dsdt.hex.generated
+++ b/hw/i386/acpi-dsdt.hex.generated
@@ -3,12 +3,12 @@
 0x53,
 0x44,
 0x54,
-0x2b,
+0x95,
 0xf,
 0x0,
 0x0,
 0x1,
-0x1e,
+0xff,
 0x42,
 0x58,
 0x50,
@@ -31,8 +31,8 @@
 0x4e,
 0x54,
 0x4c,
-0x7,
-0x11,
+0x14,
+0x2,
 0x14,
 0x20,
 0x10,
@@ -110,8 +110,8 @@
 0x47,
 0x42,
 0x10,
-0x42,
-0x12,
+0x4c,
+0x18,
 0x5f,
 0x53,
 0x42,
@@ -400,6 +400,112 @@
 0x0,
 0x79,
 0x0,
+0x5b,
+0x82,
+0x48,
+0x6,
+0x47,
+0x46,
+0x46,
+0x42,
+0x8,
+0x5f,
+0x48,
+0x49,
+0x44,
+0xd,
+0x47,
+0x46,
+0x53,
+0x48,
+0x30,
+0x30,
+0x30,
+0x34,
+0x0,
+0x8,
+0x5f,
+0x53,
+0x54,
+0x52,
+0x11,
+0x2d,
+0xa,
+0x2a,
+0x67,
+0x0,
+0x6f,
+0x0,
+0x6c,
+0x0,
+0x64,
+0x0,
+0x66,
+0x0,
+0x69,
+0x0,
+0x73,
+0x0,
+0x68,
+0x0,
+0x20,
+0x0,
+0x66,
+0x0,
+0x72,
+0x0,
+0x61,
+0x0,
+0x6d,
+0x0,
+0x65,
+0x0,
+0x62,
+0x0,
+0x75,
+0x0,
+0x66,
+0x0,
+0x66,
+0x0,
+0x65,
+0x0,
+0x72,
+0x0,
+0x0,
+0x0,
+0x8,
+0x5f,
+0x43,
+0x52,
+0x53,
+0x11,
+0x1a,
+0xa,
+0x17,
+0x86,
+0x9,
+0x0,
+0x1,
+0x0,
+0x20,
+0x1,
+0xff,
+0x0,
+0x1,
+0x0,
+0x0,
+0x89,
+0x6,
+0x0,
+0x3,
+0x1,
+0x13,
+0x0,
+0x0,
+0x0,
+0x79,
+0x0,
 0x10,
 0x22,
 0x5f,
@@ -3884,5 +3990,5 @@
 0x0
 };
 static unsigned short piix_dsdt_applesmc_sta[] = {
-0x476
+0x4e0
 };
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 24d9ab0..5a07418 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -241,6 +241,7 @@
     sysbus_create_simple("goldfish-events", GF_EVENTS_IOMEM_BASE,
                          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]);
 #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 f4588f5..bd37cf2 100644
--- a/include/hw/acpi/goldfish_defs.h
+++ b/include/hw/acpi/goldfish_defs.h
@@ -37,4 +37,9 @@
 #define GF_PIPE_IOMEM_SIZE      0x00002000
 #define GF_PIPE_IRQ             18
 
+/* goldfish framebuffer */
+#define GF_FB_IOMEM_BASE        0xff012000
+#define GF_FB_IOMEM_SIZE        0x00000100
+#define GF_FB_IRQ               19
+
 #endif  /* !ACPI_GOLDFISH_DEFS_H */