No subject


Wed Jun 1 12:03:18 EDT 2011


working with) flushes on disable.  I had a problem where reads with
the cache disabled were getting incorrect data because the data was
stuck in the cache.  With the CPU paused, I disabled the PL310 with
the L2X0_CTRL register, and my data appeared in memory.  I'll try to
find some documentation to support this.

Otherwise, wouldn't a flush_cache_all() and l2x0_flush_all() in
l2x0_disable() ensure the stack lines were flushed out?  Probably
needs a readl_releaxed as well, to ensure the disable has taken
effect.

>>
>> -void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask=
)
>> +void l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
>> =A0{
>> =A0 =A0 =A0 __u32 aux;
>> =A0 =A0 =A0 __u32 cache_id;
>> @@ -340,7 +350,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_=
val, __u32 aux_mask)
>> =A0 =A0 =A0 outer_cache.disable =3D l2x0_disable;
>> =A0 =A0 =A0 outer_cache.set_debug =3D l2x0_set_debug;
>>
>> - =A0 =A0 printk(KERN_INFO "%s cache controller enabled\n", type);
>> - =A0 =A0 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%=
08x, Cache size: %d B\n",
>> + =A0 =A0 pr_info_once("%s cache controller enabled\n", type);
>> + =A0 =A0 pr_info_once("l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x,=
 Cache size: %d B\n",
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ways, cache_id, aux, l2x0_si=
ze);
>> =A0}
>
> We might still need hooks to save/restore PL310 context since registers
> like tag and data RAM control are gone on reset. Furthermore, on L2 RAM
> retention we want to reinit L2 without having to invalidate L2 RAM(s),
> which means we cannot use l2x0_init as it is. I added a couple of hooks t=
o
> outer_cache in order to carry out this task, patch coming.

I'm assuming that every platform has a function to set up the tag ram
control the way they want them, which then calls l2x0_init.  That
platform cache init function can be called instead of directly calling
l2x0_init from the resume path.

Calling l2x0_enable instead of l2x0_init solves the retention problem.

> Lorenzo
>
>



More information about the linux-arm-kernel mailing list