Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2941891pxb; Mon, 16 Nov 2020 01:05:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJySL0ZIatDCnPbMC27tdnugJEwrJzFmLCiQh4gSDWldaoEhAt2Q6rHbAZUOqI46enrwrybo X-Received: by 2002:a05:6402:1206:: with SMTP id c6mr14493379edw.2.1605517553231; Mon, 16 Nov 2020 01:05:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605517553; cv=none; d=google.com; s=arc-20160816; b=nvX59A8u4EpZmY1AO/OXm4nwpFZvqlqxvfkwO7OKOkQB7l6LI68OFZ9G9T5LpUYKTH 1/VwCvhn1D5ihTEDl/czmOaLLI4lZIMP++HrKjuYG2BXlcavRFhVlSZuCOa6al/7sYv1 ajkp1XflrDNxW9J0v9UgiVM+JiKWh6KXsH7tDr8SEV+Allqhcc3Hk4nvtm9gOBG2nRIZ i1dbYfUMBiJhrSYoMMldzbHvLmSdHQU/YGUCUnwnV+CKHI3pr3nTxz85ZByrXmD+kW/i U62sof4p9Yi2rQV2UBMdQ9i878+BsamPD8q/WeSHyEHxdAWpeK91FBvIvzUaL8YCTfzH RPIA== 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=PfVGMxG4nUIJTFYRuzVvD7gtL2LeHv09UmzUT6YR6Oo=; b=pf5ROp3gUXEn/hp+6qpCACO5tPKT61p2xGSlfpn5zuLlENPfBevRn8aYd/APuUIE65 k9Lw/ZM0oa/1lSosOB9Zj7XTH8Op99EgE8qnm2OqfFuC4MacVHhca+ScNq7IMw5AiPWI ZBksJVC16P/5w9mugsZvRaNruNYAlJQ+LkZU6J2ovnrPB6ApVEZGcVVsKKQ5K3rXmJXk JPz3kwFMWdg+YJIp1pTJhTXdQXnFVYUEqprKq/RrKOHEb5AFWi3n7TgI2cnwksmIjM5A mFOCo2tCHvDu0gwZf2gHyAirFhQ0IV/G2jSxuo1+0gxiMPPVyjtl+ml1Hv0YeAlxq6QC IbXQ== 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 p9si11576106edm.38.2020.11.16.01.05.30; Mon, 16 Nov 2020 01:05:53 -0800 (PST) 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 S1728405AbgKPJCG (ORCPT + 99 others); Mon, 16 Nov 2020 04:02:06 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:41732 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728398AbgKPJCE (ORCPT ); Mon, 16 Nov 2020 04:02:04 -0500 Received: by mail-oi1-f195.google.com with SMTP id m13so18017543oih.8; Mon, 16 Nov 2020 01:02:03 -0800 (PST) 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=PfVGMxG4nUIJTFYRuzVvD7gtL2LeHv09UmzUT6YR6Oo=; b=J5FCGjhJwkPw95VtAf39En5UoQODDjTOmGj0fXWTKXpdpB/6O5NYynipBYMPRzYTR2 rFZYzP8rzuwpFFkfQBmOzn8NrkrEz9HR/POC6/nF7MpW842pzzXoz6/pvWER1W037c9a CBG5nwl7fp3Eq79owyIcU3jeVOdxsjZJ5y1lqvZkqlhcFfokipcqIDPPcUaVGCukTt2a Q1vf7IERWkefFzCvrO64ZOxqqNROBLO+8wwe2UfoU3bx7I6C1Obw+chkvJfMATO1MZqj o8B3SjRWGnQ3G6D5ZdERaHdXTxXrbYfx0X5AG1PdI0aCG9Tr1DbeoP3pTvQDBeeCe5rF OUBw== X-Gm-Message-State: AOAM531JH9Kn3aqfCSCzDLaUi8l2JNqbtJFu291dUtVB1hBbOeHyHY0M AVmtjQlCzHBNzIDBN6EcCwCXn3SMtkMXNdar1Fs= X-Received: by 2002:aca:4bc3:: with SMTP id y186mr8615767oia.153.1605517323566; Mon, 16 Nov 2020 01:02:03 -0800 (PST) MIME-Version: 1.0 References: <20201110125609.30246-1-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 16 Nov 2020 10:01:52 +0100 Message-ID: Subject: Re: [PATCH v3] clk: renesas: r8a774c0: Add RPC clocks To: "Lad, Prabhakar" Cc: Lad Prabhakar , Michael Turquette , Stephen Boyd , Linux-Renesas , linux-clk , Linux Kernel Mailing List , Biju Das Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, On Mon, Nov 16, 2020 at 9:54 AM Lad, Prabhakar wrote: > On Mon, Nov 16, 2020 at 8:34 AM Geert Uytterhoeven wrote: > > On Tue, Nov 10, 2020 at 1:56 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. > > > > > > Add new clk type CLK_TYPE_GEN3E3_RPCSRC to register rpcsrc as a fixed > > > clock on R-Car Gen3 E3 (and also RZ/G2E which is identical to E3 SoC), > > > parent and the divider is set based on the register value CPG_RPCCKCR[4:3] > > > (parent is cross verified against MD[4:1] pins) which has been set prior > > > to booting the kernel. > > > > > > MD[4] MD[3] MD[2] MD[1] > > > 0 0 0 1 -> RPCSRC CLK source is PLL1 > > > 0 0 1 1 -> RPCSRC CLK source is PLL1 > > > 0 1 0 0 -> RPCSRC CLK source is PLL1 > > > 1 0 1 1 -> RPCSRC CLK source is PLL1 > > > x x x x -> For any other values RPCSRC CLK source is PLL0 > > > > > > Signed-off-by: Lad Prabhakar > > > Reviewed-by: Biju Das > > > + switch (value) { > > > + case 0: > > > + div = 5; > > > + break; > > > + case 1: > > > + div = 3; > > > + break; > > > + case 2: > > > + parent = clks[core->parent >> 16]; > > > + if (IS_ERR(parent)) > > > + return ERR_CAST(parent); > > > + div = 8; > > > > R-Car D3 is very similar, but uses div = 5 instead of 8. > > Perhaps this value can be retrieved from cpg_core_clk.div? > > Of course, we can do that later, when D3 support is added. > > > Agreed, should the below be OK ? > > #define DEF_FIXED_RPCSRC_E3(_name, _id, _parent0, _parent1, _div) Fine, but then I would drop the _E3 suffix ;-) Alternatively, you can just hide the fixed 8 inside the macro, and add a seperate macro for D3 later. Up to you. 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