From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60704 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUOy3-0002Ch-Ft for qemu-devel@nongnu.org; Sun, 19 Dec 2010 14:30:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUOy1-0003Er-N1 for qemu-devel@nongnu.org; Sun, 19 Dec 2010 14:30:51 -0500 Received: from mail.mc.net ([209.172.128.24]:50532) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PUOy1-0003ER-IU for qemu-devel@nongnu.org; Sun, 19 Dec 2010 14:30:49 -0500 Message-ID: <4D0E5F16.3090905@mc.net> Date: Sun, 19 Dec 2010 13:37:58 -0600 From: Bob Breuer MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] sparc32: ledma extra registers References: <4D0CEAB0.9030706@mc.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: Blue Swirl , QEMU Developers Andreas Färber wrote: > Am 18.12.2010 um 19:53 schrieb Blue Swirl: > >> On Sat, Dec 18, 2010 at 5:09 PM, Bob Breuer wrote: >>> ledma has 0x20 bytes of registers according to OBP, and at least >>> Solaris9 >>> reads the 5th register which is beyond what we've mapped. So let's >>> setup >>> a flag (inspired by a previous patch from Blue Swirl) to identify ledma >>> from espdma, and map another 16 bytes of registers which return 0. >>> >>> Signed-off-by: Bob Breuer > > I'm not familar with that part of code but... > >>> diff --git a/hw/sparc32_dma.c b/hw/sparc32_dma.c >>> index e78f025..56be8c8 100644 >>> --- a/hw/sparc32_dma.c >>> +++ b/hw/sparc32_dma.c > >>> @@ -165,6 +169,9 @@ static uint32_t dma_mem_readl(void *opaque, >>> target_phys_addr_t addr) >>> DMAState *s = opaque; >>> uint32_t saddr; >>> >>> + if (s->is_ledma && (addr > DMA_MAX_REG_OFFSET)) { >>> + return 0; /* extra mystery register(s) */ > > Wouldn't it be a good idea to trace these "mystery" reads... > >>> + } >>> saddr = (addr & DMA_MASK) >> 2; >>> trace_sparc32_dma_mem_readl(addr, s->dmaregs[saddr]); >>> return s->dmaregs[saddr]; >>> @@ -175,6 +182,9 @@ static void dma_mem_writel(void *opaque, >>> target_phys_addr_t addr, uint32_t val) >>> DMAState *s = opaque; >>> uint32_t saddr; >>> >>> + if (s->is_ledma && (addr > DMA_MAX_REG_OFFSET)) { >>> + return; /* extra mystery register(s) */ > > ...and writes? We return just before the tracepoints fire. > Ok, I'll put together a patch to add the trace calls just before the returns. How about I also call it undocumented instead of mystery. None of the BSD's or Linux know about or use anything beyond the 4 registers. Blue, do you know of a mirror for the documents at http://wikis.sun.com/display/FOSSdocs/Home ? The pdfs there seem to have gone missing, and maybe there might be something in the macio documentation. Bob