From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB03EC10F0E for ; Fri, 12 Apr 2019 11:46:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 767172171F for ; Fri, 12 Apr 2019 11:46:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TRvWKI7P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 767172171F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m9nxxq0hA2xWKlZ2YlsXRoOSUS/HSg8CSqNmXEkByFU=; b=TRvWKI7PSWboA4 GHPRzaIb+T6z2HViU1HvOyS/K/whgJFfE/WMa3Y5hl6q/3QGgk8TDpE0dnIRLnu0hFGvpanybxca9 x6Ho7ECp8saatPG23zIA+/ZZN1p3S0LbXFZw1uzWuNjemvdMcvpuxv43cjnPYJNLO2cdagPMGQaXu LzxIzSGgn/6CDTQPIWdwa6RClGSefqBAIb82rJLGRr9LWxFcD8dCr2VsV11r1Sx/zThFLx6D+Nri0 AMz/mjkd1Ad0iYPgJqU8EffSCoRj2EajiHTdAYwPEim9dxuVfMIFrFgAfUVD1D4xp6DAQpGUTjyrv MN1qp55O9trmLN1P98Wg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEudB-0005O9-8Q; Fri, 12 Apr 2019 11:46:05 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEud7-0005Nb-Qf; Fri, 12 Apr 2019 11:46:03 +0000 Received: from ip5f5a6320.dynamic.kabel-deutschland.de ([95.90.99.32] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hEud5-0005F1-T1; Fri, 12 Apr 2019 13:45:59 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Elaine Zhang Subject: Re: [PATCH v1 4/6] clk: rockchip: add a clock-type for muxes based in the pmugrf Date: Fri, 12 Apr 2019 13:45:59 +0200 Message-ID: <15573177.ccEzvj8eDD@diego> In-Reply-To: <1554284549-24916-5-git-send-email-zhangqing@rock-chips.com> References: <1554284549-24916-1-git-send-email-zhangqing@rock-chips.com> <1554284549-24916-5-git-send-email-zhangqing@rock-chips.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_044602_014793_865703F0 X-CRM114-Status: GOOD ( 16.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangtao@rock-chips.com, xxx@rock-chips.com, xf@rock-chips.com, sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Elaine, Am Mittwoch, 3. April 2019, 11:42:27 CEST schrieb Elaine Zhang: > Rockchip socs often have some tiny number of muxes not controlled from > the core clock controller but through bits set in the pmugrf. > Use MUXPMUGRF() to cover this special clock-type. > > Signed-off-by: Elaine Zhang Do you have an example for such a clock? I.e. on rk3399 we have the pmucru which already links to the pmugrf as its "regular" rockchip,grf. Similarly the main-cru links to the main grf. So I don't really see where a clock needs to be defined in the main-grf and use a bit from the pmugrf. Similarly I wasn't really able to find anything that looks like a clock-mux in the PX30's (rk3326) pmugrf. So I'd really like an example beforehand :-D Thanks Heiko > --- > drivers/clk/rockchip/clk.c | 9 +++++++++ > drivers/clk/rockchip/clk.h | 17 +++++++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c > index 0a8a694a41ab..875412043dd7 100644 > --- a/drivers/clk/rockchip/clk.c > +++ b/drivers/clk/rockchip/clk.c > @@ -415,6 +415,8 @@ struct rockchip_clk_provider * __init rockchip_clk_init(struct device_node *np, > > ctx->grf = syscon_regmap_lookup_by_phandle(ctx->cru_node, > "rockchip,grf"); > + ctx->pmugrf = syscon_regmap_lookup_by_phandle(ctx->cru_node, > + "rockchip,pmugrf"); > > return ctx; > > @@ -490,6 +492,13 @@ void __init rockchip_clk_register_branches( > list->mux_shift, list->mux_width, > list->mux_flags); > break; > + case branch_muxpmugrf: > + clk = rockchip_clk_register_muxgrf(list->name, > + list->parent_names, list->num_parents, > + flags, ctx->pmugrf, list->muxdiv_offset, > + list->mux_shift, list->mux_width, > + list->mux_flags); > + break; > case branch_divider: > if (list->div_table) > clk = clk_register_divider_table(NULL, > diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h > index 20200a707611..1b30346f11e1 100644 > --- a/drivers/clk/rockchip/clk.h > +++ b/drivers/clk/rockchip/clk.h > @@ -234,6 +234,7 @@ struct rockchip_clk_provider { > struct clk_onecell_data clk_data; > struct device_node *cru_node; > struct regmap *grf; > + struct regmap *pmugrf; > spinlock_t lock; > }; > > @@ -386,6 +387,7 @@ enum rockchip_clk_branch_type { > branch_composite, > branch_mux, > branch_muxgrf, > + branch_muxpmugrf, > branch_divider, > branch_fraction_divider, > branch_gate, > @@ -658,6 +660,21 @@ struct rockchip_clk_branch { > .gate_offset = -1, \ > } > > +#define MUXPMUGRF(_id, cname, pnames, f, o, s, w, mf) \ > + { \ > + .id = _id, \ > + .branch_type = branch_muxpmugrf, \ > + .name = cname, \ > + .parent_names = pnames, \ > + .num_parents = ARRAY_SIZE(pnames), \ > + .flags = f, \ > + .muxdiv_offset = o, \ > + .mux_shift = s, \ > + .mux_width = w, \ > + .mux_flags = mf, \ > + .gate_offset = -1, \ > + } > + > #define DIV(_id, cname, pname, f, o, s, w, df) \ > { \ > .id = _id, \ > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel