Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3861973rdg; Wed, 18 Oct 2023 08:06:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFylAluwoOhH4ZHTqr8dZR7sONkJqlJniVIdUwA+GdvdiFF8SUtexF57dAVQ4d7ZonEya0/ X-Received: by 2002:a17:90a:c390:b0:27d:8ad:69f9 with SMTP id h16-20020a17090ac39000b0027d08ad69f9mr5213363pjt.2.1697641586083; Wed, 18 Oct 2023 08:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697641586; cv=none; d=google.com; s=arc-20160816; b=LDQy28BWY2JitmU37c93NM/zcxq7VlYip5EdoH60q8anEVXn34Kzq31pD55DpVHMK1 SY2cNfbpRx8WHImZvkBKATexUYRWokDCYDPQhqeowkSfvS3xKG1ZHMdza2lMBCv1tO8a LtYwln3Ds8nPJrgLdzG4DXfqBUKrRxTWAcoSjazG0l0uLDyBgA28KjLtkzKZejPPCK6a LZogje8GPZeb4yHMyO2Z3qOX7CH11nMK3p7vvR2sJVdrXB13VCLDAfFWJX4v7JRpZSc2 gHhejdO6o9O1H5hK+DR/kFFbf/64p4/F6WuCM5WwhIDlQhLpsmVyIAEHkhpmRexJX4go bBmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7HXzlZEP8eAU18SAjhIvmv3a+QBGV9jjB421Yzkmrd0=; fh=zVnE8nzBiWjz6k8ByGXbhrRZONZVucV+BveYc4wwjYA=; b=C8h6I+SEZUMjh8JqZd/tBgs5BrQ5R5ISHXMv5mbcRKFAEXOA6TovYf22sE1MseYW7M hQckQmtFit8uq/TYA17zcb9X5LjxiRSxKilAIs3ZajG7Rpt3BewX2vE0aiZgGGJShcwN +TW41hsG6KgA2Wm6y+uAED+0475au67LtqKi1AESUtG0Albf+LYCnXggs3uSz0WiVpFZ qFt2QcdwFSvX+vwox7fZM67kHax1royzWG/TePyNqDpMRQudRUB5KCViyTXv+VukGSbH sZQj7CQVGw7Oh/17DQzBJymZucGIYodNvHSaoCRXknyTfWVNfsdZ5Bmoe47F8w4tFw9B Ranw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z68qjQ5e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ls16-20020a17090b351000b0027762fed4a0si64903pjb.11.2023.10.18.08.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z68qjQ5e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C3F568076164; Wed, 18 Oct 2023 08:06:23 -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 S235263AbjJRPGF (ORCPT + 99 others); Wed, 18 Oct 2023 11:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230228AbjJRPGC (ORCPT ); Wed, 18 Oct 2023 11:06:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 112FBEA; Wed, 18 Oct 2023 08:06:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4899CC433C8; Wed, 18 Oct 2023 15:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697641560; bh=79ldLFk2fNTorPToymaXkLXT8GpbzW+LQ+mGqD1l0gY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Z68qjQ5eITEEOyppWrfB3SQfGDQBi8R9FV/FV4MUoiobTcTgcvBXBsVbWPSiNMAw5 xe0fPfD7p5d5pGM+FYrvEiWn6XuXmXwppyKmsegODVzpL9CSzD3tW1e33zmIw/jXfV Cn7pQ/6Bvu35CGh/hxHNv4AHQkmgFE2xbhmsqvHvoDN9DSYTkzU7U5V9xy612Kf9lQ CTOqMYA7qh5ld2v0EbPoSpRpdRcwdlDvnxGf+NfzeHYYezpNthyglo+By/WiC/UOI7 bq+ihlBeNC03/4tBPM3D3qPz8zt5mXfHcjFC6ayufCpzCc72qEEMgWc/e0J+8cQOl1 LnZEN1sF8AxWA== Message-ID: <0c83d9ee-ee31-4b8e-b635-f929fda27f20@kernel.org> Date: Thu, 19 Oct 2023 00:05:58 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 10/26] PM / devfreq: rockchip-dfi: Add RK3568 support Content-Language: en-US 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 References: <20231018061714.3553817-1-s.hauer@pengutronix.de> <20231018061714.3553817-11-s.hauer@pengutronix.de> From: Chanwoo Choi In-Reply-To: <20231018061714.3553817-11-s.hauer@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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]); Wed, 18 Oct 2023 08:06:23 -0700 (PDT) On 23. 10. 18. 15:16, Sascha Hauer wrote: > 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 */ Acked-by: Chanwoo Choi -- Best Regards, Samsung Electronics Chanwoo Choi