mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@riscstar.com>
To: Jerome Brunet <jbrunet@baylibre.com>
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
Subject: Re: [PATCH v4 1/4] dt-bindings: toshiba: introduce toshiba,tc9564-clock.yaml
Date: Thu, 3 Dec 2026 09:59:21 -0600	[thread overview]
Message-ID: <9f9281b0-c3a0-4496-8a0c-2f2ab433e736@riscstar.com> (raw)
In-Reply-To: <179630594987.3767986.13646328260055227206.b4-review@b4>

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 <lorenzo.bianconi@oss.qualcomm.com>
>> Co-developed-by: Daniel Thompson <daniel@riscstar.com>
>> Signed-off-by: Daniel Thompson <daniel@riscstar.com>
>> Signed-off-by: Alex Elder <elder@riscstar.com>

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 <lorenzo.bianconi@oss.qualcomm.com>
>> +  - Alex Elder <elder@kernel.org>
>> +  - Daniel Thompson <danielt@kernel.org>
>> +
>> +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 <dt-bindings/clock/toshiba,tc9564.h>, and reset
>> +  IDs are defined <dt-bindings/reset/toshiba,tc9564.h>.
>> +
>> +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 <lorenzo.bianconi@oss.qualcomm.com>
>> +M:	Alex Elder <elder@kernel.org>
>> +M:	Daniel Thompson <danielt@kernel.org>
>> +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 <elder@kernel.org>
>>   M:	Daniel Thompson <danielt@kernel.org>
>> @@ -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 <lorenzo.bianconi@oss.qualcomm.com>
>> +M:	Alex Elder <elder@kernel.org>
>> +M:	Daniel Thompson <danielt@kernel.org>
>> +S:	Maintained
>> +F:	include/dt-bindings/reset/toshiba,tc9564.h
>> +
>>   TOSHIBA WMI HOTKEYS DRIVER
>>   M:	Azael Avalos <coproscefalo@gmail.com>
>>   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

  reply	other threads:[~2026-12-03 15:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 16:08 [PATCH v4 0/4] clk: tc9564: introduce clock and reset drivers Alex Elder
2026-12-01 16:08 ` [PATCH v4 1/4] dt-bindings: toshiba: introduce toshiba,tc9564-clock.yaml Alex Elder
2026-12-03 13:52   ` Jerome Brunet
2026-12-03 15:59     ` Alex Elder [this message]
2026-12-03 16:15       ` Jerome Brunet
2026-12-03 16:29         ` Alex Elder
2026-12-03 18:36           ` Jerome Brunet
2026-12-01 16:08 ` [PATCH v4 2/4] clk: toshiba: introduce a TC9564 clock driver Alex Elder
2026-12-03 13:52   ` Jerome Brunet
2026-12-03 17:59     ` Alex Elder
2026-12-01 16:08 ` [PATCH v4 3/4] reset: toshiba: introduce a TC9564 reset driver Alex Elder
2026-12-01 17:11   ` Philipp Zabel
2026-12-03 13:51     ` Jerome Brunet
2026-12-03 14:56       ` Philipp Zabel
2026-12-03 15:59         ` Alex Elder
2026-12-03 16:18         ` Jerome Brunet
2026-12-03 16:29           ` Alex Elder
2026-12-03 15:59       ` Alex Elder
2026-12-01 18:36   ` Lorenzo Bianconi
2026-12-01 16:08 ` [PATCH v4 4/4] arm64: dts: qcom: qcs6490-rb3gen2: add TC9564 clock node Alex Elder
2026-12-03 13:52 ` [PATCH v4 0/4] clk: tc9564: introduce clock and reset drivers Jerome Brunet
2026-12-03 15:59   ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f9281b0-c3a0-4496-8a0c-2f2ab433e736@riscstar.com \
    --to=elder@riscstar.com \
    --cc=abelvesa@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andersson@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bmasney+clk@redhat.com \
    --cc=changhuang.liang@starfivetech.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@riscstar.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jbrunet@baylibre.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.bianconi@oss.qualcomm.com \
    --cc=marex@nabladev.com \
    --cc=mohd.anwar@oss.qualcomm.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®