Message ID | 20240317164850.32708-1-laurent.pinchart@ideasonboard.com |
---|---|
Headers | show |
Series | Add DT bindings and device tree for Compulab SB-UCM-iMX8MPLUS | expand |
On Sun, Mar 17, 2024 at 06:48:50PM +0200, Laurent Pinchart wrote: > The SB-UCM-iMX8MPLUS kit is shipped with an external DSI panel. Add a > corresponding DT overlay. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > arch/arm64/boot/dts/freescale/Makefile | 4 + > .../imx8mp-sb-ucm-panel-kd050hdfia020.dtso | 81 +++++++++++++++++++ > 2 files changed, 85 insertions(+) > create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso > > diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile > index 02efa97fc464..d7432ce6a7bb 100644 > --- a/arch/arm64/boot/dts/freescale/Makefile > +++ b/arch/arm64/boot/dts/freescale/Makefile > @@ -165,6 +165,10 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mp-icore-mx8mp-edimm2.2.dtb > dtb-$(CONFIG_ARCH_MXC) += imx8mp-msc-sm2s-ep1.dtb > dtb-$(CONFIG_ARCH_MXC) += imx8mp-phyboard-pollux-rdk.dtb > dtb-$(CONFIG_ARCH_MXC) += imx8mp-sb-ucm.dtb > + > +imx8mp-sb-ucm-panel-kd050hdfia020-dtbs := imx8mp-sb-ucm.dtb imx8mp-sb-ucm-panel-kd050hdfia020-dtbo > +dtb-$(CONFIG_ARCH_MXC) += imx8mp-sb-ucm-panel-kd050hdfia020-dtb On a side note, is there a way to selectively compile this dtb ? Running $ make dtbs will compile them all, but $ make freescale/imx8mp-sb-ucm-panel-kd050hdfia020-dtb complains with make[4]: *** No rule to make target 'arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtb'. Stop. make[3]: *** [/home/laurent/src/iob/toradex/linux/scripts/Makefile.build:481: arch/arm64/boot/dts/freescale] Error 2 make[2]: *** [/home/laurent/src/iob/toradex/linux/Makefile:1389: freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtb] Error 2 I would like to compile it selectively, as running $ make dtbs CHECK_DTBS=1 makes it much more time consuming to run the dtb checks. > + > dtb-$(CONFIG_ARCH_MXC) += imx8mp-skov-revb-hdmi.dtb > dtb-$(CONFIG_ARCH_MXC) += imx8mp-skov-revb-lt6.dtb > dtb-$(CONFIG_ARCH_MXC) += imx8mp-skov-revb-mi1010ait-1cp1.dtb > diff --git a/arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso b/arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso > new file mode 100644 > index 000000000000..fdad943c1554 > --- /dev/null > +++ b/arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso > @@ -0,0 +1,81 @@ > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > +/* > + * Copyright 2021 CompuLab > + * > + * Device tree overlay for KD050HDFIA020-C020A panel connector to Compulab > + * SB-UCM-iMX8PLUS. > + */ > + > +/dts-v1/; > +/plugin/; > + > +#include <dt-bindings/gpio/gpio.h> > +#include <dt-bindings/interrupt-controller/irq.h> > + > +&dsi_backlight { > + status = "okay"; > +}; > + > +&i2c5 { > + status = "okay"; > + > + touch@5d { > + compatible = "goodix,gt911"; > + reg = <0x5d>; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_dsi_touch>; > + > + interrupt-parent = <&gpio4>; > + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; > + > + irq-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>; > + reset-gpios = <&pca9555 5 GPIO_ACTIVE_HIGH>; > + }; > +}; > + > +&lcdif1 { > + status = "okay"; > +}; > + > +&mipi_dsi { > + #address-cells = <1>; > + #size-cells = <0>; > + samsung,esc-clock-frequency = <20000000>; > + status = "okay"; > + > + panel@0 { > + compatible = "startek,kd050hdfia020", "ilitek,ili9881c"; > + reg = <0>; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_dsi_panel>; > + > + reset-gpio = <&pca9555 4 GPIO_ACTIVE_LOW>; > + power-supply = <®_3v3_per>; > + > + backlight = <&dsi_backlight>; > + > + port { > + panel_in: endpoint { > + remote-endpoint = <&mipi_dsi_out>; > + data-lanes = <1 2 3 4>; > + }; > + }; > + }; > + > + ports { > + port@1 { > + reg = <1>; > + > + mipi_dsi_out: endpoint { > + remote-endpoint = <&panel_in>; > + data-lanes = <1 2 3 4>; > + lane-polarities = <0 0 0 0 0>; > + }; > + }; > + }; > +}; > + > +&pwm1 { > + status = "okay"; > +};
> +&eqos { > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_eqos>; > + phy-mode = "rgmii-id"; > + phy-handle = <ðphy0>; > + > + mdio { > + compatible = "snps,dwmac-mdio"; > + #address-cells = <1>; > + #size-cells = <0>; > + > + /* Atheros AR8033 on v1.0, Realtek RTL8211E on v1.1 */ > + ethphy0: ethernet-phy@0 { > + compatible = "ethernet-phy-ieee802.3-c22"; > + reg = <0>; > + eee-broken-1000t; > + }; Hi Laurent Do you happen to know what is broken with respect to EEE? It seems like a lot of IMX boards have this, so i suspect it is the MAC. Maybe we should be keying off the MAC compatible and disabling this in the ethernet driver rather than have every .dts file needing it?
On Sun, Mar 17, 2024 at 06:17:17PM +0100, Andrew Lunn wrote: > > +&eqos { > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_eqos>; > > + phy-mode = "rgmii-id"; > > + phy-handle = <ðphy0>; > > + > > + mdio { > > + compatible = "snps,dwmac-mdio"; > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + /* Atheros AR8033 on v1.0, Realtek RTL8211E on v1.1 */ > > + ethphy0: ethernet-phy@0 { > > + compatible = "ethernet-phy-ieee802.3-c22"; > > + reg = <0>; > > + eee-broken-1000t; > > + }; > > Hi Laurent > > Do you happen to know what is broken with respect to EEE? It seems > like a lot of IMX boards have this, so i suspect it is the MAC. Maybe > we should be keying off the MAC compatible and disabling this in the > ethernet driver rather than have every .dts file needing it? I wonder if this could be cargo-cult. To be honest, I've copied it from the BSP and haven't investigated it. I've tried dropping that and haven't noticed any difference, but I'm not sure how I should test it properly.
On Sun, Mar 17, 2024 at 08:57:22PM +0200, Laurent Pinchart wrote: > On Sun, Mar 17, 2024 at 06:17:17PM +0100, Andrew Lunn wrote: > > > +&eqos { > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&pinctrl_eqos>; > > > + phy-mode = "rgmii-id"; > > > + phy-handle = <ðphy0>; > > > + > > > + mdio { > > > + compatible = "snps,dwmac-mdio"; > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + /* Atheros AR8033 on v1.0, Realtek RTL8211E on v1.1 */ > > > + ethphy0: ethernet-phy@0 { > > > + compatible = "ethernet-phy-ieee802.3-c22"; > > > + reg = <0>; > > > + eee-broken-1000t; > > > + }; > > > > Hi Laurent > > > > Do you happen to know what is broken with respect to EEE? It seems > > like a lot of IMX boards have this, so i suspect it is the MAC. Maybe > > we should be keying off the MAC compatible and disabling this in the > > ethernet driver rather than have every .dts file needing it? > > I wonder if this could be cargo-cult. To be honest, I've copied it from > the BSP and haven't investigated it. I've tried dropping that and > haven't noticed any difference, but I'm not sure how I should test it > properly. Maybe a better approach is to find the errata. It could be some older version of the eqos was broken, and it got fixed along the way? If that is so, moving it into the driver would be better, assuming there is some sort of hardware version register in the eqos. Andrew
(CC'ing Johannes) On Sun, Mar 17, 2024 at 10:55:16PM +0100, Andrew Lunn wrote: > On Sun, Mar 17, 2024 at 08:57:22PM +0200, Laurent Pinchart wrote: > > On Sun, Mar 17, 2024 at 06:17:17PM +0100, Andrew Lunn wrote: > > > > +&eqos { > > > > + pinctrl-names = "default"; > > > > + pinctrl-0 = <&pinctrl_eqos>; > > > > + phy-mode = "rgmii-id"; > > > > + phy-handle = <ðphy0>; > > > > + > > > > + mdio { > > > > + compatible = "snps,dwmac-mdio"; > > > > + #address-cells = <1>; > > > > + #size-cells = <0>; > > > > + > > > > + /* Atheros AR8033 on v1.0, Realtek RTL8211E on v1.1 */ > > > > + ethphy0: ethernet-phy@0 { > > > > + compatible = "ethernet-phy-ieee802.3-c22"; > > > > + reg = <0>; > > > > + eee-broken-1000t; > > > > + }; > > > > > > Hi Laurent > > > > > > Do you happen to know what is broken with respect to EEE? It seems > > > like a lot of IMX boards have this, so i suspect it is the MAC. Maybe > > > we should be keying off the MAC compatible and disabling this in the > > > ethernet driver rather than have every .dts file needing it? > > > > I wonder if this could be cargo-cult. To be honest, I've copied it from > > the BSP and haven't investigated it. I've tried dropping that and > > haven't noticed any difference, but I'm not sure how I should test it > > properly. > > Maybe a better approach is to find the errata. It could be some older > version of the eqos was broken, and it got fixed along the way? If > that is so, moving it into the driver would be better, assuming there > is some sort of hardware version register in the eqos. I don't know if there are public errata about this issue. It is beyong my areas of expertise. I've found a relatively recent e-mail on the netdev mailing list that seems related ([1]), but there was no reply. [1] https://lore.kernel.org/netdev/9c1c9408-88ac-4ade-b8ec-2ae5d8922cac@pengutronix.de/
On Sun, Mar 17, 2024 at 06:56:47PM +0200, Laurent Pinchart wrote: > On Sun, Mar 17, 2024 at 06:48:50PM +0200, Laurent Pinchart wrote: > > The SB-UCM-iMX8MPLUS kit is shipped with an external DSI panel. Add a > > corresponding DT overlay. > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > arch/arm64/boot/dts/freescale/Makefile | 4 + > > .../imx8mp-sb-ucm-panel-kd050hdfia020.dtso | 81 +++++++++++++++++++ > > 2 files changed, 85 insertions(+) > > create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso > > > > diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile > > index 02efa97fc464..d7432ce6a7bb 100644 > > --- a/arch/arm64/boot/dts/freescale/Makefile > > +++ b/arch/arm64/boot/dts/freescale/Makefile > > @@ -165,6 +165,10 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mp-icore-mx8mp-edimm2.2.dtb > > dtb-$(CONFIG_ARCH_MXC) += imx8mp-msc-sm2s-ep1.dtb > > dtb-$(CONFIG_ARCH_MXC) += imx8mp-phyboard-pollux-rdk.dtb > > dtb-$(CONFIG_ARCH_MXC) += imx8mp-sb-ucm.dtb > > + > > +imx8mp-sb-ucm-panel-kd050hdfia020-dtbs := imx8mp-sb-ucm.dtb imx8mp-sb-ucm-panel-kd050hdfia020-dtbo > > +dtb-$(CONFIG_ARCH_MXC) += imx8mp-sb-ucm-panel-kd050hdfia020-dtb Replying to myself, fixing the typo here with s/-dtb$/.dtb/ helps :-) I'll send a v3 after waiting some time for review comments. > On a side note, is there a way to selectively compile this dtb ? Running > > $ make dtbs > > will compile them all, but > > $ make freescale/imx8mp-sb-ucm-panel-kd050hdfia020-dtb > > complains with > > make[4]: *** No rule to make target 'arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtb'. Stop. > make[3]: *** [/home/laurent/src/iob/toradex/linux/scripts/Makefile.build:481: arch/arm64/boot/dts/freescale] Error 2 > make[2]: *** [/home/laurent/src/iob/toradex/linux/Makefile:1389: freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtb] Error 2 > > I would like to compile it selectively, as running > > $ make dtbs CHECK_DTBS=1 > > makes it much more time consuming to run the dtb checks. > > > + > > dtb-$(CONFIG_ARCH_MXC) += imx8mp-skov-revb-hdmi.dtb > > dtb-$(CONFIG_ARCH_MXC) += imx8mp-skov-revb-lt6.dtb > > dtb-$(CONFIG_ARCH_MXC) += imx8mp-skov-revb-mi1010ait-1cp1.dtb > > diff --git a/arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso b/arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso > > new file mode 100644 > > index 000000000000..fdad943c1554 > > --- /dev/null > > +++ b/arch/arm64/boot/dts/freescale/imx8mp-sb-ucm-panel-kd050hdfia020.dtso > > @@ -0,0 +1,81 @@ > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > +/* > > + * Copyright 2021 CompuLab > > + * > > + * Device tree overlay for KD050HDFIA020-C020A panel connector to Compulab > > + * SB-UCM-iMX8PLUS. > > + */ > > + > > +/dts-v1/; > > +/plugin/; > > + > > +#include <dt-bindings/gpio/gpio.h> > > +#include <dt-bindings/interrupt-controller/irq.h> > > + > > +&dsi_backlight { > > + status = "okay"; > > +}; > > + > > +&i2c5 { > > + status = "okay"; > > + > > + touch@5d { > > + compatible = "goodix,gt911"; > > + reg = <0x5d>; > > + > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_dsi_touch>; > > + > > + interrupt-parent = <&gpio4>; > > + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; > > + > > + irq-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>; > > + reset-gpios = <&pca9555 5 GPIO_ACTIVE_HIGH>; > > + }; > > +}; > > + > > +&lcdif1 { > > + status = "okay"; > > +}; > > + > > +&mipi_dsi { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + samsung,esc-clock-frequency = <20000000>; > > + status = "okay"; > > + > > + panel@0 { > > + compatible = "startek,kd050hdfia020", "ilitek,ili9881c"; > > + reg = <0>; > > + pinctrl-names = "default"; > > + pinctrl-0 = <&pinctrl_dsi_panel>; > > + > > + reset-gpio = <&pca9555 4 GPIO_ACTIVE_LOW>; > > + power-supply = <®_3v3_per>; > > + > > + backlight = <&dsi_backlight>; > > + > > + port { > > + panel_in: endpoint { > > + remote-endpoint = <&mipi_dsi_out>; > > + data-lanes = <1 2 3 4>; > > + }; > > + }; > > + }; > > + > > + ports { > > + port@1 { > > + reg = <1>; > > + > > + mipi_dsi_out: endpoint { > > + remote-endpoint = <&panel_in>; > > + data-lanes = <1 2 3 4>; > > + lane-polarities = <0 0 0 0 0>; > > + }; > > + }; > > + }; > > +}; > > + > > +&pwm1 { > > + status = "okay"; > > +};
> I don't know if there are public errata about this issue. It is beyong > my areas of expertise. I've found a relatively recent e-mail on the > netdev mailing list that seems related ([1]), but there was no reply. > > [1] https://lore.kernel.org/netdev/9c1c9408-88ac-4ade-b8ec-2ae5d8922cac@pengutronix.de/ Thanks for the link. Has anybody tried setting STMMAC_FLAG_RX_CLK_RUNS_IN_LPI. https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c#L816 The problem description makes it sound like the hardware does not like the clock being turned off. Setting this flag might fix that. Andrew