From patchwork Fri Nov 1 09:57:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C3330D5CC99 for ; Fri, 1 Nov 2024 10:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Gfm06b4hKMdHLkWB/4M6o/0esEDQBJdzAKRNLmWwPQA=; b=1wHyyI5QQ4ODCxbDAQlkzk0qC7 fzU9V1/8qRZtCtUWmylJ4POhuhdg8K7HrG0nHvGeNRRmf22vmPc/3TUTcuhCZd22rt7nIaWmSmzmP fIqnyNYnJgSKObaQLPfylQc7vpOO71oXPJKSUOQwB3Morn8X8zzdWbMx5cz2u3YvJ95ZgL6ZQz6xH WmZ5NbkgxAIALWVpdc8ar0qzUEuojaR0GoKMqZdC0POnPtkSpGERkVCS5/4NXTt8Z58jQHMl+7oaC 2es0uxZ1bb/PvMsnFP32GogLFs+pHivsWEPQziyWPPBQ5h9+a3nsubUtdFT1hmLy7TnUOvCParde+ 2mkQ8niA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6oSp-00000006UDl-232d; Fri, 01 Nov 2024 10:01:07 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPT-00000006TK4-2z8R for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:41 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5cb74434bc5so2143211a12.0 for ; Fri, 01 Nov 2024 02:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455058; x=1731059858; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gfm06b4hKMdHLkWB/4M6o/0esEDQBJdzAKRNLmWwPQA=; b=DFQ+LUMaf/AG0xrTqnogN4mda7UBk809CyLKPpTWvQlfJNR1bLzDqLzGiWMkQPyEoq CWv1lPNdKNuvvR5Mk1dC9x4/LuezRnNXRS/Jny4sNZ+/asG0hCsgV51iaFJHZ0kXO1MG QOfB9DmQdWDDwcN4bIuxfhALBMZl6CE+IIu29Q/rLLG1GpDOoLxVHSdduI3otd8OL6FB iEa7jAfzXg3tofr5QMqtoU66CNMM+s2R7dEqLPB50Hx7zEWe09QTTY/N+zi2+iXcqXgH TxIhf7OHfmLb8vIfZXzdOwP87n7pBg+WMJ5JXnaFjR1iZijLKkMh/YMAzh+utqYRzkwk 2aWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455058; x=1731059858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gfm06b4hKMdHLkWB/4M6o/0esEDQBJdzAKRNLmWwPQA=; b=cCPfcRBrZEfDtUQCL9dE50D9M9td1SaOa5owk3NgiNz7OppKs1DsagSttCGVmPpDWI HadmtshaSbqN4n16zJQSQUv3HdmYDPoostKhlXbnIxggmD0jjIpZikLw6BXXj7iCdemr B/30hZBYwL4kPR7QR6l+//miTIlKX7LLVyhw7tbpjUPVjZP+SoMPLSM96jgVknCqT2Jf ftXRJybMpUJi+34yOq+IiFqDIT4+Ou4pUR7JxGoCdSdENzGvIu9s/nHJ/Xfa2rrB+TvI nh1OLBitfZdUM/BQLrX/l5agA1PWX/SBlNVCN0baggAxDyhtG/GcmuaEPMjpD2+ARKBc 98cQ== X-Forwarded-Encrypted: i=1; AJvYcCXr0adv42L82DKrjuHZT+WyzfJL6Xhm+oxw9++0FdVv2/qhJF4Okq2f1ayYHcjWY6d897rwmMK8NFwBTGAiQ3GC@lists.infradead.org X-Gm-Message-State: AOJu0YyXLMJQjqEJsWZ/8HvKLC2crToDV/CaHHhhbDDUt0kZ9hhu0A+v vwTGZ03tWIYr5UvFwUaK+oU8GaZ+cNWa/yKddMaQxeSalsRBBpeQBwZ/uyTVi7o= X-Google-Smtp-Source: AGHT+IEb89p86xoYXu3JKTNPryZg3y3CDRh6iFfjnC4NPmIs9ROG2Yx148IwXpRj1QPZZK99u/gJwg== X-Received: by 2002:a05:6402:1d4e:b0:5cb:7443:27d4 with SMTP id 4fb4d7f45d1cf-5ceb9343488mr2308264a12.25.1730455057897; Fri, 01 Nov 2024 02:57:37 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:37 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea , Krzysztof Kozlowski Subject: [PATCH v6 1/9] dt-bindings: clock: renesas,r9a08g045-vbattb: Document VBATTB Date: Fri, 1 Nov 2024 11:57:12 +0200 Message-Id: <20241101095720.2247815-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025739_814022_F0BF089B X-CRM114-Status: GOOD ( 24.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea The VBATTB IP of the Renesas RZ/G3S SoC controls the clock for RTC, the tamper detector and a small general usage memory of 128B. The VBATTB controller controls the clock for the RTC on the Renesas RZ/G3S. The HW block diagram for the clock logic is as follows: +----------+ XC `\ RTXIN --->| |----->| \ +----+ VBATTCLK | 32K clock| | |----->|gate|-----------> | osc | XBYP | | +----+ RTXOUT --->| |----->| / +----------+ ,/ One could connect as input to this HW block either a crystal or an external clock device. This is board specific. After discussions w/ Stephen Boyd the clock tree associated with this hardware block was exported in Linux as: input-xtal xbyp xc mux vbattclk where: - input-xtal is the input clock (connected to RTXIN, RTXOUT pins) - xc, xbyp are mux inputs - mux is the internal mux - vbattclk is the gate clock that feeds in the end the RTC to allow selecting the input of the MUX though assigned-clock DT properties, using the already existing clock drivers and avoid adding other DT properties. This allows select the input of the mux based on the type of the connected input clock: - if the 32768 crystal is connected as input for the VBATTB, the input of the mux should be xc - if an external clock device is connected as input for the VBATTB the input of the mux should be xbyp Add bindings for the VBATTB controller. Reviewed-by: Geert Uytterhoeven Reviewed-by: Krzysztof Kozlowski Signed-off-by: Claudiu Beznea --- Changes in v6: - collected tags Changes in v5: - used spaces in the diagram from the patch description - added "This is board specific" in the board description to emphasize the usage of the assigned-clocks in the example - added default for quartz-load-femtofarads - collected tags Changes in v4: - squashed with patch "Add clock IDs for the VBATTB controller" from v3 - removed "oscillator" word from commit description - added assigned-clocks, assigned-clock-parents to the documentation example - used clock-controller for the node name - used "quartz-load-femtofarads" property for the load capacitance - renamed include/dt-bindings/clock/r9a08g045-vbattb.h to include/dt-bindings/clock/renesas,r9a08g045-vbattb.h Changes in v3: - moved the file to clock dt bindings directory as it is the only functionality supported at the moment; the other functionalities (tamper detector, SRAM) are offered though register spreaded though the address space of the VBATTB IP and not actually individual devices; the other functionalities are not planned to be supported soon and if they will be I think they fit better on auxiliary bus than MFD - dropped interrupt names as requested in the review process - dropped the inner node for clock controller - added #clock-cells - added rtx clock - updated description for renesas,vbattb-load-nanofarads - included dt-bindings/interrupt-controller/irq.h in examples section Changes in v2: - changed file name and compatible - updated title, description sections - added clock controller part documentation and drop dedicated file for it included in v1 - used items to describe interrupts, interrupt-names, clocks, clock-names, resets - dropped node labels and status - updated clock-names for clock controller to cope with the new logic on detecting the necessity to setup bypass .../clock/renesas,r9a08g045-vbattb.yaml | 84 +++++++++++++++++++ .../clock/renesas,r9a08g045-vbattb.h | 13 +++ 2 files changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/renesas,r9a08g045-vbattb.yaml create mode 100644 include/dt-bindings/clock/renesas,r9a08g045-vbattb.h diff --git a/Documentation/devicetree/bindings/clock/renesas,r9a08g045-vbattb.yaml b/Documentation/devicetree/bindings/clock/renesas,r9a08g045-vbattb.yaml new file mode 100644 index 000000000000..3707e4118949 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/renesas,r9a08g045-vbattb.yaml @@ -0,0 +1,84 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/renesas,r9a08g045-vbattb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas Battery Backup Function (VBATTB) + +description: + Renesas VBATTB is an always on powered module (backed by battery) which + controls the RTC clock (VBATTCLK), tamper detection logic and a small + general usage memory (128B). + +maintainers: + - Claudiu Beznea + +properties: + compatible: + const: renesas,r9a08g045-vbattb + + reg: + maxItems: 1 + + interrupts: + items: + - description: tamper detector interrupt + + clocks: + items: + - description: VBATTB module clock + - description: RTC input clock (crystal or external clock device) + + clock-names: + items: + - const: bclk + - const: rtx + + '#clock-cells': + const: 1 + + power-domains: + maxItems: 1 + + resets: + items: + - description: VBATTB module reset + + quartz-load-femtofarads: + description: load capacitance of the on board crystal + enum: [ 4000, 7000, 9000, 12500 ] + default: 4000 + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - '#clock-cells' + - power-domains + - resets + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + clock-controller@1005c000 { + compatible = "renesas,r9a08g045-vbattb"; + reg = <0x1005c000 0x1000>; + interrupts = ; + clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <&vbattb_xtal>; + clock-names = "bclk", "rtx"; + assigned-clocks = <&vbattb VBATTB_MUX>; + assigned-clock-parents = <&vbattb VBATTB_XC>; + #clock-cells = <1>; + power-domains = <&cpg>; + resets = <&cpg R9A08G045_VBAT_BRESETN>; + quartz-load-femtofarads = <12500>; + }; diff --git a/include/dt-bindings/clock/renesas,r9a08g045-vbattb.h b/include/dt-bindings/clock/renesas,r9a08g045-vbattb.h new file mode 100644 index 000000000000..67774eafad06 --- /dev/null +++ b/include/dt-bindings/clock/renesas,r9a08g045-vbattb.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) + * + * Copyright (C) 2024 Renesas Electronics Corp. + */ +#ifndef __DT_BINDINGS_CLOCK_R9A08G045_VBATTB_H__ +#define __DT_BINDINGS_CLOCK_R9A08G045_VBATTB_H__ + +#define VBATTB_XC 0 +#define VBATTB_XBYP 1 +#define VBATTB_MUX 2 +#define VBATTB_VBATTCLK 3 + +#endif /* __DT_BINDINGS_CLOCK_R9A08G045_VBATTB_H__ */ From patchwork Fri Nov 1 09:57:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 33F10E68948 for ; Fri, 1 Nov 2024 10:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ewtg0K16I6vEI9VCro/VP2IXg7P8FX0BQ2vY0LS22pU=; b=LHdCm9iIbEU1J3sS1K2968oiHS 1vwRnr1G7g+oEw6A38Zh+j8VoBxFonJvlFieP3TmLuOmRh+muXsU92yQeKMElOAuee4ijMssUFE63 IFAtkOZSvjh0qGRtCrf7lsrjYMlQXJcbGcWmafIkdeE0A2nDGs+XNXvoPPDwRDtoAAmkVMwTXy1Br 9FaLlFyJfo8Me9Yg+F3j0RvVvn5dmnYrKfJOY43jasT8J/AkXJQM3etzjJupjsDBVZ2vwHoxYET+o 35xKoSo/z4GtKFVajc52ZKSoOmfFwXxCjNt3LM1OtFL6yxVPsENJxk7Oif4nK/7Lgg1JxlAf6wXEd G8H+mIUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6oUV-00000006Ubw-3vfU; Fri, 01 Nov 2024 10:02:51 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPW-00000006TKy-3iUi for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:44 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5c9150f9ed4so2448995a12.0 for ; Fri, 01 Nov 2024 02:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455061; x=1731059861; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ewtg0K16I6vEI9VCro/VP2IXg7P8FX0BQ2vY0LS22pU=; b=RRhrFKN4dEkGCC88v5Zbt1ov/EgXytZbJ2xUpXvKZ6YaeTUVy9jhRdjbrIF/+lO/US QU9dSikW9D6yZJqy81Ueq0yOvz0ZR/MTnh6fZVMXLoWDCBhqd8u8Zn+g1o95BT9Fd7de FcppMGcMY7OcLsJHukmZ0O05W/dosxzYLoQBT7HAndTfZhjzE7cw+8tUwVYhyqrhHZa0 JUoOTxXKGHj6U8HDkb7oic1zOS3EN8I0PKdTjBa/f+6QOwIiQkyVeQWBN41W0IRgqNXv 4DMb9SVr2ZGC+NQ5MBCghC+qqIShjPT1a2gtGfiIWM/lgpRMuMSroi3vKentgn7+jPXw zfbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455061; x=1731059861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ewtg0K16I6vEI9VCro/VP2IXg7P8FX0BQ2vY0LS22pU=; b=THkE58Bdwu3Go00A1rbTp1tz2Fxe9l9rwGmVPFONmyQ6hket2AMgBSFEhF6vgrS7BE FFCDb9S4R3riRv/KOzlHZYs5cQ/fep/UefcZEoJA1UvZzZEpS3ybLpdp4qaF3o2U1RK0 HGtRjdfUytNUvxp46UmiLTP6RX94rcboRApsitu1/xp390rTyH/QmRg9xPiMCxE5C0NP StFIvKA0ajh9w0tcQAOP5t2SaoGFpQP83lzA9l55IlQFJCRYFgcYeDq/0/0EqYg4/Nvh 07iZ6fg1bG5WGG8HrEA3Dq/dLaiACWRy4R3J1tgwljIGExOrD42GkYjOxLxS3LdHy6AR zHxA== X-Forwarded-Encrypted: i=1; AJvYcCVMuU/qwBAPmjGBLELRqIWEj7vWdqCYt/L/B3Vlaz7mKaXP7a/1zVuayNL9VYgqcUFcQrYnne1TZiWMnVroH5yf@lists.infradead.org X-Gm-Message-State: AOJu0YygFqGmDrPQt5BiQAlIBbbRTsdNJGp3P/mU3GTyhOzblTX21TCE +hvwCQt6znjszWT+R8VaotCNeO4Uar5FWYb4gA+427peAwcc80mW/s5oc89Y3nk= X-Google-Smtp-Source: AGHT+IEFGiN/u4W5r9i6MtaqopU2l9fL1FFrDwTz4s8iqC4tcmgZL2qm6/VdNeHlxydCj5OuRaUwEA== X-Received: by 2002:a05:6402:350c:b0:5cb:69bb:ba8e with SMTP id 4fb4d7f45d1cf-5cbbfa78a8fmr13489266a12.34.1730455061093; Fri, 01 Nov 2024 02:57:41 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:40 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 2/9] clk: linux/clk-provider.h: Add devm_clk_hw_register_gate_parent_hw() Date: Fri, 1 Nov 2024 11:57:13 +0200 Message-Id: <20241101095720.2247815-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025742_954090_C0E683F8 X-CRM114-Status: GOOD ( 12.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Add devm_clk_hw_register_gate_parent_hw() macro to allow registering devres managed gate clocks providing struct clk_hw object as parent. Reviewed-by: Geert Uytterhoeven Acked-by: Stephen Boyd Signed-off-by: Claudiu Beznea --- Changes in v6: - collected tags Changes in v5: - none Changes in v4: - collected tags Changes in v3: - none; this patch is new include/linux/clk-provider.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 75444e250a78..a49859ef3304 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -622,6 +622,24 @@ struct clk *clk_register_gate(struct device *dev, const char *name, __devm_clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \ NULL, (flags), (reg), (bit_idx), \ (clk_gate_flags), (lock)) +/** + * devm_clk_hw_register_gate_parent_hw - register a gate clock with the clock + * framework + * @dev: device that is registering this clock + * @name: name of this clock + * @parent_hw: pointer to parent clk + * @flags: framework-specific flags for this clock + * @reg: register address to control gating of this clock + * @bit_idx: which bit in the register controls gating of this clock + * @clk_gate_flags: gate-specific flags for this clock + * @lock: shared register lock for this clock + */ +#define devm_clk_hw_register_gate_parent_hw(dev, name, parent_hw, flags, \ + reg, bit_idx, clk_gate_flags, \ + lock) \ + __devm_clk_hw_register_gate((dev), NULL, (name), NULL, (parent_hw), \ + NULL, (flags), (reg), (bit_idx), \ + (clk_gate_flags), (lock)) /** * devm_clk_hw_register_gate_parent_data - register a gate clock with the * clock framework From patchwork Fri Nov 1 09:57:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 298F8E68948 for ; Fri, 1 Nov 2024 10:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P3ThccVles5w9h5xpm4pKe/Bf3Vhlh9BHbKUv1nFK9g=; b=Kz4m5DxGmTjxK0JxQJeBjNbHt8 oPLKbjn6El+Od0HcBmm7aLqXN9j6Wc/5PyPWVCiry5kHGMOX9qnteyZqBhNNnMDcOiHHC0zwHI3qA 6iTeNgl+aN1C+T9SEZdk5p3QgsHeLUoNtTcM2R1iN1VrbUr8D05cMpD/Kx+LJWBq+fm03U8KY9UR3 CsmnQEiQlpBfgiWMc4jyKgkysphrvB9DWwz5R2YgGF33YqPClOjefJdaWC/jS8fnF/d0ooTvRy2It o7E8f2tktPk9PYcpXf2g8wUTW7/FaVOFnIEuBAiUaqTnA+v5XPPm6s5e3Sw7R8WpWYlsj+IHUnUDF BUcq9z+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6oWA-00000006Uss-1A4T; Fri, 01 Nov 2024 10:04:34 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPZ-00000006TLe-3cg6 for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:47 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5ceb03aaddeso1612398a12.2 for ; Fri, 01 Nov 2024 02:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455064; x=1731059864; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P3ThccVles5w9h5xpm4pKe/Bf3Vhlh9BHbKUv1nFK9g=; b=R+egKzEMvsnoijQtqj4pLrbHAY0ToGj3YvxQQNHhqoMKnZZpPsojLs60IXCndLQ33r I/CnWZ00kkc54WtfdmgmWgtMH6TWp6L1u9naEbHUVwVPpSzv1Sr0mxLr3gWHr+cEbxZ9 YWYHbNKwFb+Ka8/VQUDXUO6wft1hemEKlDuFz9kO7HN+1KNMZZpikVRsY1lFB6S2vQU6 vRAPIyk7DJc4U1wkV0yp2WjD7i3oaqEIwo2/1O7MGp6B6FfMYeX9qxvNry0m+K7hd0yv mV/9GNcykdUTl2ETTbvqJE2eTCJB8VyW86aQqbERzefIMkzFYqPwpnhozls8Zs42Rl+q Yftg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455064; x=1731059864; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P3ThccVles5w9h5xpm4pKe/Bf3Vhlh9BHbKUv1nFK9g=; b=ZJPH3T7pZwU2z9zHP6NxvQVzzvGkPIgnvHtvWkJIHuy0t6OJJSQ0eoZcbr0ZOxRmG4 PWdgWLZ4cdBz3lq7+BWdyd4s4lfeKshJD6QSzdTQsBn+USdHBO9Dq6mZlrU5L8L8EZsm UeRONX1yNR8/ZfYqaMmlp5BHsRcaX+0QnRCH+/EEf28rBBmADMDA2BuJaDVh5FTxW9PI zutQtCNFiF+aMXNvF5XZOoOXTn/HnA/j8RywD8h04ALdE0HBtZAXuei8bv4h5kKJ0dob wPC3dHV+x+0zUKoE5DrEz8mrTnvwFJx9rEgN8XNmQTfEMLqH8iJ41RhhUuSxODiAgy+z G/0Q== X-Forwarded-Encrypted: i=1; AJvYcCW4gOgWq/IZIVHeOuJ9kPmekX7h23542TifE9yRWfeMGnuE8OoVXgFGCxefpyBOtHjJxt5W48crn3zYkUQ7Gcvx@lists.infradead.org X-Gm-Message-State: AOJu0YxgRSNJBMFhcoOiNHRZWYB+LH+4SNQh2BPVXgWDdQ/53YRoU4vf j2/BeBBQjPeaCvK1vx2cKPa7BbkQU2asozokG4w8kVldjTed7bso8fHmZz/rHSU= X-Google-Smtp-Source: AGHT+IGUlhOCwH2fmBWL8ZNb53+BHcSpXdIr+V/UM4VkSvZJ7t8FyZkdKsmNGaJmF573TUlMHtoPSw== X-Received: by 2002:a05:6402:13c9:b0:5c9:6eea:8e06 with SMTP id 4fb4d7f45d1cf-5cbbf947c0cmr18513608a12.24.1730455064181; Fri, 01 Nov 2024 02:57:44 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:43 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 3/9] clk: renesas: clk-vbattb: Add VBATTB clock driver Date: Fri, 1 Nov 2024 11:57:14 +0200 Message-Id: <20241101095720.2247815-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025745_944650_6A4E245B X-CRM114-Status: GOOD ( 33.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea The VBATTB IP of the Renesas RZ/G3S SoC controls the clock that is used by the RTC. The input to the VBATTB could be a 32KHz crystal or an external clock device. The HW block diagram for the clock generator is as follows: +----------+ XC `\ RTXIN --->| |----->| \ +----+ VBATTCLK | 32K clock| | |----->|gate|-----------> | osc | XBYP | | +----+ RTXOUT --->| |----->| / +----------+ , After discussions w/ Stephen Boyd the clock tree associated with this hardware block was exported in Linux as: vbattb-xtal xbyp xc mux vbattbclk where: - input-xtal is the input clock (connected to RTXIN, RTXOUT pins) - xc, xbyp are mux inputs - mux is the internal mux - vbattclk is the gate clock that feeds in the end the RTC to allow selecting the input of the MUX though assigned-clock DT properties, using the already existing clock drivers and avoid adding other DT properties. If the crystal is connected on RTXIN, RTXOUT pins the XC will be selected as mux input. If an external clock device is connected on RTXIN, RTXOUT pins the XBYP will be selected as mux input. The load capacitance of the internal crystal can be configured with renesas,vbattb-load-nanofarads DT property. Reviewed-by: Geert Uytterhoeven Signed-off-by: Claudiu Beznea --- Changes in v6: - used tristate - added depends ARCH_RENESAS || COMPILE_TEST Changes in v5: - collected tags Changes in v4: - dropped oscillator from patch description - s/on-board/internal in patch description - updated dt-binding included file name in the driver as it has been renamed to include/dt-bindings/clock/renesas,r9a08g045-vbattb.h - dropped the "_BIT" from driver macros - used "quartz-load-femtofarads" dt property instead of adding a new one - register the "vbattclk" as critical clock as this feeds the RTC counter logic and it needs to stay on from the moment the RTC is configured; along with it, added a comment to express this. Changes in v3: - updated patch description - dropped dependency on MFD_RENESAS_VBATTB as now there is no driver built under this flag - dropped include/clk.h - added pm_runtime and reset control support - updated register offsets - registered 4 clocks: xc, xbyp, mux, vbattclk using generic clock drivers - added MODULE_DEVICE_TABLE() Changes in v2: - updated patch description - added vendor name in Kconfig flag - used cleanup.h lock helpers - dropped the MFD code - updated registers offsets - added vbattb_clk_update_bits() and used it where possible - added vbattb_clk_need_bypass() to detect the bypass setup necessity - changed the compatible and driver names drivers/clk/renesas/Kconfig | 5 + drivers/clk/renesas/Makefile | 1 + drivers/clk/renesas/clk-vbattb.c | 205 +++++++++++++++++++++++++++++++ 3 files changed, 211 insertions(+) create mode 100644 drivers/clk/renesas/clk-vbattb.c diff --git a/drivers/clk/renesas/Kconfig b/drivers/clk/renesas/Kconfig index 76791a1c50ac..ff01f5f0ed20 100644 --- a/drivers/clk/renesas/Kconfig +++ b/drivers/clk/renesas/Kconfig @@ -237,6 +237,11 @@ config CLK_RZV2H bool "RZ/V2H(P) family clock support" if COMPILE_TEST select RESET_CONTROLLER +config CLK_RENESAS_VBATTB + tristate "Renesas VBATTB clock controller" + depends on ARCH_RZG2L || COMPILE_TEST + select RESET_CONTROLLER + # Generic config CLK_RENESAS_CPG_MSSR bool "CPG/MSSR clock support" if COMPILE_TEST diff --git a/drivers/clk/renesas/Makefile b/drivers/clk/renesas/Makefile index 23d2e26051c8..82efaa835ac7 100644 --- a/drivers/clk/renesas/Makefile +++ b/drivers/clk/renesas/Makefile @@ -53,3 +53,4 @@ obj-$(CONFIG_CLK_RZV2H) += rzv2h-cpg.o obj-$(CONFIG_CLK_RENESAS_CPG_MSSR) += renesas-cpg-mssr.o obj-$(CONFIG_CLK_RENESAS_CPG_MSTP) += clk-mstp.o obj-$(CONFIG_CLK_RENESAS_DIV6) += clk-div6.o +obj-$(CONFIG_CLK_RENESAS_VBATTB) += clk-vbattb.o diff --git a/drivers/clk/renesas/clk-vbattb.c b/drivers/clk/renesas/clk-vbattb.c new file mode 100644 index 000000000000..ff9d1ead455c --- /dev/null +++ b/drivers/clk/renesas/clk-vbattb.c @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * VBATTB clock driver + * + * Copyright (C) 2024 Renesas Electronics Corp. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define VBATTB_BKSCCR 0x1c +#define VBATTB_BKSCCR_SOSEL 6 +#define VBATTB_SOSCCR2 0x24 +#define VBATTB_SOSCCR2_SOSTP2 0 +#define VBATTB_XOSCCR 0x30 +#define VBATTB_XOSCCR_OUTEN 16 +#define VBATTB_XOSCCR_XSEL GENMASK(1, 0) +#define VBATTB_XOSCCR_XSEL_4_PF 0x0 +#define VBATTB_XOSCCR_XSEL_7_PF 0x1 +#define VBATTB_XOSCCR_XSEL_9_PF 0x2 +#define VBATTB_XOSCCR_XSEL_12_5_PF 0x3 + +/** + * struct vbattb_clk - VBATTB clock data structure + * @base: base address + * @lock: lock + */ +struct vbattb_clk { + void __iomem *base; + spinlock_t lock; +}; + +static int vbattb_clk_validate_load_capacitance(u32 *reg_lc, u32 of_lc) +{ + switch (of_lc) { + case 4000: + *reg_lc = VBATTB_XOSCCR_XSEL_4_PF; + break; + case 7000: + *reg_lc = VBATTB_XOSCCR_XSEL_7_PF; + break; + case 9000: + *reg_lc = VBATTB_XOSCCR_XSEL_9_PF; + break; + case 12500: + *reg_lc = VBATTB_XOSCCR_XSEL_12_5_PF; + break; + default: + return -EINVAL; + } + + return 0; +} + +static void vbattb_clk_action(void *data) +{ + struct device *dev = data; + struct reset_control *rstc = dev_get_drvdata(dev); + int ret; + + ret = reset_control_assert(rstc); + if (ret) + dev_err(dev, "Failed to de-assert reset!"); + + ret = pm_runtime_put_sync(dev); + if (ret < 0) + dev_err(dev, "Failed to runtime suspend!"); + + of_clk_del_provider(dev->of_node); +} + +static int vbattb_clk_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct clk_parent_data parent_data = {}; + struct clk_hw_onecell_data *clk_data; + const struct clk_hw *parent_hws[2]; + struct device *dev = &pdev->dev; + struct reset_control *rstc; + struct vbattb_clk *vbclk; + u32 of_lc, reg_lc; + struct clk_hw *hw; + /* 4 clocks are exported: VBATTB_XC, VBATTB_XBYP, VBATTB_MUX, VBATTB_VBATTCLK. */ + u8 num_clks = 4; + int ret; + + /* Default to 4pF as this is not needed if external clock device is connected. */ + of_lc = 4000; + of_property_read_u32(np, "quartz-load-femtofarads", &of_lc); + + ret = vbattb_clk_validate_load_capacitance(®_lc, of_lc); + if (ret) + return ret; + + vbclk = devm_kzalloc(dev, sizeof(*vbclk), GFP_KERNEL); + if (!vbclk) + return -ENOMEM; + + clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, num_clks), GFP_KERNEL); + if (!clk_data) + return -ENOMEM; + clk_data->num = num_clks; + + vbclk->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(vbclk->base)) + return PTR_ERR(vbclk->base); + + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; + + rstc = devm_reset_control_get_shared(dev, NULL); + if (IS_ERR(rstc)) + return PTR_ERR(rstc); + + ret = pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + ret = reset_control_deassert(rstc); + if (ret) { + pm_runtime_put_sync(dev); + return ret; + } + + dev_set_drvdata(dev, rstc); + ret = devm_add_action_or_reset(dev, vbattb_clk_action, dev); + if (ret) + return ret; + + spin_lock_init(&vbclk->lock); + + parent_data.fw_name = "rtx"; + hw = devm_clk_hw_register_gate_parent_data(dev, "xc", &parent_data, 0, + vbclk->base + VBATTB_SOSCCR2, + VBATTB_SOSCCR2_SOSTP2, + CLK_GATE_SET_TO_DISABLE, &vbclk->lock); + if (IS_ERR(hw)) + return PTR_ERR(hw); + clk_data->hws[VBATTB_XC] = hw; + + hw = devm_clk_hw_register_fixed_factor_fwname(dev, np, "xbyp", "rtx", 0, 1, 1); + if (IS_ERR(hw)) + return PTR_ERR(hw); + clk_data->hws[VBATTB_XBYP] = hw; + + parent_hws[0] = clk_data->hws[VBATTB_XC]; + parent_hws[1] = clk_data->hws[VBATTB_XBYP]; + hw = devm_clk_hw_register_mux_parent_hws(dev, "mux", parent_hws, 2, 0, + vbclk->base + VBATTB_BKSCCR, + VBATTB_BKSCCR_SOSEL, + 1, 0, &vbclk->lock); + if (IS_ERR(hw)) + return PTR_ERR(hw); + clk_data->hws[VBATTB_MUX] = hw; + + /* Set load capacitance before registering the VBATTCLK clock. */ + scoped_guard(spinlock, &vbclk->lock) { + u32 val = readl_relaxed(vbclk->base + VBATTB_XOSCCR); + + val &= ~VBATTB_XOSCCR_XSEL; + val |= reg_lc; + writel_relaxed(val, vbclk->base + VBATTB_XOSCCR); + } + + /* This feeds the RTC counter clock and it needs to stay on. */ + hw = devm_clk_hw_register_gate_parent_hw(dev, "vbattclk", hw, CLK_IS_CRITICAL, + vbclk->base + VBATTB_XOSCCR, + VBATTB_XOSCCR_OUTEN, 0, + &vbclk->lock); + + if (IS_ERR(hw)) + return PTR_ERR(hw); + clk_data->hws[VBATTB_VBATTCLK] = hw; + + return of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); +} + +static const struct of_device_id vbattb_clk_match[] = { + { .compatible = "renesas,r9a08g045-vbattb" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, vbattb_clk_match); + +static struct platform_driver vbattb_clk_driver = { + .driver = { + .name = "renesas-vbattb-clk", + .of_match_table = vbattb_clk_match, + }, + .probe = vbattb_clk_probe, +}; +module_platform_driver(vbattb_clk_driver); + +MODULE_DESCRIPTION("Renesas VBATTB Clock Driver"); +MODULE_AUTHOR("Claudiu Beznea "); +MODULE_LICENSE("GPL"); From patchwork Fri Nov 1 09:57:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859069 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DDB34E6B241 for ; Fri, 1 Nov 2024 10:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1RfCSiRKPCnvU8GbAS6ruNWu/VWU6I+MnOUaUXq52C0=; b=AwS6f5LkW0N1sqXb3gcukHrO/3 CaiS6cCfIsBfXsVsAVobHRUcX+JrLyiJkontt9dgJgjqyJfBe0jcXV+Lc0S69vCrBDl2kSHhPBK6e wxb6hxV55x/pPZ1xwm2kgdNbzh3KWem1iZ8TK4bph5uuwOXSh5o7z0Hs/HruXSIa9G8SIrFnK4cVl 5ozzy9VcVS+2XH6EYJZiE6HlL5swEH/nHCLH0DKohePchYzkNTiRuTaBlmKLaFI8vDaqZC3Lgqghs w7jkevFJNaK/DX8eZ5VOB6nBOCJQl3WWO71SqDxs9sWM1OEFBwWS3ZG3QlQEddz0gazln3R521XDW WfBhtulg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6oXq-00000006VKi-35Tj; Fri, 01 Nov 2024 10:06:18 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPc-00000006TML-0mBX for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:49 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5ceb75f9631so1318084a12.0 for ; Fri, 01 Nov 2024 02:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455067; x=1731059867; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1RfCSiRKPCnvU8GbAS6ruNWu/VWU6I+MnOUaUXq52C0=; b=QR4YUKPz/NQiMs6ueqX6RzXWnTgyjztIcfvcLJ9EGQ1gOBetsqEYrgYZ0+VcDa0EKX W/SJKsiR2j2WE5u7M51mpEFZs8XLHZfS/kiynG9grfAy9w+w0Qzde5/4IQ4HuPMY5WDR ZbIxk4KqO8+PgOKNY6U4R68hxJ5VNllfgtbLB2h3+uCWHGcKn5Ahm/XOz9ABgRxLWPeK AUa1OG53hVPh7P6pXBhsE09H3Lk4/zlSiO7qT3wWBkI2Oi68yYfrEy2viry094rcNIhV iH+jWLhQuJOYIM+mod2dAE7uazj+Ze+FXwYzJwcVe3fCqTlC4bKIiyvkD97eOuvTTXED 70Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455067; x=1731059867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1RfCSiRKPCnvU8GbAS6ruNWu/VWU6I+MnOUaUXq52C0=; b=g7g58ww68hwjJ8J23P+UunBiqFX62a8oAHikhnYl4fE0mQ3U90KtwKy5bin6louPkZ b1/HdJJOoQJMCVGDvljqI0gHcvGK+O7n1ieKh4FhWkTjLUeJUwIGnQ3xgmks49kI68P1 vjfIARXPKa3kIVsC7hUi3yBo9Xx3a1MbUvlPM2PtoKRxXnmQ2R/OA8JJ+HlV8OkUtuRN heHBhz6OVe2s086ito7zGzaMLIvF93Ad/KqBd4GrV1VHY13qKZ2T+GY+kObTaV32srai UHzhEALWTRoJiiaEdVziIKCnHu1Ay5qwY2FIscggUuM0T1NqsrDLKkzubaItHPEsA2hq rEvA== X-Forwarded-Encrypted: i=1; AJvYcCXrxAjmuoBqf0nQIvzNmDWJe+M2VKUAPsPG68FAxPYlMbi2TrvvPBKqCREorMLfhSf4A3HtCsQRBWY/PTgj9Q9f@lists.infradead.org X-Gm-Message-State: AOJu0YzYukRb13GOPmwCTSh/tXD3YvvN9Tr8xXNm9uscBIz+vL0Y3yVL ppCwY50YKLScctW+7GwAsvlEC3wXWr1CYZTUUH5eTljhSyoKO6vg/u9crymHf2I= X-Google-Smtp-Source: AGHT+IESf07+Ty6d+mR8h6jLvICrJWZMLVl4M5/vp52FC/zlmrG1YxQrK8z4XTkLNQ78LoV1FRPc3A== X-Received: by 2002:a05:6402:518d:b0:5c9:5701:f79e with SMTP id 4fb4d7f45d1cf-5cbbf947bf6mr17732684a12.27.1730455066464; Fri, 01 Nov 2024 02:57:46 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:45 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 4/9] rtc: renesas-rtca3: Fix compilation error on RISC-V Date: Fri, 1 Nov 2024 11:57:15 +0200 Message-Id: <20241101095720.2247815-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025748_248606_11D9390C X-CRM114-Status: GOOD ( 10.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Fix the following compilation errors when building the RTCA3 for RISCV: ../drivers/rtc/rtc-renesas-rtca3.c:270:23: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 270 | tm->tm_sec = bcd2bin(FIELD_GET(RTCA3_RSECCNT_SEC, sec)); | ^ ../drivers/rtc/rtc-renesas-rtca3.c:369:23: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 369 | tm->tm_sec = bcd2bin(FIELD_GET(RTCA3_RSECAR_SEC, sec)); | ^ ../drivers/rtc/rtc-renesas-rtca3.c:476:11: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 476 | cycles = FIELD_GET(RTCA3_RADJ_ADJ, radj); | ^ ../drivers/rtc/rtc-renesas-rtca3.c:523:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 523 | radj = FIELD_PREP(RTCA3_RADJ_ADJ, abs(cycles)); | ^ ../drivers/rtc/rtc-renesas-rtca3.c:658:8: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 658 | val = FIELD_PREP(RTCA3_RCR1_PES, RTCA3_RCR1_PES_1_64_SEC); | ^ Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven --- Changes in v6: - none; this patch is new drivers/rtc/rtc-renesas-rtca3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-renesas-rtca3.c b/drivers/rtc/rtc-renesas-rtca3.c index abb0f6f73906..d127933bfc8a 100644 --- a/drivers/rtc/rtc-renesas-rtca3.c +++ b/drivers/rtc/rtc-renesas-rtca3.c @@ -5,6 +5,7 @@ * Copyright (C) 2024 Renesas Electronics Corp. */ #include +#include #include #include #include From patchwork Fri Nov 1 09:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859072 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5C46BE6B24A for ; Fri, 1 Nov 2024 10:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dQzVdoqdvqgLOFlu8gMxMsd1xizkEdv4aj8iXiXRzjU=; b=bgsXtqzg4Tql2z7Wpbvq5sd4AU EMqnb9LvTXa890OZfCEVytm6onjD6grOUbfaE5TVf38Vsp+Rz3+srEcjTaduyb6tJx7DQOMGVtrEV 76lE5I8y/gA2F8v7o1ui9ScwrT4dTVhf913JUST1NpF3a0xKivJTDdIS5mNqNatWPZGl3xlSaHLAG 9lc/a4ZNJj43vffNBTvpqX/nHguFVbOYxpJtUICPGowv/D0RHp5Ro4GdEZLoWzqaG2LjkBqy6LjMU vw7DU07boBPvM2RWy1XrJI05/5OBXoZDFaH4ZRWWff850CZPjzasP18xUZ9gqi6Ryua5g67iad44J N40TWLng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6oZW-00000006VhX-1CGd; Fri, 01 Nov 2024 10:08:02 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPe-00000006TN6-2pyJ for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:52 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5cb6ca2a776so2542238a12.0 for ; Fri, 01 Nov 2024 02:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455069; x=1731059869; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dQzVdoqdvqgLOFlu8gMxMsd1xizkEdv4aj8iXiXRzjU=; b=SuC6ISV4dNyxC+KpR+Nqg9t0UNvI72sua0obz7aMssliNSloimn4eNyE4h9VW5LFUf LojlbM85MhQGgPHo8iNJeE0k7+/n2LgEZ1fekMLJU58Oz9DkU18UIQNrln3XPyT8QAio nJ+FVW48JT2oJiZAt1+lpdcR2+iHAHTnBWPPlLF3R+6i0zMQsYCxnj8hKJdpLEjBqyS2 NbUF4dEJ7C9Bh7mCRXXjDEoLdToBxJBj4JnqW0fdhVxAS4fYpgvndFfaAlN+UHSksEux fue2mElazcPLokbKQkHeq9oV91dKheYtA6Js5fcb4k27qdbzOyPmiFIlHKygYOyCGliV yXgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455069; x=1731059869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dQzVdoqdvqgLOFlu8gMxMsd1xizkEdv4aj8iXiXRzjU=; b=kRp8IJzvvI/pwiuasSrZU1NmS7wsJUGKhrz/NZZFDJpOcN90PVZyn83Svtjk3+GJ69 bNx/Nb0fuQpWGOAYXrHmZgExq7yCv0fSzHErQkdaixi9vC0Yz/RqQxopgNOx9eOh6yhs z8I7n4K1MOLnJ55PG8YhBaOg/j6f/q794kTX4oJqJ78fALrqL5r5ShBerVtfRDlZ5srn D26q6WwA7wU9MKc0FIlUvGzFy8GorMQ3XE5WtFgSMJ/ewY++Sq5cjwNAmT1XemlLIT66 vbdp5d/IdIPFAXmfdoxccXJtdoYa2c18be9F46cObbFOiJz0gChCJLlzmwqCNUpVJipf Ewig== X-Forwarded-Encrypted: i=1; AJvYcCVtp8gdEgp+LjoKRiiGOTn+06C81d2mIJ0/PGqYmS9RDb4f4oT2xlU3OWJay80vGDCytl08k+UWulu/EziAeNxG@lists.infradead.org X-Gm-Message-State: AOJu0YznB+UU+ATyOAYMk751DWFkt68L4PzvAQ25e8+NVg39OUA7TjSM 2aabmV6c6aY1DNRuAckIJsbUrGTleQwtay6DewxYc1GJ65GHI7w27RJPYtwzsh8= X-Google-Smtp-Source: AGHT+IGfg1jB9Gr5SknKQmj654bdZhqMhBEbjNXW8PNX7wmtbus6/mYgJoy7Q69k4vfLF7Q0z4tBwQ== X-Received: by 2002:a05:6402:4307:b0:5ce:af01:6317 with SMTP id 4fb4d7f45d1cf-5ceaf016b07mr3408111a12.15.1730455068835; Fri, 01 Nov 2024 02:57:48 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:47 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 5/9] arm64: dts: renesas: r9a08g045: Add VBATTB node Date: Fri, 1 Nov 2024 11:57:16 +0200 Message-Id: <20241101095720.2247815-6-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025750_748533_37C397FB X-CRM114-Status: GOOD ( 12.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Add the DT node for the VBATTB IP along with DT bindings for the clock it provides. Reviewed-by: Geert Uytterhoeven Signed-off-by: Claudiu Beznea --- Changes in v6: - none Changes in v5: - dropped the status = "disabled"; for the vbattb-xtal node Changes in v4: - used clock-controller for the vbattb node name - move the node near scif0 for ordering - set the vbattb_xtal status as disabled to avoid having it exported in linux with frequency = 0 in boards that don't use it - collected tags Changes in v3: - dropped the child nodes of vbattb; along with this dropped ranges, interrupt-names, #address-cells, #size-cells - added vbattb_xtal as input clock for vbattb Changes in v2: - update compatibles - updated clocks and clock-names for clock-controller node - removed the power domain from the clock-controller as this is controlled by parent node in v2 arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi index 067a26a66c24..a1d5084b074a 100644 --- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi @@ -72,6 +72,18 @@ scif0: serial@1004b800 { status = "disabled"; }; + vbattb: clock-controller@1005c000 { + compatible = "renesas,r9a08g045-vbattb"; + reg = <0 0x1005c000 0 0x1000>; + interrupts = ; + clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <&vbattb_xtal>; + clock-names = "bclk", "rtx"; + #clock-cells = <1>; + power-domains = <&cpg>; + resets = <&cpg R9A08G045_VBAT_BRESETN>; + status = "disabled"; + }; + i2c0: i2c@10090000 { compatible = "renesas,riic-r9a08g045", "renesas,riic-r9a09g057"; reg = <0 0x10090000 0 0x400>; @@ -425,4 +437,11 @@ timer { interrupt-names = "sec-phys", "phys", "virt", "hyp-phys", "hyp-virt"; }; + + vbattb_xtal: vbattb-xtal { + compatible = "fixed-clock"; + #clock-cells = <0>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; + }; }; From patchwork Fri Nov 1 09:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EE7B0E6B242 for ; Fri, 1 Nov 2024 10:10:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tfW7W38u73oXDY58ExSVjQCRIYrMmZQTfpbBo08M7pQ=; b=0NxWtmkQFGT5UQzoGVippfZV3v fQni/nm3VFAy3sdiFXO7R/zhMEH1kWcCv1C0MZEYWfpwphzgNjRU2yL2mubCs85lepAAZe+gXF6iM hzhidNdLkw3Ey9884/t1t00WjMnV0Ji1Is4y/a6kpglEPKIFQeu2F17MN8lu4D2zltoxcoLvRf3YP Rnw8qLnax61pQWsstSHHSTQWkPSyEJbeaZBIeK9mruPx21Bupr6Rb2q8gznxbjYVBaVvCbJfQ2BsJ wYT1g2vRIjKyxbZX7loYI69jJjtXiiueOCUuFD7P3uk+x/NBMgaApzLexCt8hp9KXRGun01WD6PD0 oqxUFyqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6obG-00000006W5B-22Ca; Fri, 01 Nov 2024 10:09:50 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPg-00000006TO7-1wuL for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:53 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a9932aa108cso265374766b.2 for ; Fri, 01 Nov 2024 02:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455071; x=1731059871; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tfW7W38u73oXDY58ExSVjQCRIYrMmZQTfpbBo08M7pQ=; b=icZaxnh5jwvaWV9LKkjnerKDWTPOzZt8DBydvVwSffJVHjtKpNxBXabGwD9JxmPS5d fTlE8+zTO6HyVyDiXuGojSFkDjx32AgIQzmB2MHtZ9ka4CpGXjR1dT2k+rZE+AO0QJCJ 69RjgblDeAhk7PbMyLkzrHmf9qOBlj27DHxS2SEqopbnm59zwFL7wbq/eh0l0EJyC8N7 3PJ1/amsZmIIx8ogTGewgAl94ol2iGeIARn2qG9FJc6oXHLd+iv50yi7Fc83OlF8O5Q4 sjLHQiDNsATUx2pTIVsyjVE7vaVuXuY5OSAkvg3xYJdsNdJY02SodAcLUINWjb/aHkmY cA/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455071; x=1731059871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tfW7W38u73oXDY58ExSVjQCRIYrMmZQTfpbBo08M7pQ=; b=nLzNpncMpRoYSgpepwtnH01JxjFjecsjQX0YRbwZkAqo/k5I0TbjpOM8fYPO7w0a0/ 3WiLilYhGZraKi4gJb+NVQ636Xjxuuzgso/c+tMWLZWO8SBtJVgPelSMo4aN52cI06Ky I6X9iLZ2gfDr5o/kcWb5nEmBvP5QQC2nzLkYke6UIQjG8FqIlW3tsHi2yVITVuZDgfnl xBPipcyoiZiBo6dHTLiuG57+oPaiw6K0QG2BsWYJhLgnnaC4XbM2PyPma3HNsvlkA8vy tvRQrHeTEJjMSwmx3C/PWT0//j/SzjJlBCXnyXNFFsVS6B/euNkENn4PXnbQpKWG5m90 d+NQ== X-Forwarded-Encrypted: i=1; AJvYcCVup7v1eomZKWpxNVyWqlcL+vgjRVXvWyOutGe9zlXXXhUaqpVIH66F7IFAkoU+DyXePQOuoO3lqJHsHNd2Ihsu@lists.infradead.org X-Gm-Message-State: AOJu0YwEN9Hz6bqdd/+gdSw14l/qRMhxwiKM7qHAN48S7Z5f7T5eQWOY m3GUUL884cc0It8oP3lAMdsICHPIP07KYeL2oEfCE9M8sMggf9MYHfmxECn6gYA= X-Google-Smtp-Source: AGHT+IFE0JHqlkVDmb2/TxlqXR6484r4+5y4byueSe80U+33dxBrQC5ZdYOn6F1eecNFW0u/e9w1Bw== X-Received: by 2002:a17:907:97ce:b0:a9a:e91:68c5 with SMTP id a640c23a62f3a-a9e5093efccmr607271566b.33.1730455070606; Fri, 01 Nov 2024 02:57:50 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:50 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 6/9] arm64: dts: renesas: r9a08g045: Add RTC node Date: Fri, 1 Nov 2024 11:57:17 +0200 Message-Id: <20241101095720.2247815-7-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025752_559262_5CCC3B15 X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Add the DT node for the RTC IP available on the Renesas RZ/G3S SoC. Reviewed-by: Geert Uytterhoeven Signed-off-by: Claudiu Beznea --- Changes in v6: - none Changes in v5: - collected tags Changes in v4: - dropped the assigned-clocks, assigned-clock-parents properties as they fit better on vbattb node - moved the RTC close to serial node for ordering Changes in v3: - added CPG clock, power domain, reset - and assigned-clocks, assigned-clock-parents to configure the VBATTCLK - included dt-bindings/clock/r9a08g045-vbattb.h Changes in v2: - updated compatibles arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi index a1d5084b074a..be8a0a768c65 100644 --- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi @@ -7,6 +7,7 @@ #include #include +#include / { compatible = "renesas,r9a08g045"; @@ -72,6 +73,20 @@ scif0: serial@1004b800 { status = "disabled"; }; + rtc: rtc@1004ec00 { + compatible = "renesas,r9a08g045-rtca3", "renesas,rz-rtca3"; + reg = <0 0x1004ec00 0 0x400>; + interrupts = , + , + ; + interrupt-names = "alarm", "period", "carry"; + clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <&vbattb VBATTB_VBATTCLK>; + clock-names = "bus", "counter"; + power-domains = <&cpg>; + resets = <&cpg R9A08G045_VBAT_BRESETN>; + status = "disabled"; + }; + vbattb: clock-controller@1005c000 { compatible = "renesas,r9a08g045-vbattb"; reg = <0 0x1005c000 0 0x1000>; From patchwork Fri Nov 1 09:57:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1BB58E6B240 for ; Fri, 1 Nov 2024 10:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RPAiWzbcwfO/oeR5F4JHaOzCtAZr+PBDQTIr9NKTt98=; b=z2ONf9f3rMHcUGkfVgVpxolGhd Nqpdq9bLP73k8oU1BqID2PSKEzcxEIaDnTEza/+ueC5gRGdx9uAeFXPxYxQ3pcQCx3TR4kkWyd+Ap P9uO2cFuUXosSw76FG8Y772SWsCjTnSiu/y8YuhAwx7ZfRKT4CPL7RrfboPqDz8aeRmPMOBbmiLWl tmkzw21lrI/2T5TOAPMYsoCiL1iwR45BwJ3Lg6DI9CrLec6haDZc5gKjhTRLKWKBmvNGPQxW67aFD FFfS71jsGLBcIjkQvmLE1glFBChVv5cUhFGIWYrCjnCWnxoukE+lr/6MMxMwkbVyFoDJQzhmGGs86 ew4jVNFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6ocu-00000006WLs-3EIl; Fri, 01 Nov 2024 10:11:32 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPj-00000006TPj-04R2 for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:56 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c94861ee25so1119414a12.0 for ; Fri, 01 Nov 2024 02:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455074; x=1731059874; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RPAiWzbcwfO/oeR5F4JHaOzCtAZr+PBDQTIr9NKTt98=; b=ov0MluGMgZUmm4YfdioEx/9xTH4Rof9obSmGlqjzw4FjANSaeW4llftJEGqUFFfrOh tfFLVHpIZ+aOjMPeBdvcKBC1Ly63YTWVrD6zYk00IwvnvuCkxtFtWLmyrDLmOcGEHb68 SMB2T0nqGpfVQdWUkXXTxkROPpscYtT1Q4vxkh5dDykvokztbHArj8Hlb/pxmmdTQoOE tsecP4iL9Wxo4WtCgFkN1MmdfSRuibkxAGatUGwNkdU+3yQ19eDoPIjzQ2P4y1ptI9aq kNIOlozuFa495eznMS6yu8Km1Twcyat+NOn6+iEWN+AqjZPnkbmfw75mffjMrGHZfu6d 5X2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455074; x=1731059874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RPAiWzbcwfO/oeR5F4JHaOzCtAZr+PBDQTIr9NKTt98=; b=V1nLQFBDEeU8LW2Y2H3G4MYrqe6e1ER8mWAol+lsHJ/k2+wxTNyiik1gwRzHUYpp7Z dtBIWAhH496xIVx0KiXWFqwuVYM4VKh0iElvGeAkd3i1+e+767VqpsWQHn1xDPYKhqhl HO57WFF4mbbgg7U/E+qBAwVWh0l1cfYqnlk4eXgt7lLgBP+iud9FAYwlnBxJYWnQrjJT xl6MoHAfWA1KQUXzvkCEluMUOPeV2PUVy5iv9D7CO5JvukjqhaSbQalabpmyQ5DqJYF7 Wy/MLdSba5fnR5T3ENlUOt8x4MupzDZGA4hQevXWDCX8P4FILpJKMwk7GJ9EPN+y7E2H /gtQ== X-Forwarded-Encrypted: i=1; AJvYcCWEmnIEYwlPgJpMkXnpo4g8K7H8rhLTKT/SYZn5TLHa3XS0DHmu6KluEsgi767uRmV7fILvG3kmBDeNVBGf/hct@lists.infradead.org X-Gm-Message-State: AOJu0YxbwnXUf4PYkoUGqaPGNV5MuTJ3Kr9krwhee2AdjgnfU3ZS5lr2 q/2dMT/yRHhXv5dy/+iCj68ogFhKudggL8vew5SOwzA9xTb9nZ/YO8yr+SfrTEc= X-Google-Smtp-Source: AGHT+IHrP9FP8fHD/OSWluh8tapezeAqFQ+YzxBMlbpTwIN/za5gGLBDUt6ZXq57lFavCwyaNAz2qw== X-Received: by 2002:a05:6402:51ca:b0:5cb:728e:926b with SMTP id 4fb4d7f45d1cf-5ceb92a38f5mr2691588a12.17.1730455073635; Fri, 01 Nov 2024 02:57:53 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:52 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 7/9] arm64: dts: renesas: rzg3s-smarc-som: Enable VBATTB Date: Fri, 1 Nov 2024 11:57:18 +0200 Message-Id: <20241101095720.2247815-8-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025755_119993_6BC032BA X-CRM114-Status: GOOD ( 10.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Enable the VBATTB controller. It provides the clock for RTC. Reviewed-by: Geert Uytterhoeven Signed-off-by: Claudiu Beznea --- Changes in v6: - none Changes in v5: - dropped the status = "okay"; from vbattb_xtal node Changes in v4: - added assigned-clocks, assigned-clock-parents properties - set vbattb_xtal status = "okay" - collected tags Changes in v3: - updated patch description - dropped vbattclk - added renesas,vbattb-load-nanofarads on vbattb - moved vbattb before vbattb_xtal Changes in v2: - none arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi index 71424e69939e..30bb4f5a7dfd 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi @@ -5,6 +5,7 @@ * Copyright (C) 2023 Renesas Electronics Corp. */ +#include #include #include @@ -344,6 +345,17 @@ mux { }; }; +&vbattb { + assigned-clocks = <&vbattb VBATTB_MUX>; + assigned-clock-parents = <&vbattb VBATTB_XC>; + quartz-load-femtofarads = <12500>; + status = "okay"; +}; + +&vbattb_xtal { + clock-frequency = <32768>; +}; + &wdt0 { timeout-sec = <60>; status = "okay"; From patchwork Fri Nov 1 09:57:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E3D78E6B240 for ; Fri, 1 Nov 2024 10:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CsdPZF9emf18XQgtgS7Xp71XPblYsQ7NBPKTENRn3uQ=; b=shHDhErpkfXe2MWcrlPRsY7YfG iTF7PAcH+NsIIA8/5hiCI4+WYAg8s5Jw7mD02TBP4awlm/SboEn9UKqnDJUrJP5Zn0p48RKKj/rBa lmKKwcr+VyzEgQ7K77tWIH093kPrzBIGTl20lRVWENDbUYm6CRBGETPa73mK8I5mdIAP+UlHTrwTh mZQ2E5zro26nELUJtiJji7YE7tYQSCmYS1dKDDvpW928OmR8246ERfXOOpXq/0NVJxsEke7f77ml1 3VnPIT5ynwbxNOuiBIAJZ/O1iZgyFb6w+LwWXbPPp3FFdKr9J29vMj/Z3o6zagSrMyZv8FdMEhkN5 QaP0kiFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6oeX-00000006WVY-0OEH; Fri, 01 Nov 2024 10:13:13 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPl-00000006TQv-1g2o for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:57:58 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5c96936065dso2251723a12.3 for ; Fri, 01 Nov 2024 02:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455076; x=1731059876; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CsdPZF9emf18XQgtgS7Xp71XPblYsQ7NBPKTENRn3uQ=; b=i0/iTzmuQ5t/GJQo/KzFzOJmxu+pYOd4pNRgwuOMzPJTjkeOuZGmJYgkuYwBvqLe3F fPziFj4y0sogWyxU1OOKZqRiT6tlMhy/H+kee+osvv8Zvi+9SwBEZaXPJA0IQRw3QJCF MYOm4GYW+32Wz7HB4oWR0b9XEct5JMQuV1C3ebZGqcCmJ//QQ7/qvyF6eiJdiBFd/pnY Dk3LDjvoCPwjnqcxE9sIH4AHw/1c4oMdA7p+WWvpzw90qZuiKwZDhQQU2mE4iySgFRIA E2ipKW3aFQ7QdJjZwc5R9E1758YQ3YWngjIEuiIrzNkl4/ZN+wtYMiAZvXPK0JUDl06x lxjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455076; x=1731059876; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CsdPZF9emf18XQgtgS7Xp71XPblYsQ7NBPKTENRn3uQ=; b=jf80UTCfv63IuZJPYoNekEna/7F1FF0fj1q7Gm/xTn4D1dO0Ch+/dHw6L9WD9pMr85 GKr8P9gMtLcE0P2nAnB4eMHzfkny7THiU0AcYbjH2WlMNT3OHE6GQ/cGs1qEs2/OdgPq FAckDeSWG2KB/bb/2H7Kox+QyVIoo0a4F67dVe0wsxTxdWk4V3DsHDmNhxzfzcMMe674 aZvZJ5O5ua0DTz7PKifo4/2RAfQKMQ9V9iYc2XryXawPsABUsrBuOOx83G+nX8WWHppb LtmARXHVjYVFj6T/vdqrDewiUIeInFhcZAfYCaz5MAxMoMITGanXDGhPBx5w+M85ftPy O2pA== X-Forwarded-Encrypted: i=1; AJvYcCWtiajJVigLjji3e44eWxT9PtpAypDVT6KVhRsM+oAen/JaRSxz4jimqcywZve3Hyku1/ydOb1IKP4KXg/guOj1@lists.infradead.org X-Gm-Message-State: AOJu0YwKEub+v98SmLu7Vm3Z3KSNy1VkEwtUcEL3h1HzzyENU9/lnhl+ tziZxrz5CCKFOrQhTQPP1dm5w/KBzvrtH0YtjAHO/ktth+/5UCb1pLa6tUa6xKo= X-Google-Smtp-Source: AGHT+IHIInFyvvZ21N4w9XKZUzECowUn+aG9F5+oWwykmTnOmG6gYMfAOXIH3hB+PUh/16T6BdSrwQ== X-Received: by 2002:a05:6402:518a:b0:5c9:76ca:705b with SMTP id 4fb4d7f45d1cf-5cd54afde73mr7392400a12.34.1730455075953; Fri, 01 Nov 2024 02:57:55 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:54 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 8/9] arm64: dts: renesas: rzg3s-smarc-som: Enable RTC Date: Fri, 1 Nov 2024 11:57:19 +0200 Message-Id: <20241101095720.2247815-9-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025757_483393_452ABFF2 X-CRM114-Status: UNSURE ( 9.51 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Enable RTC. Reviewed-by: Geert Uytterhoeven Signed-off-by: Claudiu Beznea --- Changes in v6: - none Changes in v5: - none Changes in v4: - collected tags Changes in v3: - none Changes in v2: - none arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi index 30bb4f5a7dfd..2ed01d391554 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi @@ -345,6 +345,10 @@ mux { }; }; +&rtc { + status = "okay"; +}; + &vbattb { assigned-clocks = <&vbattb VBATTB_MUX>; assigned-clock-parents = <&vbattb VBATTB_XC>; From patchwork Fri Nov 1 09:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13859109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DE318E6B242 for ; Fri, 1 Nov 2024 10:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uDVeB7Y+VIp/FplukcEJ+LJ4Vz9niC4RyWfPRl3XIfk=; b=w+F3vNMHcOl9slLs0zgwK0SKrI Ls+zjFkAItH+gu3JIhi3mPhrAQsTay/GiWJYSt3Azb7W527piyGrnlmNFRdzimcR6sIxnfR6Jq7GS bjEETGNyybjI7TdVATeU0JlhZnMdB5Kssg38ZpiC+vjM+GJKtyPBDWCWh/GXP3kHRMRSBsdpV0vXZ WccC4T5jvCNTo6LO82iWes3bK5zjWrZks8783qGywPAe2MOp+4dIDVwcVHaann74F0H/dgqdNPjIX lp0hWVtxyJc7L9QpaWgceqqhxuLes3vpeedkpxnYy3v5Fz/7viBJ4jLkaVsAISSPbQjtGW879x8On xV5ZVRDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6ogA-00000006WjU-1Ztc; Fri, 01 Nov 2024 10:14:54 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6oPo-00000006TSM-17mf for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 09:58:01 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5c99be0a4bbso2534517a12.2 for ; Fri, 01 Nov 2024 02:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1730455079; x=1731059879; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uDVeB7Y+VIp/FplukcEJ+LJ4Vz9niC4RyWfPRl3XIfk=; b=ScCu+jUv2uhMxc3KkMSEGPOf5Dtbw7Rj8NSA71Il/H3qTka6INei/Rxk3353wA/Rtz /uFssPEhfxbJEfLX93qBeZXU4UZwsne9sYK6JxIrMXlOFrNvjgMPOs2eVhgYWgBNXFfZ hSwks1pNGFZ3f7LL5bCYDH/kWbAVyQF58AZ8h0PGLrQ7HnpDEOZVzg9+vED5ge7iP8OD QbPPOkNYZW+lwlXc3x6vYGD6sX82PNn7OW1wXScUXqEmAwGSh5d84nzWyW3SU0khEDw6 KBwwJipcIL1kgPLGv4UmTKQwcJUah9uO/iP/lgP6eT8pieLDoM/32ODqmeAhhv8hyb9L uAMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730455079; x=1731059879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uDVeB7Y+VIp/FplukcEJ+LJ4Vz9niC4RyWfPRl3XIfk=; b=enaX4c3jHQ1KzMDwy5YIxRHR6x1VrohVQ0FlvPaLu50hAn19YZRv02iejUX+lV2eka L1PYl2j8Vao+FdWAcFU/7lny9SyjuJshvKPwpSneaIPSPmDXdUOOuAQhsmRrV7s132wb Ri8lEDrzdjnyrQ3wiKFYfrhCrWWfBsOPPQUxjYF0IcptcVdxBTk9GU04OAHQEEGxULNr d0tyJ01npAbQDGp7QAHWsNE6Zs/6A7PWYjvI2Zbg9fRjh+5k51qShP1aphKTa3gjE6LD YTlhn2DU6Szc9X5pBZ9VDx46dQCFzoYXjsmHFn1akGlF4xQd2KO/rvn3Y2Pihl3NNLcB e0OA== X-Forwarded-Encrypted: i=1; AJvYcCWium8PNAq1Ea52ak4z0yDicsh7LwOIoEjVHjoKUBNQY/7WLDkNgyFL7JvUQZwqdiuWKRY27CUEhPGt1fcAh2y5@lists.infradead.org X-Gm-Message-State: AOJu0YzesfnRUuqRm+KOxr0pKa6zQPtlRkEvsJuY8T2+DnnP2aWub6HK HY2aGS8+/HUKk8uuLwgNhHiNKntvc4buJBbcD8qVwyQTa51YCtsAuTQg2KcwqvA= X-Google-Smtp-Source: AGHT+IFm5mOqj3B/Gyi2brvekA2DF+HNO4SlxfDE0BQcyiDTfbNWcuu/umQTldMEOxZlW5iJz8fSBQ== X-Received: by 2002:a05:6402:3585:b0:5ce:bb37:c2e1 with SMTP id 4fb4d7f45d1cf-5cebb37c36emr1662850a12.19.1730455078849; Fri, 01 Nov 2024 02:57:58 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.190]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ceac7c8d87sm1364136a12.76.2024.11.01.02.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 02:57:57 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alexandre.belloni@bootlin.com, magnus.damm@gmail.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v6 9/9] arm64: defconfig: Enable VBATTB clock and Renesas RTCA-3 flags Date: Fri, 1 Nov 2024 11:57:20 +0200 Message-Id: <20241101095720.2247815-10-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> References: <20241101095720.2247815-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_025800_337791_2D3E8A2E X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea Enable the Renesas VBATTB clock and RTCA-3 RTC drivers. These are available on the Renesas RZ/G3S SoC. VBATTB is the clock provider for the RTC counter. Reviewed-by: Geert Uytterhoeven Signed-off-by: Claudiu Beznea --- Changes in v6: - enabled as modules - Geert: I kept your tag, let me know if you consider otherwise Changes in v5: - none Changes in v4: - squashed w/ patch "arm64: defconfig: Enable Renesas RTCA-3 flag" from v3 - updated patch description - collected tags Changes in v3: - update patch title and description - dropped CONFIG_MFD_RENESAS_VBATTB Changes in v2: - added CONFIG_MFD_RENESAS_VBATTB - added vendor name in the VBATTB clock flag arch/arm64/configs/defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 0fad83642034..c62831e61586 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1222,6 +1222,7 @@ CONFIG_RTC_DRV_IMX_SC=m CONFIG_RTC_DRV_MT6397=m CONFIG_RTC_DRV_XGENE=y CONFIG_RTC_DRV_TI_K3=m +CONFIG_RTC_DRV_RENESAS_RTCA3=m CONFIG_DMADEVICES=y CONFIG_DMA_BCM2835=y CONFIG_DMA_SUN6I=m @@ -1371,6 +1372,7 @@ CONFIG_SM_VIDEOCC_8250=y CONFIG_QCOM_HFPLL=y CONFIG_CLK_GFM_LPASS_SM8250=m CONFIG_CLK_RCAR_USB2_CLOCK_SEL=y +CONFIG_CLK_RENESAS_VBATTB=m CONFIG_HWSPINLOCK=y CONFIG_HWSPINLOCK_QCOM=y CONFIG_TEGRA186_TIMER=y