From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFaM2-0001Ae-Ks for qemu-devel@nongnu.org; Wed, 24 Dec 2008 15:29:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFaM2-0001AM-3p for qemu-devel@nongnu.org; Wed, 24 Dec 2008 15:29:18 -0500 Received: from [199.232.76.173] (port=47737 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFaM1-0001AJ-Uf for qemu-devel@nongnu.org; Wed, 24 Dec 2008 15:29:17 -0500 Received: from savannah.gnu.org ([199.232.41.3]:38901 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LFaM1-0006sn-Iw for qemu-devel@nongnu.org; Wed, 24 Dec 2008 15:29:17 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LFaM1-00007B-4I for qemu-devel@nongnu.org; Wed, 24 Dec 2008 20:29:17 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LFaM0-000077-Vk for qemu-devel@nongnu.org; Wed, 24 Dec 2008 20:29:17 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Wed, 24 Dec 2008 20:29:16 +0000 Subject: [Qemu-devel] [6130] Use the firmware configuration device Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6130 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6130 Author: blueswir1 Date: 2008-12-24 20:29:16 +0000 (Wed, 24 Dec 2008) Log Message: ----------- Use the firmware configuration device Modified Paths: -------------- trunk/hw/ppc_oldworld.c Modified: trunk/hw/ppc_oldworld.c =================================================================== --- trunk/hw/ppc_oldworld.c 2008-12-24 20:26:14 UTC (rev 6129) +++ trunk/hw/ppc_oldworld.c 2008-12-24 20:29:16 UTC (rev 6130) @@ -32,10 +32,18 @@ #include "isa.h" #include "pci.h" #include "boards.h" +#include "fw_cfg.h" #define MAX_IDE_BUS 2 #define VGA_BIOS_SIZE 65536 +#define CFG_ADDR 0xf0000510 +enum { + ARCH_PREP = 0, + ARCH_MAC99, + ARCH_HEATHROW, +}; + /* temporary frame buffer OSI calls for the video.x driver. The right solution is to modify the driver to use VGA PCI I/Os */ /* XXX: to be removed. This is no way related to emulation */ @@ -128,6 +136,7 @@ int ppc_boot_device; BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; int index; + void *fw_cfg; linux_boot = (kernel_filename != NULL); @@ -363,6 +372,11 @@ /* Special port to get debug messages from Open-Firmware */ register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL); + + fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2); + fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_HEATHROW); } QEMUMachine heathrow_machine = {