From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Pitre Subject: Re: [PATCH v3 3/5] ARM: kernel: add cpu logical map DT init in setup_arch Date: Sun, 18 Nov 2012 22:14:07 -0500 (EST) Message-ID: References: <1352983614-22924-1-git-send-email-lorenzo.pieralisi@arm.com> <1352983614-22924-4-git-send-email-lorenzo.pieralisi@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1352983614-22924-4-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Lorenzo Pieralisi Cc: Kukjin Kim , Russell King , Pawel Moll , Catalin Marinas , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Will Deacon , Amit Kucheria , Rob Herring , David Brown , Magnus Damm , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Thu, 15 Nov 2012, Lorenzo Pieralisi wrote: > 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 > Acked-by: Will Deacon Acked-by: Nicolas Pitre > --- > arch/arm/kernel/setup.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > index d0df6c8..7352073 100644 > --- a/arch/arm/kernel/setup.c > +++ b/arch/arm/kernel/setup.c > @@ -759,6 +759,7 @@ void __init setup_arch(char **cmdline_p) > > unflatten_device_tree(); > > + arm_dt_init_cpu_maps(); > #ifdef CONFIG_SMP > if (is_smp()) { > smp_set_ops(mdesc->smp); > -- > 1.7.12 > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: nicolas.pitre@linaro.org (Nicolas Pitre) Date: Sun, 18 Nov 2012 22:14:07 -0500 (EST) Subject: [PATCH v3 3/5] ARM: kernel: add cpu logical map DT init in setup_arch In-Reply-To: <1352983614-22924-4-git-send-email-lorenzo.pieralisi@arm.com> References: <1352983614-22924-1-git-send-email-lorenzo.pieralisi@arm.com> <1352983614-22924-4-git-send-email-lorenzo.pieralisi@arm.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, 15 Nov 2012, Lorenzo Pieralisi wrote: > 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 > Acked-by: Will Deacon Acked-by: Nicolas Pitre > --- > arch/arm/kernel/setup.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > index d0df6c8..7352073 100644 > --- a/arch/arm/kernel/setup.c > +++ b/arch/arm/kernel/setup.c > @@ -759,6 +759,7 @@ void __init setup_arch(char **cmdline_p) > > unflatten_device_tree(); > > + arm_dt_init_cpu_maps(); > #ifdef CONFIG_SMP > if (is_smp()) { > smp_set_ops(mdesc->smp); > -- > 1.7.12 > >