All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Adrien Grassein <adrien.grassein@gmail.com>
Cc: DTML <devicetree@vger.kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 2/3] arm64: dts: imx: Add i.mx8mm nitrogen8mm basic dts support
Date: Fri, 29 Jan 2021 10:22:50 +0100	[thread overview]
Message-ID: <20210129092250.4cet62bqkju3i3vp@pengutronix.de> (raw)
In-Reply-To: <CABkfQAHDoFpJQSE3Ls5V_jyiq5N-VO=LvZbb+pvdCRZpm+PjwA@mail.gmail.com>

Hi Adrien,

On 21-01-28 18:23, Adrien Grassein wrote:

> > > +&i2c1 {
> > > +     clock-frequency = <400000>;
> >                             ^
> >                 Is the i2c errata fixed on the imx8?
> 
> I don't know. What is this errata?
> Should I set a lower speed for the particular i2c?

The max. clock on iMX6 is 375kHz due to errate ERR007805
https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf

> >
> > > +     pinctrl-names = "default", "gpio";
> >                                      ^
> >                         no pinctrl for gpio.
> 
> Yes, it's a bug, thanks
> 
> > > +     pinctrl-0 = <&pinctrl_i2c1>;
> > > +     status = "okay";
> > > +
> > > +     pmic@8 {
> > > +             compatible = "nxp,pf8121a";
> > > +             reg = <0x8>;
> > > +
> > > +             regulators {
> > > +                 reg_ldo1: ldo1 {
> >                         ^
> >                    alignment
> 
> OK
> 
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_ldo2: ldo2 {
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_ldo3: ldo3 {
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_ldo4: ldo4 {
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck1: buck1 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck2: buck2 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_sw3: buck3 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck4: buck4 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck5: buck5 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck6: buck6 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck7: buck7 {
> > > +                             regulator-min-microvolt = <3300000>;
> > > +                             regulator-max-microvolt = <3300000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_vsnvs: vsnvs {
> > > +                             regulator-min-microvolt = <1800000>;
> > > +                             regulator-max-microvolt = <3300000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> >
> > Do we really need to have all regulators marked as always-on?
> >
> I used the definition present on the example.
> I will remove this (for the one I don't use).

Can you test to remove all always-on except for those really needed e.g.
the vddr-ref. Regulators are obtained on demand by the devices. This
allows us to save power e.g. in suspend-to-ram case.

> > > +             };
> > > +     };
> > > +};
> > > +
> > > +&i2c3 {
> > > +     clock-frequency = <100000>;
> > > +     pinctrl-names = "default", "gpio";
> > > +     pinctrl-0 = <&pinctrl_i2c3>;
> > > +     status = "okay";
> > > +
> > > +     i2cmux@70 {
> > > +             compatible = "nxp,pca9540";
> > > +             reg = <0x70>;
> > > +             #address-cells = <1>;
> > > +             #size-cells = <0>;
> > > +
> > > +             i2c3 {
> > > +                     reg = <0>;
> > > +                     #address-cells = <1>;
> > > +                     #size-cells = <0>;
> > > +
> > > +                     rtc@68 {
> > > +                             compatible = "microcrystal,rv4162";
> > > +                             pinctrl-names = "default";
> > > +                             pinctrl-0 = <&pinctrl_i2c3a_rv4162>;
> > > +                             reg = <0x68>;
> >
> > reg should be the 2nd property, after the compatible.
> >
> OK.
> 
> > > +                             interrupts-extended = <&gpio4 22 IRQ_TYPE_LEVEL_LOW>;
> > > +                             wakeup-source;
> > > +                     };
> > > +             };
> > > +     };
> > > +};
> > > +
> > > +/* console */
> > > +&uart2 {
> > > +     pinctrl-names = "default";
> > > +     pinctrl-0 = <&pinctrl_uart2>;
> > > +     assigned-clocks = <&clk IMX8MM_CLK_UART2>;
> > > +     assigned-clock-parents = <&clk IMX8MM_CLK_24M>;
> > > +     status = "okay";
> > > +};
> > > +
> > > +/* eMMC */
> > > +&usdhc1 {
> > > +     bus-width = <8>;
> > > +     sdhci-caps-mask = <0x80000000 0x0>;
> >                 ^
> > This is a SD host controller property according the doc.
> >
> Yes, I don't understand the point, sorry.
> This property is read by the host driver, but should be present here
> (like in some other dts).

I've never seen this property. I said "This is a SD host controller"
because your comment says that this usdhc controller is used for eMMC
which is not an SD controller.

> > > +     non-removable;
> > > +     pinctrl-names = "default", "state_100mhz", "state_200mhz";
> > > +     pinctrl-0 = <&pinctrl_usdhc1>;
> > > +     pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
> > > +     pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
> > > +     status = "okay";
> > > +};
> > > +
> > > +/* sdcard */
> > > +&usdhc2 {
> > > +     bus-width = <4>;
> > > +     cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
> > > +     pinctrl-names = "default", "state_100mhz", "state_200mhz";
> > > +     pinctrl-0 = <&pinctrl_usdhc2>;
> > > +     pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
> > > +     pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
> > > +     vqmmc-supply = <&reg_ldo2>;
> > > +     status = "okay";
> > > +};
> > > +
> > > +&wdog1 {
> > > +     pinctrl-names = "default";
> > > +     pinctrl-0 = <&pinctrl_wdog>;
> > > +     fsl,ext-reset-output;
> > > +     status = "okay";
> > > +};
> > > +
> > > +&iomuxc {
> > > +     pinctrl-names = "default";
> > > +     pinctrl-0 = <&pinctrl_hog>;
> >
> > It would be nice to avoid such hog's. Instead those gpios should get
> > configured by the device(s) using those.
> >
> Once again (sorry), I don't understand the point.
> I did this like any other imx8 board (imx8mq-nitrogem for example).

Question is where are those pins used and for what purpose. It is common
to specify the muxing within the device nodes like you did for the wdog1
device. This mechanism here is something like: "Oh I don't wanna setup
the muxing on the correct places, so let's mux it here in glob". Your
hog group isn't really large but it would be nice to avoid it since day
one.

Regards,
  Marco

WARNING: multiple messages have this Message-ID (diff)
From: Marco Felsch <m.felsch@pengutronix.de>
To: Adrien Grassein <adrien.grassein@gmail.com>
Cc: DTML <devicetree@vger.kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 2/3] arm64: dts: imx: Add i.mx8mm nitrogen8mm basic dts support
Date: Fri, 29 Jan 2021 10:22:50 +0100	[thread overview]
Message-ID: <20210129092250.4cet62bqkju3i3vp@pengutronix.de> (raw)
In-Reply-To: <CABkfQAHDoFpJQSE3Ls5V_jyiq5N-VO=LvZbb+pvdCRZpm+PjwA@mail.gmail.com>

Hi Adrien,

On 21-01-28 18:23, Adrien Grassein wrote:

> > > +&i2c1 {
> > > +     clock-frequency = <400000>;
> >                             ^
> >                 Is the i2c errata fixed on the imx8?
> 
> I don't know. What is this errata?
> Should I set a lower speed for the particular i2c?

The max. clock on iMX6 is 375kHz due to errate ERR007805
https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf

> >
> > > +     pinctrl-names = "default", "gpio";
> >                                      ^
> >                         no pinctrl for gpio.
> 
> Yes, it's a bug, thanks
> 
> > > +     pinctrl-0 = <&pinctrl_i2c1>;
> > > +     status = "okay";
> > > +
> > > +     pmic@8 {
> > > +             compatible = "nxp,pf8121a";
> > > +             reg = <0x8>;
> > > +
> > > +             regulators {
> > > +                 reg_ldo1: ldo1 {
> >                         ^
> >                    alignment
> 
> OK
> 
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_ldo2: ldo2 {
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_ldo3: ldo3 {
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_ldo4: ldo4 {
> > > +                             regulator-min-microvolt = <1500000>;
> > > +                             regulator-max-microvolt = <5000000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck1: buck1 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck2: buck2 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_sw3: buck3 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck4: buck4 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck5: buck5 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck6: buck6 {
> > > +                             regulator-min-microvolt = <400000>;
> > > +                             regulator-max-microvolt = <1800000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_buck7: buck7 {
> > > +                             regulator-min-microvolt = <3300000>;
> > > +                             regulator-max-microvolt = <3300000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> > > +
> > > +                     reg_vsnvs: vsnvs {
> > > +                             regulator-min-microvolt = <1800000>;
> > > +                             regulator-max-microvolt = <3300000>;
> > > +                             regulator-boot-on;
> > > +                             regulator-always-on;
> > > +                     };
> >
> > Do we really need to have all regulators marked as always-on?
> >
> I used the definition present on the example.
> I will remove this (for the one I don't use).

Can you test to remove all always-on except for those really needed e.g.
the vddr-ref. Regulators are obtained on demand by the devices. This
allows us to save power e.g. in suspend-to-ram case.

> > > +             };
> > > +     };
> > > +};
> > > +
> > > +&i2c3 {
> > > +     clock-frequency = <100000>;
> > > +     pinctrl-names = "default", "gpio";
> > > +     pinctrl-0 = <&pinctrl_i2c3>;
> > > +     status = "okay";
> > > +
> > > +     i2cmux@70 {
> > > +             compatible = "nxp,pca9540";
> > > +             reg = <0x70>;
> > > +             #address-cells = <1>;
> > > +             #size-cells = <0>;
> > > +
> > > +             i2c3 {
> > > +                     reg = <0>;
> > > +                     #address-cells = <1>;
> > > +                     #size-cells = <0>;
> > > +
> > > +                     rtc@68 {
> > > +                             compatible = "microcrystal,rv4162";
> > > +                             pinctrl-names = "default";
> > > +                             pinctrl-0 = <&pinctrl_i2c3a_rv4162>;
> > > +                             reg = <0x68>;
> >
> > reg should be the 2nd property, after the compatible.
> >
> OK.
> 
> > > +                             interrupts-extended = <&gpio4 22 IRQ_TYPE_LEVEL_LOW>;
> > > +                             wakeup-source;
> > > +                     };
> > > +             };
> > > +     };
> > > +};
> > > +
> > > +/* console */
> > > +&uart2 {
> > > +     pinctrl-names = "default";
> > > +     pinctrl-0 = <&pinctrl_uart2>;
> > > +     assigned-clocks = <&clk IMX8MM_CLK_UART2>;
> > > +     assigned-clock-parents = <&clk IMX8MM_CLK_24M>;
> > > +     status = "okay";
> > > +};
> > > +
> > > +/* eMMC */
> > > +&usdhc1 {
> > > +     bus-width = <8>;
> > > +     sdhci-caps-mask = <0x80000000 0x0>;
> >                 ^
> > This is a SD host controller property according the doc.
> >
> Yes, I don't understand the point, sorry.
> This property is read by the host driver, but should be present here
> (like in some other dts).

I've never seen this property. I said "This is a SD host controller"
because your comment says that this usdhc controller is used for eMMC
which is not an SD controller.

> > > +     non-removable;
> > > +     pinctrl-names = "default", "state_100mhz", "state_200mhz";
> > > +     pinctrl-0 = <&pinctrl_usdhc1>;
> > > +     pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
> > > +     pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
> > > +     status = "okay";
> > > +};
> > > +
> > > +/* sdcard */
> > > +&usdhc2 {
> > > +     bus-width = <4>;
> > > +     cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
> > > +     pinctrl-names = "default", "state_100mhz", "state_200mhz";
> > > +     pinctrl-0 = <&pinctrl_usdhc2>;
> > > +     pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
> > > +     pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
> > > +     vqmmc-supply = <&reg_ldo2>;
> > > +     status = "okay";
> > > +};
> > > +
> > > +&wdog1 {
> > > +     pinctrl-names = "default";
> > > +     pinctrl-0 = <&pinctrl_wdog>;
> > > +     fsl,ext-reset-output;
> > > +     status = "okay";
> > > +};
> > > +
> > > +&iomuxc {
> > > +     pinctrl-names = "default";
> > > +     pinctrl-0 = <&pinctrl_hog>;
> >
> > It would be nice to avoid such hog's. Instead those gpios should get
> > configured by the device(s) using those.
> >
> Once again (sorry), I don't understand the point.
> I did this like any other imx8 board (imx8mq-nitrogem for example).

Question is where are those pins used and for what purpose. It is common
to specify the muxing within the device nodes like you did for the wdog1
device. This mechanism here is something like: "Oh I don't wanna setup
the muxing on the correct places, so let's mux it here in glob". Your
hog group isn't really large but it would be nice to avoid it since day
one.

Regards,
  Marco

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

  parent reply	other threads:[~2021-01-29 11:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 11:15 [PATCH v5 0/3] Add support for Boundary Nitrogen8M Mini SBC Adrien Grassein
2021-01-18 11:15 ` Adrien Grassein
2021-01-18 11:15 ` [PATCH v5 1/3] dt-bindings: arm: imx: add imx8mm nitrogen support Adrien Grassein
2021-01-18 11:15   ` Adrien Grassein
2021-01-18 11:15 ` [PATCH v5 2/3] arm64: dts: imx: Add i.mx8mm nitrogen8mm basic dts support Adrien Grassein
2021-01-18 11:15   ` Adrien Grassein
2021-01-28 16:18   ` Marco Felsch
2021-01-28 16:18     ` Marco Felsch
2021-01-28 17:23     ` Adrien Grassein
2021-01-28 17:23       ` Adrien Grassein
2021-01-28 18:16       ` Adrien Grassein
2021-01-29  9:22       ` Marco Felsch [this message]
2021-01-29  9:22         ` Marco Felsch
2021-01-29  9:49         ` Adrien Grassein
2021-01-18 11:15 ` [PATCH v5 3/3] arm64: defconfig: Enable PF8x00 as builtin Adrien Grassein
2021-01-18 11:15   ` Adrien Grassein
2021-01-27 17:45 ` [PATCH v5 0/3] Add support for Boundary Nitrogen8M Mini SBC Adrien Grassein
2021-01-27 17:45   ` Adrien Grassein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210129092250.4cet62bqkju3i3vp@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=adrien.grassein@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.