diff mbox series

[1/3] arm64: dts: rockchip: add bus-width properties to mmc nodes for rk3328.dtsi

Message ID 20200416181944.5879-1-jbx6244@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/3] arm64: dts: rockchip: add bus-width properties to mmc nodes for rk3328.dtsi | expand

Commit Message

Johan Jonker April 16, 2020, 6:19 p.m. UTC
'bus-width' and pinctrl containing the bus-pins
should be in the same file, so add them to
all mmc nodes in 'rk3328.dtsi'.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 3 +++
 1 file changed, 3 insertions(+)

Comments

Chen-Yu Tsai April 21, 2020, 3:48 a.m. UTC | #1
On Fri, Apr 17, 2020 at 2:19 AM Johan Jonker <jbx6244@gmail.com> wrote:
>
> 'bus-width' and pinctrl containing the bus-pins
> should be in the same file, so add them to
> all mmc nodes in 'rk3328.dtsi'.

Nope. First of all, pinctrl usage is with pinctrl-N properties, not the
pinctrl device, and there are no defaults set for any of the mmc nodes.
Second, these are board design specific. For example, boards are free to
use just 4 bits for the eMMC if they so desire. So this should be in each
board dts file. If a board is missing this property, fix the board.

This applies to all three patches in the series.

ChenYu

> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  arch/arm64/boot/dts/rockchip/rk3328.dtsi | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> index 175060695..db2c3085e 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> @@ -861,6 +861,7 @@
>                 clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
>                          <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
>                 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
> +               bus-width = <4>;
>                 fifo-depth = <0x100>;
>                 max-frequency = <150000000>;
>                 status = "disabled";
> @@ -873,6 +874,7 @@
>                 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
>                          <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
>                 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
> +               bus-width = <4>;
>                 fifo-depth = <0x100>;
>                 max-frequency = <150000000>;
>                 status = "disabled";
> @@ -885,6 +887,7 @@
>                 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
>                          <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
>                 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
> +               bus-width = <8>;
>                 fifo-depth = <0x100>;
>                 max-frequency = <150000000>;
>                 status = "disabled";
> --
> 2.11.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Heiko Stuebner April 21, 2020, 8:23 a.m. UTC | #2
Hi ChenYu,

Am Dienstag, 21. April 2020, 05:48:52 CEST schrieb Chen-Yu Tsai:
> On Fri, Apr 17, 2020 at 2:19 AM Johan Jonker <jbx6244@gmail.com> wrote:
> >
> > 'bus-width' and pinctrl containing the bus-pins
> > should be in the same file, so add them to
> > all mmc nodes in 'rk3328.dtsi'.
> 
> Nope. First of all, pinctrl usage is with pinctrl-N properties, not the
> pinctrl device, and there are no defaults set for any of the mmc nodes.
> Second, these are board design specific. For example, boards are free to
> use just 4 bits for the eMMC if they so desire. So this should be in each
> board dts file. If a board is missing this property, fix the board.

you are correct that the pinctrl entries are missing from the patches,
bus-width and pinctrl should be defined in the same file each time,
but for the whole idea I tend to disagree. 

So far every board with a Rockchip socs follows Rockchip's reference design
for a lot of parts - for example I only see sdmmc nodes with bus-width=4
etc.

So the basic idea is to have default pinctrl settings for the settings
everybody uses predefined ... if a board comes along that needs different
settings it is free to redefine that.


Heiko


> 
> This applies to all three patches in the series.
> 
> ChenYu
> 
> > Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> > ---
> >  arch/arm64/boot/dts/rockchip/rk3328.dtsi | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> > index 175060695..db2c3085e 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> > +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> > @@ -861,6 +861,7 @@
> >                 clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
> >                          <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
> >                 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
> > +               bus-width = <4>;
> >                 fifo-depth = <0x100>;
> >                 max-frequency = <150000000>;
> >                 status = "disabled";
> > @@ -873,6 +874,7 @@
> >                 clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
> >                          <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
> >                 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
> > +               bus-width = <4>;
> >                 fifo-depth = <0x100>;
> >                 max-frequency = <150000000>;
> >                 status = "disabled";
> > @@ -885,6 +887,7 @@
> >                 clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
> >                          <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
> >                 clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
> > +               bus-width = <8>;
> >                 fifo-depth = <0x100>;
> >                 max-frequency = <150000000>;
> >                 status = "disabled";
> > --
> > 2.11.0
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Chen-Yu Tsai April 21, 2020, 8:29 a.m. UTC | #3
On Tue, Apr 21, 2020 at 4:23 PM Heiko Stübner <heiko@sntech.de> wrote:
>
> Hi ChenYu,
>
> Am Dienstag, 21. April 2020, 05:48:52 CEST schrieb Chen-Yu Tsai:
> > On Fri, Apr 17, 2020 at 2:19 AM Johan Jonker <jbx6244@gmail.com> wrote:
> > >
> > > 'bus-width' and pinctrl containing the bus-pins
> > > should be in the same file, so add them to
> > > all mmc nodes in 'rk3328.dtsi'.
> >
> > Nope. First of all, pinctrl usage is with pinctrl-N properties, not the
> > pinctrl device, and there are no defaults set for any of the mmc nodes.
> > Second, these are board design specific. For example, boards are free to
> > use just 4 bits for the eMMC if they so desire. So this should be in each
> > board dts file. If a board is missing this property, fix the board.
>
> you are correct that the pinctrl entries are missing from the patches,
> bus-width and pinctrl should be defined in the same file each time,
> but for the whole idea I tend to disagree.
>
> So far every board with a Rockchip socs follows Rockchip's reference design
> for a lot of parts - for example I only see sdmmc nodes with bus-width=4
> etc.
>
> So the basic idea is to have default pinctrl settings for the settings
> everybody uses predefined ... if a board comes along that needs different
> settings it is free to redefine that.

I think having a default is a great idea. :)

ChenYu
Heiko Stuebner April 21, 2020, 8:37 a.m. UTC | #4
Am Dienstag, 21. April 2020, 10:29:49 CEST schrieb Chen-Yu Tsai:
> On Tue, Apr 21, 2020 at 4:23 PM Heiko Stübner <heiko@sntech.de> wrote:
> >
> > Hi ChenYu,
> >
> > Am Dienstag, 21. April 2020, 05:48:52 CEST schrieb Chen-Yu Tsai:
> > > On Fri, Apr 17, 2020 at 2:19 AM Johan Jonker <jbx6244@gmail.com> wrote:
> > > >
> > > > 'bus-width' and pinctrl containing the bus-pins
> > > > should be in the same file, so add them to
> > > > all mmc nodes in 'rk3328.dtsi'.
> > >
> > > Nope. First of all, pinctrl usage is with pinctrl-N properties, not the
> > > pinctrl device, and there are no defaults set for any of the mmc nodes.
> > > Second, these are board design specific. For example, boards are free to
> > > use just 4 bits for the eMMC if they so desire. So this should be in each
> > > board dts file. If a board is missing this property, fix the board.
> >
> > you are correct that the pinctrl entries are missing from the patches,
> > bus-width and pinctrl should be defined in the same file each time,
> > but for the whole idea I tend to disagree.
> >
> > So far every board with a Rockchip socs follows Rockchip's reference design
> > for a lot of parts - for example I only see sdmmc nodes with bus-width=4
> > etc.
> >
> > So the basic idea is to have default pinctrl settings for the settings
> > everybody uses predefined ... if a board comes along that needs different
> > settings it is free to redefine that.
> 
> I think having a default is a great idea. :)

especially for controllers that only ever use the same settings anyway.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index 175060695..db2c3085e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -861,6 +861,7 @@ 
 		clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
 			 <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		bus-width = <4>;
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
 		status = "disabled";
@@ -873,6 +874,7 @@ 
 		clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
 			 <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		bus-width = <4>;
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
 		status = "disabled";
@@ -885,6 +887,7 @@ 
 		clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
 			 <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		bus-width = <8>;
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
 		status = "disabled";