]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: refactor of_get_cpu_node to support other architectures
authorSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Thu, 15 Aug 2013 12:34:18 +0000 (13:34 +0100)
committerSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Wed, 21 Aug 2013 09:24:38 +0000 (10:24 +0100)
commitf4ea6820515f38c4ab2c7b6e181af4558bfd9ec1
tree3be30cd02feff35df069b36af55b77c975282f8a
parentcd53f8b23b325eb467bc305b7c3b6828853b6297
powerpc: refactor of_get_cpu_node to support other architectures

Currently different drivers requiring to access cpu device node are
parsing the device tree themselves. Since the ordering in the DT need
not match the logical cpu ordering, the parsing logic needs to consider
that. However, this has resulted in lots of code duplication and in some
cases even incorrect logic.

It's better to consolidate them by adding support for getting cpu
device node for a given logical cpu index in DT core library. However
logical to physical index mapping can be architecture specific.

PowerPC has it's own implementation to get the cpu node for a given
logical index.

This patch refactors the current implementation of of_get_cpu_node.
This in preparation to move the implementation to DT core library.
It separates out the logical to physical mapping so that a default
matching of the physical id to the logical cpu index can be added
when moved to common code. Architecture specific code can override it.

Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Grant Likely <grant.likely@linaro.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
arch/powerpc/kernel/prom.c