Received: from eggs.gnu.org ([2001:4830:134:3::10]:58316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7L9-000503-CU for qemu-devel@nongnu.org; Wed, 17 Aug 2016 16:21:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ba7L5-0005pi-BV for qemu-devel@nongnu.org; Wed, 17 Aug 2016 16:21:31 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:35397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7L5-0005oD-4U for qemu-devel@nongnu.org; Wed, 17 Aug 2016 16:21:27 -0400 References: <1469708878-9453-1-git-send-email-marex@denx.de> <1469708878-9453-5-git-send-email-marex@denx.de> <8441a477-57c4-7deb-6531-98ab125cc3b3@gmail.com> <40332f61-6523-9c59-6c35-ed59aeb6fef4@denx.de> <7e76da71-3037-bb9b-dfaf-2146a0a465b0@denx.de> <4123941b-73a0-fec3-4af8-ada701832f48@gmail.com> From: Marek Vasut Message-ID: <0f952ce0-e9f3-5335-4fcc-899cb6f70ad0@denx.de> Date: Wed, 17 Aug 2016 22:19:47 +0200 MIME-Version: 1.0 In-Reply-To: <4123941b-73a0-fec3-4af8-ada701832f48@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/7] nios2: Add periodic timer emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Osipenko , qemu-devel@nongnu.org Cc: Jeff Da Silva , Chris Wulff , Sandra Loosemore , Yves Vandervennet , Ley Foon Tan , Juro Bystricky On 08/16/2016 11:38 PM, Dmitry Osipenko wrote: [...] >>>> Well what is sane clock frequency for hardware which can have arbitrary >>>> frequency configured in ? >>>> >>> >>> You could set to the one that is used by "10M50 GHRD" patch for example. >> >> That doesn't sound right . I can set it to 1 (Hz) , that should make it >> slow enough to signalize that something is broken while providing valid >> number. >> > > I'm not sure about it. Explicitly showing that something is wrong would be better. > >> +static void altera_timer_realize(DeviceState *dev, Error **errp) >> +{ >> + AlteraTimer *t = ALTERA_TIMER(dev); >> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); >> + >> + assert(t->freq_hz != 0); > > If you would prefer to keep error'ing out, then I can suggest to add some > verbose message instead of the assertion, like: > > if (!t->freq_hz) { > error_setg(errp, "altera_timer: \"clock-frequency\" property " \ > "must be provided"); > return; > } That's better, thanks. btw breaking strings is frowned upon in linux/u-boot as it makes it impossible to git grep for error message. Does the same apply to qemu? >>>>>> For the IIC, I wonder what that'd look like -- probably >>>>>> qemu_set_irq(parent, 0); ? >>>>>> >>>>> >>>>> No, IRQ's would be "deasserted" by resetting CPUClass state, of which QEMU takes >>>>> care itself. No action needed by the IIC. >>>> >>>> I see, thanks :) >>>> >>>> btw any chance someone can look at the other patches too ? >>>> >>>> >>> >>> >> >> > > -- Best regards, Marek Vasut