metag: smp: copy cache partition and enable GCOn
commit9e7129630329d50b8e8c3403bb71c85a7c3cbe35
authorJames Hogan <james.hogan@imgtec.com>
Thu, 7 Mar 2013 17:20:53 +0000 (7 17:20 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 15 Mar 2013 13:21:17 +0000 (15 13:21 +0000)
treef925f533798f07d975abebb2c27df4380ad12afd
parent00e6c92304ce38ff48029471c929d31a25e5cf10
metag: smp: copy cache partition and enable GCOn

When starting an SMP hardware thread, copy the cache partition
configuration so that the threads share the same cache partitions. Also
enable the GCOn bit if running in the local half of the virtual address
space to enable coherency of shared local cache partitions. An atomic
unlock system event is executed by the new cpu before any memory is read
to ensure that any writes made by the boot cpu prior to full coherency
taking effect are visible to the new cpu.

This is to allow SMP to work even when the bootloader hasn't configured
the caches for coherency. A log message is printed to describe the cache
partition changes so that the user is aware of potential unintentional
cache wastage if they've configured the cache partitions in the wrong
way.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
arch/metag/include/asm/metag_mem.h
arch/metag/kernel/head.S
arch/metag/kernel/smp.c