From patchwork Fri Aug 30 13:02:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13785109 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 02240CA0FEB for ; Fri, 30 Aug 2024 13:11:49 +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=o4cKF8EHnw7ozuhAiETk6JACXIX9wuY1t5hqCiMxxVQ=; b=h9+E1r9v76Shw++oJxt2PZTBLK rb5XOEjKGx1vxObMjUxAixHKIR0DB8R5wLmXqyAKkHCzSEnX/9DiDOzs01/lyFwaqRTyWxIWaVRju ZyOiXiO8SDuDtb89JQFXzPLs5PeO7MLImRHbcJ0967StAb9Sss+YgK2sAz6l0y9ljS+r9DdD6+y5I LGHBQqzNHsJHrb0xJircTqW1X/P20QKP05Arig9yaURoDHkVxifwwYU0hz46GkOohwvuyfORODozB BqFrRMobXfAladkXKcAze8FJWfUZ6Zsg6tyWDmRp0VAzLnMD7qQrUWFcp0Y8OCOap8qRmWUjc8tRX CBxk0Knw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk1Pg-00000006MYb-0V3s; Fri, 30 Aug 2024 13:11:40 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk1Gu-00000006JjD-1mJO for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 13:02:37 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42bbf138477so1629765e9.2 for ; Fri, 30 Aug 2024 06:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1725022955; x=1725627755; 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=o4cKF8EHnw7ozuhAiETk6JACXIX9wuY1t5hqCiMxxVQ=; b=GvwujwMglDfqvICDd6a8sqy5eCNDHSsCSbsuIikKErLBAXpaBHAIRL2RJaC22c6NRi TCUgUWU5IF4lMKLeTGraFVkY8+V374yg42M+0QFQv/IK83glGQM0aNcnLg30nxlnsfcF Fyv6fTo5f0d56l1Ga4iOubN7lDhgMZssKnExrrEi6ehnvgv+rJvu/gP6cC2X9u76QcDw Tim++OOxTEgYm+xv5C1b4cVCF8JaQYKWdsHdgDi0LKEEoQlZtfjpR89659InDABnBNDn q0X81cJ5E0uRx3f7w2yTqF3K7OZnGrhwg5I5ksnU1ZLP92hrZ2JzmDAdKLxB7/RvYhsF zTWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725022955; x=1725627755; 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=o4cKF8EHnw7ozuhAiETk6JACXIX9wuY1t5hqCiMxxVQ=; b=eJJ+PxQ4tWFvsBxy9JSJs4JexUVpF2/8HgjdE3DdjmoNvba21GF1eKX83GY6tNNlSu cNxpDPUDL9P3AWkqwIWa6ndOHo8e82mOSPSNHE1gBXc2r4YCro3GdUJn6iYzfqP7ZsWW 9b1DRwCwsGLEOL+qL0Pmd7BIzNu5VoZt2MrMijYjHbkXNxtzi9l8mYP5R/rRG5pbzGOg zrMsGeMD9axAS2jJ6tAsmUkkTsqasG/9nttR1VrIdIj51BY/DNql/WZeVjDQFqv3E+ww mdjP+qBlmIplFZcCaVRUq19n2PY/Yu2tqAeGCp1jRmfdeOEHdsCWhfZJ8L71pVLVyKpm zEFQ== X-Forwarded-Encrypted: i=1; AJvYcCWzk2eNp/LPTvsI9ESatQE84QVUiZ14OE4zhAChpI+28krXB0WY1v2Wwsx8q8kiltAcUDF5COBYvyMCmGOuziOL@lists.infradead.org X-Gm-Message-State: AOJu0YwqVan/idTlAcekimTOm0eDVqDVHDAceWebPZd82zigbJf4qdze CAZ9gyAmEQ/oCb8DhC30cbJ4OPpwTid/YeeICYpXu2HgdjlhrkzHKgcy5aBkCa4= X-Google-Smtp-Source: AGHT+IHY4ZU8GIEWhH/eJKahz8/5zLuBrFu0wzb09xgJDwo495hKXLFy1Xg9RJNV3C4Xc2gSj0XwHA== X-Received: by 2002:a05:600c:434a:b0:426:63b8:2cce with SMTP id 5b1f17b1804b1-42bb2a1abb9mr50943975e9.7.1725022954457; Fri, 30 Aug 2024 06:02:34 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba642594dsm80361785e9.47.2024.08.30.06.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 06:02:34 -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: claudiu.beznea@tuxon.dev, 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 Subject: [PATCH v3 02/12] dt-bindings: clock: r9a08g045-vbattb: Add clock IDs for the VBATTB controller Date: Fri, 30 Aug 2024 16:02:08 +0300 Message-Id: <20240830130218.3377060-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240830130218.3377060-1-claudiu.beznea.uj@bp.renesas.com> References: <20240830130218.3377060-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-20240830_060236_492407_B46EB139 X-CRM114-Status: GOOD ( 17.22 ) 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 controllers 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 oscillator or an external clock device. 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 oscillator 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 clock IDs for the VBATTB controller. Signed-off-by: Claudiu Beznea --- Changes in v3: - none; this patch is new include/dt-bindings/clock/r9a08g045-vbattb.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 include/dt-bindings/clock/r9a08g045-vbattb.h diff --git a/include/dt-bindings/clock/r9a08g045-vbattb.h b/include/dt-bindings/clock/r9a08g045-vbattb.h new file mode 100644 index 000000000000..67774eafad06 --- /dev/null +++ b/include/dt-bindings/clock/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__ */