From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750944AbdCNInW (ORCPT ); Tue, 14 Mar 2017 04:43:22 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:51759 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbdCNInV (ORCPT ); Tue, 14 Mar 2017 04:43:21 -0400 X-AuditID: b6c32a2e-f79d66d0000012ad-a5-58c7ad260b5a Subject: Re: [2/3] soc: samsung: Do not build ARMv7 PMU drivers on ARMv8 To: Krzysztof Kozlowski Cc: Catalin Marinas , Will Deacon , Kukjin Kim , Javier Martinez Canillas , Arnd Bergmann , Kevin Hilman , Olof Johansson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org From: Alim Akhtar Message-id: <0ae4c538-a3af-a1b7-418d-4bccbf09faf4@samsung.com> Date: Tue, 14 Mar 2017 14:10:02 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-version: 1.0 In-reply-to: Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SaUgUYRjHeWdmZ8attdfV7MHAYMtKKw/yGLBsiYIBv9iXEJFqzUElj21H Le1DmqVmikeERyLmEWkrympeSHmmhqCUF4hWKJLHekalZubuaPnt9/8/z5/3/8DLkspWmR0b Fhkt6CI14SpaTtV3OJ48c7yq298134C5zZz3DLf4Mh1x80Y9wWVOzpHcWkodwfX31zCcYXJY xn1qLqS5vP63BPdhZJXmZpZ7KPU+Xl+kR/zGeg7iF0cfMbyh8jHN15bd5wd7Hsj4usxxhl81 2PuxAfJzwUJ4WKygc/G5IQ+tfbVOacdd73YMjKEEtOyQhixYwO7wZqwGSWwLAxPVdBqSs0pc juDZ59wdsYJguDWL/Cdmt5KI3XhXSx8hDZoQDGT0ySRhRLBV1cGkIZa1xj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+dwzyBUWgWkpZZSMpmISlbwMi8ilE0taA4Nz23 uMBIrzgxt7g0L10vOT93EyM4trSSdjBumhF+iFGAg1GJh7dA5XiEEGtiWXFl7iFGCQ5mJRHe vyuBQrwpiZVVqUX58UWlOanFhxilOViUxHm3V2+IEBJITyxJzU5NLUgtgskycXBKNTCa7b68 j/vY9Dm3fU2r4+dfyXwjzHjzTcQhifV+GTNYzFnPfFl9UPp3XWH6RG/37cWL+Vq3/5Vst55e Yr4oNoXxsu0Mq+kKk65zfWtUEnWPuJjZuk9Zq4Wjf1Pe7pALc3+phrw+YL/KfN4dkdmMM3ck lLQqpLkfce+o++h5wF+0t3DGlL6IubZKLMUZiYZazEXFiQAA6YIhqQIAAA== X-CMS-MailID: 20170314084317epcas5p2a86821030a6a60b2db27ec52e79dccd4 X-Msg-Generator: CA X-Sender-IP: 182.195.40.13 X-Local-Sender: =?UTF-8?B?7JWM66a8G1NTSVItVHVybiBLZXkgU29sdXRpb25zG+yCvA==?= =?UTF-8?B?7ISx7KCE7J6QGy4vU2VuaW9yIENoaWVmIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?QUxJTSBBS0hUQVIbU1NJUi1UdXJuIEtleSBTb2x1dGlvbnMb?= =?UTF-8?B?U2Ftc3VuZyBFbGVjdHJvbmljcxsuL1NlbmlvciBDaGllZiBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1NXQUhRG0MxMElEMDdJRDAxMDk5Nw==?= Content-type: text/plain; charset=utf-8 X-MTR: 20170314084317epcas5p2a86821030a6a60b2db27ec52e79dccd4 X-EPHeader: CA CMS-TYPE: 105P X-Auth-Email: alim.akhtar@samsung.com X-HopCount: 7 X-CMS-RootMailID: 20170314075427epcas5p19d137fbcc390e937172a17ae99f11a0c X-RootMTR: 20170314075427epcas5p19d137fbcc390e937172a17ae99f11a0c References: <20170311213856.21701-3-krzk@kernel.org> <2da8c346-dae9-6754-8349-df0946c89ae2@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/14/2017 01:32 PM, Krzysztof Kozlowski wrote: > On Tue, Mar 14, 2017 at 9:51 AM, Alim Akhtar wrote: >> Hi Krzysztof, >> >> On 03/12/2017 03:08 AM, Krzysztof Kozlowski wrote: >>> The Exynos Power Management Unit (PMU) drivers contain quite large >>> static arrays of register values necessary for given Exynos SoC to enter >>> low power mode. All this data is useless for ARMv8 SoC like >>> Exynos5433, because the image will not be shared between ARMv7 and >>> ARMv8. >>> >>> Add additional Kconfig symbol for selecting the SoC-specific driver >>> addons thus skipping the useless data in the final image (this is >>> similar approach to chosen for Exynos clock controller drivers): >>> - exynos-pmu driver will be compiled on both architectures ARMv7 >>> and ARMv8, >>> - additional driver_data for ARMv7 SoCs will not be built on ARMv8 >>> and a macro will return NULL for them in of_device_id - this should >>> be safe as these compatibles cannot match on ARMv7 and driver >>> anyway handles NULL driver_data, >>> - on ARMv8 compile only exynos-pmu driver which exposes the >>> syscon-regmap for PMU address space. >>> >>> Signed-off-by: Krzysztof Kozlowski >>> --- >>> drivers/soc/samsung/Kconfig | 8 +++++++- >>> drivers/soc/samsung/Makefile | 4 +++- >>> drivers/soc/samsung/exynos-pmu.c | 22 ++++++++++++++++------ >>> drivers/soc/samsung/exynos-pmu.h | 3 +++ >>> 4 files changed, 29 insertions(+), 8 deletions(-) >>> >>> diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig >>> index 245533907d1b..8b25bd55e648 100644 >>> --- a/drivers/soc/samsung/Kconfig >>> +++ b/drivers/soc/samsung/Kconfig >>> @@ -8,7 +8,13 @@ if SOC_SAMSUNG >>> >>> config EXYNOS_PMU >>> bool "Exynos PMU controller driver" if COMPILE_TEST >>> - depends on (ARM && ARCH_EXYNOS) || ((ARM || ARM64) && COMPILE_TEST) >>> + depends on ARCH_EXYNOS || ((ARM || ARM64) && COMPILE_TEST) >>> + select EXYNOS_PMU_ARM_DRIVERS if ARM && ARCH_EXYNOS >>> + >> >> In general this patch look ok, but I was think we should make these >> configs configurable via _menuconfig_. Currently these are visible only >> if COMPILE_TEST is enabled. >> Recently I was working on adding PMU support for Exynos7 and I face >> issues when I want to disable this option and re-enable it for testing >> purpose. > > These drivers are not available in menuconfig on purpose - these are > essential parts of SoC. Without them usually something will not work > so user should not be able to disable them. For all of such drivers, > we use the SELECT from mach approach. > Well, what you are saying is very subjective. In past I have face issues where to isolate or narrow down some issue, we do need to play with PMU and power domains. So, having a configurable option won't hurt here. Anyway if you (or anyone else) strongly feel we should be following "SELECT from MACH approach" then lets follow it. >>> +# There is no need to enable these drivers for ARMv8 >>> +config EXYNOS_PMU_ARM_DRIVERS >>> + bool "Exynos PMU ARMv7-specific driver extensions" if COMPILE_TEST >>> + depends on EXYNOS_PMU >>> >>> config EXYNOS_PM_DOMAINS >>> bool "Exynos PM domains" if COMPILE_TEST >>> diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile >>> index 3619f2ecddaa..4d7694a4e7a4 100644 >>> --- a/drivers/soc/samsung/Makefile >>> +++ b/drivers/soc/samsung/Makefile >>> @@ -1,3 +1,5 @@ >>> -obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o exynos3250-pmu.o exynos4-pmu.o \ >>> +obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o >>> + >>> +obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \ >>> exynos5250-pmu.o exynos5420-pmu.o >>> obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o >>> diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c >>> index 56d9244ff981..bd4a76f27bc2 100644 >>> --- a/drivers/soc/samsung/exynos-pmu.c >>> +++ b/drivers/soc/samsung/exynos-pmu.c >>> @@ -69,27 +69,37 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) >>> } >>> >>> /* >>> + * Split the data between ARM architectures because it is relatively big >>> + * and useless on other arch. >>> + */ >>> +#ifdef CONFIG_EXYNOS_PMU_ARM_DRIVERS >>> +#define exynos_pmu_data_arm_ptr(data) (&data) >>> +#else >>> +#define exynos_pmu_data_arm_ptr(data) NULL >>> +#endif >>> + >>> +/* >>> * PMU platform driver and devicetree bindings. >>> */ >>> static const struct of_device_id exynos_pmu_of_device_ids[] = { >>> { >>> .compatible = "samsung,exynos3250-pmu", >>> - .data = &exynos3250_pmu_data, >>> + .data = exynos_pmu_data_arm_ptr(exynos3250_pmu_data), >>> }, { >>> .compatible = "samsung,exynos4210-pmu", >>> - .data = &exynos4210_pmu_data, >>> + .data = exynos_pmu_data_arm_ptr(exynos4210_pmu_data), >>> }, { >>> .compatible = "samsung,exynos4212-pmu", >>> - .data = &exynos4212_pmu_data, >>> + .data = exynos_pmu_data_arm_ptr(exynos4212_pmu_data), >>> }, { >>> .compatible = "samsung,exynos4412-pmu", >>> - .data = &exynos4412_pmu_data, >>> + .data = exynos_pmu_data_arm_ptr(exynos4412_pmu_data), >>> }, { >>> .compatible = "samsung,exynos5250-pmu", >>> - .data = &exynos5250_pmu_data, >>> + .data = exynos_pmu_data_arm_ptr(exynos5250_pmu_data), >>> }, { >>> .compatible = "samsung,exynos5420-pmu", >>> - .data = &exynos5420_pmu_data, >>> + .data = exynos_pmu_data_arm_ptr(exynos5420_pmu_data), >>> }, { >>> .compatible = "samsung,exynos5433-pmu", >> So, as I understand, the idea here to use something like >> .data = &exynos5433_pmu_data or so in case ARMv8? > > In the future, yes. Now there is no low power mode support for > Exynos5433 so the data is left empty. > Ok, this is fine. > Best regards, > Krzysztof > > >