From mboxrd@z Thu Jan 1 00:00:00 1970 From: gregory.clement@free-electrons.com (Gregory CLEMENT) Date: Thu, 13 Feb 2014 18:33:33 +0100 Subject: [PATCH v4 10/13] ARM: mvebu: Set the start address of a CPU in a separate function In-Reply-To: <1392312816-17657-1-git-send-email-gregory.clement@free-electrons.com> References: <1392312816-17657-1-git-send-email-gregory.clement@free-electrons.com> Message-ID: <1392312816-17657-11-git-send-email-gregory.clement@free-electrons.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Setting the start (or boot) address of A CPU is no more used only during SMP bring up, but will also be used by the CPU idle functions or later by the CPU hot plug ones. This commit moves it in a separate function. Signed-off-by: Gregory CLEMENT --- arch/arm/mach-mvebu/pmsu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c index ec745d59fea8..162ae1399f2a 100644 --- a/arch/arm/mach-mvebu/pmsu.c +++ b/arch/arm/mach-mvebu/pmsu.c @@ -61,6 +61,12 @@ static struct of_device_id of_pmsu_table[] = { { /* end of list */ }, }; +static void armada_370_xp_pmsu_set_start_addr(void *start_addr, int hw_cpu) +{ + writel(virt_to_phys(start_addr), pmsu_mp_base + + PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu)); +} + #ifdef CONFIG_SMP int armada_xp_boot_cpu(unsigned int cpu_id, void *boot_addr) { @@ -73,8 +79,7 @@ int armada_xp_boot_cpu(unsigned int cpu_id, void *boot_addr) hw_cpu = cpu_logical_map(cpu_id); - writel(virt_to_phys(boot_addr), pmsu_mp_base + - PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu)); + armada_370_xp_pmsu_set_start_addr(boot_addr, hw_cpu); /* Release CPU from reset by clearing reset bit*/ reg = readl(pmsu_reset_base + PMSU_RESET_CTL_OFFSET(hw_cpu)); -- 1.8.1.2