Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-29 Thread Nina Wu
Hi, Matthias

On Mon, 2021-03-29 at 13:16 +0200, Matthias Brugger wrote:
> 
> On 26/03/2021 08:31, Nina Wu wrote:
> > From: Nina Wu 
> > 
> > To support newer hardware architecture of devapc,
> > update device tree bindings.
> > 
> > Signed-off-by: Nina Wu 
> > ---
> >  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> > ++
> >  1 file changed, 41 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml 
> > b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > index 31e4d3c..489f6a9 100644
> > --- a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > +++ b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > @@ -20,9 +20,27 @@ properties:
> >compatible:
> >  enum:
> >- mediatek,mt6779-devapc
> > +  - mediatek,mt8192-devapc
> > +
> > +  version:
> > +description: The version of the hardware architecture
> > +$ref: /schemas/types.yaml#/definitions/uint32
> > +enum: [1, 2]
> > +maxItems: 1
> > +
> > +  slave_type_num:
> > +description: The number of the devapc set
> > +$ref: /schemas/types.yaml#/definitions/uint32
> > +enum: [1, 4]
> > +maxItems: 1
> >  
> >reg:
> >  description: The base address of devapc register bank
> > +maxItems: 4
> > +
> > +  vio_idx_num:
> > +description: The number of the devices controlled by devapc
> > +$ref: /schemas/types.yaml#/definitions/uint32-array
> 
> This can all per compatible DT data objects in the driver. Don't add new
> properties here.

I will try to remove it in the next version
Thanks


> 
> Regards,
> Matthias
> 
> >  maxItems: 1
> >  
> >interrupts:
> > @@ -39,7 +57,10 @@ properties:
> >  
> >  required:
> >- compatible
> > +  - version
> > +  - slave_type_num
> >- reg
> > +  - vio_idx_num
> >- interrupts
> >- clocks
> >- clock-names
> > @@ -53,8 +74,28 @@ examples:
> >  
> >  devapc: devapc@10207000 {
> >compatible = "mediatek,mt6779-devapc";
> > +  version = <1>;
> > +  slave_type_num = <1>;
> >reg = <0x10207000 0x1000>;
> > +  vio_idx_num = <511>;
> >interrupts = ;
> >clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> >clock-names = "devapc-infra-clock";
> >  };
> > +  - |
> > +#include 
> > +#include 
> > +
> > +devapc: devapc@10207000 {
> > +compatible = "mediatek,mt8192-devapc";
> > +version = <2>;
> > +slave_type_num = <4>;
> > +reg = <0 0x10207000 0 0x1000>,
> > +<0 0x10274000 0 0x1000>,
> > +<0 0x10275000 0 0x1000>,
> > +<0 0x1102 0 0x1000>;
> > +vio_idx_num = <367 292 242 58>;
> > +interrupts = ;
> > +clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> > +clock-names = "devapc-infra-clock";
> > +};
> > 



Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-29 Thread Matthias Brugger



On 26/03/2021 08:31, Nina Wu wrote:
> From: Nina Wu 
> 
> To support newer hardware architecture of devapc,
> update device tree bindings.
> 
> Signed-off-by: Nina Wu 
> ---
>  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> ++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml 
> b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> index 31e4d3c..489f6a9 100644
> --- a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> +++ b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> @@ -20,9 +20,27 @@ properties:
>compatible:
>  enum:
>- mediatek,mt6779-devapc
> +  - mediatek,mt8192-devapc
> +
> +  version:
> +description: The version of the hardware architecture
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [1, 2]
> +maxItems: 1
> +
> +  slave_type_num:
> +description: The number of the devapc set
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [1, 4]
> +maxItems: 1
>  
>reg:
>  description: The base address of devapc register bank
> +maxItems: 4
> +
> +  vio_idx_num:
> +description: The number of the devices controlled by devapc
> +$ref: /schemas/types.yaml#/definitions/uint32-array

This can all per compatible DT data objects in the driver. Don't add new
properties here.

Regards,
Matthias

>  maxItems: 1
>  
>interrupts:
> @@ -39,7 +57,10 @@ properties:
>  
>  required:
>- compatible
> +  - version
> +  - slave_type_num
>- reg
> +  - vio_idx_num
>- interrupts
>- clocks
>- clock-names
> @@ -53,8 +74,28 @@ examples:
>  
>  devapc: devapc@10207000 {
>compatible = "mediatek,mt6779-devapc";
> +  version = <1>;
> +  slave_type_num = <1>;
>reg = <0x10207000 0x1000>;
> +  vio_idx_num = <511>;
>interrupts = ;
>clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
>clock-names = "devapc-infra-clock";
>  };
> +  - |
> +#include 
> +#include 
> +
> +devapc: devapc@10207000 {
> +compatible = "mediatek,mt8192-devapc";
> +version = <2>;
> +slave_type_num = <4>;
> +reg = <0 0x10207000 0 0x1000>,
> +<0 0x10274000 0 0x1000>,
> +<0 0x10275000 0 0x1000>,
> +<0 0x1102 0 0x1000>;
> +vio_idx_num = <367 292 242 58>;
> +interrupts = ;
> +clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> +clock-names = "devapc-infra-clock";
> +};
> 


Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-28 Thread Nina Wu
Hi, Rob


On Fri, 2021-03-26 at 13:58 -0600, Rob Herring wrote:
> On Fri, Mar 26, 2021 at 03:31:10PM +0800, Nina Wu wrote:
> > From: Nina Wu 
> > 
> > To support newer hardware architecture of devapc,
> > update device tree bindings.
> > 
> > Signed-off-by: Nina Wu 
> > ---
> >  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> > ++
> >  1 file changed, 41 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml 
> > b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > index 31e4d3c..489f6a9 100644
> > --- a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > +++ b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > @@ -20,9 +20,27 @@ properties:
> >compatible:
> >  enum:
> >- mediatek,mt6779-devapc
> > +  - mediatek,mt8192-devapc
> > +
> > +  version:
> > +description: The version of the hardware architecture
> 
> This should be implied by the compatible string.

The version attribute is used to decide how we interpret the debug info
got from registers.
As you mentioned, we can know the version of the architecture from the
compatible, but I think there will be code like this:

if (compatible is mt6779) version = 1
else if (compatible is mt8192) version = 2

And once we have more chips to support, the code will be quite long.
So I prefer to add a 'version' here.


> 
> > +$ref: /schemas/types.yaml#/definitions/uint32
> > +enum: [1, 2]
> > +maxItems: 1
> > +
> > +  slave_type_num:
> 
> vendor prefix needed and s/_/-/

I will fixed in next version.

> 
> > +description: The number of the devapc set
> 
> What?

For mt8192, there are multiple pieces of devapc HW for different subsys.
EX: infra devapc, peri devapc, etc.
'slave_type_num' is the total number of the devapc HW.
I cannot come up with an accurate description, though.


> 
> > +$ref: /schemas/types.yaml#/definitions/uint32
> > +enum: [1, 4]
> > +maxItems: 1
> >  
> >reg:
> >  description: The base address of devapc register bank
> > +maxItems: 4
> 
> Need to define what each region is.

I will fix it in the next version.

> 
> > +
> > +  vio_idx_num:
> 
> vendor prefix needed and s/_/-/

OK, will be fixed in the next version.

> 
> > +description: The number of the devices controlled by devapc
> 
> No need to know which devices?

yes, the current driver does not care each of them.

> 
> > +$ref: /schemas/types.yaml#/definitions/uint32-array
> >  maxItems: 1
> 
> uint32-array with 'maxItems: 1' is just 'uint32'
> 

got it, so it should be 'maxItems: 4'

> >  
> >interrupts:
> > @@ -39,7 +57,10 @@ properties:
> >  
> >  required:
> >- compatible
> > +  - version
> > +  - slave_type_num
> >- reg
> > +  - vio_idx_num
> >- interrupts
> >- clocks
> >- clock-names
> > @@ -53,8 +74,28 @@ examples:
> >  
> >  devapc: devapc@10207000 {
> >compatible = "mediatek,mt6779-devapc";
> > +  version = <1>;
> > +  slave_type_num = <1>;
> >reg = <0x10207000 0x1000>;
> > +  vio_idx_num = <511>;
> >interrupts = ;
> >clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> >clock-names = "devapc-infra-clock";
> >  };
> > +  - |
> > +#include 
> > +#include 
> > +
> > +devapc: devapc@10207000 {
> > +compatible = "mediatek,mt8192-devapc";
> > +version = <2>;
> > +slave_type_num = <4>;
> > +reg = <0 0x10207000 0 0x1000>,
> > +<0 0x10274000 0 0x1000>,
> > +<0 0x10275000 0 0x1000>,
> > +<0 0x1102 0 0x1000>;
> > +vio_idx_num = <367 292 242 58>;
> 
> Is the length of this the same as the value of slave_type_num? If so, 
> don't need both.
> 

yes, the length is equal to slave_type_num.
I will try to remove it in the next version.

> > +interrupts = ;
> > +clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> > +clock-names = "devapc-infra-clock";
> > +};
> > -- 
> > 2.6.4
> > 



Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-28 Thread Nina Wu
Hi, Chun-Kuang

On Sat, 2021-03-27 at 00:18 +0800, Chun-Kuang Hu wrote:
> Hi, Nina:
> 
> Nina Wu  於 2021年3月26日 週五 下午3:34寫道:
> >
> > From: Nina Wu 
> >
> > To support newer hardware architecture of devapc,
> > update device tree bindings.
> >
> > Signed-off-by: Nina Wu 
> > ---
> >  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> > ++
> >  1 file changed, 41 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml 
> > b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > index 31e4d3c..489f6a9 100644
> > --- a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > +++ b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> > @@ -20,9 +20,27 @@ properties:
> >compatible:
> >  enum:
> >- mediatek,mt6779-devapc
> > +  - mediatek,mt8192-devapc
> > +
> > +  version:
> > +description: The version of the hardware architecture
> > +$ref: /schemas/types.yaml#/definitions/uint32
> > +enum: [1, 2]
> > +maxItems: 1
> > +
> > +  slave_type_num:
> > +description: The number of the devapc set
> > +$ref: /schemas/types.yaml#/definitions/uint32
> > +enum: [1, 4]
> > +maxItems: 1
> >
> >reg:
> >  description: The base address of devapc register bank
> > +maxItems: 4
> > +
> > +  vio_idx_num:
> > +description: The number of the devices controlled by devapc
> > +$ref: /schemas/types.yaml#/definitions/uint32-array
> >  maxItems: 1
> >
> >interrupts:
> > @@ -39,7 +57,10 @@ properties:
> >
> >  required:
> >- compatible
> > +  - version
> > +  - slave_type_num
> >- reg
> > +  - vio_idx_num
> >- interrupts
> >- clocks
> >- clock-names
> > @@ -53,8 +74,28 @@ examples:
> >
> >  devapc: devapc@10207000 {
> >compatible = "mediatek,mt6779-devapc";
> > +  version = <1>;
> 
> I think version is redundant. For example, if mt0001-devapc is
> identical to mt6779-devapc, its compatible should be
> 
> compatible = "mediatek,mt0001-devapc", "mediatek,mt6779-devapc";
> 
> In driver, only keep compatible for mt6779 and no mt0001 because
> mt0001 is identical to mt6779.
> In probe sequence, try first compatible string
> "mediatek,mt0001-devapc", but it does not exist in driver, so try next
> compatible string "mediatek,mt6779-devapc" and match.
> So mt0001-devapc would work as mt6779-devapc.
> 

I think the version is still needed.
Because there is little difference in the registers which save debug
info.


> > +  slave_type_num = <1>;
> >reg = <0x10207000 0x1000>;
> > +  vio_idx_num = <511>;
> >interrupts = ;
> >clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> >clock-names = "devapc-infra-clock";
> >  };
> > +  - |
> > +#include 
> > +#include 
> > +
> > +devapc: devapc@10207000 {
> > +compatible = "mediatek,mt8192-devapc";
> > +version = <2>;
> > +slave_type_num = <4>;
> > +reg = <0 0x10207000 0 0x1000>,
> > +<0 0x10274000 0 0x1000>,
> > +<0 0x10275000 0 0x1000>,
> > +<0 0x1102 0 0x1000>;
> > +vio_idx_num = <367 292 242 58>;
> > +interrupts = ;
> > +clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> > +clock-names = "devapc-infra-clock";
> > +};
> 
> It looks like that there are 4 devapc device in mt8192.
> These 4 device work independently, so I would like to decouple them
> rather than couple them.
> 
> devapc0: devapc@10207000 {
> compatible = "mediatek,mt8192-devapc";
> reg = <0 0x10207000 0 0x1000>;
> vio_idx_num = <367>;
> ...
> };
> 
> devapc1: devapc@10274000 {
> compatible = "mediatek,mt8192-devapc";
> reg = <0 0x10274000 0 0x1000>;
> vio_idx_num = <292>;
> ...
> };
> 
> devapc2: devapc@10275000 {
> compatible = "mediatek,mt8192-devapc";
> reg = <0 0x10275000 0 0x1000>;
> vio_idx_num = <242>;
> ...
> };
> 
> devapc3: devapc@1102 {
> compatible = "mediatek,mt8192-devapc";
> reg = <0 0x1102 0 0x1000>;
> vio_idx_num = <58>;
> ...
> };
> 

I will try this with shared IRQ and re-submit another version.


> Regards,
> Chun-Kuang.
> 
> > --
> > 2.6.4
> > ___
> > Linux-mediatek mailing list
> > linux-media...@lists.infradead.org
> > https://urldefense.com/v3/__http://lists.infradead.org/mailman/listinfo/linux-mediatek__;!!CTRNKA9wMg0ARbw!02jtHESdXiknfQKFC-IqkUJOuWEjeE-GMqwk3RmPMm3_T-Xv9pmUk9Zoi2e2kvXjoKc$
> >  



Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-28 Thread Nina Wu
Hi, Rob

I just found that there is the un-merged dependent patch.
https://patchwork.kernel.org/project/linux-mediatek/patch/20210324104110.13383-7-chun-jie.c...@mediatek.com/

I will add this to commit message in the next version.

Thanks

On Fri, 2021-03-26 at 09:10 -0600, Rob Herring wrote:
> On Fri, 26 Mar 2021 15:31:10 +0800, Nina Wu wrote:
> > From: Nina Wu 
> > 
> > To support newer hardware architecture of devapc,
> > update device tree bindings.
> > 
> > Signed-off-by: Nina Wu 
> > ---
> >  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> > ++
> >  1 file changed, 41 insertions(+)
> > 
> 
> My bot found errors running 'make dt_binding_check' on your patch:
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml:
>  properties:version:enum: False schema does not allow [1, 2]
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml:
>  properties:slave_type_num:enum: False schema does not allow [1, 4]
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml:
>  ignoring, error in schema: properties: slave_type_num: enum
> warning: no schema found in file: 
> ./Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> Documentation/devicetree/bindings/soc/mediatek/devapc.example.dts:51:18: 
> fatal error: dt-bindings/clock/mt8192-clk.h: No such file or directory
>51 | #include 
>   |  ^~~~
> compilation terminated.
> make[1]: *** [scripts/Makefile.lib:349: 
> Documentation/devicetree/bindings/soc/mediatek/devapc.example.dt.yaml] Error 1
> make[1]: *** Waiting for unfinished jobs
> make: *** [Makefile:1380: dt_binding_check] Error 2
> 
> See 
> https://urldefense.com/v3/__https://patchwork.ozlabs.org/patch/1458687__;!!CTRNKA9wMg0ARbw!zZmjm74Leee8o-eaQUB_yHYvh-66g88Rgjozv_ecSkwW-yfo7G_c9o6-p0JlFfst3VI$
>  
> 
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
> 
> pip3 install dtschema --upgrade
> 
> Please check and re-submit.
> 



Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-26 Thread Rob Herring
On Fri, Mar 26, 2021 at 03:31:10PM +0800, Nina Wu wrote:
> From: Nina Wu 
> 
> To support newer hardware architecture of devapc,
> update device tree bindings.
> 
> Signed-off-by: Nina Wu 
> ---
>  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> ++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml 
> b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> index 31e4d3c..489f6a9 100644
> --- a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> +++ b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> @@ -20,9 +20,27 @@ properties:
>compatible:
>  enum:
>- mediatek,mt6779-devapc
> +  - mediatek,mt8192-devapc
> +
> +  version:
> +description: The version of the hardware architecture

This should be implied by the compatible string.

> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [1, 2]
> +maxItems: 1
> +
> +  slave_type_num:

vendor prefix needed and s/_/-/

> +description: The number of the devapc set

What?

> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [1, 4]
> +maxItems: 1
>  
>reg:
>  description: The base address of devapc register bank
> +maxItems: 4

Need to define what each region is.

> +
> +  vio_idx_num:

vendor prefix needed and s/_/-/

> +description: The number of the devices controlled by devapc

No need to know which devices?

> +$ref: /schemas/types.yaml#/definitions/uint32-array
>  maxItems: 1

uint32-array with 'maxItems: 1' is just 'uint32'

>  
>interrupts:
> @@ -39,7 +57,10 @@ properties:
>  
>  required:
>- compatible
> +  - version
> +  - slave_type_num
>- reg
> +  - vio_idx_num
>- interrupts
>- clocks
>- clock-names
> @@ -53,8 +74,28 @@ examples:
>  
>  devapc: devapc@10207000 {
>compatible = "mediatek,mt6779-devapc";
> +  version = <1>;
> +  slave_type_num = <1>;
>reg = <0x10207000 0x1000>;
> +  vio_idx_num = <511>;
>interrupts = ;
>clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
>clock-names = "devapc-infra-clock";
>  };
> +  - |
> +#include 
> +#include 
> +
> +devapc: devapc@10207000 {
> +compatible = "mediatek,mt8192-devapc";
> +version = <2>;
> +slave_type_num = <4>;
> +reg = <0 0x10207000 0 0x1000>,
> +<0 0x10274000 0 0x1000>,
> +<0 0x10275000 0 0x1000>,
> +<0 0x1102 0 0x1000>;
> +vio_idx_num = <367 292 242 58>;

Is the length of this the same as the value of slave_type_num? If so, 
don't need both.

> +interrupts = ;
> +clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> +clock-names = "devapc-infra-clock";
> +};
> -- 
> 2.6.4
> 


Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-26 Thread Chun-Kuang Hu
Hi, Nina:

Nina Wu  於 2021年3月26日 週五 下午3:34寫道:
>
> From: Nina Wu 
>
> To support newer hardware architecture of devapc,
> update device tree bindings.
>
> Signed-off-by: Nina Wu 
> ---
>  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> ++
>  1 file changed, 41 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml 
> b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> index 31e4d3c..489f6a9 100644
> --- a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> +++ b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
> @@ -20,9 +20,27 @@ properties:
>compatible:
>  enum:
>- mediatek,mt6779-devapc
> +  - mediatek,mt8192-devapc
> +
> +  version:
> +description: The version of the hardware architecture
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [1, 2]
> +maxItems: 1
> +
> +  slave_type_num:
> +description: The number of the devapc set
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [1, 4]
> +maxItems: 1
>
>reg:
>  description: The base address of devapc register bank
> +maxItems: 4
> +
> +  vio_idx_num:
> +description: The number of the devices controlled by devapc
> +$ref: /schemas/types.yaml#/definitions/uint32-array
>  maxItems: 1
>
>interrupts:
> @@ -39,7 +57,10 @@ properties:
>
>  required:
>- compatible
> +  - version
> +  - slave_type_num
>- reg
> +  - vio_idx_num
>- interrupts
>- clocks
>- clock-names
> @@ -53,8 +74,28 @@ examples:
>
>  devapc: devapc@10207000 {
>compatible = "mediatek,mt6779-devapc";
> +  version = <1>;

I think version is redundant. For example, if mt0001-devapc is
identical to mt6779-devapc, its compatible should be

compatible = "mediatek,mt0001-devapc", "mediatek,mt6779-devapc";

In driver, only keep compatible for mt6779 and no mt0001 because
mt0001 is identical to mt6779.
In probe sequence, try first compatible string
"mediatek,mt0001-devapc", but it does not exist in driver, so try next
compatible string "mediatek,mt6779-devapc" and match.
So mt0001-devapc would work as mt6779-devapc.

> +  slave_type_num = <1>;
>reg = <0x10207000 0x1000>;
> +  vio_idx_num = <511>;
>interrupts = ;
>clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
>clock-names = "devapc-infra-clock";
>  };
> +  - |
> +#include 
> +#include 
> +
> +devapc: devapc@10207000 {
> +compatible = "mediatek,mt8192-devapc";
> +version = <2>;
> +slave_type_num = <4>;
> +reg = <0 0x10207000 0 0x1000>,
> +<0 0x10274000 0 0x1000>,
> +<0 0x10275000 0 0x1000>,
> +<0 0x1102 0 0x1000>;
> +vio_idx_num = <367 292 242 58>;
> +interrupts = ;
> +clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
> +clock-names = "devapc-infra-clock";
> +};

It looks like that there are 4 devapc device in mt8192.
These 4 device work independently, so I would like to decouple them
rather than couple them.

devapc0: devapc@10207000 {
compatible = "mediatek,mt8192-devapc";
reg = <0 0x10207000 0 0x1000>;
vio_idx_num = <367>;
...
};

devapc1: devapc@10274000 {
compatible = "mediatek,mt8192-devapc";
reg = <0 0x10274000 0 0x1000>;
vio_idx_num = <292>;
...
};

devapc2: devapc@10275000 {
compatible = "mediatek,mt8192-devapc";
reg = <0 0x10275000 0 0x1000>;
vio_idx_num = <242>;
...
};

devapc3: devapc@1102 {
compatible = "mediatek,mt8192-devapc";
reg = <0 0x1102 0 0x1000>;
vio_idx_num = <58>;
...
};

Regards,
Chun-Kuang.

> --
> 2.6.4
> ___
> Linux-mediatek mailing list
> linux-media...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek


Re: [PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-26 Thread Rob Herring
On Fri, 26 Mar 2021 15:31:10 +0800, Nina Wu wrote:
> From: Nina Wu 
> 
> To support newer hardware architecture of devapc,
> update device tree bindings.
> 
> Signed-off-by: Nina Wu 
> ---
>  .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 
> ++
>  1 file changed, 41 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml:
 properties:version:enum: False schema does not allow [1, 2]
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml:
 properties:slave_type_num:enum: False schema does not allow [1, 4]
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml:
 ignoring, error in schema: properties: slave_type_num: enum
warning: no schema found in file: 
./Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
Documentation/devicetree/bindings/soc/mediatek/devapc.example.dts:51:18: fatal 
error: dt-bindings/clock/mt8192-clk.h: No such file or directory
   51 | #include 
  |  ^~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:349: 
Documentation/devicetree/bindings/soc/mediatek/devapc.example.dt.yaml] Error 1
make[1]: *** Waiting for unfinished jobs
make: *** [Makefile:1380: dt_binding_check] Error 2

See https://patchwork.ozlabs.org/patch/1458687

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.



[PATCH 1/2] dt-bindings: devapc: Update bindings

2021-03-26 Thread Nina Wu
From: Nina Wu 

To support newer hardware architecture of devapc,
update device tree bindings.

Signed-off-by: Nina Wu 
---
 .../devicetree/bindings/soc/mediatek/devapc.yaml   | 41 ++
 1 file changed, 41 insertions(+)

diff --git a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml 
b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
index 31e4d3c..489f6a9 100644
--- a/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
+++ b/Documentation/devicetree/bindings/soc/mediatek/devapc.yaml
@@ -20,9 +20,27 @@ properties:
   compatible:
 enum:
   - mediatek,mt6779-devapc
+  - mediatek,mt8192-devapc
+
+  version:
+description: The version of the hardware architecture
+$ref: /schemas/types.yaml#/definitions/uint32
+enum: [1, 2]
+maxItems: 1
+
+  slave_type_num:
+description: The number of the devapc set
+$ref: /schemas/types.yaml#/definitions/uint32
+enum: [1, 4]
+maxItems: 1
 
   reg:
 description: The base address of devapc register bank
+maxItems: 4
+
+  vio_idx_num:
+description: The number of the devices controlled by devapc
+$ref: /schemas/types.yaml#/definitions/uint32-array
 maxItems: 1
 
   interrupts:
@@ -39,7 +57,10 @@ properties:
 
 required:
   - compatible
+  - version
+  - slave_type_num
   - reg
+  - vio_idx_num
   - interrupts
   - clocks
   - clock-names
@@ -53,8 +74,28 @@ examples:
 
 devapc: devapc@10207000 {
   compatible = "mediatek,mt6779-devapc";
+  version = <1>;
+  slave_type_num = <1>;
   reg = <0x10207000 0x1000>;
+  vio_idx_num = <511>;
   interrupts = ;
   clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
   clock-names = "devapc-infra-clock";
 };
+  - |
+#include 
+#include 
+
+devapc: devapc@10207000 {
+compatible = "mediatek,mt8192-devapc";
+version = <2>;
+slave_type_num = <4>;
+reg = <0 0x10207000 0 0x1000>,
+<0 0x10274000 0 0x1000>,
+<0 0x10275000 0 0x1000>,
+<0 0x1102 0 0x1000>;
+vio_idx_num = <367 292 242 58>;
+interrupts = ;
+clocks = <&infracfg_ao CLK_INFRA_DEVICE_APC>;
+clock-names = "devapc-infra-clock";
+};
-- 
2.6.4