4 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
7 * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
8 * SeokYeon Hwang <syeon.hwang@samsung.com>
9 * SangJin Kim <sangjin3.kim@samsung.com>
10 * KiTae Kim <kt920.kim@samsung.com>
11 * JinHyung Jo <jinhyung.jo@samsung.com>
12 * SungMin Ha <sungmin82.ha@samsung.com>
13 * MunKyu Im <munkyu.im@samsung.com>
14 * JiHye Kim <jihye1128.kim@samsung.com>
15 * GiWoong Kim <giwoong.kim@samsung.com>
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
37 * x86 board from pc_piix.c...
38 * add some TIZEN-speciaized device...
44 #include "hw/i386/pc.h"
45 #include "hw/i386/apic.h"
46 #include "hw/pci/pci.h"
47 #include "hw/pci/pci_ids.h"
50 #include "hw/boards.h"
52 #include "sysemu/kvm.h"
53 #include "hw/kvm/clock.h"
54 #include "sysemu/sysemu.h"
55 #include "hw/sysbus.h"
56 #include "hw/cpu/icc_bus.h"
57 #include "sysemu/arch_init.h"
58 #include "sysemu/blockdev.h"
59 #include "hw/i2c/smbus.h"
60 #include "hw/xen/xen.h"
61 #include "exec/memory.h"
62 #include "exec/address-spaces.h"
63 #include "hw/acpi/acpi.h"
66 # include <xen/hvm/hvm_info_table.h>
69 #include "maru_common.h"
70 #include "guest_debug.h"
72 #include "maru_brightness.h"
73 #include "maru_overlay.h"
74 #if defined(__linux__)
77 #include "vigs/vigs_device.h"
78 extern int enable_yagl;
79 extern const char *yagl_backend;
80 extern int enable_vigs;
81 extern const char *vigs_backend;
82 extern int enable_spice;
86 int codec_init(PCIBus *bus);
87 int maru_brill_codec_pci_device_init(PCIBus *bus);
89 static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
90 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
91 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
93 static bool has_pci_info = true;
95 MemoryRegion *global_ram_memory;
97 MemoryRegion *get_ram_memory(void)
99 return global_ram_memory;
102 /* maru specialized device init */
103 static void maru_device_init(void)
105 PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL);
107 #if defined(CONFIG_LINUX)
108 Display *display = XOpenDisplay(0);
109 if (!display && !enable_spice) {
110 fprintf(stderr, "Cannot open X display\n");
114 void *display = NULL;
116 struct winsys_interface *vigs_wsi = NULL;
118 pci_maru_overlay_init(pci_bus);
119 pci_maru_brightness_init(pci_bus);
120 maru_brill_codec_pci_device_init(pci_bus);
123 PCIDevice *pci_dev = pci_create(pci_bus, -1, "vigs");
124 qdev_prop_set_ptr(&pci_dev->qdev, "display", display);
125 qdev_init_nofail(&pci_dev->qdev);
126 vigs_wsi = DO_UPCAST(VIGSDevice, pci_dev, pci_dev)->wsi;
130 PCIDevice *pci_dev = pci_create(pci_bus, -1, "yagl");
131 qdev_prop_set_ptr(&pci_dev->qdev, "display", display);
133 (strcmp(yagl_backend, "vigs") == 0) &&
134 (strcmp(vigs_backend, "gl") == 0)) {
135 qdev_prop_set_ptr(&pci_dev->qdev, "winsys_gl_interface", vigs_wsi);
137 qdev_init_nofail(&pci_dev->qdev);
141 extern void pc_init_pci(QEMUMachineInitArgs *args);
142 static void maru_x86_board_init(QEMUMachineInitArgs *args)
146 has_pci_info = false;
150 static QEMUMachine maru_x86_machine = {
151 PC_DEFAULT_MACHINE_OPTIONS,
152 .name = "maru-x86-machine",
153 .alias = "maru-x86-machine",
154 .desc = "Maru Board (x86)",
155 .init = maru_x86_board_init,
156 .hot_add_cpu = pc_hot_add_cpu,
159 static void maru_machine_init(void)
161 qemu_register_machine(&maru_x86_machine);
164 machine_init(maru_machine_init);