From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNYH8-0006NV-2R for qemu-devel@nongnu.org; Thu, 15 Jan 2009 14:53:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNYH6-0006Mb-E7 for qemu-devel@nongnu.org; Thu, 15 Jan 2009 14:53:09 -0500 Received: from [199.232.76.173] (port=47881 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNYH6-0006MR-4j for qemu-devel@nongnu.org; Thu, 15 Jan 2009 14:53:08 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:42628) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNYH5-0007p1-ME for qemu-devel@nongnu.org; Thu, 15 Jan 2009 14:53:07 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n0FJpaab008215 for ; Thu, 15 Jan 2009 14:51:36 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n0FJr23L196240 for ; Thu, 15 Jan 2009 14:53:02 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n0FJqB6p000317 for ; Thu, 15 Jan 2009 14:52:12 -0500 From: Hollis Blanchard In-Reply-To: <1232022857-2315-8-git-send-email-yu.liu@freescale.com> References: <1232022857-2315-1-git-send-email-yu.liu@freescale.com> <1232022857-2315-2-git-send-email-yu.liu@freescale.com> <1232022857-2315-3-git-send-email-yu.liu@freescale.com> <1232022857-2315-4-git-send-email-yu.liu@freescale.com> <1232022857-2315-5-git-send-email-yu.liu@freescale.com> <1232022857-2315-6-git-send-email-yu.liu@freescale.com> <1232022857-2315-7-git-send-email-yu.liu@freescale.com> <1232022857-2315-8-git-send-email-yu.liu@freescale.com> Content-Type: text/plain Date: Thu, 15 Jan 2009 13:53:01 -0600 Message-Id: <1232049181.6845.3.camel@slate.austin.ibm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 7/9] powerpc/kvm: Add E500 core emulation Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yu Cc: qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org On Thu, 2009-01-15 at 20:34 +0800, Liu Yu wrote: > Signed-off-by: Liu Yu > --- > Makefile.target | 1 + > hw/ppce500.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ > hw/ppce500.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 94 insertions(+), 0 deletions(-) > create mode 100644 hw/ppce500.c > create mode 100644 hw/ppce500.h > > diff --git a/Makefile.target b/Makefile.target > index 2079fcb..223d294 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -651,6 +651,7 @@ OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o > OBJS+= ppc440.o ppc440_bamboo.o > # PowerPC E500 boards > OBJS+= ppce500_pci.o > +OBJS+= ppce500.o > ifdef FDT_LIBS > OBJS+= device_tree.o > LIBS+= $(FDT_LIBS) > diff --git a/hw/ppce500.c b/hw/ppce500.c > new file mode 100644 > index 0000000..856cce2 > --- /dev/null > +++ b/hw/ppce500.c > @@ -0,0 +1,49 @@ > +/* > + * Qemu PowerPC E500 core emualtion "emulation" > + * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. > + * > + * Author: Yu Liu, > + * > + * This file is derived from hw/ppc440.c > + * the copyright for that material belongs to the original owners. > + * > + * This is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + */ > + > +#include "hw.h" > +#include "pc.h" > +#include "hw/isa.h" > +#include "ppce500.h" > +#include "sysemu.h" > + > +#define bytes_to_mb(a) (a>>20) Doesn't look like this is used. > +CPUState *ppce500_init(ram_addr_t *ram_size) > +{ > + int i; > + ram_addr_t tmp_ram_size; > + CPUState *env; > + int ram_stick_sizes[] = {512<<20, 256<<20, 128<<20, 64<<20}; /* in bytes */ > + > + /* Setup Memory */ > + tmp_ram_size = *ram_size; > + > + for (i=0; i<(sizeof(ram_stick_sizes)/sizeof(ram_stick_sizes[0])); i++) > + while ((tmp_ram_size/ram_stick_sizes[i]) > 0) > + tmp_ram_size -= ram_stick_sizes[i]; > + > + if (tmp_ram_size) > + *ram_size -= tmp_ram_size; Since you said you don't actually have a memory controller you're emulating, I think you should completely remove all this ram_size stuff. Once you do that, this whole function becomes just cpu_ppc_init(), so you can just call that instead. > + env = cpu_ppc_init("e500v2_v30"); > + if (!env) { > + fprintf(stderr, "Unable to initilize CPU!\n"); "initialize" -- Hollis Blanchard IBM Linux Technology Center