Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753266AbeAJXvp (ORCPT + 1 other); Wed, 10 Jan 2018 18:51:45 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:50742 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752880AbeAJXvl (ORCPT ); Wed, 10 Jan 2018 18:51:41 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180110235139epoutp02e73939c46f35a47454f557cd53e13df6~Il_iHdisg1412614126epoutp02f X-AuditID: b6c32a35-c51ff700000010dd-e9-5a56a70a00c9 MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="utf-8" Message-id: <5A56A70A.2020104@samsung.com> Date: Thu, 11 Jan 2018 08:51:38 +0900 From: Chanwoo Choi Organization: Samsung Electronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Sudeep Holla Cc: krzk@kernel.org, m.szyprowski@samsung.com, s.nawrocki@samsung.com, kgene@kernel.org, tomasz.figa@gmail.com, chanwoo@kernel.org, jh80.chung@samsung.com, inki.dae@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jonghwa Lee Subject: Re: [PATCH 3/9] soc: samsung: pmu: Add the PMU data of exynos5433 to support low-power state In-reply-to: <0adffb4c-019f-a637-881c-d919c67cdbcf@arm.com> X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+3Z2tmM1+5pdvoxsHQrJcO4sL8fKspIYZDQpolaxTnrYzF3k nE00goRKa93WhbTRzW6r2UWWlTOyMEMInVSmdtEoKyrDAi0rDDpnp6j/3u95f8/H+z68BKY+ rYgl8h0ulnMwNlIxUn7j3kxd4ij/KpNu9ytAH+hql9Mnm8I4ffClV053/SzD6V2tbzB6f28f Rre11SjpYG8HTj+uP6agK9saZPTlpm4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o/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI 3y6BK2P5l+WsBdP0KrpW3GVuYFyu2sXIySEhYCJx49w1NhBbSGAdo8S/T+UgNq+AoMSPyfdY uhg5OJgF5CWOXMqGMNUlpkzJ7WLkAqp+wChxfOdpRohyLYl3e1ezgtSwCKhKfPjuCxJmAwrv f3EDbDq/gKLE1R+PGUFKRAUiJLpPVIKERYAmLjm7hRFkJLPAUyaJyd8WMYMkhAXSJV6eW8wM sesKk8Sr+U9ZQBKcAtYSO1ceZ5/AKDALyaWzEC6dhXDpAkbmVYySqQXFuem5xUYFhnmp5XrF ibnFpXnpesn5uZsYgTGz7bBW3w7G+0viDzEKcDAq8fBGiIZFCbEmlhVX5h5ilOBgVhLhXRwI FOJNSaysSi3Kjy8qzUktPsQozcGiJM57O+9YpJBAemJJanZqakFqEUyWiYNTqoExI94r9+z6 4m0rvNvZZ11j2LRjkqnkP9FZR+TPB9dMdvQPa8+pXvx4w7YVYubM91rnH1YLMnEw/cz/+QmP /DfzN9bljyvmF3999uLZxIJjz7uvL066w5g/W6Btc6yGh0lN11xl36nOS/aGPCysWGW/s721 8WH3+g9/r+6dtJv/XsXpPpUsyyu/lViKMxINtZiLihMB95KTOpUCAAA= X-CMS-MailID: 20180110235138epcas1p2018b2d74ab03a803edcf5910f444fe1b X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180109075905epcas1p321b8898a0d45287d63364e1aa768fdab X-RootMTR: 20180109075905epcas1p321b8898a0d45287d63364e1aa768fdab References: <1515484746-10656-1-git-send-email-cw00.choi@samsung.com> <1515484746-10656-4-git-send-email-cw00.choi@samsung.com> <5A557078.50101@samsung.com> <0adffb4c-019f-a637-881c-d919c67cdbcf@arm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 2018년 01월 10일 19:53, Sudeep Holla wrote: > > > On 10/01/18 01:46, Chanwoo Choi wrote: >> On 2018년 01월 09일 23:11, Sudeep Holla wrote: >>> >>> >>> On 09/01/18 07:59, Chanwoo Choi wrote: >>>> This patch adds the PMU (Power Management Unit) data of exynos5433 SoC >>>> in order to support the various power modes. Each power mode has >>>> the different value for reducing the power-consumption. >>>> >>>> Signed-off-by: Jonghwa Lee >>>> Signed-off-by: Chanwoo Choi >>>> --- >>>> arch/arm/mach-exynos/common.h | 2 - >>>> drivers/soc/samsung/Makefile | 3 +- >>>> drivers/soc/samsung/exynos-pmu.c | 1 + >>>> drivers/soc/samsung/exynos-pmu.h | 2 + >>>> drivers/soc/samsung/exynos5433-pmu.c | 286 ++++++++++++++++++++++++++++ >>>> include/linux/soc/samsung/exynos-regs-pmu.h | 148 ++++++++++++++ >>>> 6 files changed, 439 insertions(+), 3 deletions(-) >>>> create mode 100644 drivers/soc/samsung/exynos5433-pmu.c >>>> >>> >>>> diff --git a/drivers/soc/samsung/exynos5433-pmu.c b/drivers/soc/samsung/exynos5433-pmu.c >>>> new file mode 100644 >>>> index 000000000000..2571e61522f0 >>>> --- /dev/null >>>> +++ b/drivers/soc/samsung/exynos5433-pmu.c >>>> @@ -0,0 +1,286 @@ >>>> +// SPDX-License-Identifier: GPL-2.0 >>>> +// >>>> +// Copyright (c) 2018 Samsung Electronics Co., Ltd. >>>> +// Copyright (c) Jonghwa Lee >>>> +// Copyright (c) Chanwoo Choi >>>> +// >>>> +// EXYNOS5433 - CPU PMU (Power Management Unit) support >>>> + >>>> +#include >>>> +#include >>>> + >>>> +#include "exynos-pmu.h" >>>> + >>>> +static struct exynos_pmu_conf exynos5433_pmu_config[] = { >>>> + /* { .offset = address, .val = { AFTR, LPA, SLEEP } } */ >>>> + { EXYNOS5433_ATLAS_CPU0_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_ATLAS_CPU0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_ATLAS_CPU1_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_ATLAS_CPU1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_ATLAS_CPU2_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_ATLAS_CPU2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_ATLAS_CPU3_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_ATLAS_CPU3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_APOLLO_CPU0_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_APOLLO_CPU0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_APOLLO_CPU1_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_APOLLO_CPU1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_APOLLO_CPU2_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_APOLLO_CPU2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_APOLLO_CPU3_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_DIS_IRQ_APOLLO_CPU3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0 } }, >>>> + { EXYNOS5433_ATLAS_NONCPU_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>>> + { EXYNOS5433_APOLLO_NONCPU_SYS_PWR_REG, { 0x0, 0x0, 0x8 } }, >>> >>> >>> 1. First of all why do you need any of these CPU related PMU config >>> registers in kernel ? From the information I gathered this is ARM64 >>> SoC using PSCI. These are needed just in PSCI implementation and not >>> in kernel. So can you elaborate on why there are present here ? >> >> The 32bit Exynos used the 'smc' call to enter the suspend mode >> and need to handle the PMU registers. >> > > OK > >> Even if PSCI replaces the 'smc' call on the Exynos5433, >> the Exynos5433's document requires the handling of PMU config >> related to CPU for the suspend mode. >> > > OK but does it state it needs to be in kernel ?(i.e. in EL1 NS) > >> IMHO, If the secure OS implemented the all something related to CPU, >> it might be unnecessary to handle the PMU registers. I think that >> it depend on how to design the SoC by H/W Architect. This is just my opinion. >> > > Even if it can be accessed in kernel, better to keep all these in PSCI > implementation that does the actual power state management. Mixing them > in both kernel and PSCI implementation is just a mess TBH and not easy > to maintain the platform if some issues pop up. > >>> >>> 2. Are there any public documents that these names map to ? >> >> There is no public document. It is confidential. >> > > I guessed so and hence raised to remove it. > >>> If there is none, please replace these codenames(ATLAS, APOLLO) with >>> appropriately. >> >> In the Exynos5433, 'apollo' indicates the LITTLE cores (cpu0-3, cortex-a53) >> and 'atlas' indicates the big cores (cpu4-7, cortex-a57) >> >> Exynos5433 already used the 'apollo' and 'atlas' on clk-exynos5433.c driver >> and thermal device-tree node. It is better to use the original register name >> in the document in order to reduce the confusion of the change of register name >> even if document is not public. >> >> Also, exynos7 used the 'atlas' word for big cores. >> > > I disagree. If you don't have any public documents, then better use > names other developers are used to and not some code names which > otherwise is not seen in any other part of the code base. Grepping > just shows Exynos using these code names which are generally restricted I mentioned, these words were already used on other device drivers. Exynos5433 used them to indicate the big.LITTLE cores consistently. They are an alias for big.LITTLE. Latest Exynos SoC must use these words continuously. I think that each vendor SoC could define the alias or expression for their SoC. -- Best Regards, Chanwoo Choi Samsung Electronics