[U-Boot] [PATCH v2 0/2] Fix DE2 SimpleFB node creation and support LCD SimpleFB

This patchset fixes the DE2 SimpleFB node creation when HDMI is not ready, and adds support for LCD SimpleFB node creation on A64.
The first patch prevents a broken SimpleFB node to be created when HDMI is present but not probed, this is a fix and should to into 2017.11.
The second patch adds support for LCD SimpleFB node creation.
Icenowy Zheng (2): video: sunxi: de2: fix SimpleFB node creation when HDMI not initialized video: sunxi: de2: add support for LCD SimpleFB
drivers/video/sunxi/sunxi_de2.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)

When HDMI is not initialized (e.g. no monitor is plugged), the current SimpleFB code will still create a broken SimpleFB node.
Detect whether HDMI is initialized when creating SimpleFB node.
Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2") Signed-off-by: Icenowy Zheng icenowy@aosc.io --- drivers/video/sunxi/sunxi_de2.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c index e8903400ec..6d6bb2e0c3 100644 --- a/drivers/video/sunxi/sunxi_de2.c +++ b/drivers/video/sunxi/sunxi_de2.c @@ -346,13 +346,19 @@ int sunxi_simplefb_setup(void *blob) "sunxi_dw_hdmi", &hdmi); if (ret) { debug("HDMI not present\n"); - return 0; + } else if (device_active(hdmi)) { + if (mux == 0) + pipeline = "mixer0-lcd0-hdmi"; + else + pipeline = "mixer1-lcd1-hdmi"; + } else { + debug("HDMI present but not probed\n"); }
- if (mux == 0) - pipeline = "mixer0-lcd0-hdmi"; - else - pipeline = "mixer1-lcd1-hdmi"; + if (!pipeline) { + debug("No active display present\n"); + return 0; + }
de2_priv = dev_get_uclass_priv(de2); de2_plat = dev_get_uclass_platdata(de2);

On Wed, Nov 1, 2017 at 7:48 PM, Icenowy Zheng icenowy@aosc.io wrote:
When HDMI is not initialized (e.g. no monitor is plugged), the current SimpleFB code will still create a broken SimpleFB node.
Detect whether HDMI is initialized when creating SimpleFB node.
Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2") Signed-off-by: Icenowy Zheng icenowy@aosc.io
Reviewed-by: Jagan Teki jagan@openedev.com
thanks!

On Wed, Nov 01, 2017 at 10:18:06PM +0800, Icenowy Zheng wrote:
When HDMI is not initialized (e.g. no monitor is plugged), the current SimpleFB code will still create a broken SimpleFB node.
Detect whether HDMI is initialized when creating SimpleFB node.
Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2") Signed-off-by: Icenowy Zheng icenowy@aosc.io
Acked-by: Maxime Ripard maxime.ripard@free-electrons.com

On Thu, Nov 2, 2017 at 5:54 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
On Wed, Nov 01, 2017 at 10:18:06PM +0800, Icenowy Zheng wrote:
When HDMI is not initialized (e.g. no monitor is plugged), the current SimpleFB code will still create a broken SimpleFB node.
Detect whether HDMI is initialized when creating SimpleFB node.
Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2") Signed-off-by: Icenowy Zheng icenowy@aosc.io
Acked-by: Maxime Ripard maxime.ripard@free-electrons.com
Applied to u-boot-sunxi/master
thanks!

Add support for setting up SimpleFB for LCD display output in DE2 SimpleFB setup code.
Signed-off-by: Icenowy Zheng icenowy@aosc.io --- Changes in v2: - Use lcd variable. - Extract the HDMI SimpleFB fix to a dedicated patch.
drivers/video/sunxi/sunxi_de2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c index 6d6bb2e0c3..860187323c 100644 --- a/drivers/video/sunxi/sunxi_de2.c +++ b/drivers/video/sunxi/sunxi_de2.c @@ -319,7 +319,7 @@ U_BOOT_DEVICE(sunxi_de2) = { #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_VIDEO_DT_SIMPLEFB) int sunxi_simplefb_setup(void *blob) { - struct udevice *de2, *hdmi; + struct udevice *de2, *hdmi, *lcd; struct video_priv *de2_priv; struct video_uc_platdata *de2_plat; int mux; @@ -355,6 +355,15 @@ int sunxi_simplefb_setup(void *blob) debug("HDMI present but not probed\n"); }
+ ret = uclass_find_device_by_name(UCLASS_DISPLAY, + "sunxi_lcd", &lcd); + if (ret) + debug("LCD not present\n"); + else if (device_active(lcd)) + pipeline = "mixer0-lcd0"; + else + debug("LCD present but not probed\n"); + if (!pipeline) { debug("No active display present\n"); return 0;

On Wed, Nov 1, 2017 at 7:48 PM, Icenowy Zheng icenowy@aosc.io wrote:
Add support for setting up SimpleFB for LCD display output in DE2 SimpleFB setup code.
Signed-off-by: Icenowy Zheng icenowy@aosc.io
Reviewed-by: Jagan Teki jagan@openedev.com
thanks!

On Wed, Nov 01, 2017 at 10:18:07PM +0800, Icenowy Zheng wrote:
Add support for setting up SimpleFB for LCD display output in DE2 SimpleFB setup code.
Signed-off-by: Icenowy Zheng icenowy@aosc.io
Acked-by: Maxime Ripard maxime.ripard@free-electrons.com
Maxime

On Thu, Nov 2, 2017 at 5:54 PM, Maxime Ripard maxime.ripard@free-electrons.com wrote:
On Wed, Nov 01, 2017 at 10:18:07PM +0800, Icenowy Zheng wrote:
Add support for setting up SimpleFB for LCD display output in DE2 SimpleFB setup code.
Signed-off-by: Icenowy Zheng icenowy@aosc.io
Acked-by: Maxime Ripard maxime.ripard@free-electrons.com
Applied to u-boot-sunxi/master
participants (3)
-
Icenowy Zheng
-
Jagan Teki
-
Maxime Ripard