Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5874397pxu; Thu, 22 Oct 2020 13:20:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk4lRMt908KSjdujS6pxH1+jof7IW9Wp3/zR6TPajtpgTrnrdx2HZ4rDS2nbJBQENrFgB9 X-Received: by 2002:a17:906:b0d6:: with SMTP id bk22mr3954231ejb.153.1603398004089; Thu, 22 Oct 2020 13:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603398004; cv=none; d=google.com; s=arc-20160816; b=mKSdl+4aWe0pX4N4FXDMgdQpa9yNLsbvm7DIq6QVb7hUkxvPWUL7m3Q+S5Wjqmw2N6 plz36kTT/G947/1DiqCw8o7oBrfiEtHOqDmdr5MrzqMcIZjmGgu0FMpcli7wq5WgHmBV 83PDa10Duy/8DIozHuxYRZBeDQa1nzH5ckC+i0lFd2Eg8pGjB9KjLco+KeDrYt8PWxhZ amULol88Z/aaYBjT57gWpj82EajXXXXs+vkEt49pbW+OXje40LhyZpN6pUqBp9pQ5RX/ caMh2kp03fNfyj9SazbUaw43Jkj5OL9EUKLKFzPYnjapM4GUUQdLMVeGP/4SgQ3zb0e/ d8hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=qWi7olx0i8jeUc5svHxbdLLoehMJAACFeJtvJPwksLs=; b=FgSu28ufys4sx6MfXmhubO/k+SF+F0beoDbzoqkkz5+ssFzV7WrTPuOCKgP+E9va9y T5YOKxiDj9wLA/wJW9fNOUE3BwNWs4VYzSdlIHpBmhftAk0ufesvlRCLsnqJ+7IPkQZs FIRX3IDxw7FBQ8eHmGnlbZgzxcRsFwxkbE2a+wsD4wy7lGWvj8azkANtFJ5+tO63sAVN ZIpIcBUYGA5tmnvrpt8Hpq54mfhb+tNs7m7f0oupIe3B5ck0DR51pvrGfsMzVy41xZyI 8cdkk8N01IREtzIYcaMAwgW+3r85YaOp6Biaxu6KCHUi14y7PG5dAeYlO8DRz2r3mUKi H4bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si1833189ejj.595.2020.10.22.13.19.41; Thu, 22 Oct 2020 13:20:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2900684AbgJVOJh (ORCPT + 99 others); Thu, 22 Oct 2020 10:09:37 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:46485 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2900678AbgJVOJg (ORCPT ); Thu, 22 Oct 2020 10:09:36 -0400 Received: by mail-ot1-f66.google.com with SMTP id m11so1567329otk.13; Thu, 22 Oct 2020 07:09:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qWi7olx0i8jeUc5svHxbdLLoehMJAACFeJtvJPwksLs=; b=TbKTaJNJyUE3xuyt9c+RFUDzi/fzDxpbvkg+Gd0HW4kDr+x/JtQEn1ATDy35BinY6I OgQ7JHOTf1HShQmVWyQ3uQUbM9SKZWzUjhIdYy7PE5MPCLmVVSq4WByn7UhA/oRIELtI z7lgGjdEg5IcDs7NGci8SYLzaFXawjNkVOISFfY7PwyVUUdp+ICIavHovIO/j3vO6BD/ H8aoEhGKH281K4TCvroGSi7VdLtfgWe4dGQ0DjCrOumnnZnGDMPcMZOLgEKe8m869m5F 9IKDCHb1UHeQ5Dvv2gqH9wxXyzD/9giJUvNN1p7PMxaciCQtDUzayA3pSTNC+pgkDOaN rZHw== X-Gm-Message-State: AOAM533aBZYhgcy7dJau4Ii9f3Tg2BZ8vo2e+8I3jrm2BJiKjXRKJ3TE gkEA9V0p8g+GQHADAEuiOdLe8BtTgy0kCr5kcvw= X-Received: by 2002:a05:6830:210a:: with SMTP id i10mr1979468otc.145.1603375775423; Thu, 22 Oct 2020 07:09:35 -0700 (PDT) MIME-Version: 1.0 References: <20201016121709.8447-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20201016121709.8447-5-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: <20201016121709.8447-5-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Geert Uytterhoeven Date: Thu, 22 Oct 2020 16:09:24 +0200 Message-ID: Subject: Re: [PATCH 4/4] clk: renesas: r8a774c0: Add RPC clocks To: Lad Prabhakar Cc: Michael Turquette , Stephen Boyd , Linux-Renesas , linux-clk , Linux Kernel Mailing List , Biju Das , Prabhakar Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, On Fri, Oct 16, 2020 at 2:17 PM Lad Prabhakar wrote: > Describe the RPCSRC internal clock and the RPC[D2] clocks derived from it, > as well as the RPC-IF module clock, in the RZ/G2E (R8A774C0) CPG/MSSR > driver. > > Inspired by commit 94e3935b5756 ("clk: renesas: r8a77980: Add RPC clocks"). > > Signed-off-by: Lad Prabhakar > Reviewed-by: Biju Das Thanks for your patch! > --- a/drivers/clk/renesas/r8a774c0-cpg-mssr.c > +++ b/drivers/clk/renesas/r8a774c0-cpg-mssr.c > @@ -73,6 +74,12 @@ static const struct cpg_core_clk r8a774c0_core_clks[] __initconst = { > DEF_FIXED(".s2", CLK_S2, CLK_PLL1, 4, 1), > DEF_FIXED(".s3", CLK_S3, CLK_PLL1, 6, 1), > DEF_FIXED(".sdsrc", CLK_SDSRC, CLK_PLL1, 2, 1), > + DEF_BASE(".rpcsrc", CLK_RPCSRC, CLK_TYPE_GEN3_RPCSRC, CLK_PLL1), > + > + DEF_BASE("rpc", R8A774C0_CLK_RPC, CLK_TYPE_GEN3_RPC, > + CLK_RPCSRC), > + DEF_BASE("rpcd2", R8A774C0_CLK_RPCD2, CLK_TYPE_GEN3_RPCD2, > + R8A774C0_CLK_RPC), > > DEF_DIV6_RO(".r", CLK_RINT, CLK_EXTAL, CPG_RCKCR, 32), > > @@ -275,6 +283,10 @@ static int __init r8a774c0_cpg_mssr_init(struct device *dev) > return rcar_gen3_cpg_init(cpg_pll_config, 0, cpg_mode); > } > > +static const struct clk_div_table cpg_rpcsrc_div_table[] = { > + { 0, 5 }, { 1, 3 }, { 2, 8 }, {3, 2}, {0, 0}, > +}; The above models RPCSRC as a clock generated by dividing PLL1 by either 5, 3, 8, or 2. This does not match the hardware user's manual, which states that RPCSRC is either PLL1 divided by 5 or 3, or PLL0 divided by 8 or 2. I think you need a new clock type (CLK_TYPE_GEN3E_RPCSRC, as it applies to RZ/G2E, and R-Car E3?), which registers a composite clock consisting of a mux and divider. This is a bit similar to the RPC/RPCD2 clocks, which are composite clocks consisting of a divider and a gate. Note that R-Car D3 is similar, except that PLL0 is divided by 5 or 2, which means yet another clock type (and div_table). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds