diff mbox series

[3/5] dt-bindings: reset: ocelot: Add documentation for 'microchip,reset-switch-core' property

Message ID 20200513130842.24847-4-lars.povlsen@microchip.com (mailing list archive)
State Not Applicable
Headers show
Series power: Adding support for Microchip Sparx5 SoC | expand

Commit Message

Lars Povlsen May 13, 2020, 1:08 p.m. UTC
This documents the 'microchip,reset-switch-core' property in the
ocelot-reset driver.

Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
---
 .../devicetree/bindings/power/reset/ocelot-reset.txt        | 6 ++++++
 1 file changed, 6 insertions(+)

--
2.26.2

Comments

Rob Herring (Arm) May 28, 2020, 2:25 a.m. UTC | #1
On Wed, May 13, 2020 at 03:08:40PM +0200, Lars Povlsen wrote:
> This documents the 'microchip,reset-switch-core' property in the
> ocelot-reset driver.
> 
> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
> ---
>  .../devicetree/bindings/power/reset/ocelot-reset.txt        | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> index 4d530d8154848..20fff03753ad2 100644
> --- a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> +++ b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> @@ -9,9 +9,15 @@ microchip Sparx5 armv8 SoC's.
>  Required Properties:
>   - compatible: "mscc,ocelot-chip-reset" or "microchip,sparx5-chip-reset"
> 
> +Optional properties:
> +- microchip,reset-switch-core : Perform a switch core reset at the
> +  time of driver load. This is may be used to initialize the switch
> +  core to a known state (before other drivers are loaded).

How do you know when other drivers are loaded? This could be a module 
perhaps. Doesn't seem like something that belongs in DT.

Can this behavior be implied with "microchip,sparx5-chip-reset"?

Rob
Lars Povlsen June 2, 2020, 9:49 a.m. UTC | #2
Rob Herring writes:

> On Wed, May 13, 2020 at 03:08:40PM +0200, Lars Povlsen wrote:
>> This documents the 'microchip,reset-switch-core' property in the
>> ocelot-reset driver.
>>
>> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
>> ---
>>  .../devicetree/bindings/power/reset/ocelot-reset.txt        | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
>> index 4d530d8154848..20fff03753ad2 100644
>> --- a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
>> +++ b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
>> @@ -9,9 +9,15 @@ microchip Sparx5 armv8 SoC's.
>>  Required Properties:
>>   - compatible: "mscc,ocelot-chip-reset" or "microchip,sparx5-chip-reset"
>>
>> +Optional properties:
>> +- microchip,reset-switch-core : Perform a switch core reset at the
>> +  time of driver load. This is may be used to initialize the switch
>> +  core to a known state (before other drivers are loaded).
>
> How do you know when other drivers are loaded? This could be a module
> perhaps. Doesn't seem like something that belongs in DT.
>

The reset driver is loaded at postcore_initcall() time, which ensures it
is loaded before other drivers using the switch core. I noticed other
drivers do the same to do low-level system reset and initialization at
early boot time.

> Can this behavior be implied with "microchip,sparx5-chip-reset"?

Since we need to cater for both modus operandi, I would need two driver
compatible strings per platform, which scales worse than a single
property.

The "microchip,reset-switch-core" is a device configuration property
which tells the system (driver) how the hw should be handled. Since you
do not *always* want to reset the switch core (f.ex. when implementing
systems with warm reboot), I think it makes perfect sense - but I may be
biased off course :-)

Thank you for (all) of your comments, by the way!

---Lars

>
> Rob
Sebastian Reichel Aug. 28, 2020, 4:39 p.m. UTC | #3
Hi,

On Tue, Jun 02, 2020 at 11:49:08AM +0200, Lars Povlsen wrote:
> Rob Herring writes:
> > On Wed, May 13, 2020 at 03:08:40PM +0200, Lars Povlsen wrote:
> >> This documents the 'microchip,reset-switch-core' property in the
> >> ocelot-reset driver.
> >>
> >> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
> >> ---
> >>  .../devicetree/bindings/power/reset/ocelot-reset.txt        | 6 ++++++
> >>  1 file changed, 6 insertions(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> >> index 4d530d8154848..20fff03753ad2 100644
> >> --- a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> >> +++ b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> >> @@ -9,9 +9,15 @@ microchip Sparx5 armv8 SoC's.
> >>  Required Properties:
> >>   - compatible: "mscc,ocelot-chip-reset" or "microchip,sparx5-chip-reset"
> >>
> >> +Optional properties:
> >> +- microchip,reset-switch-core : Perform a switch core reset at the
> >> +  time of driver load. This is may be used to initialize the switch
> >> +  core to a known state (before other drivers are loaded).
> >
> > How do you know when other drivers are loaded? This could be a module
> > perhaps. Doesn't seem like something that belongs in DT.
> >
> 
> The reset driver is loaded at postcore_initcall() time, which ensures it
> is loaded before other drivers using the switch core. I noticed other
> drivers do the same to do low-level system reset and initialization at
> early boot time.
> 
> > Can this behavior be implied with "microchip,sparx5-chip-reset"?
> 
> Since we need to cater for both modus operandi, I would need two driver
> compatible strings per platform, which scales worse than a single
> property.
> 
> The "microchip,reset-switch-core" is a device configuration property
> which tells the system (driver) how the hw should be handled. Since you
> do not *always* want to reset the switch core (f.ex. when implementing
> systems with warm reboot), I think it makes perfect sense - but I may be
> biased off course :-)
> 
> Thank you for (all) of your comments, by the way!
> 
> ---Lars
> > Rob

Is this series still needed? Did I miss a follow-up?

-- Sebastian
Lars Povlsen Aug. 31, 2020, 8:19 a.m. UTC | #4
Sebastian Reichel writes:

> Hi,
> 
> On Tue, Jun 02, 2020 at 11:49:08AM +0200, Lars Povlsen wrote:
> > Rob Herring writes:
> > > On Wed, May 13, 2020 at 03:08:40PM +0200, Lars Povlsen wrote:
> > >> This documents the 'microchip,reset-switch-core' property in the
> > >> ocelot-reset driver.
> > >>
> > >> Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
> > >> ---
> > >>  .../devicetree/bindings/power/reset/ocelot-reset.txt        | 6 ++++++
> > >>  1 file changed, 6 insertions(+)
> > >>
> > >> diff --git a/Documentation/devicetree/bindings/power/reset/ocelot-rese=
> t.txt b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> > >> index 4d530d8154848..20fff03753ad2 100644
> > >> --- a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> > >> +++ b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
> > >> @@ -9,9 +9,15 @@ microchip Sparx5 armv8 SoC's.
> > >>  Required Properties:
> > >>   - compatible: "mscc,ocelot-chip-reset" or "microchip,sparx5-chip-res=
> et"
> > >>
> > >> +Optional properties:
> > >> +- microchip,reset-switch-core : Perform a switch core reset at the
> > >> +  time of driver load. This is may be used to initialize the switch
> > >> +  core to a known state (before other drivers are loaded).
> > >
> > > How do you know when other drivers are loaded? This could be a module
> > > perhaps. Doesn't seem like something that belongs in DT.
> > >
> > 
> > The reset driver is loaded at postcore_initcall() time, which ensures it
> > is loaded before other drivers using the switch core. I noticed other
> > drivers do the same to do low-level system reset and initialization at
> > early boot time.
> > 
> > > Can this behavior be implied with "microchip,sparx5-chip-reset"?
> > 
> > Since we need to cater for both modus operandi, I would need two driver
> > compatible strings per platform, which scales worse than a single
> > property.
> > 
> > The "microchip,reset-switch-core" is a device configuration property
> > which tells the system (driver) how the hw should be handled. Since you
> > do not *always* want to reset the switch core (f.ex. when implementing
> > systems with warm reboot), I think it makes perfect sense - but I may be
> > biased off course :-)
> > 
> > Thank you for (all) of your comments, by the way!
> > 
> > ---Lars
> > > Rob
> 
> Is this series still needed? Did I miss a follow-up?

Hi Sebastian!

Yes, the series is still needed, but the conversation died after my
last message.

If the DT-controlled reset property is too controversial, I am willing
to drop that part. (Rob just reviewed the bindings).

MCHP reference designs have GPIO resets, so we *could* get by without,
but new designs may this feature.

> -- Sebastian

---Lars
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
index 4d530d8154848..20fff03753ad2 100644
--- a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
+++ b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
@@ -9,9 +9,15 @@  microchip Sparx5 armv8 SoC's.
 Required Properties:
  - compatible: "mscc,ocelot-chip-reset" or "microchip,sparx5-chip-reset"

+Optional properties:
+- microchip,reset-switch-core : Perform a switch core reset at the
+  time of driver load. This is may be used to initialize the switch
+  core to a known state (before other drivers are loaded).
+
 Example:
 	reset@1070008 {
 		compatible = "mscc,ocelot-chip-reset";
 		reg = <0x1070008 0x4>;
+		microchip,reset-switch-core;
 	};