From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen/arm: Set up Versatile Express timer frequency to 24 Mhz Date: Wed, 26 Jun 2013 12:10:59 +0100 Message-ID: <51CACC43.6020708@linaro.org> References: <1372079458-7884-1-git-send-email-julien.grall@linaro.org> <20130624135133.GA93536@ocelot.phlegethon.org> <1372174264.18901.46.camel@zakaz.uk.xensource.com> <51C9BB38.3000805@linaro.org> <20130626083110.GA18887@ocelot.phlegethon.org> <20130626105233.GB18887@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130626105233.GB18887@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: Xen Devel , Sengul Thomas , Ian Campbell , patches@linaro.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 06/26/2013 11:52 AM, Tim Deegan wrote: > At 11:24 +0100 on 26 Jun (1372245863), Stefano Stabellini wrote: >> On Wed, 26 Jun 2013, Tim Deegan wrote: >>> At 09:05 +0900 on 26 Jun (1372237555), Sengul Thomas wrote: >>>>> >>>>> Timers on ARM seems a bit complex. The current issue is with arch timer >>>>> (which is also used by dom0). >>>> >>>> Just out of curiosity, what is the difference between arch timer and >>>> platform timer? >>> >>> The arch timer has its interface specified in the CPU manual and >>> required (IIRC) for any processor that supports the virt extensions. >>> The platform timers are whatever other time sources come on the SoC >>> you're running on. >>> >>> Having thought about this a bit, ISTR that the register in Julien's >>> patch doesn't control anything -- it's there to tell the arch timer's >>> users how fast that timer is going, so it ought to be set up by whatever >>> sets up the timer itself (turning on oscillators &c). >>> >>> So the right thing to do is to move that write into more board-specific >>> start-of-day code (and eventually into the boot-wrapper), and rely on >>> the bootloader/firmware to have done it in the general case. >> >> I think that you are right >> >> >>> On a real >>> TC2 is that register already correct at (xen's) boot time? >>> >>> But presumably just changing it from 100KHz to 24KHz for all vexpresses >>> is wrong because that will break things on the software models in the >>> opposite way. >> >> I think we should read CNTFRQ at boot time rather than trying to write >> it. We should be able to cope with whatever frequency has been setup by >> the firmware, right? > > Yes -- in the case where the firmware has done it, we should be reading > this register rather than writing it. Xen already reads the timer frequency in arm/time.c. > On the software VE model the code was developed on, there is no firmware > and so Xen has to set this up along with the other things that we'd > expect firmware to do. So we can move that write to the start-fo-day > board-specific asm hacks, and the actual driver code can just read it. Is it possible to start to use u-boot on the VE model? So we can remove the code which set up the timer freqency. -- Julien