Received: from eggs.gnu.org ([2001:4830:134:3::10]:55220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W67rG-0003NM-PR for qemu-devel@nongnu.org; Wed, 22 Jan 2014 19:09:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W67rB-0003vu-RD for qemu-devel@nongnu.org; Wed, 22 Jan 2014 19:09:22 -0500 Message-ID: <1390435718.24905.525.camel@snotra.buserror.net> From: Scott Wood Date: Wed, 22 Jan 2014 18:08:38 -0600 In-Reply-To: <1390175077-5717-8-git-send-email-agraf@suse.de> References: <1390175077-5717-1-git-send-email-agraf@suse.de> <1390175077-5717-8-git-send-email-agraf@suse.de> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 07/10] PPC: guts: Add emulation of a few more registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Mon, 2014-01-20 at 00:44 +0100, Alexander Graf wrote: > The GUTS device is used by system software to find out about hardware > details of the current system. > > We only emulate the bare minimum to be able to reboot a guest which is > not sufficient to make u-boot happy. > > Add a few more registers to our portfolio with dummy values. > > Signed-off-by: Alexander Graf > --- > hw/ppc/mpc8544_guts.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c > index a10abe9..af8c742 100644 > --- a/hw/ppc/mpc8544_guts.c > +++ b/hw/ppc/mpc8544_guts.c > @@ -25,6 +25,8 @@ > #define MPC8544_GUTS_RSTCR_RESET 0x02 > > #define MPC8544_GUTS_ADDR_PORPLLSR 0x00 > +#define PORPLLSR_SYS_RATIO_MAX 0x3e > +#define PORPLLSR_CPU0_RATIO_MAX (0x3f << 16) > #define MPC8544_GUTS_ADDR_PORBMSR 0x04 > #define MPC8544_GUTS_ADDR_PORIMPSCR 0x08 > #define MPC8544_GUTS_ADDR_PORDEVSR 0x0C > @@ -36,6 +38,7 @@ > #define MPC8544_GUTS_ADDR_GPINDR 0x50 > #define MPC8544_GUTS_ADDR_PMUXCR 0x60 > #define MPC8544_GUTS_ADDR_DEVDISR 0x70 > +#define DEVDISR_DISABLED_NONE 0x0 > #define MPC8544_GUTS_ADDR_POWMGTCSR 0x80 > #define MPC8544_GUTS_ADDR_MCPSUMR 0x90 > #define MPC8544_GUTS_ADDR_RSTRSCR 0x94 > @@ -73,6 +76,15 @@ static uint64_t mpc8544_guts_read(void *opaque, hwaddr addr, > > addr &= MPC8544_GUTS_MMIO_SIZE - 1; > switch (addr) { > + case MPC8544_GUTS_ADDR_PORPLLSR: > + value = PORPLLSR_SYS_RATIO_MAX | PORPLLSR_CPU0_RATIO_MAX; > + break; > + case MPC8544_GUTS_ADDR_PORDEVSR: > + value = 0; > + break; > + case MPC8544_GUTS_ADDR_DEVDISR: > + value = DEVDISR_DISABLED_NONE; > + break; But we don't actually have most of these devices that you're claiming aren't disabled via DEVDISR -- and with the paravirt target, what do these registers even mean? I'd rather see U-Boot not touch these registers for the QEMU target, rather than returning arbitrary values. -Scott