Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp314981rdb; Thu, 19 Oct 2023 05:34:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbRZiNQ6ChEwkLIWegx8vZOmbkBw/jnvC90cB275Ng73EBTSI9kONJjM0cDbGao7shimm9 X-Received: by 2002:a05:6358:ed7:b0:141:162:b0cd with SMTP id 23-20020a0563580ed700b001410162b0cdmr1744922rwh.19.1697718893386; Thu, 19 Oct 2023 05:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697718893; cv=none; d=google.com; s=arc-20160816; b=HWbPNY11gCJ5skOg7CjxblHiEbaDnxJU3B4S+SMgfSWL7YEr748q8B+586X+MlB8BD zF58/sJ5eJwxGJrg+isf1eSV4xk+PW/ixfqRk5kNX+tlFNknLcM1u2Ch+rEXEpcxp88X mA7G+e2aPk4q9ne/YNhM10Uw0LU8iG67KHqMICMlSwmRnVLyG0X3QPSG3XDNKpOYmqgn R3swCaaYY95qivVLK72/1UCo33PxFhyz18KcUxsUnN3IMVq7TZPxZuY2D6Y1IlcmbPjZ IovTaovgAc9TGtDYcgfmZEXstuhm5/A49LL+p1hONAlS4NeyHNE+crIqF7OWE5MMmEGR shpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:thread-index :content-language:content-transfer-encoding:mime-version:message-id :date:subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=TDOo3bhcjq1V1M/NiUKjoKU/btNbYwTzVuBWaGqt1jA=; fh=BewXI0FRnKfC6Wd82TCVXAxSLgLI2yRBzCBbY9+GTd0=; b=gfEQBOmTV5qXw3s5p1oDvk2hPwNMUUUEf/lfFkj++1IIubnRE4B5eNb768noKci8WD GBsQZ8q9TXlZMmcocMJoAtu52CW4xhRv9DLpwr1BP/SXPo8HbLlx8RmoNaUUGi9SC3wp uk4iJT9/LYFPziUz0dXiyOdcLBFQvwo+Zg35WfV8Q+1mw2b+0cl/ez3Y/di2VbewLgAV 2i0OsJXH+jXOE195seSWTzhysYo7miHLUlqghIMpXsSQJ2kQJ4wwxDFSR/U39oCpJNLR bSI/6cihXLVDmou9CldgKR0SNMM1a2kv73bvmWvLyBxxmethQZmK/ju3NwndUjYTDluF lIaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=rpDuKZu0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q16-20020aa79830000000b00690d8405fe2si840746pfl.60.2023.10.19.05.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=rpDuKZu0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1F696827AFB4; Thu, 19 Oct 2023 05:34:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345634AbjJSMe0 (ORCPT + 99 others); Thu, 19 Oct 2023 08:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345635AbjJSMeZ (ORCPT ); Thu, 19 Oct 2023 08:34:25 -0400 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C380BE for ; Thu, 19 Oct 2023 05:34:22 -0700 (PDT) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20231019123420epoutp032c7d90887382edd90a1980fe497b216d~Pgk8Aff8o2024520245epoutp03M for ; Thu, 19 Oct 2023 12:34:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20231019123420epoutp032c7d90887382edd90a1980fe497b216d~Pgk8Aff8o2024520245epoutp03M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1697718860; bh=TDOo3bhcjq1V1M/NiUKjoKU/btNbYwTzVuBWaGqt1jA=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=rpDuKZu0qUxG1BuD5FxyxxjD4Yi7ewHHujr+c0DgpZfE4J4deDZnAJoiuqsIcgPJB qJQcH0j+BUSxAFh0tbPj32ZFfXlSbDtPPGkLWGV8yP17sQF5LfWuoVXGMeqL0rbtc4 onTA8BsNbKf5bFrG6LcJa49waBvnESVy6oWpt7Vo= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20231019123419epcas1p266cc01c048793aeb28ad566c7f0b97c6~Pgk7LgH3a3075930759epcas1p2t; Thu, 19 Oct 2023 12:34:19 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.36.136]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4SB6bZ4HjXz4x9Pv; Thu, 19 Oct 2023 12:34:18 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.31.09739.A4221356; Thu, 19 Oct 2023 21:34:18 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20231019123417epcas1p4e9848b4eb0c174f8765f8154703c463d~Pgk5ykCov2224822248epcas1p4J; Thu, 19 Oct 2023 12:34:17 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231019123417epsmtrp1c0f155fb521cd0d75209e38a7a7a25df~Pgk5woGVR0993009930epsmtrp1d; Thu, 19 Oct 2023 12:34:17 +0000 (GMT) X-AuditID: b6c32a37-c0bff7000000260b-74-6531224a7d92 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 67.3A.07368.94221356; Thu, 19 Oct 2023 21:34:17 +0900 (KST) Received: from cw00choi03 (unknown [10.113.111.106]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231019123417epsmtip256da5cd81b2449a687062668b50d02d5~Pgk5XLG8o2707827078epsmtip2V; Thu, 19 Oct 2023 12:34:17 +0000 (GMT) From: "Chanwoo Choi" To: "'Chanwoo Choi'" , "'Sascha Hauer'" , Cc: , , , "'Heiko Stuebner'" , "'Kyungmin Park'" , "'MyungJoo Ham'" , "'Will Deacon'" , "'Mark Rutland'" , , "'Michael Riesch'" , "'Robin Murphy'" , "'Vincent Legoll'" , "'Rob Herring'" , "'Krzysztof Kozlowski'" , "'Conor Dooley'" , , "'Sebastian Reichel'" In-Reply-To: Subject: RE: [PATCH v8 19/26] PM / devfreq: rockchip-dfi: add support for RK3588 Date: Thu, 19 Oct 2023 21:34:17 +0900 Message-ID: <004401da0288$93af2db0$bb0d8910$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: ko Thread-Index: AQFYMiMsP3soeW2GlDsie1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ZzXcMbsFCGB9MSS1OzU1ILUIpgsEwen VANTfUqX4TdVox/PnarORl3Ksj3qevX3XVXhz98tti0Nu3JoC9+tOT7aK1L3cpef37ToqenD nwVTypTvHmfN2SWqWMfx17DllmDJ4jAl7cINsTvdvvR/Wmng22AXLeU7rU4xq3sn/7klXJtY gq3ipoSd1rO1dWj6x6vDqv3hs7Pk1J6rrQLKlrqJxzTnJl6d0/Zh7cMLnpL+b9feYo6TsdC7 ptp39cz63TY68ozse18fTg80M69dnjNhR4uY3l0RHmW2QIW6D9kvlsxe/MA9kU1R48uazN0L Mvae+vRFuWHKXrUfOrNLNXx8tST+PNHNTz59NO+yRGgRT8fdPapWkkmLcr+F5168pvmNcf6O 9UuVWIozEg21mIuKEwFH5QBJbwMAAA== X-CMS-MailID: 20231019123417epcas1p4e9848b4eb0c174f8765f8154703c463d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231018151237epcas1p343048db94d5678e0dd8ab865f7cad8a1 References: <20231018061714.3553817-1-s.hauer@pengutronix.de> <20231018061714.3553817-20-s.hauer@pengutronix.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:34:50 -0700 (PDT) > -----Original Message----- > From: Chanwoo Choi > Sent: Thursday, October 19, 2023 12:12 AM > To: Sascha Hauer ; linux- > rockchip@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; > linux-pm@vger.kernel.org; Heiko Stuebner ; Kyungmin Park > ; MyungJoo Ham ; Will > Deacon ; Mark Rutland ; > kernel@pengutronix.de; Michael Riesch ; > Robin Murphy ; Vincent Legoll > ; Rob Herring ; Krzysztof > Kozlowski ; Conor Dooley > ; devicetree@vger.kernel.org; Sebastian Reichel > ; Jonathan Cameron > > Subject: Re: [PATCH v8 19/26] PM / devfreq: rockchip-dfi: add support for > RK3588 > > On 23. 10. 18. 15:17, Sascha Hauer wrote: > > Add support for the RK3588 to the driver. The RK3588 has four DDR > > channels with a register stride of 0x4000 between the channel > > registers, also it has a DDRMON_CTRL register per channel. > > > > Reviewed-by: Jonathan Cameron > > Reviewed-by: Sebastian Reichel > > Signed-off-by: Sascha Hauer > > --- > > drivers/devfreq/event/rockchip-dfi.c | 36 +++++++++++++++++++++++++++- > > include/soc/rockchip/rk3588_grf.h | 18 ++++++++++++++ > > 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 > > include/soc/rockchip/rk3588_grf.h > > > > diff --git a/drivers/devfreq/event/rockchip-dfi.c > > b/drivers/devfreq/event/rockchip-dfi.c > > index bf38829a2a4af..794f36e7eebd1 100644 > > --- a/drivers/devfreq/event/rockchip-dfi.c > > +++ b/drivers/devfreq/event/rockchip-dfi.c > > @@ -26,8 +26,9 @@ > > #include #include > > #include > > +#include > > > > -#define DMC_MAX_CHANNELS 2 > > +#define DMC_MAX_CHANNELS 4 > > > > #define HIWORD_UPDATE(val, mask) ((val) | (mask) << 16) > > > > @@ -723,9 +724,42 @@ static int rk3568_dfi_init(struct rockchip_dfi *dfi) > > return 0; > > }; > > > > +static int rk3588_dfi_init(struct rockchip_dfi *dfi) { > > + struct regmap *regmap_pmu = dfi->regmap_pmu; > > + u32 reg2, reg3, reg4; > > + > > + regmap_read(regmap_pmu, RK3588_PMUGRF_OS_REG2, ®2); > > + regmap_read(regmap_pmu, RK3588_PMUGRF_OS_REG3, ®3); > > + regmap_read(regmap_pmu, RK3588_PMUGRF_OS_REG4, ®4); > > + > > + /* lower 3 bits of the DDR type */ > > + dfi->ddr_type = FIELD_GET(RK3588_PMUGRF_OS_REG2_DRAMTYPE_INFO, > > +reg2); > > + > > + /* > > + * For version three and higher the upper two bits of the DDR type > are > > + * in RK3588_PMUGRF_OS_REG3 > > + */ > > + if (FIELD_GET(RK3588_PMUGRF_OS_REG3_SYSREG_VERSION, reg3) >= 0x3) > > + dfi->ddr_type |= > FIELD_GET(RK3588_PMUGRF_OS_REG3_DRAMTYPE_INFO_V3, > > +reg3) << 3; > > + > > + dfi->buswidth[0] = FIELD_GET(RK3588_PMUGRF_OS_REG2_BW_CH0, reg2) == > 0 ? 4 : 2; > > + dfi->buswidth[1] = FIELD_GET(RK3588_PMUGRF_OS_REG2_BW_CH1, reg2) == > 0 ? 4 : 2; > > + dfi->buswidth[2] = FIELD_GET(RK3568_PMUGRF_OS_REG2_BW_CH0, reg4) == > 0 ? 4 : 2; > > + dfi->buswidth[3] = FIELD_GET(RK3588_PMUGRF_OS_REG2_BW_CH1, reg4) == > 0 ? 4 : 2; > > + dfi->channel_mask = FIELD_GET(RK3588_PMUGRF_OS_REG2_CH_INFO, reg2) > | > > + FIELD_GET(RK3588_PMUGRF_OS_REG2_CH_INFO, reg4) << 2; > > + dfi->max_channels = 4; > > + > > + dfi->ddrmon_stride = 0x4000; > > + > > + return 0; > > +}; > > + > > static const struct of_device_id rockchip_dfi_id_match[] = { > > { .compatible = "rockchip,rk3399-dfi", .data = rk3399_dfi_init }, > > { .compatible = "rockchip,rk3568-dfi", .data = rk3568_dfi_init }, > > + { .compatible = "rockchip,rk3588-dfi", .data = rk3588_dfi_init }, > > { }, > > }; > > > > diff --git a/include/soc/rockchip/rk3588_grf.h > > b/include/soc/rockchip/rk3588_grf.h > > new file mode 100644 > > index 0000000000000..630b35a550640 > > --- /dev/null > > +++ b/include/soc/rockchip/rk3588_grf.h > > @@ -0,0 +1,18 @@ > > +/* SPDX-License-Identifier: GPL-2.0+ */ #ifndef __SOC_RK3588_GRF_H > > +#define __SOC_RK3588_GRF_H > > + > > +#define RK3588_PMUGRF_OS_REG2 0x208 > > +#define RK3588_PMUGRF_OS_REG2_DRAMTYPE_INFO GENMASK(15, 13) > > +#define RK3588_PMUGRF_OS_REG2_BW_CH0 GENMASK(3, 2) > > +#define RK3588_PMUGRF_OS_REG2_BW_CH1 GENMASK(19, 18) > > +#define RK3588_PMUGRF_OS_REG2_CH_INFO GENMASK(29, 28) > > + > > +#define RK3588_PMUGRF_OS_REG3 0x20c > > +#define RK3588_PMUGRF_OS_REG3_DRAMTYPE_INFO_V3 GENMASK(13, 12) > > +#define RK3588_PMUGRF_OS_REG3_SYSREG_VERSION GENMASK(31, 28) > > + > > +#define RK3588_PMUGRF_OS_REG4 0x210 > > +#define RK3588_PMUGRF_OS_REG5 0x214 > > + > > +#endif /* __SOC_RK3588_GRF_H */ > > Acked-by: Chanwoo Choi > > -- > Best Regards, > Samsung Electronics > Chanwoo Choi Applied it. Thanks Best Regards, Chanwoo Choi