OSDN Git Service

ARM: kernel: add cpu logical map DT init in setup_arch
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 14 Dec 2011 16:01:24 +0000 (16:01 +0000)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 19 Nov 2012 15:44:34 +0000 (15:44 +0000)
commit5587164eea4aad88fcb79d9b21dc8f14fea598cd
treefbfd148020ee0b4292a637af68165dc2b9e1b9e1
parenta0ae02405076ac32bd17ece976e914b5b6075bb0
ARM: kernel: add cpu logical map DT init in setup_arch

As soon as the device tree is unflattened the cpu logical to physical
mapping is carried out in setup_arch to build a proper array of MPIDR and
corresponding logical indexes.

The mapping could have been carried out using the flattened DT blob and
related primitives, but since the mapping is not needed by early boot
code it can safely be executed when the device tree has been uncompressed to
its tree data structure.

This patch adds the arm_dt_init_cpu maps() function call in setup_arch().

If the kernel is not compiled with DT support the function is empty and
no logical mapping takes place through it; the mapping carried out in
smp_setup_processor_id() is left unchanged.
If DT is supported the mapping created in smp_setup_processor_id() is overriden.
The DT mapping also sets the possible cpus mask, hence platform
code need not set it again in the respective smp_init_cpus() functions.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
arch/arm/kernel/setup.c