[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 7/9] powerpc/kvm: Add E500 core emulation
From: |
Hollis Blanchard |
Subject: |
[Qemu-devel] Re: [PATCH 7/9] powerpc/kvm: Add E500 core emulation |
Date: |
Thu, 15 Jan 2009 13:53:01 -0600 |
On Thu, 2009-01-15 at 20:34 +0800, Liu Yu wrote:
> Signed-off-by: Liu Yu <address@hidden>
> ---
> 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, <address@hidden>
> + *
> + * 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
- [Qemu-devel] [PATCH 3/9] powerpc/kvm: Enable mpic for E500 platform, (continued)
- [Qemu-devel] [PATCH 3/9] powerpc/kvm: Enable mpic for E500 platform, Liu Yu, 2009/01/15
- [Qemu-devel] [PATCH 4/9] powerpc/kvm: enable POWERPC_MMU_BOOKE_FSL when kvm is enabled, Liu Yu, 2009/01/15
- [Qemu-devel] [PATCH 5/9] powerpc/kvm: Add freescale pci controller's support, Liu Yu, 2009/01/15
- [Qemu-devel] [PATCH 6/9] powerpc/kvm: Add E500 irq support, Liu Yu, 2009/01/15
- [Qemu-devel] [PATCH 7/9] powerpc/kvm: Add E500 core emulation, Liu Yu, 2009/01/15
- [Qemu-devel] [PATCH 8/9] powerpc/kvm: extern one function for E500 code use, Liu Yu, 2009/01/15
- Message not available
- [Qemu-devel] RE: [PATCH 9/9] powerpc/kvm: Add MPC85xx board support, Liu Yu, 2009/01/16
- [Qemu-devel] RE: [PATCH 9/9] powerpc/kvm: Add MPC85xx board support, Hollis Blanchard, 2009/01/16
- [Qemu-devel] RE: [PATCH 9/9] powerpc/kvm: Add MPC85xx board support, Liu Yu, 2009/01/19
- [Qemu-devel] RE: [PATCH 9/9] powerpc/kvm: Add MPC85xx board support, Hollis Blanchard, 2009/01/20
- [Qemu-devel] Re: [PATCH 7/9] powerpc/kvm: Add E500 core emulation,
Hollis Blanchard <=
- [Qemu-devel] RE: [PATCH 7/9] powerpc/kvm: Add E500 core emulation, Liu Yu, 2009/01/16
- [Qemu-devel] RE: [PATCH 7/9] powerpc/kvm: Add E500 core emulation, Hollis Blanchard, 2009/01/16
- [Qemu-devel] RE: [PATCH 7/9] powerpc/kvm: Add E500 core emulation, Liu Yu, 2009/01/19
- [Qemu-devel] RE: [PATCH 7/9] powerpc/kvm: Add E500 core emulation, Liu Yu, 2009/01/19
- [Qemu-devel] Re: [PATCH 5/9] powerpc/kvm: Add freescale pci controller's support, Hollis Blanchard, 2009/01/15
- [Qemu-devel] RE: [PATCH 5/9] powerpc/kvm: Add freescale pci controller's support, Liu Yu, 2009/01/16
- Re: [Qemu-devel] [PATCH 3/9] powerpc/kvm: Enable mpic for E500 platform, Anthony Liguori, 2009/01/15
- RE: [Qemu-devel] [PATCH 3/9] powerpc/kvm: Enable mpic for E500 platform, Liu Yu, 2009/01/16
- RE: [Qemu-devel] [PATCH 3/9] powerpc/kvm: Enable mpic for E500 platform, Hollis Blanchard, 2009/01/16
- Re: [Qemu-devel] [PATCH 3/9] powerpc/kvm: Enable mpic for E500 platform, Aurelien Jarno, 2009/01/16