[PATCH 0/2] fix hdmi video setup for khadas vim3x boards

next patches add missed parts
Artem Lapkin (2): gpio: gpio-uclass: add OPEN_DRAIN flag parsing arm64: dts: meson: fix meson-khadas-vim3-u-boot.dtsi
arch/arm/dts/meson-khadas-vim3-u-boot.dtsi | 2 ++ drivers/gpio/gpio-uclass.c | 10 ++++++++++ 2 files changed, 12 insertions(+)

add GPIOD_OPEN_DRAIN flag which cant parsed properly
Problem: for example cant power video system for sm1 g12a socs because OPEN_DRAIN flag cant parsed
DTS examples:
``` $ grep GPIO_OPEN_DRAIN> arch/arm/dts/meson-*.dt* arch/arm/dts/meson-g12a-sei510.dts: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-g12a-u200.dts: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-gx-libretech-pc.dtsi: gpio = <&gpio GPIOH_3 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-khadas-vim3.dtsi: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-sm1-sei610.dts: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; ```
Signed-off-by: Artem Lapkin art@khadas.com --- drivers/gpio/gpio-uclass.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index bad6b71e0c..6225f32457 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -574,6 +574,15 @@ int dm_gpio_set_value(const struct gpio_desc *desc, int value) if (ret) return ret;
+ if (desc->flags & GPIOD_OPEN_DRAIN) { + if (value) + gpio_get_ops(desc->dev)->direction_input(desc->dev, desc->offset); + else + gpio_get_ops(desc->dev)->direction_output(desc->dev, desc->offset, 0); + + return 0; + } + if (desc->flags & GPIOD_ACTIVE_LOW) value = !value;

Hi,
This has already been pushed on u-boot master: https://patchwork.ozlabs.org/project/uboot/patch/20200505084318.15307-2-narm...
Commit: 47bd533e9dd0f967ff7b62f3edfd6c97131e1501 Author: Neil Armstrong narmstrong@baylibre.com Date: Tue May 5 10:43:17 2020 +0200
gpio: emulate open drain & open source in dm_gpio_set_value()
Handle the GPIOD_OPEN_DRAIN & GPIOD_OPEN_SOURCE flags to emulate open drain and open source by setting the GPIO line as input depending on the requested value.
The behaviour is taken from the Linux gpiolib.
Signed-off-by: Neil Armstrong narmstrong@baylibre.com Reviewed-by: Simon Glass sjg@chromium.org
Neil
On 15/01/2021 06:15, Artem Lapkin wrote:
add GPIOD_OPEN_DRAIN flag which cant parsed properly
Problem: for example cant power video system for sm1 g12a socs because OPEN_DRAIN flag cant parsed
DTS examples:
$ grep GPIO_OPEN_DRAIN\> arch/arm/dts/meson-*.dt* arch/arm/dts/meson-g12a-sei510.dts: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-g12a-u200.dts: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-gx-libretech-pc.dtsi: gpio = <&gpio GPIOH_3 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-khadas-vim3.dtsi: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>; arch/arm/dts/meson-sm1-sei610.dts: gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
Signed-off-by: Artem Lapkin art@khadas.com
drivers/gpio/gpio-uclass.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index bad6b71e0c..6225f32457 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -574,6 +574,15 @@ int dm_gpio_set_value(const struct gpio_desc *desc, int value) if (ret) return ret;
- if (desc->flags & GPIOD_OPEN_DRAIN) {
if (value)
gpio_get_ops(desc->dev)->direction_input(desc->dev, desc->offset);
else
gpio_get_ops(desc->dev)->direction_output(desc->dev, desc->offset, 0);
return 0;
- }
- if (desc->flags & GPIOD_ACTIVE_LOW) value = !value;

Add missed include meson-g12-common-u-boot.dtsi
PROBLEM: missed hdmi video setup for VIM3 and VIM3L boards
Signed-off-by: Artem Lapkin art@khadas.com --- arch/arm/dts/meson-khadas-vim3-u-boot.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi index 81fd5be378..5d6444cbac 100644 --- a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi +++ b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi @@ -10,6 +10,8 @@ }; };
+#include "meson-g12-common-u-boot.dtsi" + &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_4b_pins>, <&emmc_ds_pins>;

Hi,
On 15/01/2021 06:15, Artem Lapkin wrote:
Add missed include meson-g12-common-u-boot.dtsi
PROBLEM: missed hdmi video setup for VIM3 and VIM3L boards
Signed-off-by: Artem Lapkin art@khadas.com
arch/arm/dts/meson-khadas-vim3-u-boot.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi index 81fd5be378..5d6444cbac 100644 --- a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi +++ b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi @@ -10,6 +10,8 @@ }; };
+#include "meson-g12-common-u-boot.dtsi"
It's not necessary since already included in: arch/arm/dts/meson-g12b-a311d-khadas-vim3-u-boot.dtsi:#include "meson-g12-common-u-boot.dtsi" and arch/arm/dts/meson-sm1-u-boot.dtsi:#include "meson-g12-common-u-boot.dtsi"
What u-boot version are you using ? Please check u-boot-master and my u-boot-amlogic and u-boot-amlogic-next branches on https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic before posting !
Thanks, Neil

It's not necessary since already included in:
Yes u right ! Sorry !
On Fri, Jan 15, 2021 at 4:15 PM Neil Armstrong narmstrong@baylibre.com wrote:
Hi,
On 15/01/2021 06:15, Artem Lapkin wrote:
Add missed include meson-g12-common-u-boot.dtsi
PROBLEM: missed hdmi video setup for VIM3 and VIM3L boards
Signed-off-by: Artem Lapkin art@khadas.com
arch/arm/dts/meson-khadas-vim3-u-boot.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi
b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi
index 81fd5be378..5d6444cbac 100644 --- a/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi +++ b/arch/arm/dts/meson-khadas-vim3-u-boot.dtsi @@ -10,6 +10,8 @@ }; };
+#include "meson-g12-common-u-boot.dtsi"
It's not necessary since already included in: arch/arm/dts/meson-g12b-a311d-khadas-vim3-u-boot.dtsi:#include "meson-g12-common-u-boot.dtsi" and arch/arm/dts/meson-sm1-u-boot.dtsi:#include "meson-g12-common-u-boot.dtsi"
What u-boot version are you using ? Please check u-boot-master and my u-boot-amlogic and u-boot-amlogic-next branches on https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic before posting !
Thanks, Neil
participants (3)
-
Art Nikpal
-
Artem Lapkin
-
Neil Armstrong