Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp312782rdb; Thu, 19 Oct 2023 05:31:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpumpWwkeF50jgTc/7zVobo9LedXeRMTeCCy+R5qXCMInOZAeV6MJlJDuOGGcmVUjTG9cJ X-Received: by 2002:a05:6871:49cc:b0:1ea:c913:3494 with SMTP id ty12-20020a05687149cc00b001eac9133494mr1719036oab.6.1697718676449; Thu, 19 Oct 2023 05:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697718676; cv=none; d=google.com; s=arc-20160816; b=NqHZCFH+byLrDUm6tNZ8fUxL5+Ds+Piv0enXhW/+KCo0Ph3iXS9J1v/8n5AzMrHeQH P5l8Ja/OAwW4aCTF5taafFjlRTgbvLtFupbbOzGJjjGzhOLcFrWEl8tMLQMy7erUDDQJ zoyLsHt/igGW1cpjMg+nsSDS7ewEmC9tMULLds3aHTjsPikNgJA4S5r1ix6/uRKFlmYA Bm8hfXfVzOJISYGk1t+nGdS3xp4ktRvFnmFjRXQrn3j/9b4ihigZveCX4sTrTcENAjn2 KcFpB00CPhtcu3a2LTNkcKHS7COPEpkOH1ZMXAF9EX1peMu8RMA/xTvuaP8zoONISAdl Ztsw== 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=tKjHhutN2DvaRqlyp9HEk1LtTOt0C8O3wcqmbh25CO4H/i8cfHf0hh/S+DHFwThueB a+Og05rb+D9qrhhFzYPtAK5Lrquz53Q3A/PCACZKQ0PuW0kJ5roX0YsWPtalpb1bEICe aFnxyqDvAAO0gt8ouKP+C8zDWqr2xN82xlbAKKZYF+hB2yqwKv66RzIxrUlVd54ypCbl MAkwWu/rGdGjcd4cYr0eGmPkMCuHbFgqe8Gw31dE8LPJ1+C2uCv3QTKju4uoHGYWSvyl GYsR3vmZI/Zk6wIntE1unMkMth3RIFbEFnIYKotNu7RaKKPvJfO6v8NA+ewUfmiSluQC Lp6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="cl/2Eu7e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id d5-20020a655ac5000000b005781e99d048si4149297pgt.889.2023.10.19.05.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:31:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="cl/2Eu7e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 66EAA809842D; Thu, 19 Oct 2023 05:30:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345730AbjJSMaI (ORCPT + 99 others); Thu, 19 Oct 2023 08:30:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235422AbjJSM3z (ORCPT ); Thu, 19 Oct 2023 08:29:55 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7790D7C for ; Thu, 19 Oct 2023 05:29:46 -0700 (PDT) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231019122944epoutp04b4a5f0c235f415be601af58f244e47a1~Pgg7Yzqsu3056030560epoutp04_ for ; Thu, 19 Oct 2023 12:29:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231019122944epoutp04b4a5f0c235f415be601af58f244e47a1~Pgg7Yzqsu3056030560epoutp04_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1697718584; bh=TDOo3bhcjq1V1M/NiUKjoKU/btNbYwTzVuBWaGqt1jA=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=cl/2Eu7eVWSTruIkRdW9+FxDst3qASL4DHoh8/P4QdrM78qM69lPUJ0ME8I/eiGCw 1wih8B2vhZjdgOgBBWj6HHOBMVS0ghOiOuRsHn5dF0Qb6qgt75EZv8L7bUx6gZCN3s bHKaxz68guR4GgJcZzw51EhRcMXSl0ADgtq7sTak= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20231019122943epcas1p3a7aaf6b7d57a12d30e0823eed1168a5d~Pgg56k4hP0139501395epcas1p3b; Thu, 19 Oct 2023 12:29:43 +0000 (GMT) Received: from epsmgec1p1.samsung.com (unknown [182.195.36.134]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4SB6VG20VKz4x9Ps; Thu, 19 Oct 2023 12:29:42 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmgec1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 87.01.09731.63121356; Thu, 19 Oct 2023 21:29:42 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231019122941epcas1p1f094121c91f61fea36f4b02fa9c219b5~Pgg4YTgsV1912419124epcas1p1a; Thu, 19 Oct 2023 12:29:41 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231019122157epsmtrp166d30538f20c5191acf82727c5059119~PgaIHUUbd0316803168epsmtrp1M; Thu, 19 Oct 2023 12:21:57 +0000 (GMT) X-AuditID: b6c32a36-a7dff70000002603-f0-65312136c29f Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 7E.99.18939.56F11356; Thu, 19 Oct 2023 21:21:57 +0900 (KST) Received: from cw00choi03 (unknown [10.113.111.106]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231019122157epsmtip2c2dc2144b509f4fa568996ea3089c182~PgaH1ozco1190911909epsmtip2T; Thu, 19 Oct 2023 12:21:57 +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:21:57 +0900 Message-ID: <002c01da0286$da5fde00$8f1f9a00$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: ko Thread-Index: AQFYMiMsP3soeW2GlDs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axrIbVvqnjCR1c03lh0zt+c+r7cvynbGl/2/19vTP5nildioo7qzHN59yijRkLz8yU T2UfiBAWqPW12/HK7H8KrYrew+HyiMw0tzuxvcA96PLZEMJw1rkzu/BVYn/3QRdmufJ82ecR k3XYsajloQ5TUPUV7RHfX5TH82YMRYsdgg6LvPzGoTT9nPWLe1mG8v3d21Y9d7TjJ0+kPvow a1+MOmJvasCM+NoMLrOoswuXPl7M/TfC+Gpgy0OXfrfb94q9/ibSco5UeUzmlvoYE66+kx/f GVm8Nf3bqlvhMZt3/uw97q8wTpk+2f20yWB9WV+reHL0vmfF1mNBHqrjCz6j77uvXB09qp5q eiwWPQ+PonBdAiP1xrQ65j8LiMUjhQQAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7bCSvG6qvGGqwfljYhYTb1xhsViz9xyT xfwj51gt/j96zWqxaupOFou+Fw+ZLc42vWG32PT4GqvF5V1z2Cw+9x5htPj04D+zxdLrF5ks Di5UsbjduILNonXvEXaLgx+esFr83b6JxeLuaz+L42ufsVm03DF1EPFYM28No8eOu0sYPXbO usvusWlVJ5vHnWt72Dw2L6n36P9r4NG3ZRWjx/Zr85g9Pm+S85j/+zFjAHcUl01Kak5mWWqR vl0CV8bkvinMBdc0Kz52/2RpYFyh1MXIySEhYCJx80ojexcjF4eQwHZGic5L35khEpIS0y4e BbI5gGxhicOHiyFqnjNK7Ns+iw0kziagI7HgRyhIuYhAncTk7l1sIDXMArdZJRZO/8UM0fCF UWJu6wdGkCpOATuJZYens4DYwgIBEs+bToEtYxFQlfh88jI7iM0rYCnxov8XG4QtKHFy5hOw emYBbYmnN59C2fIS29/OgTpUQeLn02WsEHERidmdbcwQF7lJNE65xTaBUXgWklGzkIyahWTU LCTtCxhZVjGKphYU56bnJhcY6hUn5haX5qXrJefnbmIEx75W0A7GZev/6h1iZOJgPMQowcGs JMKr6mGQKsSbklhZlVqUH19UmpNafIhRmoNFSZxXOaczRUggPbEkNTs1tSC1CCbLxMEp1cCU 9q/c5OqhiafqJ7iWTFBYGvcwcq6I1ox31ZeabjyeuElj0urcPskvOX+LUhQ+6b18nzD33dMO 0Y7L0l+2nzp3ZivvcXvRGyUSp+/uqrgbe+PXjeg1z5WFuWXDlWMfJZ+OvRLl6OLxWH/7b9b3 +rM3f7C7qbftbWf51o5A8Scq92Wi97QnrjcUm/+xce2L6dfnyEWL6GmUck5dzXplV1+kzc73 B7k9zy5U279vGkNXkUVqwregxR7KHKtW36+NEXNzODJrWtHBvheFrxa1/17atPX/q4KqSazH /p3zju+bttw36MpWxX1tqTyObw7M26g0q1GtbIbNhAkXVCYvmW6Qkv9uwb5KGfmYAw82b/5z 8b8SS3FGoqEWc1FxIgDz1POobAMAAA== X-CMS-MailID: 20231019122941epcas1p1f094121c91f61fea36f4b02fa9c219b5 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:30:49 -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