powerpc/ppc64: adapt arm's setup

Copy arm's setup code (also DT based) over to powerpc, adapting
it a bit. Also bring over arm's setup selftest, giving powerpc
its first test.

The largest change from arm's setup.c is that instead of using a
hardcoded SMP_CACHE_BYTES, cpu_set() is extended to extract the
icache and dcache line sizes from the cpu DT nodes. That change
also requires that we call cpu_init() before mem_init() in setup().

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
6 files changed