From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v1 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform Date: Fri, 16 Jan 2015 19:34:29 +0000 Message-ID: <54B967C5.5010903@linaro.org> References: <1421412610-19313-1-git-send-email-oiurii.konovalenko@globallogic.com> <1421412610-19313-4-git-send-email-oiurii.konovalenko@globallogic.com> <54B91B56.1060206@linaro.org> <54B92F23.7060507@linaro.org> <54B93CE6.1080106@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Iurii Konovalenko Cc: Oleksandr Tyshchenko , Stefano Stabellini , tim@xen.org, Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 16/01/15 19:11, Iurii Konovalenko wrote: > On Fri, Jan 16, 2015 at 6:31 PM, Julien Grall wrote: >> >> On 16/01/15 16:17, Iurii Konovalenko wrote: >>> I tried to add instruction: asm volatile("mcr p15, 0, %0, c14, c0, 0" : >>> : "r" (freq)); >>> Also I tried to write it via Xen API: WRITE_SYSREG32(freq, CNTFRQ_EL0); >>> >>> But unfortunately Xen fails on both this instructions with "Undefined >>> instruction" exception. >>> You can see log in attachment. >>> Could you please suggest reason, why it happens? >> >> CNTFRQ can only be written in Secure PL1 mode. >> >> I have the feeling CNTFRQ is not update automatically when Xen is >> writing in CNTFID0. So the frequency may mismatch. >> >> Assuming this, I'm wondering if we hit the second part of the if >> sentence [1] and therefore this code useful? >> > > Now I understand it. > So I will set up frequency and enable timer in u-boot. > As there is no way to change frequency in Hypervisor mode, I will > remove from board file mode checking and frequency related staff. > So time init function is like: > > static int __init shmobile_init_time(void) > { > void __iomem *tmu; > > /* Remap "armgcnt address map" space */ > tmu = ioremap_nocache(SHMOBILE_ARCH_TIMER_BASE, PAGE_SIZE); > if ( !tmu ) > { > dprintk(XENLOG_ERR, "Unable to map TMU\n"); > return -ENOMEM; > } > /* Enable the timer if it is not running */ > if ( (readl_relaxed(tmu + SHMOBILE_ARCH_TIMER_CNTCR) & 1) == 0 ) > writel_relaxed(1, tmu + SHMOBILE_ARCH_TIMER_CNTCR); > > iounmap(tmu); > > return 0; > } > > Am I right? While you are modifying U-boot, can you also enable the timer? It would avoid to do specific timer initialization for this board. >> BWT I see in the log: >> >> (XEN) /psci method must be smc, but is: "hvc" >> >> Does it mean your platform support PSCI? Or did you add the PSCI node >> for DOM0? > > I added PSCI node to dom0 Device Tree: > psci { > compatible = "arm,psci"; > method = "hvc"; > cpu_on = <2>; > }; You don't need to add it. Xen will create the PSCI node for DOM0 during the domain building. Regards, -- Julien Grall