diff mbox series

[3/4] ARM: dts: omap: omap4-epson-embt2ws: add unknown gpio outputs

Message ID 20240930213008.159647-4-andreas@kemnade.info
State Superseded
Headers show
Series ARM: dts: omap: omap4-epson-embt2ws: misc gpio definitions | expand

Commit Message

Andreas Kemnade Sept. 30, 2024, 9:30 p.m. UTC
Set them to the state seen in a running system, initialized
by vendor u-boot or kernel. Add line names where they are defined in the
vendor kernel.
gpio15 resets something in the display, otherwise meaning of the
gpios is not known.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 .../boot/dts/ti/omap/omap4-epson-embt2ws.dts  | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)

Comments

Roger Quadros Oct. 4, 2024, 7:53 a.m. UTC | #1
On 01/10/2024 00:30, Andreas Kemnade wrote:
> Set them to the state seen in a running system, initialized
> by vendor u-boot or kernel. Add line names where they are defined in the
> vendor kernel.
> gpio15 resets something in the display, otherwise meaning of the
> gpios is not known.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
>  .../boot/dts/ti/omap/omap4-epson-embt2ws.dts  | 84 +++++++++++++++++++
>  1 file changed, 84 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> index cc1b6080bf95..c8205ae89840 100644
> --- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> +++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> @@ -115,6 +115,65 @@ wl12xx_vmmc: wl12xx-vmmc {
>  	};
>  };
>  > +&gpio1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&gpio1_hog_pins &gpio1wk_hog_pins>;
> +
> +	lb-reset-hog {
> +		gpio-hog;
> +		gpios = <9 GPIO_ACTIVE_HIGH>;
> +		output-low;
> +		line-name = "lb_reset";
> +	};

Just curious, what does lb stand for.

> +
> +	power-en-hog {
> +		gpio-hog;
> +		gpios = <10 GPIO_ACTIVE_HIGH>;
> +		output-high;
> +		line-name = "power_en";
> +	};
> +
> +	panel-power-en-hog {
> +		gpio-hog;
> +		gpios = <14 GPIO_ACTIVE_HIGH>;
> +		output-low;
> +		line-name = "panel_power_en";
> +	};

Is panel always enabled? I didn't see a panel driver
else it could be hooked to panel regulator?

> +
> +	blc-r-hog {
> +		gpio-hog;
> +		gpios = <17 GPIO_ACTIVE_HIGH>;
> +		output-low;
> +		line-name = "blc_r";
> +	};

this should be modeled as a gpio regulator and paried to backlight left?

> +
> +	blc-l-hog {
> +		gpio-hog;
> +		gpios = <16 GPIO_ACTIVE_HIGH>;
> +		output-low;
> +		line-name = "blc_l";
> +	};


this should be modeled as a gpio regulator and paried to backlight right?

> +
> +	high-hog {
> +		gpio-hog;
> +		gpios = <15 GPIO_ACTIVE_HIGH /* maybe dsi to dpi chip reset? */
> +			 21 GPIO_ACTIVE_HIGH
> +			 26 GPIO_ACTIVE_HIGH>;
> +		output-high;
> +		line-name = "unknown-high";
> +	};
> +
> +	low-hog {
> +		gpio-hog;
> +		gpios = <18 GPIO_ACTIVE_HIGH
> +			 19 GPIO_ACTIVE_HIGH
> +			 20 GPIO_ACTIVE_HIGH
> +			 22 GPIO_ACTIVE_HIGH>;
> +		output-low;
> +		line-name = "unknown-low";
> +	};

These are probably OK as we don't know their actual function.

> +};
> +
>  &i2c1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&i2c1_pins>;
> @@ -406,6 +465,22 @@ OMAP4_IOPAD(0x56, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio35 */
>  		>;
>  	};
>  
> +	gpio1_hog_pins: pinmux-gpio1-hog-pins {
> +		pinctrl-single,pins = <
> +			OMAP4_IOPAD(0x1b4, PIN_OUTPUT | MUX_MODE3) /* gpio14 */
> +			OMAP4_IOPAD(0x1b8, PIN_OUTPUT | MUX_MODE3) /* gpio16 */
> +			OMAP4_IOPAD(0x1ba, PIN_OUTPUT | MUX_MODE3) /* gpio17 */
> +
> +			OMAP4_IOPAD(0x1b6, PIN_OUTPUT | MUX_MODE3) /* gpio15 */
> +			OMAP4_IOPAD(0x1bc, PIN_OUTPUT | MUX_MODE3) /* gpio18 */
> +			OMAP4_IOPAD(0x1be, PIN_OUTPUT | MUX_MODE3) /* gpio19 */
> +			OMAP4_IOPAD(0x1c0, PIN_OUTPUT | MUX_MODE3) /* gpio20 */
> +			OMAP4_IOPAD(0x1c2, PIN_OUTPUT | MUX_MODE3) /* gpio21 */
> +			OMAP4_IOPAD(0x1c4, PIN_OUTPUT | MUX_MODE3) /* gpio22 */
> +			OMAP4_IOPAD(0x1cc, PIN_OUTPUT | MUX_MODE3) /* gpio26 */
> +		>;
> +	};
> +
>  	i2c1_pins: pinmux-i2c1-pins {
>  		pinctrl-single,pins = <
>  			   OMAP4_IOPAD(0x122, PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c1_scl */
> @@ -527,6 +602,15 @@ OMAP4_IOPAD(0x1c8, PIN_OUTPUT | MUX_MODE3)  /* gpio_24 / WLAN_EN */
>  	};
>  };
>  
> +&omap4_pmx_wkup {
> +	gpio1wk_hog_pins: pinmux-gpio1wk-hog-pins {
> +		pinctrl-single,pins = <
> +			OMAP4_IOPAD(0x68, PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpio9 */
> +			OMAP4_IOPAD(0x6a, PIN_INPUT | MUX_MODE3) /* gpio10 */
> +		>;
> +	};
> +};
> +
>  &uart2 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&uart2_pins &bt_pins>;
Andreas Kemnade Oct. 4, 2024, 11:33 a.m. UTC | #2
Am Fri, 4 Oct 2024 10:53:57 +0300
schrieb Roger Quadros <rogerq@kernel.org>:

> On 01/10/2024 00:30, Andreas Kemnade wrote:
> > Set them to the state seen in a running system, initialized
> > by vendor u-boot or kernel. Add line names where they are defined
> > in the vendor kernel.
> > gpio15 resets something in the display, otherwise meaning of the
> > gpios is not known.
> > 
> > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> > ---
> >  .../boot/dts/ti/omap/omap4-epson-embt2ws.dts  | 84
> > +++++++++++++++++++ 1 file changed, 84 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
> > b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts index
> > cc1b6080bf95..c8205ae89840 100644 ---
> > a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts +++
> > b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts @@ -115,6
> > +115,65 @@ wl12xx_vmmc: wl12xx-vmmc { };
> >  };  
> >  > +&gpio1 {  
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&gpio1_hog_pins &gpio1wk_hog_pins>;
> > +
> > +	lb-reset-hog {
> > +		gpio-hog;
> > +		gpios = <9 GPIO_ACTIVE_HIGH>;
> > +		output-low;
> > +		line-name = "lb_reset";
> > +	};  
> 
> Just curious, what does lb stand for.
> 
me too. Maybe b is the same as in cb 

static struct gpio bt2ws_lb_gpios[] = {
        {BLC_L_GPIO,   GPIOF_OUT_INIT_LOW,  "gpio_blc_l"   },
        {BLC_R_GPIO,   GPIOF_OUT_INIT_LOW,  "gpio_blc_r"   },
        {LB_RESET_GPIO,GPIOF_OUT_INIT_LOW,  "gpio_lb_reset"},
        {POWER_EN_GPIO,GPIOF_OUT_INIT_HIGH, "gpio_power_en"},
        {PANEL_POWER_EN_GPIO,GPIOF_OUT_INIT_LOW, "gpio_panel_power_en"},
};

That is what is in the vendor kernel and matches 

> > +
> > +	power-en-hog {
> > +		gpio-hog;
> > +		gpios = <10 GPIO_ACTIVE_HIGH>;
> > +		output-high;
> > +		line-name = "power_en";
> > +	};
> > +
> > +	panel-power-en-hog {
> > +		gpio-hog;
> > +		gpios = <14 GPIO_ACTIVE_HIGH>;
> > +		output-low;
> > +		line-name = "panel_power_en";
> > +	};  
> 
> Is panel always enabled? I didn't see a panel driver
> else it could be hooked to panel regulator?
> 
Panels are behind two dsi to dpi converters.
I have a driver. At the moment, I boot into vendor
v3.0 kernel, reprogram boot order, warm reboot into mainline u-boot +
kernel to get display working. I can read registers via dsi at least
after blanking the panel for the first time. Blanking/unblanking seems
to work.
With a low pulse on gpio15 I can reset something in the display which
the vendor kernel can recover from but not my mainline driver. Then no
communication with the display seem to work.

About gpio 10/14 I know only the name (from the possibly kernel sources
and matching /sys/kernel/debug/gpio). And that knowledge I want to
forward into the formal hardware description, the device tree.

$ grep -R PANEL_POWER_EN *
arch/arm/mach-omap2/board-bt2ws.c:
{PANEL_POWER_EN_GPIO,GPIOF_OUT_INIT_LOW, "gpio_panel_power_en"},
arch/arm/mach-omap2/board-bt2ts.c:
{PANEL_POWER_EN_GPIO,GPIOF_OUT_INIT_LOW, "gpio_panel_power_en"},
include/video/omap-panel-bt2.h:#define PANEL_POWER_EN_GPIO 14	// GPIO

But I did not get the supposed vendor kernel to fully boot. I have the verdict
that I do not have the exact sources of the kernel which is running.
I also did not notice any change in behaviour when toggling these gpios.
So either they are a leftover from another board revision or something
gets supplied by some parasitic ways.

I think the best is to explain the situation more in the comments.
What is a bit difficult is here is that there is something done in the m3
processors but apparently nothing vital to having display output (tried
with an initrd without any m3 firmware), probably
doing something camera-related, so the kernel sources do not give a full
picture of the hardware anyways.

BTW: do you know how to best trace gpio changes done by the vendor kernel
without recompiling it? I managed to write a module deviating the master_xfre
function for i2c to log things.

> > +
> > +	blc-r-hog {
> > +		gpio-hog;
> > +		gpios = <17 GPIO_ACTIVE_HIGH>;
> > +		output-low;
> > +		line-name = "blc_r";
> > +	};  
> 
> this should be modeled as a gpio regulator and paried to backlight
> left?
> 
Discussed in patch 2.

Regards,
Andreas
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
index cc1b6080bf95..c8205ae89840 100644
--- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
+++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts
@@ -115,6 +115,65 @@  wl12xx_vmmc: wl12xx-vmmc {
 	};
 };
 
+&gpio1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&gpio1_hog_pins &gpio1wk_hog_pins>;
+
+	lb-reset-hog {
+		gpio-hog;
+		gpios = <9 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "lb_reset";
+	};
+
+	power-en-hog {
+		gpio-hog;
+		gpios = <10 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "power_en";
+	};
+
+	panel-power-en-hog {
+		gpio-hog;
+		gpios = <14 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "panel_power_en";
+	};
+
+	blc-r-hog {
+		gpio-hog;
+		gpios = <17 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "blc_r";
+	};
+
+	blc-l-hog {
+		gpio-hog;
+		gpios = <16 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "blc_l";
+	};
+
+	high-hog {
+		gpio-hog;
+		gpios = <15 GPIO_ACTIVE_HIGH /* maybe dsi to dpi chip reset? */
+			 21 GPIO_ACTIVE_HIGH
+			 26 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "unknown-high";
+	};
+
+	low-hog {
+		gpio-hog;
+		gpios = <18 GPIO_ACTIVE_HIGH
+			 19 GPIO_ACTIVE_HIGH
+			 20 GPIO_ACTIVE_HIGH
+			 22 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "unknown-low";
+	};
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c1_pins>;
@@ -406,6 +465,22 @@  OMAP4_IOPAD(0x56, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio35 */
 		>;
 	};
 
+	gpio1_hog_pins: pinmux-gpio1-hog-pins {
+		pinctrl-single,pins = <
+			OMAP4_IOPAD(0x1b4, PIN_OUTPUT | MUX_MODE3) /* gpio14 */
+			OMAP4_IOPAD(0x1b8, PIN_OUTPUT | MUX_MODE3) /* gpio16 */
+			OMAP4_IOPAD(0x1ba, PIN_OUTPUT | MUX_MODE3) /* gpio17 */
+
+			OMAP4_IOPAD(0x1b6, PIN_OUTPUT | MUX_MODE3) /* gpio15 */
+			OMAP4_IOPAD(0x1bc, PIN_OUTPUT | MUX_MODE3) /* gpio18 */
+			OMAP4_IOPAD(0x1be, PIN_OUTPUT | MUX_MODE3) /* gpio19 */
+			OMAP4_IOPAD(0x1c0, PIN_OUTPUT | MUX_MODE3) /* gpio20 */
+			OMAP4_IOPAD(0x1c2, PIN_OUTPUT | MUX_MODE3) /* gpio21 */
+			OMAP4_IOPAD(0x1c4, PIN_OUTPUT | MUX_MODE3) /* gpio22 */
+			OMAP4_IOPAD(0x1cc, PIN_OUTPUT | MUX_MODE3) /* gpio26 */
+		>;
+	};
+
 	i2c1_pins: pinmux-i2c1-pins {
 		pinctrl-single,pins = <
 			   OMAP4_IOPAD(0x122, PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c1_scl */
@@ -527,6 +602,15 @@  OMAP4_IOPAD(0x1c8, PIN_OUTPUT | MUX_MODE3)  /* gpio_24 / WLAN_EN */
 	};
 };
 
+&omap4_pmx_wkup {
+	gpio1wk_hog_pins: pinmux-gpio1wk-hog-pins {
+		pinctrl-single,pins = <
+			OMAP4_IOPAD(0x68, PIN_INPUT_PULLDOWN | MUX_MODE3) /* gpio9 */
+			OMAP4_IOPAD(0x6a, PIN_INPUT | MUX_MODE3) /* gpio10 */
+		>;
+	};
+};
+
 &uart2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart2_pins &bt_pins>;