From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.231.139 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796313565; b=t4NiL081Sr7X1B3FAQSuvhH3Y1wEjOEYHnyiKf6jVHnROONT8MfUJdAQpUyL1Hwl37eo eUq4chj1+a0+JBSPGrFCmqcRhUQM9h+j+aA59C5J6hoTbRFc/Hv+VNO0HEGnz19VjjgU+ 9oCviIXtOhe4QxaSLY4zNGi+KbjS5mkcLLnsjnqrrmTh9lvJhuCxeKlHjj12auWAB9uGT XpOwV+UzRyFKM8Vi2vwIkZyIcj1++1qm4WfZ0sMLkD+w7T3DbN5bvrwYPl+9jGq+lkAU7 LJb/EWNZtc54n/lpzuu9JTlIiBbuR7Us5Yb6I4l0vzlSocrJIKgvaiXXzyQ/3TnDTMQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796313565; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=PszZlx7aLIDuSxkS452fJKozvVXdJxgu5Hl3OxCyXQQ=; b=cLLN+vmiTfoeQ9c33LC1phZMqh/kPfNKwsS1C1ItTIfUEpHy53NXTbQm2WiN/iCg143G 4QQKwE/Qb8zZAWRgfjFmSeISkfZscPCdolPTv1y35jXeD0P3U59pcrN0GWnJdfwvXUphc hWqD4LxBsjJ8cXEmuLj/tzlC67ZCoE8Ne0gG/ElbwLesDkgymWtArUFYV40+BhHVRbvGz 4cMSct4m03hJMudelT12ji996geuOMDr7K1KhYoxMX8upbfsxsy5+0Fk8jQe/JgQszacp 2ANjzkI9oK4U0DjO8jnHpgXf2u0LuO9AGEGLxfKIQ4Duz2JOFYjoAyUZJbz2yOeh6Iw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass header.d=riscstar.com header.i=@riscstar.com header.a=rsa-sha256 header.s=google header.b=SdpLN8NL; arc=none smtp.remote-ip=74.125.231.139 Received: from mail-oo2-f11.google.com (mail-oo2-f11.google.com [74.125.231.139]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAC33606A330 for ; Thu, 3 Dec 2026 15:59:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BAC33606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=riscstar.com header.i=@riscstar.com header.a=rsa-sha256 header.s=google header.b=SdpLN8NL Received: by mail-oo2-f11.google.com with SMTP id 46e09a7af769-863208c7496so8337a34.0 for ; Thu, 03 Dec 2026 07:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar.com; s=google; t=1796313564; x=1796918364; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PszZlx7aLIDuSxkS452fJKozvVXdJxgu5Hl3OxCyXQQ=; b=SdpLN8NLnwi4bTgc06ZxVqNByR43j3TOW9zNub2CaLuj/c0oqPnqtwYAEiZ+K9Pleu hGgGtsd2T0iDa5ecmKsRYx1LLMNWVWNHzh6dJ8g9AoONo8LATh6CLA20bNA0IF4U/TMq aX904ydNN5RwsH6RF49IK9sQCWq34p48k8wIiKFA+7iDxAKVzjRQDaG5GsW5Xu+XN82P 9xLqHqsr0/y5pg3ZEqtetgDShltFhwQQuj1b0qWARsZLZyHRxlj+8/KWKzCScKa5ZpSV JyUO39fnCGdXg8rvq9vuJLCCTgqlovQgYscuVVz0dt7r0d+VqlakcaKKsrqCxgG9iQLe fqUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796313564; x=1796918364; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=PszZlx7aLIDuSxkS452fJKozvVXdJxgu5Hl3OxCyXQQ=; b=1sHYghfe8PzOKLUZKRz5Kr2shoUy0lsG9+Qopw+GsTgudD1T/4OgAe4N9xRELhV5Xf C6/vW0pLY6L5jErpIURI4VNGnnnafXmxM+aqCyGYxNOG0cqUCfl16MMtYcGxDa256sNT iF8imz9b8jjB4kavUirBwMDpKFKUL6NKGXJdHlnsnqqiGH/PqUbG6rlUz8+serw60wcA O2Za9pcLycGCKxU8OU3SMt5+0hPk+MMJLHqs4aX+Kw6ObAPqpyTYNQje/zBM1i3XYN8u Ot0bSq+Ck7dfKS6Nn4w5RNfZMgdwzTTO2oFQonIm/mAtyTgs40S3rbCtqP+jWPwmiw5K kcyg== X-Forwarded-Encrypted: i=1; AL+hErGFbuLjUz6eNJw6oXIRNb3n3REBB8qdLNEGryvCk3GrKkYywx73Fe0bgqar32obQAhHa4gw59VHdtlOHk4=@vger.kernel.org X-Gm-Message-State: APuU4Z/tqE6vjAnBBJjPeSlqMXiYuP8O0mupAhZcmGtqdMfLqHzwrTzj pVZCm/FOZDRUk/3zsVs9PMIC+0n3mCOkXSdht7z4lRqkBwKoe7tikronJw8t7sgA2js= X-Gm-Gg: AZFdTZeMcJTTiD2gq9kBZTfPP93okzAOGiXg8DKpOFAmzaJOPVHcd0vMIDb2wFwEfMz zzivdGUgX7aJJgp3ZHMB2doCDw1A//0k62hptnKmMxcaqAtR6nob8bEl1hwx+FodXXl2wo0+0vS zKU2H6ZumhmDK/ycv5PveE+tqkjw8kJKvTd1oJwfKTkQHqJJNOwz+eLqlGoTSuGCmUO9TrtlCy3 gpebsXDoeGNpyoarHr5RlgONyNnPMM/o22EMcHDlCX6PIutfvzqhZV4iOG3iHLvFIKLX7crgQp9 cB4F/crom9wmQ5A4p7kuBtjdtpfApWYLHAQpETb3TtKJstCXdy0ky8ezIoMXWt1TRs8cw+UrBwE x8v/GMd9mmenMI3S4+SRY0r5K1jryKCEzWkyC8L9EevvdFbuvsqL/5X7kU3z9KXYNC2UAASqIxb vMvv+1amul0f2QwjJannqEDJyB7H12UhlLb79iy9NTwhSNKF53f2JhYcoxtbftDjD3Q6bvAJR+g p+0lUa6UpKbGU8DwSjG0ne31A+9ZTxpAEUGL5WE0DwYyAiIMeHoZFzz8NaW7trl8f9nEBnGLg0X tfy+jRYQjIM0XnCGaCOhx1llkQKvFvWUUTxz2wMeUP6vjOAbB6FjOQ== X-Received: by 2002:a05:6830:34a9:b0:81a:adf1:ae71 with SMTP id 46e09a7af769-8631535db09mr48932289a34.4.1796313563560; Thu, 03 Dec 2026 07:59:23 -0800 (PST) Received: from [172.22.22.28] ([76.156.233.211]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8639242b7eesm16687448a34.24.2026.12.03.07.59.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2026 07:59:23 -0800 (PST) Message-ID: <9f9281b0-c3a0-4496-8a0c-2f2ab433e736@riscstar.com> Date: Thu, 3 Dec 2026 09:59:21 -0600 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/4] dt-bindings: toshiba: introduce toshiba,tc9564-clock.yaml To: Jerome Brunet Cc: sboyd@kernel.org, bmasney+clk@redhat.com, jbrunet+clk@baylibre.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, andersson@kernel.org, konradybcio@kernel.org, abelvesa@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, daniel@riscstar.com, mohd.anwar@oss.qualcomm.com, lorenzo.bianconi@oss.qualcomm.com, fabrice.gasnier@foss.st.com, alexandre.torgue@foss.st.com, marex@nabladev.com, changhuang.liang@starfivetech.com, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261201160810.2422466-1-elder@riscstar.com> <20261201160810.2422466-2-elder@riscstar.com> <179630594987.3767986.13646328260055227206.b4-review@b4> Content-Language: en-US From: Alex Elder In-Reply-To: <179630594987.3767986.13646328260055227206.b4-review@b4> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/3/26 7:52 AM, Jerome Brunet wrote: >> Define the binding for the clock and reset controller present in the >> Toshiba TC9564 SoC. >> >> Reviewed-by: Lorenzo Bianconi >> Co-developed-by: Daniel Thompson >> Signed-off-by: Daniel Thompson >> Signed-off-by: Alex Elder Thanks for your message. I respond to your question (and have a question of my own) at the end. >> --- >> v4: - Reset IDs are now defined in a separate header file >> - Clock and reset ID symbols now have a "TC9564_" prefix. >> - A missing space in a guard #endif has been added >> >> .../bindings/clock/toshiba,tc9564-clock.yaml | 74 +++++++++++++++++++ >> MAINTAINERS | 15 ++++ >> include/dt-bindings/clock/toshiba,tc9564.h | 26 +++++++ >> include/dt-bindings/reset/toshiba,tc9564.h | 24 ++++++ >> 4 files changed, 139 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/clock/toshiba,tc9564-clock.yaml >> create mode 100644 include/dt-bindings/clock/toshiba,tc9564.h >> create mode 100644 include/dt-bindings/reset/toshiba,tc9564.h >> >> diff --git a/Documentation/devicetree/bindings/clock/toshiba,tc9564-clock.yaml b/Documentation/devicetree/bindings/clock/toshiba,tc9564-clock.yaml >> new file mode 100644 >> index 000000000000..0f55d18c6119 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/clock/toshiba,tc9564-clock.yaml >> @@ -0,0 +1,74 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/clock/toshiba,tc9564-clock.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Toshiba TC9564 Clock and Reset Controllers >> + >> +maintainers: >> + - Lorenzo Bianconi >> + - Alex Elder >> + - Daniel Thompson >> + >> +description: >> + The Toshiba TC9564 is an SoC accessed by a host system through the >> + upstream PCIe port on the PCIe switch it implements. The chip includes >> + an embedded PCIe endpoint that provides access to various peripherals >> + within the SoC via its BARs. These peripherals include a simple >> + controller to gate internal clocks, and a reset controller. >> + >> + The TC9564 chip has a single input clock. Internally that clock is >> + multiplied by a PLL, and the PLL signal is divided internally into >> + a set of fixed rate, always-on clocks. >> + >> + The clock controller exposes a set of simple gated clocks, which are >> + controlled by two registers. Each is derived from one of the internal >> + fixed-rate clocks. A total of 21 gated clocks are implemented within >> + the chip, but support for enabling and disabling only a subset of them >> + is provided at this time. Two clocks (I2C and PCIE) are marked critical >> + to make it clear that they should never be disabled. >> + >> + The reset controller uses two other registers to control a set of 13 >> + resets that can be asserted or deasserted. Here too, only a subset >> + of the resets can currently be managed, and the I2C and PCIE resets >> + are treated as critical. >> + >> + Clock IDs are defined , and reset >> + IDs are defined . >> + >> +properties: >> + compatible: >> + items: >> + - const: toshiba,tc9564-clock >> + >> + reg: >> + maxItems: 1 >> + >> + clocks: >> + maxItems: 1 >> + >> + "#clock-cells": >> + const: 1 >> + >> + "#reset-cells": >> + const: 1 >> + >> +required: >> + - compatible >> + - reg >> + - clocks >> + - "#clock-cells" >> + - "#reset-cells" >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + clock-controller@1004 { >> + compatible = "toshiba,tc9564-clock"; >> + reg = <0x1004 0x10>; >> + clocks = <&tc9564_xo_board>; >> + #clock-cells = <1>; >> + #reset-cells = <1>; >> + }; >> diff --git a/MAINTAINERS b/MAINTAINERS >> index 93abbb315065..ed55ac25ac4c 100644 >> --- a/MAINTAINERS >> +++ b/MAINTAINERS >> @@ -28332,6 +28332,14 @@ F: Documentation/devicetree/bindings/media/i2c/toshiba,tc358743.yaml >> F: drivers/media/i2c/tc358743* >> F: include/media/i2c/tc358743.h >> >> +TOSHIBA TC9564 CLOCK CONTROLLER DRIVER >> +M: Lorenzo Bianconi >> +M: Alex Elder >> +M: Daniel Thompson >> +S: Maintained >> +F: Documentation/devicetree/bindings/clock/toshiba,tc9564-clock.yaml >> +F: include/dt-bindings/clock/toshiba,tc9564.h >> + >> TOSHIBA TC9564 PCI DRIVER >> M: Alex Elder >> M: Daniel Thompson >> @@ -28339,6 +28347,13 @@ S: Maintained >> F: Documentation/devicetree/bindings/misc/pci1179,0220.yaml >> F: drivers/misc/tc9564-pci.c >> >> +TOSHIBA TC9564 RESET CONTROLLER DRIVER >> +M: Lorenzo Bianconi >> +M: Alex Elder >> +M: Daniel Thompson >> +S: Maintained >> +F: include/dt-bindings/reset/toshiba,tc9564.h >> + >> TOSHIBA WMI HOTKEYS DRIVER >> M: Azael Avalos >> L: platform-driver-x86@vger.kernel.org >> diff --git a/include/dt-bindings/clock/toshiba,tc9564.h b/include/dt-bindings/clock/toshiba,tc9564.h >> new file mode 100644 >> index 000000000000..540fef71016b >> --- /dev/null >> +++ b/include/dt-bindings/clock/toshiba,tc9564.h >> @@ -0,0 +1,26 @@ >> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ >> + >> +/* >> + * Copyright (C) 2026 by RISCstar Solutions Corporation. All rights reserved. >> + */ >> + >> +#ifndef __CLOCK_TOSHIBA_TC9564_H__ >> +#define __CLOCK_TOSHIBA_TC9564_H__ >> + >> +/* Clock IDs */ >> + >> +#define TC9564_CLK_I2C 0 /* critical */ >> +#define TC9564_CLK_PCIE 1 /* critical */ > > "critical" is a Linux driver policy (CLK_IS_CRITICAL), not part of the > ID ABI. Drop the comments from the header; the driver is the place that > documents it. OK. >> +#define TC9564_CLK_MSIGEN 2 >> + >> +#define TC9564_CLK_MAC0_TX 3 >> +#define TC9564_CLK_MAC0_RX 4 >> +#define TC9564_CLK_MAC0_125M 5 >> +#define TC9564_CLK_MAC0_ALL 6 >> + >> +#define TC9564_CLK_MAC1_TX 7 >> +#define TC9564_CLK_MAC1_RX 8 >> +#define TC9564_CLK_MAC1_125M 9 >> +#define TC9564_CLK_MAC1_ALL 10 >> + >> +#endif /* __CLOCK_TOSHIBA_TC9564_H__ */ >> diff --git a/include/dt-bindings/reset/toshiba,tc9564.h b/include/dt-bindings/reset/toshiba,tc9564.h >> new file mode 100644 >> index 000000000000..942a284b0d2f >> --- /dev/null >> +++ b/include/dt-bindings/reset/toshiba,tc9564.h >> @@ -0,0 +1,24 @@ >> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ >> + >> +/* >> + * Copyright (C) 2026 by RISCstar Solutions Corporation. All rights reserved. >> + */ >> + >> +#ifndef __RESET_TOSHIBA_TC9564_H__ >> +#define __RESET_TOSHIBA_TC9564_H__ >> + >> +/* Reset IDs */ >> + >> +#define TC9564_RST_I2C 0 /* critical */ >> +#define TC9564_RST_PCIE 1 /* critical */ > > You WARN() and error out on those 2 id. Why expose them then ? Because you suggested it, basically. Earlier, I "defined" these but commented out the definition (this was for clock IDs, but the reset IDs are the same situation). https://lore.kernel.org/lkml/20261012152408.3729237-1-elder@riscstar.com/ In response to patch 2, you said: > +/* > + * The PCIe and I2C clocks are controllable, but we depend on PCIe > + * and that relies on I2C, so we don't allow them to be disabled. > + */ > +static const struct tc9564_clock_init tc9564_clock_init[] = { > + TC9564_CLOCK_INIT0(MCU, 0), > + TC9564_CLOCK_INIT0(INTC, 4), > + /* TC9564_CLOCK_INIT0(PCIE, 9), */ > + /* TC9564_CLOCK_INIT0(I2C, 12), */ Please don't leave commented-out code. The comment above already explains why these two clocks are not exposed. BTW, the comment points more toward CLK_IS_CRITICAL, rather than removing the clocks. None of the consumer will ever need those clocks ? We have requested a well-defined clock tree from the vendor, and our last request produced nothing new. I decided it would be better to simply avoid defining any clock or reset ID that we don't actually use in code, and that includes the PCIe and I2C clocks and resets. I posted a new version of the series, in which the clock driver is essentially rewritten. I see now that I neglected to explain the fact that some of the IDs are no longer defined. https://lore.kernel.org/all/20261104004332.2141282-1-elder@riscstar.com/ In response to patch 3 in that series, you asked: Could you explain why clock PCIe and I2C that where critical in the previous version have been left out ? they are not critical anymore ? I explained (as I did above) that I omitted unused clocks, but agreed to add these back again based on your comment. Now it seems you might agree that simply not defining the I2C and PCIE clock and/or/reset IDs (as I originally did, but without any commented-out code) might be OK after all. --> Which do you prefer? Include them in the binding but mark them as critical? Or simply omit them from the set of published IDs, thereby not providing a standard way to enable/disable the clocks or assert/deassert the resets? (Or define the IDs for one and not the other, or something else?) -Alex