* [PATCH 2/3] ARM: Wolfvision PF5: of_probe only once
2024-10-01 10:47 [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Sascha Hauer
@ 2024-10-01 10:47 ` Sascha Hauer
2024-10-01 10:47 ` [PATCH 3/3] ARM: Wolfvision PF5: add display overlay Sascha Hauer
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2024-10-01 10:47 UTC (permalink / raw)
To: Barebox List; +Cc: Michael Riesch
When overlays have been applied we have to call of_clk_init() and
of_probe() once to have the changes from the overlays take effect. We
only have to do it once though after all overlays have been applied, not
after each overlay.
Doing it after each overlay has the undesired side effect that the VOP2
will be probed right after the io-expander board has been detected. At
that time the display overlay is not yet included, so the VOP2 probes
without the display and it won't be available later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/boards/wolfvision/common.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/common/boards/wolfvision/common.c b/common/boards/wolfvision/common.c
index 9a56b39b01..fe3417e81f 100644
--- a/common/boards/wolfvision/common.c
+++ b/common/boards/wolfvision/common.c
@@ -48,8 +48,7 @@ int wolfvision_apply_overlay(const struct wv_overlay *overlay, char **files)
return ret;
}
- of_clk_init();
- of_probe();
+ return 1;
}
return 0;
@@ -106,6 +105,7 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
int num_extensions, char **overlays)
{
int i, hwid, ret;
+ bool do_of_probe = false;
ret = of_device_ensure_probed_by_alias("saradc");
if (ret)
@@ -130,12 +130,19 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
if (overlay->name) {
pr_info("Detected %s %s\n", overlay->name,
extension->name);
- wolfvision_apply_overlay(overlay, overlays);
+ ret = wolfvision_apply_overlay(overlay, overlays);
+ if (ret > 0)
+ do_of_probe = true;
} else {
pr_warning("Detected unknown %s HWID %d\n",
extension->name, hwid);
}
}
+ if (do_of_probe) {
+ of_clk_init();
+ of_probe();
+ }
+
return 0;
}
--
2.39.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] ARM: Wolfvision PF5: add display overlay
2024-10-01 10:47 [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Sascha Hauer
2024-10-01 10:47 ` [PATCH 2/3] ARM: Wolfvision PF5: of_probe only once Sascha Hauer
@ 2024-10-01 10:47 ` Sascha Hauer
2024-10-02 7:14 ` [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Michael Riesch
2024-10-02 11:58 ` Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2024-10-01 10:47 UTC (permalink / raw)
To: Barebox List; +Cc: Michael Riesch
The Wolfvision PF5 can have a display connected to it. The presence of
the display can be checked for using an analog input. Include the
corresponding device tree overlay when the display is connected.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/wolfvision-pf5/board.c | 15 +++++++++++++++
arch/arm/dts/Makefile | 4 ++--
.../arm/dts/rk3568-wolfvision-pf5-display-vz.dtso | 11 +++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/dts/rk3568-wolfvision-pf5-display-vz.dtso
diff --git a/arch/arm/boards/wolfvision-pf5/board.c b/arch/arm/boards/wolfvision-pf5/board.c
index 5a2f4201ba..c2a6963c0f 100644
--- a/arch/arm/boards/wolfvision-pf5/board.c
+++ b/arch/arm/boards/wolfvision-pf5/board.c
@@ -15,15 +15,19 @@
#include <boards/wolfvision/common.h>
#include <mach/rockchip/bbu.h>
+#define PF5_DISPLAY_VZ_FILENAME "rk3568-wolfvision-pf5-display-vz.dtbo"
+#define PF5_DISPLAY_VZ_DATA __dtbo_rk3568_wolfvision_pf5_display_vz_start
#define PF5_IO_EXPANDER_FILENAME "rk3568-wolfvision-pf5-io-expander.dtbo"
#define PF5_IO_EXPANDER_DATA __dtbo_rk3568_wolfvision_pf5_io_expander_start
enum {
PF5_HWID_CHANNEL_MAINBOARD = 1,
PF5_HWID_CHANNEL_MODULE = 2,
+ PF5_HWID_CHANNEL_DISPLAY = 3,
};
extern char PF5_IO_EXPANDER_DATA[];
+extern char PF5_DISPLAY_VZ_DATA[];
static const struct wv_rk3568_extension pf5_extensions[] = {
{
@@ -45,6 +49,17 @@ static const struct wv_rk3568_extension pf5_extensions[] = {
[16] = { .name = "no", },
},
},
+ {
+ .adc_chan = PF5_HWID_CHANNEL_DISPLAY,
+ .name = "display",
+ .overlays = {
+ [0] = { .name = "Visualizer",
+ .filename = PF5_DISPLAY_VZ_FILENAME,
+ .data = PF5_DISPLAY_VZ_DATA,
+ },
+ [16] = { .name = "no" },
+ },
+ },
};
static int pf5_probe(struct device *dev)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 654d221fa3..fe32b812f6 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -231,6 +231,6 @@ lwl-$(CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP) += imx8mp-var-dart-dt8mcusto
lwl-$(CONFIG_MACH_TQMA93XX) += imx93-tqma9352-mba93xxca.dtb.o \
imx93-tqma9352-mba93xxla.dtb.o
-obj-$(CONFIG_MACH_WOLFVISION_PF5) += rk3568-wolfvision-pf5-io-expander.dtbo.o
-
+obj-$(CONFIG_MACH_WOLFVISION_PF5) += rk3568-wolfvision-pf5-io-expander.dtbo.o \
+ rk3568-wolfvision-pf5-display-vz.dtbo.o
clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts *.dtb.z
diff --git a/arch/arm/dts/rk3568-wolfvision-pf5-display-vz.dtso b/arch/arm/dts/rk3568-wolfvision-pf5-display-vz.dtso
new file mode 100644
index 0000000000..0e57a6660e
--- /dev/null
+++ b/arch/arm/dts/rk3568-wolfvision-pf5-display-vz.dtso
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Device tree overlay for the WolfVision PF5 Visualizer display.
+ *
+ * Copyright (C) 2024 WolfVision GmbH.
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <arm64/rockchip/rk3568-wolfvision-pf5-display-vz.dtso>
--
2.39.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso
2024-10-01 10:47 [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Sascha Hauer
2024-10-01 10:47 ` [PATCH 2/3] ARM: Wolfvision PF5: of_probe only once Sascha Hauer
2024-10-01 10:47 ` [PATCH 3/3] ARM: Wolfvision PF5: add display overlay Sascha Hauer
@ 2024-10-02 7:14 ` Michael Riesch
2024-10-02 11:58 ` Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Michael Riesch @ 2024-10-02 7:14 UTC (permalink / raw)
To: Sascha Hauer, Barebox List
Hi Sascha,
Very nice, thanks for the patches.
On 10/1/24 12:47, Sascha Hauer wrote:
> rk3568-wolfvision-pf5-io-expander-upstream.dtso has been merged in the
> upstream dts files, so switch to using the upstream version.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net>
Regards, Michael
> ---
> ...8-wolfvision-pf5-io-expander-upstream.dtso | 137 ------------------
> .../rk3568-wolfvision-pf5-io-expander.dtso | 2 +-
> 2 files changed, 1 insertion(+), 138 deletions(-)
> delete mode 100644 arch/arm/dts/rk3568-wolfvision-pf5-io-expander-upstream.dtso
>
> diff --git a/arch/arm/dts/rk3568-wolfvision-pf5-io-expander-upstream.dtso b/arch/arm/dts/rk3568-wolfvision-pf5-io-expander-upstream.dtso
> deleted file mode 100644
> index ebcaeafc38..0000000000
> --- a/arch/arm/dts/rk3568-wolfvision-pf5-io-expander-upstream.dtso
> +++ /dev/null
> @@ -1,137 +0,0 @@
> -// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
> -/*
> - * Device tree overlay for the WolfVision PF5 IO Expander board.
> - *
> - * Copyright (C) 2024 WolfVision GmbH.
> - */
> -
> -/dts-v1/;
> -/plugin/;
> -
> -#include <dt-bindings/clock/rk3568-cru.h>
> -#include <dt-bindings/gpio/gpio.h>
> -#include <dt-bindings/interrupt-controller/irq.h>
> -#include <dt-bindings/pinctrl/rockchip.h>
> -
> -&{/} {
> - gmac0_clkin: external-gmac0-clock {
> - compatible = "fixed-clock";
> - clock-frequency = <50000000>;
> - clock-output-names = "gmac0_clkin";
> - #clock-cells = <0>;
> - };
> -
> - usb_host_vbus: usb-host-vbus-regulator {
> - compatible = "regulator-fixed";
> - enable-active-high;
> - gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
> - pinctrl-names = "default";
> - pinctrl-0 = <&usb_host_vbus_en>;
> - regulator-name = "usb_host_vbus";
> - regulator-min-microvolt = <5000000>;
> - regulator-max-microvolt = <5000000>;
> - vin-supply = <&vcc5v_in>;
> - };
> -
> - vcc1v8_eth: vcc1v8-eth-regulator {
> - compatible = "regulator-fixed";
> - enable-active-high;
> - gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
> - pinctrl-names = "default";
> - pinctrl-0 = <&vcc1v8_eth_en>;
> - regulator-always-on;
> - regulator-boot-on;
> - regulator-name = "1v8_eth";
> - regulator-min-microvolt = <1800000>;
> - regulator-max-microvolt = <1800000>;
> - vin-supply = <&vcc3v3_sys>;
> - };
> -
> - vcc3v3_eth: vcc3v3-eth-regulator {
> - compatible = "regulator-fixed";
> - enable-active-low;
> - gpio = <&gpio0 RK_PC0 GPIO_ACTIVE_LOW>;
> - pinctrl-names = "default";
> - pinctrl-0 = <&vcc3v3_eth_enn>;
> - regulator-always-on;
> - regulator-boot-on;
> - regulator-name = "3v3_eth";
> - regulator-min-microvolt = <3300000>;
> - regulator-max-microvolt = <3300000>;
> - vin-supply = <&vcc3v3_sys>;
> - };
> -};
> -
> -&gmac0 {
> - assigned-clocks = <&cru SCLK_GMAC0_RX_TX>,
> - <&cru SCLK_GMAC0>;
> - assigned-clock-parents = <&cru SCLK_GMAC0_RMII_SPEED>,
> - <&gmac0_clkin>;
> - clock_in_out = "input";
> - phy-handle = <&dp83826>;
> - phy-mode = "rmii";
> - phy-supply = <&vcc3v3_eth>;
> - pinctrl-names = "default";
> - pinctrl-0 = <&gmac0_miim
> - &gmac0_clkinout
> - &gmac0_rx_er
> - &gmac0_rx_bus2
> - &gmac0_tx_bus2>;
> - status = "okay";
> -};
> -
> -&mdio0 {
> - #address-cells = <1>;
> - #size-cells = <0>;
> -
> - dp83826: ethernet-phy@0 {
> - compatible = "ethernet-phy-ieee802.3-c22";
> - reg = <0x0>;
> - interrupt-parent = <&gpio0>;
> - interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
> - pinctrl-names = "default";
> - pinctrl-0 = <ð_wake_intn ð_phy_rstn>;
> - reset-assert-us = <1000>;
> - reset-deassert-us = <2000>;
> - reset-gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_LOW>;
> - wakeup-source;
> - };
> -};
> -
> -&pinctrl {
> - ethernet {
> - eth_wake_intn: eth-wake-intn-pinctrl {
> - rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
> - };
> -
> - eth_phy_rstn: eth-phy-rstn-pinctrl {
> - rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
> - };
> -
> - vcc1v8_eth_en: vcc1v8-eth-en-pinctrl {
> - rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
> - };
> -
> - vcc3v3_eth_enn: vcc3v3-eth-enn-pinctrl {
> - rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
> - };
> - };
> -
> - usb {
> - usb_host_vbus_en: usb-host-vbus-en-pinctrl {
> - rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
> - };
> - };
> -};
> -
> -&usb_host1_xhci {
> - maximum-speed = "high-speed";
> - phys = <&usb2phy0_host>;
> - phy-names = "usb2-phy";
> - status = "okay";
> -};
> -
> -&usb2phy0_host {
> - phy-supply = <&usb_host_vbus>;
> - status = "okay";
> -};
> diff --git a/arch/arm/dts/rk3568-wolfvision-pf5-io-expander.dtso b/arch/arm/dts/rk3568-wolfvision-pf5-io-expander.dtso
> index 37b48afd2d..5160a7ec1a 100644
> --- a/arch/arm/dts/rk3568-wolfvision-pf5-io-expander.dtso
> +++ b/arch/arm/dts/rk3568-wolfvision-pf5-io-expander.dtso
> @@ -8,4 +8,4 @@
> /dts-v1/;
> /plugin/;
>
> -#include "rk3568-wolfvision-pf5-io-expander-upstream.dtso"
> +#include <arm64/rockchip/rk3568-wolfvision-pf5-io-expander.dtso>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso
2024-10-01 10:47 [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Sascha Hauer
` (2 preceding siblings ...)
2024-10-02 7:14 ` [PATCH 1/3] ARM: wolfvision PF5: Use upstream IO expander dtso Michael Riesch
@ 2024-10-02 11:58 ` Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2024-10-02 11:58 UTC (permalink / raw)
To: Barebox List, Sascha Hauer; +Cc: Michael Riesch
On Tue, 01 Oct 2024 12:47:36 +0200, Sascha Hauer wrote:
> rk3568-wolfvision-pf5-io-expander-upstream.dtso has been merged in the
> upstream dts files, so switch to using the upstream version.
>
>
Applied, thanks!
[1/3] ARM: wolfvision PF5: Use upstream IO expander dtso
https://git.pengutronix.de/cgit/barebox/commit/?id=234f36ad4082 (link may not be stable)
[2/3] ARM: Wolfvision PF5: of_probe only once
https://git.pengutronix.de/cgit/barebox/commit/?id=281aa901624e (link may not be stable)
[3/3] ARM: Wolfvision PF5: add display overlay
https://git.pengutronix.de/cgit/barebox/commit/?id=3ed7b0ebc507 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 5+ messages in thread