Message ID | 20241223125553.3527812-1-m.wilczynski@samsung.com |
---|---|
Headers | show |
Series | Enable drm/imagination BXM-4-64 Support for LicheePi 4A | expand |
On 23/12/2024 13:55, Michal Wilczynski wrote: > The kernel communicates with the E902 core through the mailbox > transport using AON firmware protocol. Add dt-bindings to document it > the dt node. > > Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> > --- > .../bindings/firmware/thead,th1520-aon.yaml | 59 +++++++++++++++++++ > MAINTAINERS | 1 + > 2 files changed, 60 insertions(+) > create mode 100644 Documentation/devicetree/bindings/firmware/thead,th1520-aon.yaml > > diff --git a/Documentation/devicetree/bindings/firmware/thead,th1520-aon.yaml b/Documentation/devicetree/bindings/firmware/thead,th1520-aon.yaml > new file mode 100644 > index 000000000000..ca4c276766a3 > --- /dev/null > +++ b/Documentation/devicetree/bindings/firmware/thead,th1520-aon.yaml > @@ -0,0 +1,59 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/firmware/thead,th1520-aon.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: T-HEAD TH1520 AON (Always-On) Firmware Node Drop "Node", unless this is somehow name of device (not a DT node). > + > +description: | > + The Always-On (AON) subsystem in the TH1520 SoC is responsible for managing > + low-power states, system wakeup events, and power management tasks. It is > + designed to operate independently in a dedicated power domain, allowing it to > + remain functional even during the SoC's deep sleep states. > + > + At the heart of the AON subsystem is the E902, a low-power core that executes > + firmware responsible for coordinating tasks such as power domain control, > + clock management, and system wakeup signaling. Communication between the main > + SoC and the AON subsystem is handled through a mailbox interface, which > + enables message-based interactions with the AON firmware. > + > +maintainers: > + - Michal Wilczynski <m.wilczynski@samsung.com> > + > +properties: > + compatible: > + const: thead,th1520-aon > + > + mboxes: > + maxItems: 1 > + > + mbox-names: > + items: > + - const: aon > + > + power-domain: > + $ref: /schemas/power/thead,th1520-power.yaml# > + description: Subnode representing the hardware power domain of the AON subsystem. > + > +additionalProperties: false > + > +required: > + - compatible > + - mboxes > + - mbox-names In all your bindings patches: "required" block goes before additional/unevaluatedProperties. See also example-schema. > + > +examples: > + - | > + firmware { > + aon: aon { Best regards, Krzysztof
On 23/12/2024 13:55, Michal Wilczynski wrote: > Add a YAML schema for the T-HEAD TH1520 SoC reset controller. This > controller manages resets for subsystems such as the GPU within the > TH1520 SoC. > > Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> > --- > .../bindings/reset/thead,th1520-reset.yaml | 45 +++++++++++++++++++ > MAINTAINERS | 2 + > .../dt-bindings/reset/thead,th1520-reset.h | 13 ++++++ > 3 files changed, 60 insertions(+) > create mode 100644 Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml > create mode 100644 include/dt-bindings/reset/thead,th1520-reset.h > > diff --git a/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml b/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml > new file mode 100644 > index 000000000000..46d0e6b8c712 > --- /dev/null > +++ b/Documentation/devicetree/bindings/reset/thead,th1520-reset.yaml > @@ -0,0 +1,45 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > + Drop blank line > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/reset/thead,th1520-reset.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: T-HEAD TH1520 SoC Reset Controller > + > +description: | Do not need '|' unless you need to preserve formatting. > + The T-HEAD TH1520 reset controller is a hardware block that asserts/deasserts > + resets for SoC subsystems. > + > +maintainers: > + - Michal Wilczynski <m.wilczynski@samsung.com> > + > +properties: > + compatible: > + enum: > + - thead,th1520-reset > + ... > RNBD BLOCK DRIVERS > diff --git a/include/dt-bindings/reset/thead,th1520-reset.h b/include/dt-bindings/reset/thead,th1520-reset.h > new file mode 100644 > index 000000000000..a4958b2ed710 > --- /dev/null > +++ b/include/dt-bindings/reset/thead,th1520-reset.h > @@ -0,0 +1,13 @@ > +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ > +/* > + * Copyright (c) 2024 Samsung Electronics Co., Ltd. > + * Author: Michal Wilczynski <m.wilczynski@samsung.com> > + */ > + > +#ifndef _DT_BINDINGS_TH1520_RESET_H > +#define _DT_BINDINGS_TH1520_RESET_H > + > +#define TH1520_RESET_ID_GPU 0 > +#define TH1520_RESET_NUM_IDS 1 Drop the NUM_IDS define. Number is not a binding. But this leads to another question: only one reset? Then reset-cells should be 0. > + > +#endif /* _DT_BINDINGS_TH1520_RESET_H */ Best regards, Krzysztof
Quoting Michal Wilczynski (2024-12-23 04:55:35) > The T-Head TH1520 SoC’s AP clock controller now needs two address ranges > to manage both the Application Processor (AP) and Video Output (VO) > subsystem clocks. Update the device tree bindings to require two `reg` > entries, one for the AP clocks and one for the VO clocks. > > Additionally, introduce new VO subsystem clock constants in the header > file. These constants will be used by the driver to control VO-related > components such as display and graphics units. > > Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> > --- [...] > diff --git a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml > index 0129bd0ba4b3..f0df97a450ef 100644 > --- a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml > +++ b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml > @@ -47,7 +54,9 @@ examples: > #include <dt-bindings/clock/thead,th1520-clk-ap.h> > clock-controller@ef010000 { > compatible = "thead,th1520-clk-ap"; > - reg = <0xef010000 0x1000>; > + reg = <0xef010000 0x1000>, > + <0xff010000 0x1000>; I don't get it. Why not have two nodes and two devices? They have different register regions so likely they're different devices on the internal SoC bus. They may have the same input clks, but otherwise I don't see how they're the same node. > + reg-names = "ap-clks", "vo-clks"; > clocks = <&osc>; > #clock-cells = <1>; > };
On 12/24/24 09:53, Krzysztof Kozlowski wrote: > On Mon, Dec 23, 2024 at 12:50:59PM -0800, Stephen Boyd wrote: >> Quoting Michal Wilczynski (2024-12-23 04:55:35) >>> The T-Head TH1520 SoC’s AP clock controller now needs two address ranges >>> to manage both the Application Processor (AP) and Video Output (VO) >>> subsystem clocks. Update the device tree bindings to require two `reg` >>> entries, one for the AP clocks and one for the VO clocks. >>> >>> Additionally, introduce new VO subsystem clock constants in the header >>> file. These constants will be used by the driver to control VO-related >>> components such as display and graphics units. >>> >>> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> >>> --- >> [...] >>> diff --git a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml >>> index 0129bd0ba4b3..f0df97a450ef 100644 >>> --- a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml >>> +++ b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml >>> @@ -47,7 +54,9 @@ examples: >>> #include <dt-bindings/clock/thead,th1520-clk-ap.h> >>> clock-controller@ef010000 { >>> compatible = "thead,th1520-clk-ap"; >>> - reg = <0xef010000 0x1000>; >>> + reg = <0xef010000 0x1000>, >>> + <0xff010000 0x1000>; >> >> I don't get it. Why not have two nodes and two devices? They have >> different register regions so likely they're different devices on the >> internal SoC bus. They may have the same input clks, but otherwise I >> don't see how they're the same node. > > That's a good point. Aren't here simply two different clock controllers? Yeah there are two clock controllers, based on the review comments I was trying to re-use the driver, but the driver can also be re-used to serve multiple nodes and multiple compatible and .data properties, if that's fine with you that's how it will look like in v3. Thanks, Michał > > Best regards, > Krzysztof > >
On 24/12/2024 10:23, Michal Wilczynski wrote: > > > On 12/24/24 09:53, Krzysztof Kozlowski wrote: >> On Mon, Dec 23, 2024 at 12:50:59PM -0800, Stephen Boyd wrote: >>> Quoting Michal Wilczynski (2024-12-23 04:55:35) >>>> The T-Head TH1520 SoC’s AP clock controller now needs two address ranges >>>> to manage both the Application Processor (AP) and Video Output (VO) >>>> subsystem clocks. Update the device tree bindings to require two `reg` >>>> entries, one for the AP clocks and one for the VO clocks. >>>> >>>> Additionally, introduce new VO subsystem clock constants in the header >>>> file. These constants will be used by the driver to control VO-related >>>> components such as display and graphics units. >>>> >>>> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> >>>> --- >>> [...] >>>> diff --git a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml >>>> index 0129bd0ba4b3..f0df97a450ef 100644 >>>> --- a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml >>>> +++ b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml >>>> @@ -47,7 +54,9 @@ examples: >>>> #include <dt-bindings/clock/thead,th1520-clk-ap.h> >>>> clock-controller@ef010000 { >>>> compatible = "thead,th1520-clk-ap"; >>>> - reg = <0xef010000 0x1000>; >>>> + reg = <0xef010000 0x1000>, >>>> + <0xff010000 0x1000>; >>> >>> I don't get it. Why not have two nodes and two devices? They have >>> different register regions so likely they're different devices on the >>> internal SoC bus. They may have the same input clks, but otherwise I >>> don't see how they're the same node. >> >> That's a good point. Aren't here simply two different clock controllers? > > Yeah there are two clock controllers, based on the review comments I was > trying to re-use the driver, but the driver can also be re-used to serve > multiple nodes and multiple compatible and .data properties, if that's > fine with you that's how it will look like in v3. Yeah, please drop my review tag and rework it to have two different devices. Driver design should not influence DTS. Best regards, Krzysztof