From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755065AbbCRPVl (ORCPT ); Wed, 18 Mar 2015 11:21:41 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:54055 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752088AbbCRPVh (ORCPT ); Wed, 18 Mar 2015 11:21:37 -0400 MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 X-AuditID: cbfec7f4-b7f126d000001e9a-9d-5509976d4078 Content-transfer-encoding: 8BIT Message-id: <1426692093.23982.4.camel@AMDC1943> Subject: Re: [PATCH v2 4/5] ARM: EXYNOS: add exynos_get_boot_addr() helper From: Krzysztof Kozlowski To: Bartlomiej Zolnierkiewicz Cc: Kukjin Kim , Kukjin Kim , Daniel Lezcano , Tomasz Figa , Colin Cross , Kyungmin Park , Marek Szyprowski , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King Date: Wed, 18 Mar 2015 16:21:33 +0100 In-reply-to: <1554212.H7UVZkpb2L@amdc1032> References: <1426684197-22281-1-git-send-email-b.zolnierkie@samsung.com> <1426684197-22281-5-git-send-email-b.zolnierkie@samsung.com> <1554212.H7UVZkpb2L@amdc1032> X-Mailer: Evolution 3.10.4-0ubuntu2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsVy+t/xq7q50zlDDZ5fVbbYOGM9q8WCGe3M FvM+y1q8fmFo0bvgKptF/+PXzBZnm96wW1zeNYfN4nPvEUaLGef3MVmsPXKX3WLzh5dsFqt2 /WF04PVoae5h89g56y67x4JNpR6bVnWyedy5tofNo2/LKkaPz5vkAtijuGxSUnMyy1KL9O0S uDJmbfvLVnBXsWJn70uWBsaPEl2MnBwSAiYS05+1sUHYYhIX7q0Hsrk4hASWMkp8n76QFSTB KyAo8WPyPZYuRg4OZgF5iSOXskHCzALqEpPmLWKGqP/MKPHmzQw2iHp9if8t58FsYQEviS8P 37CA2GwCxhKbly8Bi4sIWEisXfGWBaSZWWARs8TmV/fAEiwCqhKb17eCNXAKaEmcv7OKFWLD O0aJI+vfMYFcISGgLNHY7zaBUWAWkvtmIdw3C8l9CxiZVzGKppYmFxQnpeca6hUn5haX5qXr JefnbmKExMuXHYyLj1kdYhTgYFTi4XX4wREqxJpYVlyZe4hRgoNZSYS3upEzVIg3JbGyKrUo P76oNCe1+BAjEwenVANj/qYAXQeBeua9p+N02jw+K1l9/Oc57+PB1paq6+cXPd+W1CrCuuV9 +ZVPytuWh5xPmP7565VrB25FyonnlDjHXTNesOSPh9GUU9OSPv5+daykd457fPTleSK7FVZd SG6Z98X61EcOozWx3vHKqz7rrH4jYfj2TsLK44e3GS7LyL5Zyi8RdeLADSWW4oxEQy3mouJE ALijN3F1AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On śro, 2015-03-18 at 16:18 +0100, Bartlomiej Zolnierkiewicz wrote: > On Wednesday, March 18, 2015 02:43:49 PM Krzysztof Kozlowski wrote: > > 2015-03-18 14:09 GMT+01:00 Bartlomiej Zolnierkiewicz : > > > Add get_cpu_boot_addr() firmware operation and then > > > exynos_get_boot_addr() helper. > > > > > > This is a preparation for adding coupled cpuidle support > > > for Exynos3250 SoC. > > > > > > There should be no functional changes caused by this patch. > > > > > > Cc: Daniel Lezcano > > > Cc: Russell King > > > Signed-off-by: Bartlomiej Zolnierkiewicz > > > --- > > > arch/arm/include/asm/firmware.h | 4 ++++ > > > arch/arm/mach-exynos/firmware.c | 17 +++++++++++++++++ > > > arch/arm/mach-exynos/platsmp.c | 25 +++++++++++++++++++++++++ > > > 3 files changed, 46 insertions(+) > > > > > > diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h > > > index 89aefe1..34c1d96 100644 > > > --- a/arch/arm/include/asm/firmware.h > > > +++ b/arch/arm/include/asm/firmware.h > > > @@ -34,6 +34,10 @@ struct firmware_ops { > > > */ > > > int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr); > > > /* > > > + * Gets boot address of specified physical CPU > > > + */ > > > + int (*get_cpu_boot_addr)(int cpu, unsigned long *boot_addr); > > > + /* > > > * Boots specified physical CPU > > > */ > > > int (*cpu_boot)(int cpu); > > > diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c > > > index f236877..c9e4481 100644 > > > --- a/arch/arm/mach-exynos/firmware.c > > > +++ b/arch/arm/mach-exynos/firmware.c > > > @@ -104,6 +104,22 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr) > > > return 0; > > > } > > > > > > +static int exynos_get_cpu_boot_addr(int cpu, unsigned long *boot_addr) > > > +{ > > > + void __iomem *boot_reg; > > > + > > > + if (!sysram_ns_base_addr) > > > + return -ENODEV; > > > + > > > + boot_reg = sysram_ns_base_addr + 0x1c; > > > + > > > + if (soc_is_exynos4412()) > > > + boot_reg += 4 * cpu; > > > + > > > + *boot_addr = __raw_readl(boot_reg); > > > + return 0; > > > +} > > > + > > > static int exynos_cpu_suspend(unsigned long arg) > > > { > > > flush_cache_all(); > > > @@ -138,6 +154,7 @@ static int exynos_resume(void) > > > static const struct firmware_ops exynos_firmware_ops = { > > > .do_idle = IS_ENABLED(CONFIG_EXYNOS_CPU_SUSPEND) ? exynos_do_idle : NULL, > > > .set_cpu_boot_addr = exynos_set_cpu_boot_addr, > > > + .get_cpu_boot_addr = exynos_get_cpu_boot_addr, > > > .cpu_boot = exynos_cpu_boot, > > > .suspend = IS_ENABLED(CONFIG_PM_SLEEP) ? exynos_suspend : NULL, > > > .resume = IS_ENABLED(CONFIG_EXYNOS_CPU_SUSPEND) ? exynos_resume : NULL, > > > diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c > > > index b7cfcdc..449edd1 100644 > > > --- a/arch/arm/mach-exynos/platsmp.c > > > +++ b/arch/arm/mach-exynos/platsmp.c > > > @@ -272,6 +272,31 @@ fail: > > > return ret; > > > } > > > > > > +static int exynos_get_boot_addr(u32 core_id, unsigned long *boot_addr) > > > +{ > > > + int ret; > > > + > > > + /* > > > + * Try to get boot address using firmware first > > > + * and fall back to boot register if it fails. > > > + */ > > > + ret = call_firmware_op(get_cpu_boot_addr, core_id, boot_addr); > > > + if (ret && ret != -ENOSYS) > > > + goto fail; > > > > The exynos_get_cpu_boot_addr() returns ENODEV. Do you really want to > > check for ENOSYS here? > > Yes. When secure firmware is not present on the board the call_firmware_op() > itself returns -ENOSYS (exynos_get_cpu_boot_addr() is not called in this > case) and it needs to be handled in a special way. Right, my mistake. Rest looks good: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof