From patchwork Fri Mar 29 08:16:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Tao X-Patchwork-Id: 232306 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3B6002C00AA for ; Fri, 29 Mar 2013 19:17:59 +1100 (EST) Received: from localhost ([::1]:33201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULUVZ-0008Cu-8a for incoming@patchwork.ozlabs.org; Fri, 29 Mar 2013 04:17:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULUV5-00088k-LY for qemu-devel@nongnu.org; Fri, 29 Mar 2013 04:17:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULUV3-0007FU-Ph for qemu-devel@nongnu.org; Fri, 29 Mar 2013 04:17:27 -0400 Received: from [222.73.24.84] (port=35984 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULUV3-0007D7-EN for qemu-devel@nongnu.org; Fri, 29 Mar 2013 04:17:25 -0400 X-IronPort-AV: E=Sophos;i="4.87,372,1363104000"; d="scan'208";a="6969340" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 29 Mar 2013 16:14:48 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r2T8HI6r014558; Fri, 29 Mar 2013 16:17:20 +0800 Received: from localhost.localdomain ([10.167.233.156]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013032916162799-163880 ; Fri, 29 Mar 2013 16:16:27 +0800 From: Hu Tao To: qemu-devel , "Daniel P. Berrange" , KAMEZAWA Hiroyuki , Jan Kiszka , Gleb Natapov , Blue Swirl , Eric Blake , Andrew Jones , Marcelo Tosatti , Sasha Levin , Luiz Capitulino , Anthony Liguori , Markus Armbruster , Paolo Bonzini , Stefan Hajnoczi , Juan Quintela , Orit Wasserman , Wen Congyang , "Michael S. Tsirkin" , Alexander Graf , Alex Williamson , Peter Maydell , Christian Borntraeger Date: Fri, 29 Mar 2013 16:16:46 +0800 Message-Id: <6cafd3eee5c1897db770a9d51c8c1de5e20a1c74.1364541739.git.hutao@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: References: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/03/29 16:16:27, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/03/29 16:16:30, Serialize complete at 2013/03/29 16:16:30 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Subject: [Qemu-devel] [PATCH v16 5/6] pc_piix, pc_q35: export fw_cfg X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This lets other devices pass informations to seabios. Signed-off-by: Hu Tao --- hw/i386/pc_piix.c | 7 ++++--- hw/i386/pc_q35.c | 9 ++++++--- hw/pc.h | 6 ++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 0abc9f1..7a9d9a8 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -54,6 +54,8 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 }; static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; +void *fw_cfg_piix; + /* PC hardware initialisation */ static void pc_init1(MemoryRegion *system_memory, MemoryRegion *system_io, @@ -84,7 +86,6 @@ static void pc_init1(MemoryRegion *system_memory, MemoryRegion *ram_memory; MemoryRegion *pci_memory; MemoryRegion *rom_memory; - void *fw_cfg = NULL; pc_cpus_init(cpu_model); pc_acpi_init("acpi-dsdt.aml"); @@ -112,7 +113,7 @@ static void pc_init1(MemoryRegion *system_memory, /* allocate ram and load rom/bios */ if (!xen_enabled()) { - fw_cfg = pc_memory_init(system_memory, + fw_cfg_piix = pc_memory_init(system_memory, kernel_filename, kernel_cmdline, initrd_filename, below_4g_mem_size, above_4g_mem_size, rom_memory, &ram_memory); @@ -210,7 +211,7 @@ static void pc_init1(MemoryRegion *system_memory, /* TODO: Populate SPD eeprom data. */ smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, gsi[9], *smi_irq, - kvm_enabled(), fw_cfg); + kvm_enabled(), fw_cfg_piix); smbus_eeprom_init(smbus, 8, NULL, 0); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4f5f347..ce7798c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -45,6 +45,8 @@ /* ICH9 AHCI has 6 ports */ #define MAX_SATA_PORTS 6 +void *fw_cfg_q35; + /* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE) * BIOS will read it and start S3 resume at POST Entry */ static void pc_cmos_set_s3_resume(void *opaque, int irq, int level) @@ -111,9 +113,10 @@ static void pc_q35_init(QEMUMachineInitArgs *args) /* allocate ram and load rom/bios */ if (!xen_enabled()) { - pc_memory_init(get_system_memory(), kernel_filename, kernel_cmdline, - initrd_filename, below_4g_mem_size, above_4g_mem_size, - rom_memory, &ram_memory); + fw_cfg_q35 = pc_memory_init(get_system_memory(), kernel_filename, + kernel_cmdline, initrd_filename, + below_4g_mem_size, above_4g_mem_size, + rom_memory, &ram_memory); } /* irq lines */ diff --git a/hw/pc.h b/hw/pc.h index 8e1dd4c..d42b76b 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -145,6 +145,12 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, extern PCIDevice *piix4_dev; int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn); +/* pc_piix.c */ +extern void *fw_cfg_piix; + +/* pc_q35.c */ +extern void *fw_cfg_q35; + /* vga.c */ enum vga_retrace_method { VGA_RETRACE_DUMB,