From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiFEX-0000xe-H5 for qemu-devel@nongnu.org; Wed, 07 May 2014 23:43:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiFER-0004FR-IB for qemu-devel@nongnu.org; Wed, 07 May 2014 23:42:57 -0400 Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]:57659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiFER-0004Ej-BB for qemu-devel@nongnu.org; Wed, 07 May 2014 23:42:51 -0400 Received: by mail-pd0-f177.google.com with SMTP id p10so1895156pdj.36 for ; Wed, 07 May 2014 20:42:50 -0700 (PDT) Date: Thu, 8 May 2014 03:42:59 +0000 From: "Edgar E. Iglesias" Message-ID: <20140508034258.GG7381@hostname> References: <1399512908-23925-1-git-send-email-edgar.iglesias@gmail.com> <1399512908-23925-5-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v1 4/5] xilinx_timer: Fix writes into TCSR register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: "qemu-devel@nongnu.org Developers" , linux@roeck-us.net On Thu, May 08, 2014 at 12:45:03PM +1000, Peter Crosthwaite wrote: > On Thu, May 8, 2014 at 11:35 AM, Edgar E. Iglesias > wrote: > > From: Guenter Roeck > > > > The TCSR register has only 11 valid bits. This is now used by the > > linux kernel to auto-detect endianness, and causes Linux 3.15-rc1 > > and later to hang when run under qemu-microblaze. Mask valid bits > > before writing the register to solve the problem. > > > > Signed-off-by: Guenter Roeck > > Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Edgar E. Iglesias > > --- > > hw/timer/xilinx_timer.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c > > index 6113b97..3ff1da9 100644 > > --- a/hw/timer/xilinx_timer.c > > +++ b/hw/timer/xilinx_timer.c > > @@ -169,7 +169,7 @@ timer_write(void *opaque, hwaddr addr, > > if (value & TCSR_TINT) > > value &= ~TCSR_TINT; > > > > - xt->regs[addr] = value; > > + xt->regs[addr] = value & 0x7ff; > > In at least the later TRMs, Bit 11 is validly defined as the cascade > bit, taking the total number of bits to 12. I think this mask should > be 0xfff. Hi, For timer versions without cascading support, bit 11 is reserved. I think the patch is good. Once someone adds cascading support we can expose and implement the cascading bit + the necessary additional regs. Cheers, Edgar