Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1407763pxb; Fri, 21 Jan 2022 17:58:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvB2FEoAy4GKAQaczCppOaRZwonI0bHw3fDYcOC8MC3Fd0/VnF+MFxaqECVrH5eqJKfdOj X-Received: by 2002:a17:90a:6409:: with SMTP id g9mr3282595pjj.108.1642816702179; Fri, 21 Jan 2022 17:58:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642816702; cv=none; d=google.com; s=arc-20160816; b=ccRBWXGcSoTmASq78I3Mm2WHdLFG9K4WDGaWxzyNp9aquQp46istfsoVj+IeRHICDF qUbwO8sft+s0OZmALWfwKOfJgjGIVxPrE58IEfFrKyN6m97M4kJBhjDqr9O1dwAYlK46 WuGytOF95cOe8P77SYaPRuuXUyH7ciy/ACFQYEg/4AGMxE+GM6Ufu15HJZ4D/bA/XIlS 3neIbQJdIr87/ccvpr6mByBjb+lXvFl9+azYwsKsjxcHR1VjPqHsStsefwEEhv6O93id D7qfm+rDOU6cROMvCHQPJhnR97Q+KdE1bOd8cXsFKGFH2tD2jRJxGPO0HXEU3VPfyBWr aIVg== 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=08CzZT3mvD81ccDG4Ahw8PON0/dRtPJlIrRMOEcIQq0=; b=jRRLZln4SlKMBeUq/M8HTScAsb6eYJB59htUbhZebr+DJNUuLZXUazM+7q3iZjxNar bJoMmOETUJvOOstLSWVGA9oM9MQdu6p9c+cgGLHEuSgoDmzs2htnxu/9czcIxKU6GRjp 9AEytSEg6tOyWa3/1iStZBaPB547QejTAAWvtJ19uTzg88eW9+IAHmJIgQajEIL+7bU+ 6LFV9fohSYPNU6F507XIGhP9T4gCpqrCoFnLyqMUVe+nEJXYD5QQW6nVX91BMx3WA5Wz vLGrpqIwTdlDHy/2UCvYu7E1+/ssmPxQdkhFlbEeGZrfW7wrBnoo2VjMdbdCXByL23i/ Nlng== 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 d3si8876461plg.418.2022.01.21.17.58.10; Fri, 21 Jan 2022 17:58:22 -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 S1351574AbiAUQj6 (ORCPT + 99 others); Fri, 21 Jan 2022 11:39:58 -0500 Received: from mail-ua1-f42.google.com ([209.85.222.42]:36856 "EHLO mail-ua1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbiAUQjz (ORCPT ); Fri, 21 Jan 2022 11:39:55 -0500 Received: by mail-ua1-f42.google.com with SMTP id r15so17920116uao.3; Fri, 21 Jan 2022 08:39:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=08CzZT3mvD81ccDG4Ahw8PON0/dRtPJlIrRMOEcIQq0=; b=VIABAAJDHwzrGevUBUGMyFyUvaC57Ebu+5Brbt8ayORxrLEVHjGmvMCsB6DtwRZ4Ti XSrcEJE7IkiutsWg7oLxK5J8Wg5bsGZujUsobnYEWMJM3bemXsilmtBeJHT9AHRmR6Q5 nZdurbTgmShFcZSxPK7BE9M6S6AQsnHxigjJvXYho9PQr3YthIM/qLsuCJ/9U0a9zuQL DLqxyUfyuleGKLqfeQIKWoj3bI7nL6NKZ9QAT8j4oH8oUWK1aqdOzd1qxoA4mTt84i4t 6fqfuLHOssDD1SQtmyLG3jbCqgh3OKBZUmm5kqYsn5X3VTk/8FtOEXHuVDGZTa5/q3pU yCFg== X-Gm-Message-State: AOAM532REYvzhdbkliAyeo4OvkmSKlXOSOu1hjc+Sp/MTFdqKgOzU7/e xDU86tZ5/Kh5RVwdonSCs94s98q0skccfA== X-Received: by 2002:a05:6102:3ec4:: with SMTP id n4mr2025644vsv.41.1642783194198; Fri, 21 Jan 2022 08:39:54 -0800 (PST) Received: from mail-ua1-f47.google.com (mail-ua1-f47.google.com. [209.85.222.47]) by smtp.gmail.com with ESMTPSA id y4sm1329355vsi.14.2022.01.21.08.39.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jan 2022 08:39:54 -0800 (PST) Received: by mail-ua1-f47.google.com with SMTP id y4so17926134uad.1; Fri, 21 Jan 2022 08:39:53 -0800 (PST) X-Received: by 2002:a67:e95a:: with SMTP id p26mr1990858vso.38.1642783193716; Fri, 21 Jan 2022 08:39:53 -0800 (PST) MIME-Version: 1.0 References: <20220110134659.30424-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220110134659.30424-6-prabhakar.mahadev-lad.rj@bp.renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Fri, 21 Jan 2022 17:39:42 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 05/12] clk: renesas: Add support for RZ/V2L SoC To: "Lad, Prabhakar" Cc: Lad Prabhakar , Linux-Renesas , Michael Turquette , Stephen Boyd , Biju Das , Linux Kernel Mailing List , linux-clk Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, On Fri, Jan 21, 2022 at 5:32 PM Lad, Prabhakar wrote: > On Fri, Jan 21, 2022 at 2:45 PM Geert Uytterhoeven wrote: > > On Mon, Jan 10, 2022 at 2:47 PM Lad Prabhakar > > wrote: > > > From: Biju Das > > > > > > The clock structure for RZ/V2L is almost identical to RZ/G2L SoC. The only > > > difference being RZ/V2L has an additional registers to control clock and > > > reset for the DRP-AI block. > > > > > > This patch adds minimal clock and reset entries required to boot the > > > system on Renesas RZ/V2L SMARC EVK and binds it with the RZ/G2L CPG core > > > driver. > > > > > > Signed-off-by: Biju Das > > > Signed-off-by: Lad Prabhakar > > > > Thanks for your patch! > > > > > --- /dev/null > > > +++ b/drivers/clk/renesas/r9a07g054-cpg.c > > > > > +const struct rzg2l_cpg_info r9a07g054_cpg_info = { > > > + /* Core Clocks */ > > > + .core_clks = r9a07g054_core_clks, > > > + .num_core_clks = ARRAY_SIZE(r9a07g054_core_clks), > > > + .last_dt_core_clk = LAST_DT_CORE_CLK, > > > + .num_total_core_clks = MOD_CLK_BASE, > > > + > > > + /* Critical Module Clocks */ > > > + .crit_mod_clks = r9a07g054_crit_mod_clks, > > > + .num_crit_mod_clks = ARRAY_SIZE(r9a07g054_crit_mod_clks), > > > + > > > + /* Module Clocks */ > > > + .mod_clks = r9a07g054_mod_clks, > > > + .num_mod_clks = ARRAY_SIZE(r9a07g054_mod_clks), > > > + .num_hw_mod_clks = R9A07G054_TSU_PCLK + 1, > > > > R9A07G054_STPAI_ACLK_DRP > > > Agreed. > > > > + > > > + /* Resets */ > > > + .resets = r9a07g054_resets, > > > + .num_resets = ARRAY_SIZE(r9a07g054_resets), > > > +}; > > > > Given RZ/V2L is RZ/G2L + DRP-AI, and the common clock IDs are the > > same, what about reusing r9a07g044-cpg.c, and just adding a separate > > r9a07g054_cpg_info? > > > Agreed. To clarify for clock and reset entries for common we use the > macros defined for RZ/G2L and for DRP entries we use the RZ/V2L macros > (which will be an additional member) ? You can have a struct with two arrays: static const struct { static struct rzg2l_mod_clk common[...]; #ifdef CONFIG_CLK_R9A07G054 static struct rzg2l_mod_clk drp[...]; #endif } r9a07g054_mod_clks[] = ... See drivers/pinctrl/renesas/pfc-r8a77951.c. > > When you add DRP-AI clocks and resets later, you just have to make > > sure .num_{core_clks,mod_clks,resets} are correct, similar to how > > drivers/pinctrl/renesas/pfc-r8a77951.c handles common and automotive > > pin groups and functions. > > > Agreed. E.g. ARRAY_SIZE(r9a07g054_mod_clks.common) vs. ARRAY_SIZE(r9a07g054_mod_clks.common) + ARRAY_SIZE(r9a07g054_mod_clks.drp). 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