devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Ying <victor.liu@nxp.com>
To: Marcel Ziswiler <marcel@ziswiler.com>, devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-imx@nxp.com,
	linux-arm-kernel@lists.infradead.org,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	Abel Vesa <abelvesa@kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Oliver Graute <oliver.graute@kococonnector.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Pierre Gondois <pierre.gondois@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	Viorel Suman <viorel.suman@nxp.com>,
	Zhou Peng <eagle.zhou@nxp.com>
Subject: Re: [PATCH v4 05/17] arm64: dts: imx8qm: add pwm_lvds0/1 support
Date: Wed, 18 Jan 2023 16:47:18 +0800	[thread overview]
Message-ID: <60f8f656cf466b8fbd8dfe93177119cfa4839b72.camel@nxp.com> (raw)
In-Reply-To: <20230118072656.18845-6-marcel@ziswiler.com>

Hi Marcel,

On Wed, 2023-01-18 at 08:26 +0100, Marcel Ziswiler wrote:
> From: Liu Ying <victor.liu@nxp.com>
> 
> This patch adds pwm_lvds0/1 support together with a
> i.MX 8QM LVDS subsystem device tree.
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> 
> ---
> 
> Changes in v4:
> - New patch combining the following downstream patches limitted to
> LVDS
>   PWM functionality for now:
>   commit 036c6b28a186 ("arm64: imx8qm.dtsi: Add LVDS0/1 subsystems
> support")
>   commit c3d29611d9d4 ("arm64: imx8qm-ss-lvds.dtsi: Add pwm_lvds0/1
> support")
>   commit baf1b0f22f8a ("LF-882-1 arm64: imx8qm-ss-lvds.dtsi: Separate
> ipg clock for lvds0/1 subsystems")

Sorry, I don't think the downstream patches are doing things correct.
The biggest problem is that the lvds related devices should be child
devices of display subsystem pixel link MSI bus device(See below
comments).

I have local patches to add some lvds related devices which haven't
been submitted.

> 
>  .../boot/dts/freescale/imx8qm-ss-lvds.dtsi    | 83
> +++++++++++++++++++
>  arch/arm64/boot/dts/freescale/imx8qm.dtsi     |  1 +
>  2 files changed, 84 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/freescale/imx8qm-ss-lvds.dtsi
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8qm-ss-lvds.dtsi
> b/arch/arm64/boot/dts/freescale/imx8qm-ss-lvds.dtsi
> new file mode 100644
> index 000000000000..4b940fc3c890
> --- /dev/null
> +++ b/arch/arm64/boot/dts/freescale/imx8qm-ss-lvds.dtsi
> @@ -0,0 +1,83 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2023 NXP
> + */
> +
> +/ {
> +	lvds1_subsys: bus@56240000 {
> +		compatible = "simple-bus";

In my local patches, there is no 'lvds{0,1}_subsys'. Instead, lvds
related devices are child devices of 'dc{0,1}_pl_msi_bus' buses,
something like this:

In imx8qm-ss-dc.dtsi:
&dc0_subsys {
        dc0_pl_msi_bus: bus@56200000 {
                compatible = "fsl,imx8qm-display-pixel-link-msi-bus",
"simple-pm-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                reg = <0x56200000 0x20000>;
                interrupt-parent = <&dc0_irqsteer>;
                interrupts = <320>;
                ranges;
                clocks = <&dc0_disp_ctrl_link_mst0_lpcg
IMX_LPCG_CLK_4>,
                         <&dc0_disp_ctrl_link_mst0_lpcg
IMX_LPCG_CLK_4>;
                clock-names = "msi", "ahb";
                power-domains = <&pd IMX_SC_R_DC_0>;
                status = "disabled";
        };
};

In imx8qm-ss-lvds.dtsi:
&dc0_pl_msi_bus {
        lvds0_irqsteer: interrupt-controller@56240000 {
                compatible = "fsl,imx-irqsteer";
                ...
        };

        lvds0_csr: bus@56241000 {
                compatible = "fsl,imx8qm-lvds-csr", "syscon", "simple-
pm-bus";
		...
	};

	lvds0_pwm_lpcg: clock-controller@5624300c {
                compatible = "fsl,imx8qm-lpcg", "fsl,imx8qxp-lpcg";
		...
	};

	lvds0_pwm: pwm@56244000 {
                compatible = "fsl,imx8qm-pwm", "fsl,imx27-pwm";
		...
	};
};

The below patch is needed to use clocks for pixel link MSI bus as a
simple-pm-bus.


https://lore.kernel.org/lkml/20221226031417.1056745-1-victor.liu@nxp.com/t/

"fsl,imx8qm-lvds-csr" needs to be added into simple_pm_bus_of_match[]
in simple-pm-bus.c.

> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges = <0x56240000 0x0 0x56240000 0x10000>;
> +
> +		lvds0_ipg_clk: clock-lvds-ipg {
> +			compatible = "fixed-clock";
> +			#clock-cells = <0>;
> +			clock-frequency = <24000000>;
> +			clock-output-names = "lvds0_ipg_clk";
> +		};
> +
> +		lvds0_pwm_lpcg: clock-controller@5624300c {
> +			compatible = "fsl,imx8qm-lpcg";

Should list "fsl,imx8qxp-lpcg" as one item as well, since imx8qxp-
lpcg.yaml mentions it.

> +			reg = <0x5624300c 0x4>;
> +			#clock-cells = <1>;
> +			clocks = <&clk IMX_SC_R_LVDS_0_PWM_0
> IMX_SC_PM_CLK_PER>,
> +				 <&lvds0_ipg_clk>;
> +			clock-indices = <IMX_LPCG_CLK_0>,
> <IMX_LPCG_CLK_4>;
> +			clock-output-names = "lvds0_pwm_lpcg_clk",
> +					     "lvds0_pwm_lpcg_ipg_clk";
> +			power-domains = <&pd IMX_SC_R_LVDS_0_PWM_0>;
> +		};
> +
> +		pwm_lvds0: pwm@56244000 {
> +			compatible = "fsl,imx27-pwm";

Need to document "fsl,imx8qm-pwm" in imx-pwm.yaml and list it in the
compatible sting here.

> +			reg = <0x56244000 0x1000>;
> +			clocks = <&lvds0_pwm_lpcg 0>,
> +				 <&lvds0_pwm_lpcg 1>;

In my local patches, I set the clocks property as:
                clocks = <&lvds0_pwm_lpcg IMX_LPCG_CLK_0>,
                         <&lvds0_pwm_lpcg IMX_LPCG_CLK_4>;

I'm not sure if it is correct now.

> +			clock-names = "per", "ipg";
> +			assigned-clocks = <&clk IMX_SC_R_LVDS_0_PWM_0
> IMX_SC_PM_CLK_PER>;
> +			assigned-clock-rates = <24000000>;
> +			#pwm-cells = <2>;
> +			power-domains = <&pd IMX_SC_R_LVDS_0_PWM_0>;
> +			status = "disabled";

In my local patches, this node has the below interrupt related
properties:
                interrupt-parent = <&lvds0_irqsteer>;
                interrupts = <12>;

> +		};
> +	};
> +
> +	lvds2_subsys: bus@57240000 {

Above comments apply for 'lvds2_subsys' similarly.

[...]

Regards,
Liu Ying



  reply	other threads:[~2023-01-18  9:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  7:26 [PATCH v4 00/17] arm64: dts: freescale: prepare and add apalis imx8 support Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 01/17] arm64: dts: freescale: imx8-ss-lsio: add support for lsio_pwm0-3 Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 02/17] arm64: dts: imx8-ss-dma: add io-channel-cells to adc nodes Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 03/17] arm64: dts: freescale: imx8-ss-dma: set lpspi0 max frequency to 60mhz Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 04/17] firmware: imx: scu-pd: add missed lvds lpi2c and pwm power domains Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 05/17] arm64: dts: imx8qm: add pwm_lvds0/1 support Marcel Ziswiler
2023-01-18  8:47   ` Liu Ying [this message]
2023-01-18 13:31     ` Marcel Ziswiler
2023-01-19  1:23       ` Liu Ying
2023-01-18  7:26 ` [PATCH v4 06/17] arm64: dts: imx8qxp: add flexcan in adma Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 07/17] arch: arm64: imx8qm: add can node in devicetree Marcel Ziswiler
2023-01-18 13:58   ` Krzysztof Kozlowski
2023-01-18 14:32     ` Marcel Ziswiler
2023-01-18 14:35       ` Krzysztof Kozlowski
2023-01-18  7:26 ` [PATCH v4 08/17] arm64: dts: imx8qm: add vpu decoder and encoder Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 09/17] dt-bindings: arm: fsl: add toradex,apalis-imx8 et al Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 10/17] arm64: dts: freescale: add initial apalis imx8 aka quadmax module support Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 11/17] arm64: dts: freescale: add apalis imx8 aka quadmax carrier board support Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 12/17] arm64: dts: freescale: apalis-imx8: analogue audio comment Marcel Ziswiler
2023-01-18 13:59   ` Krzysztof Kozlowski
2023-01-18 14:33     ` Marcel Ziswiler
2023-01-18 14:36       ` Krzysztof Kozlowski
2023-01-18  7:26 ` [PATCH v4 13/17] arm64: dts: freescale: apalis-imx8: add bkl1_pwm functionality Marcel Ziswiler
2023-01-18 14:00   ` Krzysztof Kozlowski
2023-01-18 14:34     ` Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 14/17] arm64: dts: freescale: apalis-imx8: add flexcan functionality Marcel Ziswiler
2023-01-18 14:01   ` Krzysztof Kozlowski
2023-01-18 14:34     ` Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 15/17] arm64: dts: freescale: apalis-imx8: enable messaging units Marcel Ziswiler
2023-01-18 14:01   ` Krzysztof Kozlowski
2023-01-18 14:35     ` Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 16/17] arm64: dts: freescale: apalis-imx8: fix reserved-memory node names Marcel Ziswiler
2023-01-18 14:02   ` Krzysztof Kozlowski
2023-01-18 14:36     ` Marcel Ziswiler
2023-01-18 14:37       ` Krzysztof Kozlowski
2023-01-18 14:42         ` Marcel Ziswiler
2023-01-18  7:26 ` [PATCH v4 17/17] arm64: dts: freescale: apalis-imx8: enable vpu Marcel Ziswiler

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=60f8f656cf466b8fbd8dfe93177119cfa4839b72.camel@nxp.com \
    --to=victor.liu@nxp.com \
    --cc=abelvesa@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eagle.zhou@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel.ziswiler@toradex.com \
    --cc=marcel@ziswiler.com \
    --cc=oliver.graute@kococonnector.com \
    --cc=pierre.gondois@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=viorel.suman@nxp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).