Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp287147rdb; Thu, 19 Oct 2023 04:46:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgBALpATjtasOsyeMtKEqJJk530uMZSqUFQgdRB62r6CmLNzB0wMnIIpcG/c2NA1L1Hdzd X-Received: by 2002:a05:6a21:71ca:b0:12c:2dc7:74bc with SMTP id ay10-20020a056a2171ca00b0012c2dc774bcmr1722555pzc.46.1697716004831; Thu, 19 Oct 2023 04:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697716004; cv=none; d=google.com; s=arc-20160816; b=KlQtUeyvNBtBARbTS+vkGInS/CjHFslTyYCx1Z4uNL7W5Na1z1K17l8mC2Y/4PxNIj nvlTCOwdcGiD4dwehCGPvY1FOF7M+c0BrD3fGfGBgaeC9U8F4kA05huD5lhli1OZJH2Z 5OyLcad1+IaOmtlQhX6zrBVXQ3vB9+3v45cC2LU6mrNsH88r2aXjwTuAGokvPjI79UMp W3c6Agh4vDXD15YNCkARNxuCys5lSZgBtn6KtpMlbKEU4FCto7CbR3LYpQHDJLQadugz AizTZFqztaiF/X2SlKt+w/mPZLCCeUERszELvvJcIxA6sDhxHAZIGX4+B84h31r9J114 sMpQ== 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=mSBfvOFoNFPkM09tCwPxZBHUPhJ7xD9mMbi8iLkam00=; fh=za2Ddqh0pPdNj4p+pypF3ipiFhfLO31rK06zIw+vlFU=; b=vULGxynDf/YpPaeg0nUa5BY+E56eAfhaRezz7gPUcVjwdlZrqGS4a/je/zXi7FGT0H QE6WVwH6EcLXgHsdONySJZVMq58zqDj8juAS8Oiq38sTNR2oUzyWjp/XOjse7bcWRZ2z a2nNY4fobteQX/phI6RHuHwdM8uNEAC5fu8/HgTB97u8YuvVBxrSbBCp2ppvPrK2Qf0c Q4lIm3lrwFxd43jXFsf1N5Q+Pi0WDJTFN8v4eMVehtHKCq/GnT41QJL2Nmc8A2k79EBA DN+InqPMhjX4//w/SlzIe3C0fY8Kwo+MQdy0p3WcTTNDZ0TMXCu/6Ajg4yUAUIGyy9GL Ujsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TnMPcaCC; 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 z19-20020a63e113000000b0057cbd803b30si4359754pgh.654.2023.10.19.04.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:46:44 -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=TnMPcaCC; 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 35318818CC93; Thu, 19 Oct 2023 04:46:42 -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 S1345357AbjJSLqZ (ORCPT + 99 others); Thu, 19 Oct 2023 07:46:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345405AbjJSLqX (ORCPT ); Thu, 19 Oct 2023 07:46:23 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B33E913D for ; Thu, 19 Oct 2023 04:46:18 -0700 (PDT) Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20231019114616epoutp02a37d9ba98a00a6025fc560601f455fdc~Pf6_jl8Kg0817808178epoutp02j for ; Thu, 19 Oct 2023 11:46:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20231019114616epoutp02a37d9ba98a00a6025fc560601f455fdc~Pf6_jl8Kg0817808178epoutp02j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1697715976; bh=mSBfvOFoNFPkM09tCwPxZBHUPhJ7xD9mMbi8iLkam00=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=TnMPcaCC0QVsqLAt2dxeHKLkD3gaIj9myQXVMWysZmXNuIS2SX4wPOf8LQ2oeIBHu Q/6BbPVtiZKoREz/xAnGbVI96UZUpDoS+2tA9vvh2GfrLNwRHZfqWwns7ayjNtYYyj 7mfX45XEBFc7iAkE2/FKUlgBlSNrUpkqBoq3PKOY= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20231019114616epcas1p1fa5aff3c1ce6986dea09eaa32f41ded2~Pf69zmdSd1293912939epcas1p1E; Thu, 19 Oct 2023 11:46:16 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.36.145]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4SB5X71h5fz4x9Pr; Thu, 19 Oct 2023 11:46:15 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id D4.CD.09739.70711356; Thu, 19 Oct 2023 20:46:15 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231019114614epcas1p1693c864aa78ae3cce36346ebba2a44e4~Pf68Xd7Jo3242732427epcas1p1p; Thu, 19 Oct 2023 11:46:14 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231019114614epsmtrp1c2ef939fbe63033b549351bec1cd256f~Pf68U9DNG1588115881epsmtrp1b; Thu, 19 Oct 2023 11:46:14 +0000 (GMT) X-AuditID: b6c32a37-c0bff7000000260b-48-653117070a03 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 6A.B9.08817.60711356; Thu, 19 Oct 2023 20:46:14 +0900 (KST) Received: from cw00choi03 (unknown [10.113.111.106]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231019114614epsmtip1cc0e706eaf625030cc89da7398a01c8d~Pf68B5Esd2936029360epsmtip1G; Thu, 19 Oct 2023 11:46:14 +0000 (GMT) From: "Chanwoo Choi" To: "'Sascha Hauer'" , Cc: , , , "'Heiko Stuebner'" , "'Chanwoo Choi'" , "'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: <20231018061714.3553817-11-s.hauer@pengutronix.de> Subject: RE: [PATCH v8 10/26] PM / devfreq: rockchip-dfi: Add RK3568 support Date: Thu, 19 Oct 2023 20:46:14 +0900 Message-ID: <001101da0281$dd10bf70$97323e50$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: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Y9HMyG+CQYOlAEpOIhQG0nPEQJivO5DHqzGPqU+mMxgZWkbjE S/jDoU32oFIV2cxJhlEx6n9dDsn3yedsTrn5Ru48WRieeMHN2PluMW/IVC4+kikd+D193pR0 2rNuxV5nkWUd33xbK38SFCVyHhTzYqQRhxOCdubnur8ty7HxbZH6hneBx0uSoifdD7ZuaXB7 Wf0x5/hzpApvWkPaqsccX4e6r2vxwJ+ExefQmY6koJSClY0Nq65hdktrU1juUYUZ1b/PMu+L z1Ebs/x2CSqlDsPchO9FJ7k1ylq5PTvBlt3X6ydt6aqVqQSRBkV5R6ksyl+r2jh44FzygZjv raLx3nAMq/eOafmy297v+fVZqFL5GqU08+L3LFp9okf9W+vOFwhh19nEsyFtfitnbwRMRDz2 KlmddyduvwTXpCnCgjG1RvEHUF5fpWsDAAA= X-CMS-MailID: 20231019114614epcas1p1693c864aa78ae3cce36346ebba2a44e4 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: 20231018061911epcas1p37a7bedf255e61c583dc933f8f0bc5f08 References: <20231018061714.3553817-1-s.hauer@pengutronix.de> <20231018061714.3553817-11-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 04:46:42 -0700 (PDT) > -----Original Message----- > From: Sascha Hauer > Sent: Wednesday, October 18, 2023 3:17 PM > To: linux-rockchip@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; > linux-pm@vger.kernel.org; Heiko Stuebner ; Chanwoo Choi > ; 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 > ; Sascha Hauer > Subject: [PATCH v8 10/26] PM / devfreq: rockchip-dfi: Add RK3568 support > > This adds RK3568 support to the DFI driver. Only iniitialization differs > from the currently supported RK3399. > > Signed-off-by: Sascha Hauer > --- > > Notes: > Changes since v7: > - Add comment to explain << 3 > > drivers/devfreq/event/rockchip-dfi.c | 27 +++++++++++++++++++++++++++ > include/soc/rockchip/rk3568_grf.h | 12 ++++++++++++ > 2 files changed, 39 insertions(+) > create mode 100644 include/soc/rockchip/rk3568_grf.h > > diff --git a/drivers/devfreq/event/rockchip-dfi.c > b/drivers/devfreq/event/rockchip-dfi.c > index 12f9096879235..571d72d1abd1c 100644 > --- a/drivers/devfreq/event/rockchip-dfi.c > +++ b/drivers/devfreq/event/rockchip-dfi.c > @@ -23,6 +23,7 @@ > > #include > #include > +#include > > #define DMC_MAX_CHANNELS 2 > > @@ -211,10 +212,36 @@ static int rk3399_dfi_init(struct rockchip_dfi *dfi) > return 0; > }; > > +static int rk3568_dfi_init(struct rockchip_dfi *dfi) { > + struct regmap *regmap_pmu = dfi->regmap_pmu; > + u32 reg2, reg3; > + > + regmap_read(regmap_pmu, RK3568_PMUGRF_OS_REG2, ®2); > + regmap_read(regmap_pmu, RK3568_PMUGRF_OS_REG3, ®3); > + > + /* lower 3 bits of the DDR type */ > + dfi->ddr_type = FIELD_GET(RK3568_PMUGRF_OS_REG2_DRAMTYPE_INFO, > reg2); > + > + /* > + * For version three and higher the upper two bits of the DDR type > are > + * in RK3568_PMUGRF_OS_REG3 > + */ > + if (FIELD_GET(RK3568_PMUGRF_OS_REG3_SYSREG_VERSION, reg3) >= 0x3) > + dfi->ddr_type |= > FIELD_GET(RK3568_PMUGRF_OS_REG3_DRAMTYPE_INFO_V3, > +reg3) << 3; > + > + dfi->channel_mask = BIT(0); > + dfi->max_channels = 1; > + > + 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 }, > { }, > }; > + > MODULE_DEVICE_TABLE(of, rockchip_dfi_id_match); > > static int rockchip_dfi_probe(struct platform_device *pdev) diff --git > a/include/soc/rockchip/rk3568_grf.h b/include/soc/rockchip/rk3568_grf.h > new file mode 100644 > index 0000000000000..575584e9d8834 > --- /dev/null > +++ b/include/soc/rockchip/rk3568_grf.h > @@ -0,0 +1,12 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ #ifndef __SOC_RK3568_GRF_H > +#define __SOC_RK3568_GRF_H > + > +#define RK3568_PMUGRF_OS_REG2 0x208 > +#define RK3568_PMUGRF_OS_REG2_DRAMTYPE_INFO GENMASK(15, 13) > + > +#define RK3568_PMUGRF_OS_REG3 0x20c > +#define RK3568_PMUGRF_OS_REG3_DRAMTYPE_INFO_V3 GENMASK(13, 12) > +#define RK3568_PMUGRF_OS_REG3_SYSREG_VERSION GENMASK(31, 28) > + > +#endif /* __SOC_RK3568_GRF_H */ > -- > 2.39.2 Applied it. Thanks Best Regards, Chanwoo Choi