Re: [PATCH 2/5] qemu/kvm: E500 core emulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 12 January 2009 03:02:10 Liu Yu wrote:
> > -----Original Message-----
> > From: kvm-ppc-owner@xxxxxxxxxxxxxxx 
> > [mailto:kvm-ppc-owner@xxxxxxxxxxxxxxx] On Behalf Of Hollis Blanchard
> > Sent: Saturday, January 10, 2009 4:16 AM
> > To: Liu Yu-B13201
> > Cc: kvm-ppc@xxxxxxxxxxxxxxx
> > Subject: Re: [PATCH 2/5] qemu/kvm: E500 core emulation
> > 
> > On Fri, 2009-01-09 at 15:56 +0800, Liu Yu wrote:
> > > Signed-off-by: Liu Yu <yu.liu@xxxxxxxxxxxxx>
> > > ---
> > >  hw/ppce500.c |   74 
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  hw/ppce500.h |   66 
> > +++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  2 files changed, 140 insertions(+), 0 deletions(-)
> > >  create mode 100644 hw/ppce500.c
> > >  create mode 100644 hw/ppce500.h
> > > 
> > > diff --git a/hw/ppce500.c b/hw/ppce500.c
> > > new file mode 100644
> > > index 0000000..13eab47
> > > --- /dev/null
> > > +++ b/hw/ppce500.c
> > > @@ -0,0 +1,74 @@
> > > +/*
> > > + * Qemu PowerPC E500 core emualtion
> > > + *
> > > + * Copyright (C) 2009 Freescale Semiconductor, Inc. All 
> > rights reserved.
> > > + *
> > > + * Author: Yu Liu,     <yu.liu@xxxxxxxxxxxxx>
> > > + *
> > > + * This file is derived from hw/ppc440.c
> > > + * the copyright for that material belongs to the original owners.
> > 
> > I guess you based this off an old version of ppc440.c, which 
> > isn't good
> > because I improved that code a lot when merging in to qemu.
> > 
> > > + * 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 PPCE500_SERIAL0_REGS       0x4500
> > > +#define PPCE500_SERIAL1_REGS       0x4600
> > > +#define PPCE500_MPIC_REGS  0x40000
> > > +#define bytes_to_mb(a) (a>>20)
> > > +
> > > +CPUState *ppce500_init(ram_addr_t *ram_size,
> > > +           qemu_irq **pic,
> > > +           target_ulong ccsrbar_base)
> > > +{
> > > +    qemu_irq *mpic_irq, *irqs;
> > > +    SerialState * serial[2];
> > > +    int ram_stick_sizes[] = {512<<20, 256<<20}; /* in bytes */
> > 
> > Your memory controller only supports 512M and 256M?
> 
> I don't emulate the memory controller, so I think qemu/e500 coulde
> support all kinds capacities.
> 
> 
> > 
> > > +    int i;
> > > +    ram_addr_t tmp_ram_size;
> > > +    CPUState *env;
> > > +
> > > +    /* 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;
> > 
> > This code was all refactored into a much nicer form. Look at
> > ppc4xx_sdram_adjust(), and rename it if you need it too.
> 
> As I haven't emulated memory controller, do I need to do this?

No, you don't. In that case you should remove this ram code entirely.

(The only reason we emulated the memory controller is because some of the 
early Linux bootwrapper code on 4xx uses it.)

-- 
Hollis Blanchard
IBM Linux Technology Center
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux