All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: dts: uniphier: add interrupts to support card serial
@ 2020-06-23 11:46 Masahiro Yamada
  2020-06-23 11:46 ` [PATCH 2/4] arm64: " Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-23 11:46 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Masahiro Yamada, Rob Herring, devicetree, linux-kernel

Since commit e69f5dc623f9 ("dt-bindings: serial: Convert 8250 to
json-schema"), the schema for "ns16550a" is checked.

Since then, 'make ARCH=arm dtbs_check' is so noisy because the
required property 'interrupts' is missing.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/boot/dts/uniphier-ld4-ref.dts  | 4 ++++
 arch/arm/boot/dts/uniphier-ld6b-ref.dts | 4 ++++
 arch/arm/boot/dts/uniphier-pro4-ref.dts | 4 ++++
 arch/arm/boot/dts/uniphier-sld8-ref.dts | 4 ++++
 4 files changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/uniphier-ld4-ref.dts b/arch/arm/boot/dts/uniphier-ld4-ref.dts
index f2d060f403cc..bac922499205 100644
--- a/arch/arm/boot/dts/uniphier-ld4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld4-ref.dts
@@ -39,6 +39,10 @@ &ethsc {
 	interrupts = <1 8>;
 };
 
+&serialsc {
+	interrupts = <1 8>;
+};
+
 &serial0 {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/uniphier-ld6b-ref.dts b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
index 079cadc11e6c..e0136846ee94 100644
--- a/arch/arm/boot/dts/uniphier-ld6b-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
@@ -42,6 +42,10 @@ &ethsc {
 	interrupts = <4 8>;
 };
 
+&serialsc {
+	interrupts = <4 8>;
+};
+
 &serial0 {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/uniphier-pro4-ref.dts b/arch/arm/boot/dts/uniphier-pro4-ref.dts
index 181442c48532..22d7150a1eb7 100644
--- a/arch/arm/boot/dts/uniphier-pro4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-ref.dts
@@ -42,6 +42,10 @@ &ethsc {
 	interrupts = <2 8>;
 };
 
+&serialsc {
+	interrupts = <2 8>;
+};
+
 &serial0 {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/uniphier-sld8-ref.dts b/arch/arm/boot/dts/uniphier-sld8-ref.dts
index cf9ea0b15065..0ad22af4294f 100644
--- a/arch/arm/boot/dts/uniphier-sld8-ref.dts
+++ b/arch/arm/boot/dts/uniphier-sld8-ref.dts
@@ -39,6 +39,10 @@ &ethsc {
 	interrupts = <0 8>;
 };
 
+&serialsc {
+	interrupts = <0 8>;
+};
+
 &serial0 {
 	status = "okay";
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/4] arm64: dts: uniphier: add interrupts to support card serial
  2020-06-23 11:46 [PATCH 1/4] ARM: dts: uniphier: add interrupts to support card serial Masahiro Yamada
@ 2020-06-23 11:46 ` Masahiro Yamada
  2020-06-23 11:46 ` [PATCH 3/4] ARM: dts: uniphier: rename support card serial node to fix schema warning Masahiro Yamada
  2020-06-23 11:46 ` [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus Masahiro Yamada
  2 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-23 11:46 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Masahiro Yamada, Rob Herring, devicetree, linux-kernel

Since commit e69f5dc623f9 ("dt-bindings: serial: Convert 8250 to
json-schema"), the schema for "ns16550a" is checked.

Since then, 'make ARCH=arm64 dtbs_check' is so noisy because the
required property 'interrupts' is missing.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts | 4 ++++
 arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts | 4 ++++
 arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
index 693171f82ff1..d07401fafffa 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
@@ -42,6 +42,10 @@ &ethsc {
 	interrupts = <0 8>;
 };
 
+&serialsc {
+	interrupts = <0 8>;
+};
+
 &serial0 {
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
index eeb976e7892d..709908d5812b 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
@@ -42,6 +42,10 @@ &ethsc {
 	interrupts = <0 8>;
 };
 
+&serialsc {
+	interrupts = <0 8>;
+};
+
 &serial0 {
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts b/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts
index 7c30c6b56b57..eca60e02e85a 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dts
@@ -43,6 +43,10 @@ &ethsc {
 	interrupts = <4 8>;
 };
 
+&serialsc {
+	interrupts = <4 8>;
+};
+
 &spi0 {
 	status = "okay";
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/4] ARM: dts: uniphier: rename support card serial node to fix schema warning
  2020-06-23 11:46 [PATCH 1/4] ARM: dts: uniphier: add interrupts to support card serial Masahiro Yamada
  2020-06-23 11:46 ` [PATCH 2/4] arm64: " Masahiro Yamada
@ 2020-06-23 11:46 ` Masahiro Yamada
  2020-06-23 11:46 ` [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus Masahiro Yamada
  2 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-23 11:46 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Masahiro Yamada, Rob Herring, devicetree, linux-kernel

Since commit e69f5dc623f9 ("dt-bindings: serial: Convert 8250 to
json-schema"), the schema for "ns16550a" is checked.

'make ARCH=arm dtbs_check' emits the following warning:

  uart@b0000: $nodename:0: 'uart@b0000' does not match '^serial(@[0-9a-f,]+)*$'

Rename the node to follow the pattern defined in
Documentation/devicetree/bindings/serial/serial.yaml

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/boot/dts/uniphier-support-card.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/uniphier-support-card.dtsi b/arch/arm/boot/dts/uniphier-support-card.dtsi
index bf441c2eff79..11e46e7de7c5 100644
--- a/arch/arm/boot/dts/uniphier-support-card.dtsi
+++ b/arch/arm/boot/dts/uniphier-support-card.dtsi
@@ -23,7 +23,7 @@ ethsc: ethernet@0 {
 			reg-io-width = <4>;
 		};
 
-		serialsc: uart@b0000 {
+		serialsc: serial@b0000 {
 			compatible = "ns16550a";
 			reg = <0x000b0000 0x20>;
 			clock-frequency = <12288000>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-23 11:46 [PATCH 1/4] ARM: dts: uniphier: add interrupts to support card serial Masahiro Yamada
  2020-06-23 11:46 ` [PATCH 2/4] arm64: " Masahiro Yamada
  2020-06-23 11:46 ` [PATCH 3/4] ARM: dts: uniphier: rename support card serial node to fix schema warning Masahiro Yamada
@ 2020-06-23 11:46 ` Masahiro Yamada
  2020-06-23 12:24   ` Lee Jones
  2 siblings, 1 reply; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-23 11:46 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Masahiro Yamada, Rob Herring, devicetree, linux-kernel

'make ARCH=arm dtbs_check' emits the following warning:

  support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'

Maybe, simple-mfd could be a better fit for this device.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/boot/dts/uniphier-support-card.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/uniphier-support-card.dtsi b/arch/arm/boot/dts/uniphier-support-card.dtsi
index 11e46e7de7c5..eedc10cbc6e6 100644
--- a/arch/arm/boot/dts/uniphier-support-card.dtsi
+++ b/arch/arm/boot/dts/uniphier-support-card.dtsi
@@ -10,7 +10,7 @@ &system_bus {
 	ranges = <1 0x00000000 0x42000000 0x02000000>;
 
 	support_card: support-card@1,1f00000 {
-		compatible = "simple-bus";
+		compatible = "simple-mfd";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x00000000 1 0x01f00000 0x00100000>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-23 11:46 ` [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus Masahiro Yamada
@ 2020-06-23 12:24   ` Lee Jones
  2020-06-24 16:29       ` Masahiro Yamada
  0 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2020-06-23 12:24 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-arm-kernel, Rob Herring, devicetree, linux-kernel

On Tue, 23 Jun 2020, Masahiro Yamada wrote:

> 'make ARCH=arm dtbs_check' emits the following warning:
> 
>   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> 
> Maybe, simple-mfd could be a better fit for this device.

The two should be equivalent.

What do you mean by "maybe"?  Does this squash the warning?

Isn't the issue caused by the ','?

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  arch/arm/boot/dts/uniphier-support-card.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/uniphier-support-card.dtsi b/arch/arm/boot/dts/uniphier-support-card.dtsi
> index 11e46e7de7c5..eedc10cbc6e6 100644
> --- a/arch/arm/boot/dts/uniphier-support-card.dtsi
> +++ b/arch/arm/boot/dts/uniphier-support-card.dtsi
> @@ -10,7 +10,7 @@ &system_bus {
>  	ranges = <1 0x00000000 0x42000000 0x02000000>;
>  
>  	support_card: support-card@1,1f00000 {
> -		compatible = "simple-bus";
> +		compatible = "simple-mfd";
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  		ranges = <0x00000000 1 0x01f00000 0x00100000>;

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-23 12:24   ` Lee Jones
@ 2020-06-24 16:29       ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-24 16:29 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-arm-kernel, Rob Herring, DTML, Linux Kernel Mailing List

On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Tue, 23 Jun 2020, Masahiro Yamada wrote:
>
> > 'make ARCH=arm dtbs_check' emits the following warning:
> >
> >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> >
> > Maybe, simple-mfd could be a better fit for this device.
>
> The two should be equivalent.

Yes, I know.
That's why I can change "simple-bus" to "simple-mfd"
with no risk.

The difference is schema-check.

The node name for "simple-bus" is checked by 'make dtbs_check'.

See this code:
https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17

Even if I rename the node, it does not accept the
unit name '1,1f00000'



>
> What do you mean by "maybe"?  Does this squash the warning?

"maybe" means I am not quite sure
which compatible is a better fit
to describe this device.


As mentioned above, simple-bus and simple-mfd
are interchangeable from a driver point of view.

This add-on board is integrated with various peripherals
such as 16550a serial, smsc9115 ether etc.
The address-decode is implemented in a CPLD device.
It has chip selects and local addresses, which are mapped to
the parent.

It can be either simple-bus or simple-mfd, I think.


dt-schema checks the node name of simple-bus.
Currently, there is no check for simple-mfd.

So, I think this patch is an easy solution
to fix the warning.

Rob is in Cc. Please add comments if any.


>
> Isn't the issue caused by the ','?

Right.

The node name of simple-bus
must meet the regular expression:
"^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"


Even if I rename the node
"support-card@1,1f00000"
to "bus@1,1f00000", the warning is still
displayed due to ','

"1,1f00000" means
the address 0x01f00000 of chip select 1.


Thanks

>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> >  arch/arm/boot/dts/uniphier-support-card.dtsi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/boot/dts/uniphier-support-card.dtsi b/arch/arm/boot/dts/uniphier-support-card.dtsi
> > index 11e46e7de7c5..eedc10cbc6e6 100644
> > --- a/arch/arm/boot/dts/uniphier-support-card.dtsi
> > +++ b/arch/arm/boot/dts/uniphier-support-card.dtsi
> > @@ -10,7 +10,7 @@ &system_bus {
> >       ranges = <1 0x00000000 0x42000000 0x02000000>;
> >
> >       support_card: support-card@1,1f00000 {
> > -             compatible = "simple-bus";
> > +             compatible = "simple-mfd";
> >               #address-cells = <1>;
> >               #size-cells = <1>;
> >               ranges = <0x00000000 1 0x01f00000 0x00100000>;
>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog



--
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
@ 2020-06-24 16:29       ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-24 16:29 UTC (permalink / raw)
  To: Lee Jones; +Cc: DTML, Rob Herring, Linux Kernel Mailing List, linux-arm-kernel

On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Tue, 23 Jun 2020, Masahiro Yamada wrote:
>
> > 'make ARCH=arm dtbs_check' emits the following warning:
> >
> >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> >
> > Maybe, simple-mfd could be a better fit for this device.
>
> The two should be equivalent.

Yes, I know.
That's why I can change "simple-bus" to "simple-mfd"
with no risk.

The difference is schema-check.

The node name for "simple-bus" is checked by 'make dtbs_check'.

See this code:
https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17

Even if I rename the node, it does not accept the
unit name '1,1f00000'



>
> What do you mean by "maybe"?  Does this squash the warning?

"maybe" means I am not quite sure
which compatible is a better fit
to describe this device.


As mentioned above, simple-bus and simple-mfd
are interchangeable from a driver point of view.

This add-on board is integrated with various peripherals
such as 16550a serial, smsc9115 ether etc.
The address-decode is implemented in a CPLD device.
It has chip selects and local addresses, which are mapped to
the parent.

It can be either simple-bus or simple-mfd, I think.


dt-schema checks the node name of simple-bus.
Currently, there is no check for simple-mfd.

So, I think this patch is an easy solution
to fix the warning.

Rob is in Cc. Please add comments if any.


>
> Isn't the issue caused by the ','?

Right.

The node name of simple-bus
must meet the regular expression:
"^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"


Even if I rename the node
"support-card@1,1f00000"
to "bus@1,1f00000", the warning is still
displayed due to ','

"1,1f00000" means
the address 0x01f00000 of chip select 1.


Thanks

>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> >  arch/arm/boot/dts/uniphier-support-card.dtsi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/boot/dts/uniphier-support-card.dtsi b/arch/arm/boot/dts/uniphier-support-card.dtsi
> > index 11e46e7de7c5..eedc10cbc6e6 100644
> > --- a/arch/arm/boot/dts/uniphier-support-card.dtsi
> > +++ b/arch/arm/boot/dts/uniphier-support-card.dtsi
> > @@ -10,7 +10,7 @@ &system_bus {
> >       ranges = <1 0x00000000 0x42000000 0x02000000>;
> >
> >       support_card: support-card@1,1f00000 {
> > -             compatible = "simple-bus";
> > +             compatible = "simple-mfd";
> >               #address-cells = <1>;
> >               #size-cells = <1>;
> >               ranges = <0x00000000 1 0x01f00000 0x00100000>;
>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog



--
Best Regards
Masahiro Yamada

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-24 16:29       ` Masahiro Yamada
@ 2020-06-24 18:16         ` Lee Jones
  -1 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-24 18:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-arm-kernel, Rob Herring, DTML, Linux Kernel Mailing List

On Thu, 25 Jun 2020, Masahiro Yamada wrote:

> On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> >
> > > 'make ARCH=arm dtbs_check' emits the following warning:
> > >
> > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > >
> > > Maybe, simple-mfd could be a better fit for this device.
> >
> > The two should be equivalent.
> 
> Yes, I know.
> That's why I can change "simple-bus" to "simple-mfd"
> with no risk.
> 
> The difference is schema-check.
> 
> The node name for "simple-bus" is checked by 'make dtbs_check'.
> 
> See this code:
> https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> 
> Even if I rename the node, it does not accept the
> unit name '1,1f00000'
> 
> > What do you mean by "maybe"?  Does this squash the warning?
> 
> "maybe" means I am not quite sure
> which compatible is a better fit
> to describe this device.
> 
> As mentioned above, simple-bus and simple-mfd
> are interchangeable from a driver point of view.
> 
> This add-on board is integrated with various peripherals
> such as 16550a serial, smsc9115 ether etc.
> The address-decode is implemented in a CPLD device.
> It has chip selects and local addresses, which are mapped to
> the parent.
> 
> It can be either simple-bus or simple-mfd, I think.
> 
> 
> dt-schema checks the node name of simple-bus.
> Currently, there is no check for simple-mfd.
> 
> So, I think this patch is an easy solution
> to fix the warning.

Yes, looking at the documentation it seems as though 'simple-mfd'
would be a better fit.  Is the device a single IP with various
different functions?

> Rob is in Cc. Please add comments if any.
> 
> > Isn't the issue caused by the ','?
> 
> Right.
> 
> The node name of simple-bus
> must meet the regular expression:
> "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> 
> 
> Even if I rename the node
> "support-card@1,1f00000"
> to "bus@1,1f00000", the warning is still
> displayed due to ','
> 
> "1,1f00000" means
> the address 0x01f00000 of chip select 1.

Is this an officially accepted format?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
@ 2020-06-24 18:16         ` Lee Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-24 18:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: DTML, Rob Herring, Linux Kernel Mailing List, linux-arm-kernel

On Thu, 25 Jun 2020, Masahiro Yamada wrote:

> On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> >
> > > 'make ARCH=arm dtbs_check' emits the following warning:
> > >
> > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > >
> > > Maybe, simple-mfd could be a better fit for this device.
> >
> > The two should be equivalent.
> 
> Yes, I know.
> That's why I can change "simple-bus" to "simple-mfd"
> with no risk.
> 
> The difference is schema-check.
> 
> The node name for "simple-bus" is checked by 'make dtbs_check'.
> 
> See this code:
> https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> 
> Even if I rename the node, it does not accept the
> unit name '1,1f00000'
> 
> > What do you mean by "maybe"?  Does this squash the warning?
> 
> "maybe" means I am not quite sure
> which compatible is a better fit
> to describe this device.
> 
> As mentioned above, simple-bus and simple-mfd
> are interchangeable from a driver point of view.
> 
> This add-on board is integrated with various peripherals
> such as 16550a serial, smsc9115 ether etc.
> The address-decode is implemented in a CPLD device.
> It has chip selects and local addresses, which are mapped to
> the parent.
> 
> It can be either simple-bus or simple-mfd, I think.
> 
> 
> dt-schema checks the node name of simple-bus.
> Currently, there is no check for simple-mfd.
> 
> So, I think this patch is an easy solution
> to fix the warning.

Yes, looking at the documentation it seems as though 'simple-mfd'
would be a better fit.  Is the device a single IP with various
different functions?

> Rob is in Cc. Please add comments if any.
> 
> > Isn't the issue caused by the ','?
> 
> Right.
> 
> The node name of simple-bus
> must meet the regular expression:
> "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> 
> 
> Even if I rename the node
> "support-card@1,1f00000"
> to "bus@1,1f00000", the warning is still
> displayed due to ','
> 
> "1,1f00000" means
> the address 0x01f00000 of chip select 1.

Is this an officially accepted format?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-24 18:16         ` Lee Jones
@ 2020-06-25 14:37           ` Masahiro Yamada
  -1 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-25 14:37 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-arm-kernel, Rob Herring, DTML, Linux Kernel Mailing List

On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Thu, 25 Jun 2020, Masahiro Yamada wrote:
>
> > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > >
> > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > >
> > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > >
> > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > >
> > > > Maybe, simple-mfd could be a better fit for this device.
> > >
> > > The two should be equivalent.
> >
> > Yes, I know.
> > That's why I can change "simple-bus" to "simple-mfd"
> > with no risk.
> >
> > The difference is schema-check.
> >
> > The node name for "simple-bus" is checked by 'make dtbs_check'.
> >
> > See this code:
> > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> >
> > Even if I rename the node, it does not accept the
> > unit name '1,1f00000'
> >
> > > What do you mean by "maybe"?  Does this squash the warning?
> >
> > "maybe" means I am not quite sure
> > which compatible is a better fit
> > to describe this device.
> >
> > As mentioned above, simple-bus and simple-mfd
> > are interchangeable from a driver point of view.
> >
> > This add-on board is integrated with various peripherals
> > such as 16550a serial, smsc9115 ether etc.
> > The address-decode is implemented in a CPLD device.
> > It has chip selects and local addresses, which are mapped to
> > the parent.
> >
> > It can be either simple-bus or simple-mfd, I think.
> >
> >
> > dt-schema checks the node name of simple-bus.
> > Currently, there is no check for simple-mfd.
> >
> > So, I think this patch is an easy solution
> > to fix the warning.
>
> Yes, looking at the documentation it seems as though 'simple-mfd'
> would be a better fit.  Is the device a single IP with various
> different functions?


Not an IP.

This is a small board that consists of
a CPLD + ethernet controller + serial controller + LED, etc.


>
> > Rob is in Cc. Please add comments if any.
> >
> > > Isn't the issue caused by the ','?
> >
> > Right.
> >
> > The node name of simple-bus
> > must meet the regular expression:
> > "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> >
> >
> > Even if I rename the node
> > "support-card@1,1f00000"
> > to "bus@1,1f00000", the warning is still
> > displayed due to ','
> >
> > "1,1f00000" means
> > the address 0x01f00000 of chip select 1.
>
> Is this an officially accepted format?


I am not sure if it is official.

Rob said the data fields should be separated by commas.
https://www.spinics.net/lists/devicetree/msg201565.html




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
@ 2020-06-25 14:37           ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-25 14:37 UTC (permalink / raw)
  To: Lee Jones; +Cc: DTML, Rob Herring, Linux Kernel Mailing List, linux-arm-kernel

On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Thu, 25 Jun 2020, Masahiro Yamada wrote:
>
> > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > >
> > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > >
> > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > >
> > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > >
> > > > Maybe, simple-mfd could be a better fit for this device.
> > >
> > > The two should be equivalent.
> >
> > Yes, I know.
> > That's why I can change "simple-bus" to "simple-mfd"
> > with no risk.
> >
> > The difference is schema-check.
> >
> > The node name for "simple-bus" is checked by 'make dtbs_check'.
> >
> > See this code:
> > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> >
> > Even if I rename the node, it does not accept the
> > unit name '1,1f00000'
> >
> > > What do you mean by "maybe"?  Does this squash the warning?
> >
> > "maybe" means I am not quite sure
> > which compatible is a better fit
> > to describe this device.
> >
> > As mentioned above, simple-bus and simple-mfd
> > are interchangeable from a driver point of view.
> >
> > This add-on board is integrated with various peripherals
> > such as 16550a serial, smsc9115 ether etc.
> > The address-decode is implemented in a CPLD device.
> > It has chip selects and local addresses, which are mapped to
> > the parent.
> >
> > It can be either simple-bus or simple-mfd, I think.
> >
> >
> > dt-schema checks the node name of simple-bus.
> > Currently, there is no check for simple-mfd.
> >
> > So, I think this patch is an easy solution
> > to fix the warning.
>
> Yes, looking at the documentation it seems as though 'simple-mfd'
> would be a better fit.  Is the device a single IP with various
> different functions?


Not an IP.

This is a small board that consists of
a CPLD + ethernet controller + serial controller + LED, etc.


>
> > Rob is in Cc. Please add comments if any.
> >
> > > Isn't the issue caused by the ','?
> >
> > Right.
> >
> > The node name of simple-bus
> > must meet the regular expression:
> > "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> >
> >
> > Even if I rename the node
> > "support-card@1,1f00000"
> > to "bus@1,1f00000", the warning is still
> > displayed due to ','
> >
> > "1,1f00000" means
> > the address 0x01f00000 of chip select 1.
>
> Is this an officially accepted format?


I am not sure if it is official.

Rob said the data fields should be separated by commas.
https://www.spinics.net/lists/devicetree/msg201565.html




-- 
Best Regards
Masahiro Yamada

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-25 14:37           ` Masahiro Yamada
@ 2020-06-25 14:57             ` Lee Jones
  -1 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-25 14:57 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-arm-kernel, Rob Herring, DTML, Linux Kernel Mailing List

On Thu, 25 Jun 2020, Masahiro Yamada wrote:

> On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> >
> > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > >
> > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > >
> > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > >
> > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > >
> > > > > Maybe, simple-mfd could be a better fit for this device.
> > > >
> > > > The two should be equivalent.
> > >
> > > Yes, I know.
> > > That's why I can change "simple-bus" to "simple-mfd"
> > > with no risk.
> > >
> > > The difference is schema-check.
> > >
> > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > >
> > > See this code:
> > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > >
> > > Even if I rename the node, it does not accept the
> > > unit name '1,1f00000'
> > >
> > > > What do you mean by "maybe"?  Does this squash the warning?
> > >
> > > "maybe" means I am not quite sure
> > > which compatible is a better fit
> > > to describe this device.
> > >
> > > As mentioned above, simple-bus and simple-mfd
> > > are interchangeable from a driver point of view.
> > >
> > > This add-on board is integrated with various peripherals
> > > such as 16550a serial, smsc9115 ether etc.
> > > The address-decode is implemented in a CPLD device.
> > > It has chip selects and local addresses, which are mapped to
> > > the parent.
> > >
> > > It can be either simple-bus or simple-mfd, I think.
> > >
> > >
> > > dt-schema checks the node name of simple-bus.
> > > Currently, there is no check for simple-mfd.
> > >
> > > So, I think this patch is an easy solution
> > > to fix the warning.
> >
> > Yes, looking at the documentation it seems as though 'simple-mfd'
> > would be a better fit.  Is the device a single IP with various
> > different functions?
> 
> Not an IP.
> 
> This is a small board that consists of
> a CPLD + ethernet controller + serial controller + LED, etc.

Then simple MFD does not seem like a good fit.

Neither does 'simple-bus'.

What is it you're trying to describe in the device hierarchy?

> > > Rob is in Cc. Please add comments if any.
> > >
> > > > Isn't the issue caused by the ','?
> > >
> > > Right.
> > >
> > > The node name of simple-bus
> > > must meet the regular expression:
> > > "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> > >
> > >
> > > Even if I rename the node
> > > "support-card@1,1f00000"
> > > to "bus@1,1f00000", the warning is still
> > > displayed due to ','
> > >
> > > "1,1f00000" means
> > > the address 0x01f00000 of chip select 1.
> >
> > Is this an officially accepted format?
> 
> I am not sure if it is official.
> 
> Rob said the data fields should be separated by commas.
> https://www.spinics.net/lists/devicetree/msg201565.html

Are you sure he doesn't mean in the 'reg' property.

Rather than the node-name@NNNNNNNN syntax.

BTW, I think the error you link to above is related to the
node-name@NNNNNNNN not matching the value listed in the 'reg'
property.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
@ 2020-06-25 14:57             ` Lee Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-25 14:57 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: DTML, Rob Herring, Linux Kernel Mailing List, linux-arm-kernel

On Thu, 25 Jun 2020, Masahiro Yamada wrote:

> On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> >
> > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > >
> > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > >
> > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > >
> > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > >
> > > > > Maybe, simple-mfd could be a better fit for this device.
> > > >
> > > > The two should be equivalent.
> > >
> > > Yes, I know.
> > > That's why I can change "simple-bus" to "simple-mfd"
> > > with no risk.
> > >
> > > The difference is schema-check.
> > >
> > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > >
> > > See this code:
> > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > >
> > > Even if I rename the node, it does not accept the
> > > unit name '1,1f00000'
> > >
> > > > What do you mean by "maybe"?  Does this squash the warning?
> > >
> > > "maybe" means I am not quite sure
> > > which compatible is a better fit
> > > to describe this device.
> > >
> > > As mentioned above, simple-bus and simple-mfd
> > > are interchangeable from a driver point of view.
> > >
> > > This add-on board is integrated with various peripherals
> > > such as 16550a serial, smsc9115 ether etc.
> > > The address-decode is implemented in a CPLD device.
> > > It has chip selects and local addresses, which are mapped to
> > > the parent.
> > >
> > > It can be either simple-bus or simple-mfd, I think.
> > >
> > >
> > > dt-schema checks the node name of simple-bus.
> > > Currently, there is no check for simple-mfd.
> > >
> > > So, I think this patch is an easy solution
> > > to fix the warning.
> >
> > Yes, looking at the documentation it seems as though 'simple-mfd'
> > would be a better fit.  Is the device a single IP with various
> > different functions?
> 
> Not an IP.
> 
> This is a small board that consists of
> a CPLD + ethernet controller + serial controller + LED, etc.

Then simple MFD does not seem like a good fit.

Neither does 'simple-bus'.

What is it you're trying to describe in the device hierarchy?

> > > Rob is in Cc. Please add comments if any.
> > >
> > > > Isn't the issue caused by the ','?
> > >
> > > Right.
> > >
> > > The node name of simple-bus
> > > must meet the regular expression:
> > > "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> > >
> > >
> > > Even if I rename the node
> > > "support-card@1,1f00000"
> > > to "bus@1,1f00000", the warning is still
> > > displayed due to ','
> > >
> > > "1,1f00000" means
> > > the address 0x01f00000 of chip select 1.
> >
> > Is this an officially accepted format?
> 
> I am not sure if it is official.
> 
> Rob said the data fields should be separated by commas.
> https://www.spinics.net/lists/devicetree/msg201565.html

Are you sure he doesn't mean in the 'reg' property.

Rather than the node-name@NNNNNNNN syntax.

BTW, I think the error you link to above is related to the
node-name@NNNNNNNN not matching the value listed in the 'reg'
property.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-25 14:57             ` Lee Jones
@ 2020-06-29  1:58               ` Masahiro Yamada
  -1 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-29  1:58 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-arm-kernel, Rob Herring, DTML, Linux Kernel Mailing List

On Thu, Jun 25, 2020 at 11:57 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Thu, 25 Jun 2020, Masahiro Yamada wrote:
>
> > On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> > >
> > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > >
> > > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > >
> > > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > > >
> > > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > > >
> > > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > > >
> > > > > > Maybe, simple-mfd could be a better fit for this device.
> > > > >
> > > > > The two should be equivalent.
> > > >
> > > > Yes, I know.
> > > > That's why I can change "simple-bus" to "simple-mfd"
> > > > with no risk.
> > > >
> > > > The difference is schema-check.
> > > >
> > > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > > >
> > > > See this code:
> > > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > > >
> > > > Even if I rename the node, it does not accept the
> > > > unit name '1,1f00000'
> > > >
> > > > > What do you mean by "maybe"?  Does this squash the warning?
> > > >
> > > > "maybe" means I am not quite sure
> > > > which compatible is a better fit
> > > > to describe this device.
> > > >
> > > > As mentioned above, simple-bus and simple-mfd
> > > > are interchangeable from a driver point of view.
> > > >
> > > > This add-on board is integrated with various peripherals
> > > > such as 16550a serial, smsc9115 ether etc.
> > > > The address-decode is implemented in a CPLD device.
> > > > It has chip selects and local addresses, which are mapped to
> > > > the parent.
> > > >
> > > > It can be either simple-bus or simple-mfd, I think.
> > > >
> > > >
> > > > dt-schema checks the node name of simple-bus.
> > > > Currently, there is no check for simple-mfd.
> > > >
> > > > So, I think this patch is an easy solution
> > > > to fix the warning.
> > >
> > > Yes, looking at the documentation it seems as though 'simple-mfd'
> > > would be a better fit.  Is the device a single IP with various
> > > different functions?
> >
> > Not an IP.
> >
> > This is a small board that consists of
> > a CPLD + ethernet controller + serial controller + LED, etc.
>
> Then simple MFD does not seem like a good fit.
>
> Neither does 'simple-bus'.

Then, I do not know what to do.


This board connection is so simple
that no hardware initialization needed to get access
to peripherals.

So, 'simple-bus' or 'simple-mfd' is preferred.

If this is not either simple-bus or simple-mfd,
I need a special driver to probe the
child devices such as ethernet, serial etc.



> What is it you're trying to describe in the device hierarchy?


The connection is as follows:


|-Main board -|      |----- add-on board ----|
|             |      |     (this board)      |
|             |      |                       |
|    (SoC) ---|------|--- CPLD --- ethernet  |
|             |      |          |- serial    |
|-------------|      |          |- LED       |
                     |                       |
                     |-----------------------|



uniphier-support-card.dtsi describes the
"add-on board" part.
Address-decode is implemented in CPLD.


So, the criteria to become MFD is
whether it is an IP integrated into SoC.


- implemented in an SoC  --> MFD

- implemented in a board + CPLD  --> not MFD


Right?




>
> > > > Rob is in Cc. Please add comments if any.
> > > >
> > > > > Isn't the issue caused by the ','?
> > > >
> > > > Right.
> > > >
> > > > The node name of simple-bus
> > > > must meet the regular expression:
> > > > "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> > > >
> > > >
> > > > Even if I rename the node
> > > > "support-card@1,1f00000"
> > > > to "bus@1,1f00000", the warning is still
> > > > displayed due to ','
> > > >
> > > > "1,1f00000" means
> > > > the address 0x01f00000 of chip select 1.
> > >
> > > Is this an officially accepted format?
> >
> > I am not sure if it is official.
> >
> > Rob said the data fields should be separated by commas.
> > https://www.spinics.net/lists/devicetree/msg201565.html
>
> Are you sure he doesn't mean in the 'reg' property.
>
> Rather than the node-name@NNNNNNNN syntax.
>
> BTW, I think the error you link to above is related to the
> node-name@NNNNNNNN not matching the value listed in the 'reg'
> property.


If I get rid of @NNNNNNNN part,
DTC warns the following for W=1 builds:

arch/arm/boot/dts/uniphier-support-card.dtsi:12.29-32.4: Warning
(unit_address_vs_reg): /soc/system-bus@58c00000/support-card: node has
a reg or ranges property, but no unit name



So, 'reg' or 'range' requires a unit name.

A unit name should be a base address.
If it has a chip select, the format is
<chip-select>,<base-address>

But the schema does not allow commas
in a unit name of simple-bus.

This is the problem I am trying to do something for.





>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
@ 2020-06-29  1:58               ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2020-06-29  1:58 UTC (permalink / raw)
  To: Lee Jones; +Cc: DTML, Rob Herring, Linux Kernel Mailing List, linux-arm-kernel

On Thu, Jun 25, 2020 at 11:57 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Thu, 25 Jun 2020, Masahiro Yamada wrote:
>
> > On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> > >
> > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > >
> > > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > >
> > > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > > >
> > > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > > >
> > > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > > >
> > > > > > Maybe, simple-mfd could be a better fit for this device.
> > > > >
> > > > > The two should be equivalent.
> > > >
> > > > Yes, I know.
> > > > That's why I can change "simple-bus" to "simple-mfd"
> > > > with no risk.
> > > >
> > > > The difference is schema-check.
> > > >
> > > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > > >
> > > > See this code:
> > > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > > >
> > > > Even if I rename the node, it does not accept the
> > > > unit name '1,1f00000'
> > > >
> > > > > What do you mean by "maybe"?  Does this squash the warning?
> > > >
> > > > "maybe" means I am not quite sure
> > > > which compatible is a better fit
> > > > to describe this device.
> > > >
> > > > As mentioned above, simple-bus and simple-mfd
> > > > are interchangeable from a driver point of view.
> > > >
> > > > This add-on board is integrated with various peripherals
> > > > such as 16550a serial, smsc9115 ether etc.
> > > > The address-decode is implemented in a CPLD device.
> > > > It has chip selects and local addresses, which are mapped to
> > > > the parent.
> > > >
> > > > It can be either simple-bus or simple-mfd, I think.
> > > >
> > > >
> > > > dt-schema checks the node name of simple-bus.
> > > > Currently, there is no check for simple-mfd.
> > > >
> > > > So, I think this patch is an easy solution
> > > > to fix the warning.
> > >
> > > Yes, looking at the documentation it seems as though 'simple-mfd'
> > > would be a better fit.  Is the device a single IP with various
> > > different functions?
> >
> > Not an IP.
> >
> > This is a small board that consists of
> > a CPLD + ethernet controller + serial controller + LED, etc.
>
> Then simple MFD does not seem like a good fit.
>
> Neither does 'simple-bus'.

Then, I do not know what to do.


This board connection is so simple
that no hardware initialization needed to get access
to peripherals.

So, 'simple-bus' or 'simple-mfd' is preferred.

If this is not either simple-bus or simple-mfd,
I need a special driver to probe the
child devices such as ethernet, serial etc.



> What is it you're trying to describe in the device hierarchy?


The connection is as follows:


|-Main board -|      |----- add-on board ----|
|             |      |     (this board)      |
|             |      |                       |
|    (SoC) ---|------|--- CPLD --- ethernet  |
|             |      |          |- serial    |
|-------------|      |          |- LED       |
                     |                       |
                     |-----------------------|



uniphier-support-card.dtsi describes the
"add-on board" part.
Address-decode is implemented in CPLD.


So, the criteria to become MFD is
whether it is an IP integrated into SoC.


- implemented in an SoC  --> MFD

- implemented in a board + CPLD  --> not MFD


Right?




>
> > > > Rob is in Cc. Please add comments if any.
> > > >
> > > > > Isn't the issue caused by the ','?
> > > >
> > > > Right.
> > > >
> > > > The node name of simple-bus
> > > > must meet the regular expression:
> > > > "^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$"
> > > >
> > > >
> > > > Even if I rename the node
> > > > "support-card@1,1f00000"
> > > > to "bus@1,1f00000", the warning is still
> > > > displayed due to ','
> > > >
> > > > "1,1f00000" means
> > > > the address 0x01f00000 of chip select 1.
> > >
> > > Is this an officially accepted format?
> >
> > I am not sure if it is official.
> >
> > Rob said the data fields should be separated by commas.
> > https://www.spinics.net/lists/devicetree/msg201565.html
>
> Are you sure he doesn't mean in the 'reg' property.
>
> Rather than the node-name@NNNNNNNN syntax.
>
> BTW, I think the error you link to above is related to the
> node-name@NNNNNNNN not matching the value listed in the 'reg'
> property.


If I get rid of @NNNNNNNN part,
DTC warns the following for W=1 builds:

arch/arm/boot/dts/uniphier-support-card.dtsi:12.29-32.4: Warning
(unit_address_vs_reg): /soc/system-bus@58c00000/support-card: node has
a reg or ranges property, but no unit name



So, 'reg' or 'range' requires a unit name.

A unit name should be a base address.
If it has a chip select, the format is
<chip-select>,<base-address>

But the schema does not allow commas
in a unit name of simple-bus.

This is the problem I am trying to do something for.





>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog



-- 
Best Regards
Masahiro Yamada

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-29  1:58               ` Masahiro Yamada
@ 2020-06-29  7:36                 ` Lee Jones
  -1 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-29  7:36 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-arm-kernel, Rob Herring, DTML, Linux Kernel Mailing List

On Mon, 29 Jun 2020, Masahiro Yamada wrote:

> On Thu, Jun 25, 2020 at 11:57 PM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> >
> > > On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> > > >
> > > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > > >
> > > > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > > >
> > > > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > > > >
> > > > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > > > >
> > > > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > > > >
> > > > > > > Maybe, simple-mfd could be a better fit for this device.
> > > > > >
> > > > > > The two should be equivalent.
> > > > >
> > > > > Yes, I know.
> > > > > That's why I can change "simple-bus" to "simple-mfd"
> > > > > with no risk.
> > > > >
> > > > > The difference is schema-check.
> > > > >
> > > > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > > > >
> > > > > See this code:
> > > > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > > > >
> > > > > Even if I rename the node, it does not accept the
> > > > > unit name '1,1f00000'
> > > > >
> > > > > > What do you mean by "maybe"?  Does this squash the warning?
> > > > >
> > > > > "maybe" means I am not quite sure
> > > > > which compatible is a better fit
> > > > > to describe this device.
> > > > >
> > > > > As mentioned above, simple-bus and simple-mfd
> > > > > are interchangeable from a driver point of view.
> > > > >
> > > > > This add-on board is integrated with various peripherals
> > > > > such as 16550a serial, smsc9115 ether etc.
> > > > > The address-decode is implemented in a CPLD device.
> > > > > It has chip selects and local addresses, which are mapped to
> > > > > the parent.
> > > > >
> > > > > It can be either simple-bus or simple-mfd, I think.
> > > > >
> > > > >
> > > > > dt-schema checks the node name of simple-bus.
> > > > > Currently, there is no check for simple-mfd.
> > > > >
> > > > > So, I think this patch is an easy solution
> > > > > to fix the warning.
> > > >
> > > > Yes, looking at the documentation it seems as though 'simple-mfd'
> > > > would be a better fit.  Is the device a single IP with various
> > > > different functions?
> > >
> > > Not an IP.
> > >
> > > This is a small board that consists of
> > > a CPLD + ethernet controller + serial controller + LED, etc.
> >
> > Then simple MFD does not seem like a good fit.
> >
> > Neither does 'simple-bus'.
> 
> Then, I do not know what to do.
> 
> 
> This board connection is so simple
> that no hardware initialization needed to get access
> to peripherals.
> 
> So, 'simple-bus' or 'simple-mfd' is preferred.
> 
> If this is not either simple-bus or simple-mfd,
> I need a special driver to probe the
> child devices such as ethernet, serial etc.
> 
> 
> 
> > What is it you're trying to describe in the device hierarchy?
> 
> 
> The connection is as follows:
> 
> 
> |-Main board -|      |----- add-on board ----|
> |             |      |     (this board)      |
> |             |      |                       |
> |    (SoC) ---|------|--- CPLD --- ethernet  |
> |             |      |          |- serial    |
> |-------------|      |          |- LED       |
>                      |                       |
>                      |-----------------------|
> 
> 
> 
> uniphier-support-card.dtsi describes the
> "add-on board" part.
> Address-decode is implemented in CPLD.
> 
> 
> So, the criteria to become MFD is
> whether it is an IP integrated into SoC.
> 
> 
> - implemented in an SoC  --> MFD

If

 s/in an SoC/in a single piece of silicon/

... then yes.

> - implemented in a board + CPLD  --> not MFD
> 
> Right?

Right.  Unless all H/W is represented inside the CPLD, in which case
the CPLD is, in theory, the MFD.  Although, due to the nature of
CPLDs, this is a slippery slope.

You may want something like:

  arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts

... where the add-on board is represented separately (not in the
same hierarchical structure as the main board.  The main board is then
included as a DTSI from the add-on board.

It might also be worth looking at how consumer boards such as the
RaspberryPi, BeagleBoard and the like handle their add-on boards,
mezzanines, capes, hats, etc.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
@ 2020-06-29  7:36                 ` Lee Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-29  7:36 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: DTML, Rob Herring, Linux Kernel Mailing List, linux-arm-kernel

On Mon, 29 Jun 2020, Masahiro Yamada wrote:

> On Thu, Jun 25, 2020 at 11:57 PM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> >
> > > On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> > > >
> > > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > > >
> > > > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > > >
> > > > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > > > >
> > > > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > > > >
> > > > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > > > >
> > > > > > > Maybe, simple-mfd could be a better fit for this device.
> > > > > >
> > > > > > The two should be equivalent.
> > > > >
> > > > > Yes, I know.
> > > > > That's why I can change "simple-bus" to "simple-mfd"
> > > > > with no risk.
> > > > >
> > > > > The difference is schema-check.
> > > > >
> > > > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > > > >
> > > > > See this code:
> > > > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > > > >
> > > > > Even if I rename the node, it does not accept the
> > > > > unit name '1,1f00000'
> > > > >
> > > > > > What do you mean by "maybe"?  Does this squash the warning?
> > > > >
> > > > > "maybe" means I am not quite sure
> > > > > which compatible is a better fit
> > > > > to describe this device.
> > > > >
> > > > > As mentioned above, simple-bus and simple-mfd
> > > > > are interchangeable from a driver point of view.
> > > > >
> > > > > This add-on board is integrated with various peripherals
> > > > > such as 16550a serial, smsc9115 ether etc.
> > > > > The address-decode is implemented in a CPLD device.
> > > > > It has chip selects and local addresses, which are mapped to
> > > > > the parent.
> > > > >
> > > > > It can be either simple-bus or simple-mfd, I think.
> > > > >
> > > > >
> > > > > dt-schema checks the node name of simple-bus.
> > > > > Currently, there is no check for simple-mfd.
> > > > >
> > > > > So, I think this patch is an easy solution
> > > > > to fix the warning.
> > > >
> > > > Yes, looking at the documentation it seems as though 'simple-mfd'
> > > > would be a better fit.  Is the device a single IP with various
> > > > different functions?
> > >
> > > Not an IP.
> > >
> > > This is a small board that consists of
> > > a CPLD + ethernet controller + serial controller + LED, etc.
> >
> > Then simple MFD does not seem like a good fit.
> >
> > Neither does 'simple-bus'.
> 
> Then, I do not know what to do.
> 
> 
> This board connection is so simple
> that no hardware initialization needed to get access
> to peripherals.
> 
> So, 'simple-bus' or 'simple-mfd' is preferred.
> 
> If this is not either simple-bus or simple-mfd,
> I need a special driver to probe the
> child devices such as ethernet, serial etc.
> 
> 
> 
> > What is it you're trying to describe in the device hierarchy?
> 
> 
> The connection is as follows:
> 
> 
> |-Main board -|      |----- add-on board ----|
> |             |      |     (this board)      |
> |             |      |                       |
> |    (SoC) ---|------|--- CPLD --- ethernet  |
> |             |      |          |- serial    |
> |-------------|      |          |- LED       |
>                      |                       |
>                      |-----------------------|
> 
> 
> 
> uniphier-support-card.dtsi describes the
> "add-on board" part.
> Address-decode is implemented in CPLD.
> 
> 
> So, the criteria to become MFD is
> whether it is an IP integrated into SoC.
> 
> 
> - implemented in an SoC  --> MFD

If

 s/in an SoC/in a single piece of silicon/

... then yes.

> - implemented in a board + CPLD  --> not MFD
> 
> Right?

Right.  Unless all H/W is represented inside the CPLD, in which case
the CPLD is, in theory, the MFD.  Although, due to the nature of
CPLDs, this is a slippery slope.

You may want something like:

  arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts

... where the add-on board is represented separately (not in the
same hierarchical structure as the main board.  The main board is then
included as a DTSI from the add-on board.

It might also be worth looking at how consumer boards such as the
RaspberryPi, BeagleBoard and the like handle their add-on boards,
mezzanines, capes, hats, etc.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
  2020-06-29  7:36                 ` Lee Jones
@ 2020-06-29  7:43                   ` Lee Jones
  -1 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-29  7:43 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-arm-kernel, Rob Herring, DTML, Linux Kernel Mailing List

On Mon, 29 Jun 2020, Lee Jones wrote:

> On Mon, 29 Jun 2020, Masahiro Yamada wrote:
> 
> > On Thu, Jun 25, 2020 at 11:57 PM Lee Jones <lee.jones@linaro.org> wrote:
> > >
> > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > >
> > > > On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> > > > >
> > > > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > > > >
> > > > > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > > > >
> > > > > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > > > > >
> > > > > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > > > > >
> > > > > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > > > > >
> > > > > > > > Maybe, simple-mfd could be a better fit for this device.
> > > > > > >
> > > > > > > The two should be equivalent.
> > > > > >
> > > > > > Yes, I know.
> > > > > > That's why I can change "simple-bus" to "simple-mfd"
> > > > > > with no risk.
> > > > > >
> > > > > > The difference is schema-check.
> > > > > >
> > > > > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > > > > >
> > > > > > See this code:
> > > > > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > > > > >
> > > > > > Even if I rename the node, it does not accept the
> > > > > > unit name '1,1f00000'
> > > > > >
> > > > > > > What do you mean by "maybe"?  Does this squash the warning?
> > > > > >
> > > > > > "maybe" means I am not quite sure
> > > > > > which compatible is a better fit
> > > > > > to describe this device.
> > > > > >
> > > > > > As mentioned above, simple-bus and simple-mfd
> > > > > > are interchangeable from a driver point of view.
> > > > > >
> > > > > > This add-on board is integrated with various peripherals
> > > > > > such as 16550a serial, smsc9115 ether etc.
> > > > > > The address-decode is implemented in a CPLD device.
> > > > > > It has chip selects and local addresses, which are mapped to
> > > > > > the parent.
> > > > > >
> > > > > > It can be either simple-bus or simple-mfd, I think.
> > > > > >
> > > > > >
> > > > > > dt-schema checks the node name of simple-bus.
> > > > > > Currently, there is no check for simple-mfd.
> > > > > >
> > > > > > So, I think this patch is an easy solution
> > > > > > to fix the warning.
> > > > >
> > > > > Yes, looking at the documentation it seems as though 'simple-mfd'
> > > > > would be a better fit.  Is the device a single IP with various
> > > > > different functions?
> > > >
> > > > Not an IP.
> > > >
> > > > This is a small board that consists of
> > > > a CPLD + ethernet controller + serial controller + LED, etc.
> > >
> > > Then simple MFD does not seem like a good fit.
> > >
> > > Neither does 'simple-bus'.
> > 
> > Then, I do not know what to do.
> > 
> > 
> > This board connection is so simple
> > that no hardware initialization needed to get access
> > to peripherals.
> > 
> > So, 'simple-bus' or 'simple-mfd' is preferred.
> > 
> > If this is not either simple-bus or simple-mfd,
> > I need a special driver to probe the
> > child devices such as ethernet, serial etc.
> > 
> > 
> > 
> > > What is it you're trying to describe in the device hierarchy?
> > 
> > 
> > The connection is as follows:
> > 
> > 
> > |-Main board -|      |----- add-on board ----|
> > |             |      |     (this board)      |
> > |             |      |                       |
> > |    (SoC) ---|------|--- CPLD --- ethernet  |
> > |             |      |          |- serial    |
> > |-------------|      |          |- LED       |
> >                      |                       |
> >                      |-----------------------|
> > 
> > 
> > 
> > uniphier-support-card.dtsi describes the
> > "add-on board" part.
> > Address-decode is implemented in CPLD.
> > 
> > 
> > So, the criteria to become MFD is
> > whether it is an IP integrated into SoC.
> > 
> > 
> > - implemented in an SoC  --> MFD
> 
> If
> 
>  s/in an SoC/in a single piece of silicon/
> 
> ... then yes.
> 
> > - implemented in a board + CPLD  --> not MFD
> > 
> > Right?
> 
> Right.  Unless all H/W is represented inside the CPLD, in which case
> the CPLD is, in theory, the MFD.  Although, due to the nature of
> CPLDs, this is a slippery slope.
> 
> You may want something like:
> 
>   arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts
> 
> ... where the add-on board is represented separately (not in the
> same hierarchical structure as the main board.  The main board is then
> included as a DTSI from the add-on board.
> 
> It might also be worth looking at how consumer boards such as the
> RaspberryPi, BeagleBoard and the like handle their add-on boards,
> mezzanines, capes, hats, etc.

Another option; if the add-on board PCB really doesn't do anything
except provide some copper lines to the on-board components, then does
it need representing in Device Tree at all?  I suggest not.

Your issue will come when you want to swap out that board and insert
another, which contains different functionality.  This is why it would
be better to represent the whole board as an orthogonal *.dts file.
Whether you decide to lay it out as it's own board (as above) or as
children to the system-bus will be up to you.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus
@ 2020-06-29  7:43                   ` Lee Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2020-06-29  7:43 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: DTML, Rob Herring, Linux Kernel Mailing List, linux-arm-kernel

On Mon, 29 Jun 2020, Lee Jones wrote:

> On Mon, 29 Jun 2020, Masahiro Yamada wrote:
> 
> > On Thu, Jun 25, 2020 at 11:57 PM Lee Jones <lee.jones@linaro.org> wrote:
> > >
> > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > >
> > > > On Thu, Jun 25, 2020 at 3:16 AM Lee Jones <lee.jones@linaro.org> wrote:
> > > > >
> > > > > On Thu, 25 Jun 2020, Masahiro Yamada wrote:
> > > > >
> > > > > > On Tue, Jun 23, 2020 at 9:24 PM Lee Jones <lee.jones@linaro.org> wrote:
> > > > > > >
> > > > > > > On Tue, 23 Jun 2020, Masahiro Yamada wrote:
> > > > > > >
> > > > > > > > 'make ARCH=arm dtbs_check' emits the following warning:
> > > > > > > >
> > > > > > > >   support-card@1,1f00000: $nodename:0: 'support-card@1,1f00000' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
> > > > > > > >
> > > > > > > > Maybe, simple-mfd could be a better fit for this device.
> > > > > > >
> > > > > > > The two should be equivalent.
> > > > > >
> > > > > > Yes, I know.
> > > > > > That's why I can change "simple-bus" to "simple-mfd"
> > > > > > with no risk.
> > > > > >
> > > > > > The difference is schema-check.
> > > > > >
> > > > > > The node name for "simple-bus" is checked by 'make dtbs_check'.
> > > > > >
> > > > > > See this code:
> > > > > > https://github.com/robherring/dt-schema/blob/v2020.05/schemas/simple-bus.yaml#L17
> > > > > >
> > > > > > Even if I rename the node, it does not accept the
> > > > > > unit name '1,1f00000'
> > > > > >
> > > > > > > What do you mean by "maybe"?  Does this squash the warning?
> > > > > >
> > > > > > "maybe" means I am not quite sure
> > > > > > which compatible is a better fit
> > > > > > to describe this device.
> > > > > >
> > > > > > As mentioned above, simple-bus and simple-mfd
> > > > > > are interchangeable from a driver point of view.
> > > > > >
> > > > > > This add-on board is integrated with various peripherals
> > > > > > such as 16550a serial, smsc9115 ether etc.
> > > > > > The address-decode is implemented in a CPLD device.
> > > > > > It has chip selects and local addresses, which are mapped to
> > > > > > the parent.
> > > > > >
> > > > > > It can be either simple-bus or simple-mfd, I think.
> > > > > >
> > > > > >
> > > > > > dt-schema checks the node name of simple-bus.
> > > > > > Currently, there is no check for simple-mfd.
> > > > > >
> > > > > > So, I think this patch is an easy solution
> > > > > > to fix the warning.
> > > > >
> > > > > Yes, looking at the documentation it seems as though 'simple-mfd'
> > > > > would be a better fit.  Is the device a single IP with various
> > > > > different functions?
> > > >
> > > > Not an IP.
> > > >
> > > > This is a small board that consists of
> > > > a CPLD + ethernet controller + serial controller + LED, etc.
> > >
> > > Then simple MFD does not seem like a good fit.
> > >
> > > Neither does 'simple-bus'.
> > 
> > Then, I do not know what to do.
> > 
> > 
> > This board connection is so simple
> > that no hardware initialization needed to get access
> > to peripherals.
> > 
> > So, 'simple-bus' or 'simple-mfd' is preferred.
> > 
> > If this is not either simple-bus or simple-mfd,
> > I need a special driver to probe the
> > child devices such as ethernet, serial etc.
> > 
> > 
> > 
> > > What is it you're trying to describe in the device hierarchy?
> > 
> > 
> > The connection is as follows:
> > 
> > 
> > |-Main board -|      |----- add-on board ----|
> > |             |      |     (this board)      |
> > |             |      |                       |
> > |    (SoC) ---|------|--- CPLD --- ethernet  |
> > |             |      |          |- serial    |
> > |-------------|      |          |- LED       |
> >                      |                       |
> >                      |-----------------------|
> > 
> > 
> > 
> > uniphier-support-card.dtsi describes the
> > "add-on board" part.
> > Address-decode is implemented in CPLD.
> > 
> > 
> > So, the criteria to become MFD is
> > whether it is an IP integrated into SoC.
> > 
> > 
> > - implemented in an SoC  --> MFD
> 
> If
> 
>  s/in an SoC/in a single piece of silicon/
> 
> ... then yes.
> 
> > - implemented in a board + CPLD  --> not MFD
> > 
> > Right?
> 
> Right.  Unless all H/W is represented inside the CPLD, in which case
> the CPLD is, in theory, the MFD.  Although, due to the nature of
> CPLDs, this is a slippery slope.
> 
> You may want something like:
> 
>   arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dts
> 
> ... where the add-on board is represented separately (not in the
> same hierarchical structure as the main board.  The main board is then
> included as a DTSI from the add-on board.
> 
> It might also be worth looking at how consumer boards such as the
> RaspberryPi, BeagleBoard and the like handle their add-on boards,
> mezzanines, capes, hats, etc.

Another option; if the add-on board PCB really doesn't do anything
except provide some copper lines to the on-board components, then does
it need representing in Device Tree at all?  I suggest not.

Your issue will come when you want to swap out that board and insert
another, which contains different functionality.  This is why it would
be better to represent the whole board as an orthogonal *.dts file.
Whether you decide to lay it out as it's own board (as above) or as
children to the system-bus will be up to you.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-06-29 20:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23 11:46 [PATCH 1/4] ARM: dts: uniphier: add interrupts to support card serial Masahiro Yamada
2020-06-23 11:46 ` [PATCH 2/4] arm64: " Masahiro Yamada
2020-06-23 11:46 ` [PATCH 3/4] ARM: dts: uniphier: rename support card serial node to fix schema warning Masahiro Yamada
2020-06-23 11:46 ` [PATCH 4/4] ARM: dts: uniphier: change support card to simple-mfd from simple-bus Masahiro Yamada
2020-06-23 12:24   ` Lee Jones
2020-06-24 16:29     ` Masahiro Yamada
2020-06-24 16:29       ` Masahiro Yamada
2020-06-24 18:16       ` Lee Jones
2020-06-24 18:16         ` Lee Jones
2020-06-25 14:37         ` Masahiro Yamada
2020-06-25 14:37           ` Masahiro Yamada
2020-06-25 14:57           ` Lee Jones
2020-06-25 14:57             ` Lee Jones
2020-06-29  1:58             ` Masahiro Yamada
2020-06-29  1:58               ` Masahiro Yamada
2020-06-29  7:36               ` Lee Jones
2020-06-29  7:36                 ` Lee Jones
2020-06-29  7:43                 ` Lee Jones
2020-06-29  7:43                   ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.