[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v1 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform



On 16/01/15 19:11, Iurii Konovalenko wrote:
> On Fri, Jan 16, 2015 at 6:31 PM, Julien Grall <julien.grall@xxxxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.