From 460b15adc9baab3dd403191b14c34647a24c1fcc Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Wed, 1 Nov 2017 22:18:06 +0800 Subject: [PATCH 1/3] video: sunxi: de2: fix SimpleFB node creation when HDMI not initialized 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 Reviewed-by: Jagan Teki Acked-by: Maxime Ripard --- 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 e890340..6d6bb2e 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); From e286fada9d434cd211b56fa7a4b5ef8965577e7f Mon Sep 17 00:00:00 2001 From: Artturi Alm Date: Wed, 8 Nov 2017 05:08:57 +0200 Subject: [PATCH 2/3] sunxi: fix CONFIG_SUNXI_EMAC references fixes CONFIG_SUNXI_EMAC references from drivers/net/Makefile and include/configs/sunxi-common.h likely forgotten in: commit abc3e4df59f5 ("sunxi: Convert SUNXI_EMAC to Kconfig") Signed-off-by: Artturi Alm Reviewed-by: Jagan Teki --- drivers/net/Makefile | 2 +- include/configs/sunxi-common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 94a4fd8..ac5443c 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -21,7 +21,7 @@ obj-$(CONFIG_DNET) += dnet.o obj-$(CONFIG_E1000) += e1000.o obj-$(CONFIG_E1000_SPI) += e1000_spi.o obj-$(CONFIG_EEPRO100) += eepro100.o -obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o +obj-$(CONFIG_SUN4I_EMAC) += sunxi_emac.o obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o obj-$(CONFIG_ENC28J60) += enc28j60.o obj-$(CONFIG_EP93XX) += ep93xx_eth.o diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 4207398..4391a8c 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -286,7 +286,7 @@ extern int soft_i2c_gpio_scl; #endif /* CONFIG_VIDEO_SUNXI */ /* Ethernet support */ -#ifdef CONFIG_SUNXI_EMAC +#ifdef CONFIG_SUN4I_EMAC #define CONFIG_PHY_ADDR 1 #define CONFIG_MII /* MII PHY management */ #endif From 6270a3f035d0bdb5d2283dff4bb568d36ab4c0e3 Mon Sep 17 00:00:00 2001 From: Artturi Alm Date: Wed, 8 Nov 2017 05:08:58 +0200 Subject: [PATCH 3/3] sunxi: restore PHYLIB for CONFIG_SUN4I_EMAC users due misnaming of CONFIG_SUN4I_EMAC in include/configs/sunxi-common.h, likely missed in: commit 3146f0c017df ("Move PHYLIB to Kconfig") Signed-off-by: Artturi Alm Reviewed-by: Jagan Teki --- drivers/net/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index c1ce54e..52555da 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -247,6 +247,7 @@ config SUN7I_GMAC config SUN4I_EMAC bool "Allwinner Sun4i Ethernet MAC support" depends on DM_ETH + select PHYLIB help This driver supports the Allwinner based SUN4I Ethernet MAC.