Skip to contentSkip to conversation

meson: add support for Video Output

PATCH In review Neil Armstrong 2 participants 23 messages Jan 15, 2019 – Jan 29, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover meson: add support for Video Output

This patchset adds support for CVBS and/or HDMI output for Amlogic Meson GX SoCs (GXBB, GXL and GXM) based on the Linux Meson DRM driver ported to the U-Boot Video DM model. It supports only the "DMT" video modes reported by the monitors since AVI InfoFrame management is missing from the U-Boot video model.

The port includes some changes in the dw-hdmi driver to support custom PHY calls and support for the ColorSpace converter since the Amlogic Meson GX video pipeline can only output un YUV444 mode, thus activating the CSC is needed to output RGB for HDMI.

Video Support needs some tweaks in the DT like the u-boot,dm-pre-reloc for the VPU node and a tweak to access the HHI registers from the DW-HDMI glue driver. A port of a linux patch is also necessary to hook a regulator to enable HDMI.

Finally, it enables console mux and console env for all Amlogic boards and enabled Video Support for the Libre Computer AML-S905X-CC board.

Jorge Ramirez-Ortiz (2):
video: dw_hdmi: support SoC specific read/write ops
video: dw_hdmi: add support for color conversion

Maxime Jourdan (6):
power: domain: meson-gx-pwrc-vpu: add missing depends
arm64: dts: meson-gx: vpu should be probed before relocation
arm64: dts: meson-gx: add hhi reg entry to hdmi_tx
arm: meson: board-gx: Setup VPU in fdt
arm: meson64: enable console mux and console env by default
arm: libretech-cc: enable video by default

Neil Armstrong (3):
video: Add Meson Video Processing Unit Driver
arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply
configs: meson64: use vidconsole and usbkbd if enabled

 arch/arm/dts/meson-gx-u-boot.dtsi             |   21 +
 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi |    7 +
 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi  |    7 +
 .../meson-gxl-s905x-khadas-vim-u-boot.dtsi    |    7 +
 arch/arm/dts/meson-gxl-s905x-khadas-vim.dts   |    1 +
 .../meson-gxl-s905x-libretech-cc-u-boot.dtsi  |    7 +
 arch/arm/dts/meson-gxl-s905x-libretech-cc.dts |    1 +
 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi |    7 +
 arch/arm/dts/meson-gxl-s905x-p212.dts         |    1 +
 .../arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi |    7 +
 arch/arm/dts/meson-gxm-khadas-vim2.dts        |    1 +
 arch/arm/include/asm/arch-meson/meson-vpu.h   |   13 +
 arch/arm/mach-meson/board-gx.c                |    5 +
 configs/khadas-vim2_defconfig                 |    2 +
 configs/khadas-vim_defconfig                  |    2 +
 configs/libretech-cc_defconfig                |    8 +
 configs/odroid-c2_defconfig                   |    2 +
 configs/p212_defconfig                        |    2 +
 drivers/power/domain/Kconfig                  |    2 +-
 drivers/video/Kconfig                         |    2 +
 drivers/video/Makefile                        |    1 +
 drivers/video/dw_hdmi.c                       |  267 ++-
 drivers/video/meson/Kconfig                   |   12 +
 drivers/video/meson/Makefile                  |    9 +
 drivers/video/meson/meson_canvas.c            |   45 +
 drivers/video/meson/meson_dw_hdmi.c           |  445 +++++
 drivers/video/meson/meson_dw_hdmi.h           |  134 ++
 drivers/video/meson/meson_plane.c             |  177 ++
 drivers/video/meson/meson_registers.h         | 1393 ++++++++++++++++
 drivers/video/meson/meson_vclk.c              |  893 ++++++++++
 drivers/video/meson/meson_venc.c              | 1464 +++++++++++++++++
 drivers/video/meson/meson_vpu.c               |  211 +++
 drivers/video/meson/meson_vpu.h               |   97 ++
 drivers/video/meson/meson_vpu_init.c          |  440 +++++
 drivers/video/meson/simplefb_common.c         |   29 +
 drivers/video/meson/simplefb_common.h         |   21 +
 include/configs/meson64.h                     |   23 +
 include/dw_hdmi.h                             |   74 +
 include/media_bus_format.h                    |  156 ++
 39 files changed, 5992 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/meson-gx-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi
 create mode 100644 arch/arm/include/asm/arch-meson/meson-vpu.h
 create mode 100644 drivers/video/meson/Kconfig
 create mode 100644 drivers/video/meson/Makefile
 create mode 100644 drivers/video/meson/meson_canvas.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.h
 create mode 100644 drivers/video/meson/meson_plane.c
 create mode 100644 drivers/video/meson/meson_registers.h
 create mode 100644 drivers/video/meson/meson_vclk.c
 create mode 100644 drivers/video/meson/meson_venc.c
 create mode 100644 drivers/video/meson/meson_vpu.c
 create mode 100644 drivers/video/meson/meson_vpu.h
 create mode 100644 drivers/video/meson/meson_vpu_init.c
 create mode 100644 drivers/video/meson/simplefb_common.c
 create mode 100644 drivers/video/meson/simplefb_common.h
 create mode 100644 include/media_bus_format.h
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/11 power: domain: meson-gx-pwrc-vpu: add missing depends

From: Maxime Jourdan <[email protected]>

MESON_GX_VPU_POWER_DOMAIN should depend on POWER_DOMAIN.

---
 drivers/power/domain/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/domain/Kconfig +1 -1
index 93deaef809..06bba6220b 100644
@@ -32,7 +32,7 @@ config MTK_POWER_DOMAIN
 
 config MESON_GX_VPU_POWER_DOMAIN
 	bool "Enable Amlogic Meson GX VPU power domain driver"
-	depends on ARCH_MESON
+	depends on POWER_DOMAIN && ARCH_MESON
 	help
 	  Enable support for manipulating Amlogic Meson GX Video Processing
 	  Unit power domain.
Signature · 1 line
2.20.1
Reviewed-by on v1 1/11
#2 lore raw

Re: [PATCH u-boot 01/11] power: domain: meson-gx-pwrc-vpu: add missing depends

Quoted 6 lines · On Tue, 15 Jan 2019 17:17:49 +0100 Neil Armstrong narmstrong at baylibre.com…

From: Maxime Jourdan <[email protected]>

MESON_GX_VPU_POWER_DOMAIN should depend on POWER_DOMAIN.

--
Anatolij

#3 lore raw

PATCH 2/11 video: dw_hdmi: support SoC specific read/write ops

In reply to Neil Armstrong

From: Jorge Ramirez-Ortiz <[email protected]>

Some IPs like the meson VPU have a specific way to write to dw_hdmi registers. Make it configurable.

---
 drivers/video/dw_hdmi.c | 14 ++++++++++++--
 include/dw_hdmi.h       |  2 ++
 2 files changed, 14 insertions(+), 2 deletions(-)
drivers/video/dw_hdmi.c +12 -2
index 229bd63c97..e03f24fa98 100644
@@ -52,7 +52,7 @@ static const struct tmds_n_cts n_cts_table[] = {
 	}
 };
 
-static void hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
+static void dw_hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
 {
 	switch (hdmi->reg_io_width) {
 	case 1:
@@ -67,7 +67,7 @@ static void hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
 	}
 }
 
-static u8 hdmi_read(struct dw_hdmi *hdmi, int offset)
+static u8 dw_hdmi_read(struct dw_hdmi *hdmi, int offset)
 {
 	switch (hdmi->reg_io_width) {
 	case 1:
@@ -82,6 +82,10 @@ static u8 hdmi_read(struct dw_hdmi *hdmi, int offset)
 	return 0;
 }
 
+static u8 (*hdmi_read)(struct dw_hdmi *hdmi, int offset) = dw_hdmi_read;
+static void (*hdmi_write)(struct dw_hdmi *hdmi, u8 val, int offset) =
+								 dw_hdmi_write;
+
 static void hdmi_mod(struct dw_hdmi *hdmi, unsigned reg, u8 mask, u8 data)
 {
 	u8 val = hdmi_read(hdmi, reg) & ~mask;
@@ -754,6 +758,12 @@ void dw_hdmi_init(struct dw_hdmi *hdmi)
 		  HDMI_IH_MUTE_MUTE_WAKEUP_INTERRUPT |
 		  HDMI_IH_MUTE_MUTE_ALL_INTERRUPT;
 
+	if (hdmi->write_reg)
+		hdmi_write = hdmi->write_reg;
+
+	if (hdmi->read_reg)
+		hdmi_read = hdmi->read_reg;
+
 	hdmi_write(hdmi, ih_mute, HDMI_IH_MUTE);
 
 	/* enable i2c master done irq */
include/dw_hdmi.h +2 -0
index 23088ec768..35edc189c0 100644
@@ -472,6 +472,8 @@ struct dw_hdmi {
 	u8 reg_io_width;
 
 	int (*phy_set)(struct dw_hdmi *hdmi, uint mpixelclock);
+	void (*write_reg)(struct dw_hdmi *hdmi, u8 val, int offset);
+	u8 (*read_reg)(struct dw_hdmi *hdmi, int offset);
 };
 
 int dw_hdmi_phy_cfg(struct dw_hdmi *hdmi, uint mpixelclock);
Signature · 1 line
2.20.1
Reviewed-by on v1 2/11
#4 lore raw

Re: [PATCH u-boot 02/11] video: dw_hdmi: support SoC specific read/write ops

Hi Neil,

Quoted 9 lines · On Tue, 15 Jan 2019 17:17:50 +0100 Neil Armstrong narmstrong at baylibre.com…

From: Jorge Ramirez-Ortiz <[email protected]>

Some IPs like the meson VPU have a specific way to write to dw_hdmi registers. Make it configurable.

--
Anatolij

#5 lore raw

PATCH 3/11 video: dw_hdmi: add support for color conversion

In reply to Neil Armstrong

From: Jorge Ramirez-Ortiz <[email protected]>

Some IPs like the meson VPU can only feed a particular pixel format to dw_hdmi. As of now, the driver is hardcoded to use RGB888 as input.

This commit enables different pixel format inputs, with the appropriate CSC configuration.

---
 drivers/video/dw_hdmi.c    | 253 ++++++++++++++++++++++++++++++++++++-
 include/dw_hdmi.h          |  72 +++++++++++
 include/media_bus_format.h | 156 +++++++++++++++++++++++
 3 files changed, 480 insertions(+), 1 deletion(-)
 create mode 100644 include/media_bus_format.h
drivers/video/dw_hdmi.c +252 -1
index e03f24fa98..463436edf3 100644
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <asm/io.h>
+#include <media_bus_format.h>
 #include "dw_hdmi.h"
 
 struct tmds_n_cts {
@@ -52,6 +53,24 @@ static const struct tmds_n_cts n_cts_table[] = {
 	}
 };
 
+static const u16 csc_coeff_default[3][4] = {
+	{ 0x2000, 0x0000, 0x0000, 0x0000 },
+	{ 0x0000, 0x2000, 0x0000, 0x0000 },
+	{ 0x0000, 0x0000, 0x2000, 0x0000 }
+};
+
+static const u16 csc_coeff_rgb_in_eitu601[3][4] = {
+	{ 0x2591, 0x1322, 0x074b, 0x0000 },
+	{ 0x6535, 0x2000, 0x7acc, 0x0200 },
+	{ 0x6acd, 0x7534, 0x2000, 0x0200 }
+};
+
+static const u16 csc_coeff_rgb_out_eitu601[3][4] = {
+	{ 0x2000, 0x6926, 0x74fd, 0x010e },
+	{ 0x2000, 0x2cdd, 0x0000, 0x7e9a },
+	{ 0x2000, 0x0000, 0x38b4, 0x7e3b }
+};
+
 static void dw_hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset)
 {
 	switch (hdmi->reg_io_width) {
@@ -162,9 +181,52 @@ static void hdmi_audio_set_samplerate(struct dw_hdmi *hdmi, u32 pixel_clk)
  */
 static void hdmi_video_sample(struct dw_hdmi *hdmi)
 {
-	u32 color_format = 0x01;
+	u32 color_format;
 	uint val;
 
+	switch (hdmi->hdmi_data.enc_in_bus_format) {
+	case MEDIA_BUS_FMT_RGB888_1X24:
+		color_format = 0x01;
+		break;
+	case MEDIA_BUS_FMT_RGB101010_1X30:
+		color_format = 0x03;
+		break;
+	case MEDIA_BUS_FMT_RGB121212_1X36:
+		color_format = 0x05;
+		break;
+	case MEDIA_BUS_FMT_RGB161616_1X48:
+		color_format = 0x07;
+		break;
+	case MEDIA_BUS_FMT_YUV8_1X24:
+	case MEDIA_BUS_FMT_UYYVYY8_0_5X24:
+		color_format = 0x09;
+		break;
+	case MEDIA_BUS_FMT_YUV10_1X30:
+	case MEDIA_BUS_FMT_UYYVYY10_0_5X30:
+		color_format = 0x0B;
+		break;
+	case MEDIA_BUS_FMT_YUV12_1X36:
+	case MEDIA_BUS_FMT_UYYVYY12_0_5X36:
+		color_format = 0x0D;
+		break;
+	case MEDIA_BUS_FMT_YUV16_1X48:
+	case MEDIA_BUS_FMT_UYYVYY16_0_5X48:
+		color_format = 0x0F;
+		break;
+	case MEDIA_BUS_FMT_UYVY8_1X16:
+		color_format = 0x16;
+		break;
+	case MEDIA_BUS_FMT_UYVY10_1X20:
+		color_format = 0x14;
+		break;
+	case MEDIA_BUS_FMT_UYVY12_1X24:
+		color_format = 0x12;
+		break;
+	default:
+		color_format = 0x01;
+		break;
+	}
+
 	val = HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_DISABLE |
 	      ((color_format << HDMI_TX_INVID0_VIDEO_MAPPING_OFFSET) &
 	      HDMI_TX_INVID0_VIDEO_MAPPING_MASK);
@@ -457,6 +519,180 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
 	hdmi_write(hdmi, edid->vsync_len.typ, HDMI_FC_VSYNCINWIDTH);
 }
 
+static bool hdmi_bus_fmt_is_rgb(unsigned int bus_format)
+{
+	switch (bus_format) {
+	case MEDIA_BUS_FMT_RGB888_1X24:
+	case MEDIA_BUS_FMT_RGB101010_1X30:
+	case MEDIA_BUS_FMT_RGB121212_1X36:
+	case MEDIA_BUS_FMT_RGB161616_1X48:
+		return true;
+
+	default:
+		return false;
+	}
+}
+
+static bool hdmi_bus_fmt_is_yuv444(unsigned int bus_format)
+{
+	switch (bus_format) {
+	case MEDIA_BUS_FMT_YUV8_1X24:
+	case MEDIA_BUS_FMT_YUV10_1X30:
+	case MEDIA_BUS_FMT_YUV12_1X36:
+	case MEDIA_BUS_FMT_YUV16_1X48:
+		return true;
+
+	default:
+		return false;
+	}
+}
+
+static bool hdmi_bus_fmt_is_yuv422(unsigned int bus_format)
+{
+	switch (bus_format) {
+	case MEDIA_BUS_FMT_UYVY8_1X16:
+	case MEDIA_BUS_FMT_UYVY10_1X20:
+	case MEDIA_BUS_FMT_UYVY12_1X24:
+		return true;
+
+	default:
+		return false;
+	}
+}
+
+static int is_color_space_interpolation(struct dw_hdmi *hdmi)
+{
+	if (!hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_in_bus_format))
+		return 0;
+
+	if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format) ||
+	    hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format))
+		return 1;
+
+	return 0;
+}
+
+static int is_color_space_decimation(struct dw_hdmi *hdmi)
+{
+	if (!hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_out_bus_format))
+		return 0;
+
+	if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_in_bus_format) ||
+	    hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_in_bus_format))
+		return 1;
+
+	return 0;
+}
+
+static int hdmi_bus_fmt_color_depth(unsigned int bus_format)
+{
+	switch (bus_format) {
+	case MEDIA_BUS_FMT_RGB888_1X24:
+	case MEDIA_BUS_FMT_YUV8_1X24:
+	case MEDIA_BUS_FMT_UYVY8_1X16:
+	case MEDIA_BUS_FMT_UYYVYY8_0_5X24:
+		return 8;
+
+	case MEDIA_BUS_FMT_RGB101010_1X30:
+	case MEDIA_BUS_FMT_YUV10_1X30:
+	case MEDIA_BUS_FMT_UYVY10_1X20:
+	case MEDIA_BUS_FMT_UYYVYY10_0_5X30:
+		return 10;
+
+	case MEDIA_BUS_FMT_RGB121212_1X36:
+	case MEDIA_BUS_FMT_YUV12_1X36:
+	case MEDIA_BUS_FMT_UYVY12_1X24:
+	case MEDIA_BUS_FMT_UYYVYY12_0_5X36:
+		return 12;
+
+	case MEDIA_BUS_FMT_RGB161616_1X48:
+	case MEDIA_BUS_FMT_YUV16_1X48:
+	case MEDIA_BUS_FMT_UYYVYY16_0_5X48:
+		return 16;
+
+	default:
+		return 0;
+	}
+}
+
+static int is_color_space_conversion(struct dw_hdmi *hdmi)
+{
+	return hdmi->hdmi_data.enc_in_bus_format !=
+	       hdmi->hdmi_data.enc_out_bus_format;
+}
+
+static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi)
+{
+	const u16 (*csc_coeff)[3][4] = &csc_coeff_default;
+	unsigned int i;
+	u32 csc_scale = 1;
+
+	if (is_color_space_conversion(hdmi)) {
+		if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) {
+			csc_coeff = &csc_coeff_rgb_out_eitu601;
+		} else if (hdmi_bus_fmt_is_rgb(
+					hdmi->hdmi_data.enc_in_bus_format)) {
+			csc_coeff = &csc_coeff_rgb_in_eitu601;
+			csc_scale = 0;
+		}
+	}
+
+	/* The CSC registers are sequential, alternating MSB then LSB */
+	for (i = 0; i < ARRAY_SIZE(csc_coeff_default[0]); i++) {
+		u16 coeff_a = (*csc_coeff)[0][i];
+		u16 coeff_b = (*csc_coeff)[1][i];
+		u16 coeff_c = (*csc_coeff)[2][i];
+
+		hdmi_write(hdmi, coeff_a & 0xff, HDMI_CSC_COEF_A1_LSB + i * 2);
+		hdmi_write(hdmi, coeff_a >> 8, HDMI_CSC_COEF_A1_MSB + i * 2);
+		hdmi_write(hdmi, coeff_b & 0xff, HDMI_CSC_COEF_B1_LSB + i * 2);
+		hdmi_write(hdmi, coeff_b >> 8, HDMI_CSC_COEF_B1_MSB + i * 2);
+		hdmi_write(hdmi, coeff_c & 0xff, HDMI_CSC_COEF_C1_LSB + i * 2);
+		hdmi_write(hdmi, coeff_c >> 8, HDMI_CSC_COEF_C1_MSB + i * 2);
+	}
+
+	hdmi_mod(hdmi, HDMI_CSC_SCALE, HDMI_CSC_SCALE_CSCSCALE_MASK, csc_scale);
+}
+
+static void hdmi_video_csc(struct dw_hdmi *hdmi)
+{
+	int color_depth = 0;
+	int interpolation = HDMI_CSC_CFG_INTMODE_DISABLE;
+	int decimation = 0;
+
+	/* YCC422 interpolation to 444 mode */
+	if (is_color_space_interpolation(hdmi))
+		interpolation = HDMI_CSC_CFG_INTMODE_CHROMA_INT_FORMULA1;
+	else if (is_color_space_decimation(hdmi))
+		decimation = HDMI_CSC_CFG_DECMODE_CHROMA_INT_FORMULA3;
+
+	switch (hdmi_bus_fmt_color_depth(hdmi->hdmi_data.enc_out_bus_format)) {
+	case 8:
+		color_depth = HDMI_CSC_SCALE_CSC_COLORDE_PTH_24BPP;
+		break;
+	case 10:
+		color_depth = HDMI_CSC_SCALE_CSC_COLORDE_PTH_30BPP;
+		break;
+	case 12:
+		color_depth = HDMI_CSC_SCALE_CSC_COLORDE_PTH_36BPP;
+		break;
+	case 16:
+		color_depth = HDMI_CSC_SCALE_CSC_COLORDE_PTH_48BPP;
+		break;
+
+	default:
+		return;
+	}
+
+	/* Configure the CSC registers */
+	hdmi_write(hdmi, interpolation | decimation, HDMI_CSC_CFG);
+
+	hdmi_mod(hdmi, HDMI_CSC_SCALE, HDMI_CSC_SCALE_CSC_COLORDE_PTH_MASK,
+		 color_depth);
+
+	dw_hdmi_update_csc_coeffs(hdmi);
+}
+
 /* hdmi initialization step b.4 */
 static void hdmi_enable_video_path(struct dw_hdmi *hdmi, bool audio)
 {
@@ -483,6 +719,20 @@ static void hdmi_enable_video_path(struct dw_hdmi *hdmi, bool audio)
 	clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
 	hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS);
 
+	/* Enable csc path */
+	if (is_color_space_conversion(hdmi)) {
+		clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE;
+		hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS);
+	}
+
+	/* Enable color space conversion if needed */
+	if (is_color_space_conversion(hdmi))
+		hdmi_write(hdmi, HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_IN_PATH,
+			   HDMI_MC_FLOWCTRL);
+	else
+		hdmi_write(hdmi, HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_BYPASS,
+			   HDMI_MC_FLOWCTRL);
+
 	if (audio) {
 		clkdis &= ~HDMI_MC_CLKDIS_AUDCLK_DISABLE;
 		hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS);
@@ -736,6 +986,7 @@ int dw_hdmi_enable(struct dw_hdmi *hdmi, const struct display_timing *edid)
 	}
 
 	hdmi_video_packetize(hdmi);
+	hdmi_video_csc(hdmi);
 	hdmi_video_sample(hdmi);
 
 	hdmi_clear_overflow(hdmi);
include/dw_hdmi.h +72 -0

103 lines not on this page · raw message

include/media_bus_format.h new file +156 -0

156 lines not on this page · raw message

Signature · 1 line
2.20.1
Reviewed-by on v1 3/11
#6 lore raw

Re: [PATCH u-boot 03/11] video: dw_hdmi: add support for color conversion

Quoted 11 lines · On Tue, 15 Jan 2019 17:17:51 +0100 Neil Armstrong narmstrong at baylibre.com…

From: Jorge Ramirez-Ortiz <[email protected]>

Some IPs like the meson VPU can only feed a particular pixel format to dw_hdmi. As of now, the driver is hardcoded to use RGB888 as input.

This commit enables different pixel format inputs, with the appropriate CSC configuration.

--
Anatolij

#7 lore raw

PATCH 4/11 video: Add Meson Video Processing Unit Driver

In reply to Neil Armstrong

This adds video output support for Amlogic GXBB/GXL/GXM chips. The supported ports are CVBS and HDMI (based on DW_HDMI).

When using HDMI, only DMT modes are supported.

There is support for simple-framebuffer (CONFIG_VIDEO_DT_SIMPLEFB)

---
 arch/arm/include/asm/arch-meson/meson-vpu.h |   13 +
 drivers/video/Kconfig                       |    2 +
 drivers/video/Makefile                      |    1 +
 drivers/video/meson/Kconfig                 |   12 +
 drivers/video/meson/Makefile                |    9 +
 drivers/video/meson/meson_canvas.c          |   45 +
 drivers/video/meson/meson_dw_hdmi.c         |  445 ++++++
 drivers/video/meson/meson_dw_hdmi.h         |  134 ++
 drivers/video/meson/meson_plane.c           |  177 +++
 drivers/video/meson/meson_registers.h       | 1393 ++++++++++++++++++
 drivers/video/meson/meson_vclk.c            |  893 +++++++++++
 drivers/video/meson/meson_venc.c            | 1464 +++++++++++++++++++
 drivers/video/meson/meson_vpu.c             |  211 +++
 drivers/video/meson/meson_vpu.h             |   97 ++
 drivers/video/meson/meson_vpu_init.c        |  440 ++++++
 drivers/video/meson/simplefb_common.c       |   29 +
 drivers/video/meson/simplefb_common.h       |   21 +
 17 files changed, 5386 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-meson/meson-vpu.h
 create mode 100644 drivers/video/meson/Kconfig
 create mode 100644 drivers/video/meson/Makefile
 create mode 100644 drivers/video/meson/meson_canvas.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.h
 create mode 100644 drivers/video/meson/meson_plane.c
 create mode 100644 drivers/video/meson/meson_registers.h
 create mode 100644 drivers/video/meson/meson_vclk.c
 create mode 100644 drivers/video/meson/meson_venc.c
 create mode 100644 drivers/video/meson/meson_vpu.c
 create mode 100644 drivers/video/meson/meson_vpu.h
 create mode 100644 drivers/video/meson/meson_vpu_init.c
 create mode 100644 drivers/video/meson/simplefb_common.c
 create mode 100644 drivers/video/meson/simplefb_common.h
arch/arm/include/asm/arch-meson/meson-vpu.h new file +13 -0
new file mode 100644
index 0000000000..f31dfa6ad8
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2016 BayLibre, SAS
+ * Author: Maxime Jourdan <[email protected]>
+ */
+
+#ifndef __MESON_VPU_H__
+#define __MESON_VPU_H__
+
+/* Allow reserving the framebuffer memory region */
+void meson_vpu_rsv_fb(void *fdt);
+
+#endif /* __MESON_VPU_H__ */
drivers/video/Kconfig +2 -0
index 25c94f4a9e..2eac4b6381 100644
@@ -401,6 +401,8 @@ config VIDEO_LCD_SPI_MISO
 	option takes a string in the format understood by 'name_to_gpio'
 	function, e.g. PH1 for pin 1 of port H.
 
+source "drivers/video/meson/Kconfig"
+
 config VIDEO_MVEBU
 	bool "Armada XP LCD controller"
 	default n
drivers/video/Makefile +1 -0
index 80e1e82903..671f037c35 100644
@@ -52,6 +52,7 @@ obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o
 obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o
 obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o
 obj-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o
+obj-${CONFIG_VIDEO_MESON} += meson/
 obj-$(CONFIG_VIDEO_MVEBU) += mvebu_lcd.o
 obj-$(CONFIG_VIDEO_MX3) += mx3fb.o videomodes.o
 obj-$(CONFIG_VIDEO_MXS) += mxsfb.o videomodes.o
drivers/video/meson/Kconfig new file +12 -0
new file mode 100644
index 0000000000..0c9ddeb8b6
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2018 BayLibre, SAS
+#
+# Author: Neil Armstrong <[email protected]>
+
+config VIDEO_MESON
+	bool "Enable Amlogic Meson video support"
+	depends on DM_VIDEO
+	select DISPLAY
+	help
+	  Enable Amlogic Meson Video Processing Unit video support.
drivers/video/meson/Makefile new file +9 -0
new file mode 100644
index 0000000000..1e929b343e
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2018 BayLibre, SAS
+#
+# Author: Neil Armstrong <[email protected]>
+
+obj-$(CONFIG_VIDEO_MESON) = meson_vpu.o meson_vpu_init.o meson_canvas.o
+obj-$(CONFIG_VIDEO_MESON) += meson_plane.o meson_venc.o meson_vclk.o
+obj-$(CONFIG_VIDEO_MESON) += meson_dw_hdmi.o simplefb_common.o ../dw_hdmi.o
drivers/video/meson/meson_canvas.c new file +45 -0

45 lines not on this page · raw message

drivers/video/meson/meson_dw_hdmi.c new file +445 -0

445 lines not on this page · raw message

drivers/video/meson/meson_dw_hdmi.h new file +134 -0

134 lines not on this page · raw message

drivers/video/meson/meson_plane.c new file +177 -0

177 lines not on this page · raw message

drivers/video/meson/meson_registers.h new file +1393 -0

1,393 lines not on this page · raw message

drivers/video/meson/meson_vclk.c new file +893 -0

757 lines not on this page · raw message

drivers/video/meson/meson_venc.c new file +1464 -0

1,464 lines not on this page · raw message

drivers/video/meson/meson_vpu.c new file +211 -0

211 lines not on this page · raw message

drivers/video/meson/meson_vpu.h new file +97 -0

97 lines not on this page · raw message

drivers/video/meson/meson_vpu_init.c new file +440 -0

440 lines not on this page · raw message

drivers/video/meson/simplefb_common.c new file +29 -0
new file mode 100644
index 0000000000..81782326d4

Lines of this file are not shown. View the raw message.

drivers/video/meson/simplefb_common.h new file +21 -0
new file mode 100644
index 0000000000..9ea7b0486c

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.20.1

Part of the diff is not shown here. View the raw message.

Reviewed-by on v1 4/11
#8 lore raw

Re: [PATCH u-boot 04/11] video: Add Meson Video Processing Unit Driver

Quoted 10 lines · On Tue, 15 Jan 2019 17:17:52 +0100 Neil Armstrong narmstrong at baylibre.com…

This adds video output support for Amlogic GXBB/GXL/GXM chips. The supported ports are CVBS and HDMI (based on DW_HDMI).

When using HDMI, only DMT modes are supported.

There is support for simple-framebuffer (CONFIG_VIDEO_DT_SIMPLEFB)

Please see minor comment below.

Quoted 1 line
drivers/video/meson/meson_canvas.c +0 -0

...

drivers/video/meson/meson_canvas.c line 21

Quoted 11 lines
drivers/video/meson/meson_canvas.c +11 -0
+/* DMC Registers */
+#define DMC_CAV_LUT_DATAL	0x48 /* 0x12 offset in data sheet */
+#define CANVAS_WIDTH_LBIT	29
+#define CANVAS_WIDTH_LWID       3
+#define DMC_CAV_LUT_DATAH	0x4c /* 0x13 offset in data sheet */
+#define CANVAS_WIDTH_HBIT       0
+#define CANVAS_HEIGHT_BIT       9
+#define CANVAS_BLKMODE_BIT      24
+#define DMC_CAV_LUT_ADDR	0x50 /* 0x14 offset in data sheet */
+#define CANVAS_LUT_WR_EN        (0x2 << 8)
+#define CANVAS_LUT_RD_EN        (0x1 << 8)

Some define values are not aligned by tab here.

--
Anatolij

#9 lore raw

Re: [PATCH u-boot 04/11] video: Add Meson Video Processing Unit Driver

Hi Anatolij,

Quoted 20 lines · Anatolij Gustschin
Quoted 10 lines · On Tue, 15 Jan 2019 17:17:52 +0100 Neil Armstrong narmstrong at baylibre.com…

This adds video output support for Amlogic GXBB/GXL/GXM chips. The supported ports are CVBS and HDMI (based on DW_HDMI).

When using HDMI, only DMT modes are supported.

There is support for simple-framebuffer (CONFIG_VIDEO_DT_SIMPLEFB)

Please see minor comment below.

Quoted 1 line
drivers/video/meson/meson_canvas.c +0 -0

...

Quoted 13 lines

drivers/video/meson/meson_canvas.c line 21

Quoted 11 lines
drivers/video/meson/meson_canvas.c +11 -0
+/* DMC Registers */
+#define DMC_CAV_LUT_DATAL	0x48 /* 0x12 offset in data sheet */
+#define CANVAS_WIDTH_LBIT	29
+#define CANVAS_WIDTH_LWID       3
+#define DMC_CAV_LUT_DATAH	0x4c /* 0x13 offset in data sheet */
+#define CANVAS_WIDTH_HBIT       0
+#define CANVAS_HEIGHT_BIT       9
+#define CANVAS_BLKMODE_BIT      24
+#define DMC_CAV_LUT_ADDR	0x50 /* 0x14 offset in data sheet */
+#define CANVAS_LUT_WR_EN        (0x2 << 8)
+#define CANVAS_LUT_RD_EN        (0x1 << 8)

Some define values are not aligned by tab here.

Thanks for reviewing,

I'll fix it.

Do you mind if I push this serie via the amlogic custodian ?

Tom is it ok for you ?

Neil

Quoted 4 lines

--
Anatolij

#10 lore raw

Re: [PATCH u-boot 04/11] video: Add Meson Video Processing Unit Driver

Hi Neil,

On Tue, 29 Jan 2019 09:26:58 +0100
Neil Armstrong narmstrong at baylibre.com wrote:
...

Quoted 5 lines
Quoted 1 line

Some define values are not aligned by tab here.

Thanks for reviewing,

I'll fix it.

Thanks!

Quoted 1 line

Do you mind if I push this serie via the amlogic custodian ?

I'm okay if you push via amlogic tree.

--
Anatolij

#11 lore raw

PATCH 5/11 arm64: dts: meson-gx: vpu should be probed before relocation

In reply to Neil Armstrong

From: Maxime Jourdan <[email protected]>

Flag the appropriate nodes with u-boot,dm-pre-reloc

---
 arch/arm/dts/meson-gx-u-boot.dtsi                 | 15 +++++++++++++++
 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi     |  7 +++++++
 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi      |  7 +++++++
 .../dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi    |  7 +++++++
 .../dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi  |  7 +++++++
 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi     |  7 +++++++
 arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi    |  7 +++++++
 7 files changed, 57 insertions(+)
 create mode 100644 arch/arm/dts/meson-gx-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi
arch/arm/dts/meson-gx-u-boot.dtsi new file +15 -0
new file mode 100644
index 0000000000..868a573e2a
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Maxime Jourdan <[email protected]>
+ */
+
+/ {
+	soc {
+		u-boot,dm-pre-reloc;
+	};
+};
+
+&vpu {
+	u-boot,dm-pre-reloc;
+};
arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..c35158d7e9
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include "meson-gx-u-boot.dtsi"
arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..c35158d7e9
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include "meson-gx-u-boot.dtsi"
arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..c35158d7e9
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include "meson-gx-u-boot.dtsi"
arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..c35158d7e9
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include "meson-gx-u-boot.dtsi"
arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..c35158d7e9
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include "meson-gx-u-boot.dtsi"
arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..c35158d7e9
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS.
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include "meson-gx-u-boot.dtsi"
Signature · 1 line
2.20.1
#12 lore raw

PATCH 6/11 arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply

In reply to Neil Armstrong

The hdmi_5v regulator must be enabled to provide power to the physical HDMI PHY and enables the HDMI 5V presence loopback for the monitor.

Fixes b409f625a6d5 ("ARM64: dts: meson-gx: Add HDMI_5V regulator on selected boards")
[backport of linux commit e1f2163deac059ad39f07aba9e314ebe605d5a7a]
---
 arch/arm/dts/meson-gxl-s905x-khadas-vim.dts   | 1 +
 arch/arm/dts/meson-gxl-s905x-libretech-cc.dts | 1 +
 arch/arm/dts/meson-gxl-s905x-p212.dts         | 1 +
 arch/arm/dts/meson-gxm-khadas-vim2.dts        | 1 +
 4 files changed, 4 insertions(+)
arch/arm/dts/meson-gxl-s905x-khadas-vim.dts +1 -0
index d32cf38463..ceb34afe42 100644
@@ -78,6 +78,7 @@
 	status = "okay";
 	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
 	pinctrl-names = "default";
+	hdmi-supply = <&hdmi_5v>;
 };
 
 &hdmi_tx_tmds_port {
arch/arm/dts/meson-gxl-s905x-libretech-cc.dts +1 -0
index 90a56af967..a23252efc6 100644
@@ -155,6 +155,7 @@
 	status = "okay";
 	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
 	pinctrl-names = "default";
+	hdmi-supply = <&hdmi_5v>;
 };
 
 &hdmi_tx_tmds_port {
arch/arm/dts/meson-gxl-s905x-p212.dts +1 -0
index 5896e8a5d8..2602940c20 100644
@@ -51,6 +51,7 @@
 	status = "okay";
 	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
 	pinctrl-names = "default";
+	hdmi-supply = <&hdmi_5v>;
 };
 
 &hdmi_tx_tmds_port {
arch/arm/dts/meson-gxm-khadas-vim2.dts +1 -0
index 313f88f875..782e9edac8 100644
@@ -271,6 +271,7 @@
 	status = "okay";
 	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
 	pinctrl-names = "default";
+	hdmi-supply = <&hdmi_5v>;
 };
 
 &hdmi_tx_tmds_port {
Signature · 1 line
2.20.1
#13 lore raw

PATCH 7/11 arm64: dts: meson-gx: add hhi reg entry to hdmi_tx

In reply to Neil Armstrong

From: Maxime Jourdan <[email protected]>

There's no reliable way to reuse the hhi entry from the vpu as is done in the linux kernel, so we duplicate it here.

We will be able to sync against kernel DTS in the future when the VPU gets based on the clock framework rather than the HHI reg.

---
 arch/arm/dts/meson-gx-u-boot.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/dts/meson-gx-u-boot.dtsi +6 -0
index 868a573e2a..b84e5edba4 100644
@@ -13,3 +13,9 @@
 &vpu {
 	u-boot,dm-pre-reloc;
 };
+
+&hdmi_tx {
+	reg = <0x0 0xc883a000 0x0 0x1c>,
+	      <0x0 0xc883c000 0x0 0x1000>;
+	reg-names = "hdmitx", "hhi";
+};
Signature · 1 line
2.20.1
#14 lore raw

PATCH 8/11 arm: meson: board-gx: Setup VPU in fdt

In reply to Neil Armstrong

From: Maxime Jourdan <[email protected]>

If VIDEO_MESON is enabled, we need to setup the fdt for the framebuffer.

Call meson_vpu_rsv_fb() which reserves the framebuffer memory region for EFI, and sets up simple-framebuffer nodes if simplefb support is enabled.

---
 arch/arm/mach-meson/board-gx.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-meson/board-gx.c +5 -0
index e41552db52..5b0126a72e 100644
@@ -9,6 +9,7 @@
 #include <asm/arch/eth.h>
 #include <asm/arch/gx.h>
 #include <asm/arch/mem.h>
+#include <asm/arch/meson-vpu.h>
 #include <asm/io.h>
 #include <asm/armv8/mmu.h>
 #include <linux/sizes.h>
@@ -65,6 +66,10 @@ void meson_init_reserved_memory(void *fdt)
 	/* Add BL32 reserved zone */
 	if (bl32_start && bl32_size)
 		meson_board_add_reserved_memory(fdt, bl32_start, bl32_size);
+
+#if defined(CONFIG_VIDEO_MESON)
+	meson_vpu_rsv_fb(fdt);
+#endif
 }
 
 phys_size_t get_effective_memsize(void)
Signature · 1 line
2.20.1
Reviewed-by on v1 8/11
#15 lore raw

Re: [PATCH u-boot 08/11] arm: meson: board-gx: Setup VPU in fdt

Quoted 10 lines · On Tue, 15 Jan 2019 17:17:56 +0100 Neil Armstrong narmstrong at baylibre.com…

From: Maxime Jourdan <[email protected]>

If VIDEO_MESON is enabled, we need to setup the fdt for the framebuffer.

Call meson_vpu_rsv_fb() which reserves the framebuffer memory region for EFI, and sets up simple-framebuffer nodes if simplefb support is enabled.

--
Anatolij

#16 lore raw

PATCH 9/11 configs: meson64: use vidconsole and usbkbd if enabled

In reply to Neil Armstrong

Allows displaying the console via video and using a USB keyboard.

Also enables CONFIG_SPLASH_SCREEN if using video.

---
 include/configs/meson64.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
include/configs/meson64.h +23 -0
index 40ac079dfc..d82a674270 100644
@@ -16,6 +16,26 @@
 #define GICC_BASE			0xc4302000
 #endif
 
+/* For splashscreen */
+#ifdef CONFIG_DM_VIDEO
+#define CONFIG_VIDEO_BMP_RLE8
+#define CONFIG_BMP_16BPP
+#define CONFIG_BMP_24BPP
+#define CONFIG_BMP_32BPP
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_SPLASH_SCREEN_ALIGN
+#define STDOUT_CFG "vidconsole,serial"
+#else
+#define STDOUT_CFG "serial"
+#endif
+
+#ifdef CONFIG_USB_KEYBOARD
+#define STDIN_CFG "usbkbd,serial"
+#define CONFIG_PREBOOT "usb start"
+#else
+#define STDIN_CFG "serial"
+#endif
+
 #define CONFIG_CPU_ARMV8
 #define CONFIG_REMAKE_ELF
 #define CONFIG_ENV_SIZE			0x2000
@@ -59,6 +79,9 @@
 
 #ifndef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS \
+	"stdin=" STDIN_CFG "\0" \
+	"stdout=" STDOUT_CFG "\0" \
+	"stderr=" STDOUT_CFG "\0" \
 	"fdt_addr_r=0x08008000\0" \
 	"scriptaddr=0x08000000\0" \
 	"kernel_addr_r=0x08080000\0" \
Signature · 1 line
2.20.1
Reviewed-by on v1 9/11
#17 lore raw

Re: [PATCH u-boot 09/11] configs: meson64: use vidconsole and usbkbd if enabled

Quoted 6 lines · On Tue, 15 Jan 2019 17:17:57 +0100 Neil Armstrong narmstrong at baylibre.com…

Allows displaying the console via video and using a USB keyboard.

Also enables CONFIG_SPLASH_SCREEN if using video.

--
Anatolij

#18 lore raw

PATCH 10/11 arm: meson64: enable console mux and console env by default

In reply to Neil Armstrong

From: Maxime Jourdan <[email protected]>

With the recent addition of the meson VPU driver, enable the following config entries by default for meson-64 targets: CONFIG_CONSOLE_MUX, CONFIG_SYS_CONSOLE_IS_IN_ENV.

This allows outputting the console via video if CONFIG_VIDEO_MESON is selected.

---
 configs/khadas-vim2_defconfig  | 2 ++
 configs/khadas-vim_defconfig   | 2 ++
 configs/libretech-cc_defconfig | 2 ++
 configs/odroid-c2_defconfig    | 2 ++
 configs/p212_defconfig         | 2 ++
 5 files changed, 10 insertions(+)
configs/khadas-vim2_defconfig +2 -0
index 75514d2ca5..ed8e32776c 100644
@@ -44,3 +44,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
configs/khadas-vim_defconfig +2 -0
index cf87802653..add8e0973a 100644
@@ -49,3 +49,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
configs/libretech-cc_defconfig +2 -0
index c21b9ad9ca..c3fdca5e67 100644
@@ -49,3 +49,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
configs/odroid-c2_defconfig +2 -0
index 33e6e74fa2..60cf97b3b6 100644
@@ -38,3 +38,5 @@ CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_DEBUG_UART_SKIP_INIT=y
 CONFIG_MESON_SERIAL=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
configs/p212_defconfig +2 -0
index 2ab47e616f..d2c2da10f4 100644
@@ -48,3 +48,5 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
Signature · 1 line
2.20.1
Reviewed-by on v1 10/11
#19 lore raw

Re: [PATCH u-boot 10/11] arm: meson64: enable console mux and console env by default

Quoted 11 lines · On Tue, 15 Jan 2019 17:17:58 +0100 Neil Armstrong narmstrong at baylibre.com…

From: Maxime Jourdan <[email protected]>

With the recent addition of the meson VPU driver, enable the following config entries by default for meson-64 targets: CONFIG_CONSOLE_MUX, CONFIG_SYS_CONSOLE_IS_IN_ENV.

This allows outputting the console via video if CONFIG_VIDEO_MESON is selected.

--
Anatolij

#20 lore raw

PATCH 11/11 arm: libretech-cc: enable video by default

In reply to Neil Armstrong

From: Maxime Jourdan <[email protected]>

libretech-cc being the main device tested with CONFIG_VIDEO_MESON, let's enable it by default.

Also enable:
- CONFIG_SYS_WHITE_ON_BLACK for prettiness
- CONFIG_VIDEO_DT_SIMPLEFB for framebuffer sharing with kernel

---
 configs/libretech-cc_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)
configs/libretech-cc_defconfig +6 -0
index c3fdca5e67..fa01b15a0b 100644
@@ -51,3 +51,9 @@ CONFIG_USB_DWC3=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MESON_GX_VPU_POWER_DOMAIN=y
+CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_MESON=y
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_VIDEO_DT_SIMPLEFB=y
Signature · 1 line
2.20.1
Reviewed-by on v1 11/11
#21 lore raw

Re: [PATCH u-boot 11/11] arm: libretech-cc: enable video by default

Quoted 11 lines · On Tue, 15 Jan 2019 17:17:59 +0100 Neil Armstrong narmstrong at baylibre.com…

From: Maxime Jourdan <[email protected]>

libretech-cc being the main device tested with CONFIG_VIDEO_MESON, let's enable it by default.

Also enable:
- CONFIG_SYS_WHITE_ON_BLACK for prettiness
- CONFIG_VIDEO_DT_SIMPLEFB for framebuffer sharing with kernel

--
Anatolij

#22 lore raw
In reply to Neil Armstrong

Hi Anatolij, Tom,

Could you have a look at patches 2, 3 & 4 ?
Is there a more dedicated reviewer for this ?

Thanks,
Neil

Quoted 100 lines · Neil Armstrong

This patchset adds support for CVBS and/or HDMI output for Amlogic Meson GX SoCs (GXBB, GXL and GXM) based on the Linux Meson DRM driver ported to the U-Boot Video DM model. It supports only the "DMT" video modes reported by the monitors since AVI InfoFrame management is missing from the U-Boot video model.

The port includes some changes in the dw-hdmi driver to support custom PHY calls and support for the ColorSpace converter since the Amlogic Meson GX video pipeline can only output un YUV444 mode, thus activating the CSC is needed to output RGB for HDMI.

Video Support needs some tweaks in the DT like the u-boot,dm-pre-reloc for the VPU node and a tweak to access the HHI registers from the DW-HDMI glue driver. A port of a linux patch is also necessary to hook a regulator to enable HDMI.

Finally, it enables console mux and console env for all Amlogic boards and enabled Video Support for the Libre Computer AML-S905X-CC board.

Jorge Ramirez-Ortiz (2):
video: dw_hdmi: support SoC specific read/write ops
video: dw_hdmi: add support for color conversion

Maxime Jourdan (6):
power: domain: meson-gx-pwrc-vpu: add missing depends
arm64: dts: meson-gx: vpu should be probed before relocation
arm64: dts: meson-gx: add hhi reg entry to hdmi_tx
arm: meson: board-gx: Setup VPU in fdt
arm: meson64: enable console mux and console env by default
arm: libretech-cc: enable video by default

Neil Armstrong (3):
video: Add Meson Video Processing Unit Driver
arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply
configs: meson64: use vidconsole and usbkbd if enabled

 arch/arm/dts/meson-gx-u-boot.dtsi             |   21 +
 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi |    7 +
 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi  |    7 +
 .../meson-gxl-s905x-khadas-vim-u-boot.dtsi    |    7 +
 arch/arm/dts/meson-gxl-s905x-khadas-vim.dts   |    1 +
 .../meson-gxl-s905x-libretech-cc-u-boot.dtsi  |    7 +
 arch/arm/dts/meson-gxl-s905x-libretech-cc.dts |    1 +
 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi |    7 +
 arch/arm/dts/meson-gxl-s905x-p212.dts         |    1 +
 .../arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi |    7 +
 arch/arm/dts/meson-gxm-khadas-vim2.dts        |    1 +
 arch/arm/include/asm/arch-meson/meson-vpu.h   |   13 +
 arch/arm/mach-meson/board-gx.c                |    5 +
 configs/khadas-vim2_defconfig                 |    2 +
 configs/khadas-vim_defconfig                  |    2 +
 configs/libretech-cc_defconfig                |    8 +
 configs/odroid-c2_defconfig                   |    2 +
 configs/p212_defconfig                        |    2 +
 drivers/power/domain/Kconfig                  |    2 +-
 drivers/video/Kconfig                         |    2 +
 drivers/video/Makefile                        |    1 +
 drivers/video/dw_hdmi.c                       |  267 ++-
 drivers/video/meson/Kconfig                   |   12 +
 drivers/video/meson/Makefile                  |    9 +
 drivers/video/meson/meson_canvas.c            |   45 +
 drivers/video/meson/meson_dw_hdmi.c           |  445 +++++
 drivers/video/meson/meson_dw_hdmi.h           |  134 ++
 drivers/video/meson/meson_plane.c             |  177 ++
 drivers/video/meson/meson_registers.h         | 1393 ++++++++++++++++
 drivers/video/meson/meson_vclk.c              |  893 ++++++++++
 drivers/video/meson/meson_venc.c              | 1464 +++++++++++++++++
 drivers/video/meson/meson_vpu.c               |  211 +++
 drivers/video/meson/meson_vpu.h               |   97 ++
 drivers/video/meson/meson_vpu_init.c          |  440 +++++
 drivers/video/meson/simplefb_common.c         |   29 +
 drivers/video/meson/simplefb_common.h         |   21 +
 include/configs/meson64.h                     |   23 +
 include/dw_hdmi.h                             |   74 +
 include/media_bus_format.h                    |  156 ++
 39 files changed, 5992 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/meson-gx-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-nanopi-k2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi
 create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi
 create mode 100644 arch/arm/include/asm/arch-meson/meson-vpu.h
 create mode 100644 drivers/video/meson/Kconfig
 create mode 100644 drivers/video/meson/Makefile
 create mode 100644 drivers/video/meson/meson_canvas.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.c
 create mode 100644 drivers/video/meson/meson_dw_hdmi.h
 create mode 100644 drivers/video/meson/meson_plane.c
 create mode 100644 drivers/video/meson/meson_registers.h
 create mode 100644 drivers/video/meson/meson_vclk.c
 create mode 100644 drivers/video/meson/meson_venc.c
 create mode 100644 drivers/video/meson/meson_vpu.c
 create mode 100644 drivers/video/meson/meson_vpu.h
 create mode 100644 drivers/video/meson/meson_vpu_init.c
 create mode 100644 drivers/video/meson/simplefb_common.c
 create mode 100644 drivers/video/meson/simplefb_common.h
 create mode 100644 include/media_bus_format.h