Skip to content

Commit

Permalink
meson: edge: refresh patches
Browse files Browse the repository at this point in the history
  • Loading branch information
hzyitc committed Nov 18, 2023
1 parent d46851f commit e56cf50
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
meson8/meson8b/meson8m2: Support HDMI
From 7c9bee96b281696f69ac1b45c423156919a1c3a6 Mon Sep 17 00:00:00 2001
From: Martin Blumenstingl <[email protected]>
Date: Sat, 18 Nov 2023 01:22:02 +0800
Subject: [PATCH 1/3] meson8/meson8b/meson8m2: Support HDMI

The following codes are come from https://github.com/xdarklight/linux/commits/meson-mx-integration-5.18-20220516.

Expand All @@ -13,7 +16,7 @@ Special thank to Martin Blumenstingl.
arch/arm/boot/dts/amlogic/meson8m2.dtsi | 4 +
drivers/gpu/drm/meson/Kconfig | 9 +
drivers/gpu/drm/meson/Makefile | 1 +
drivers/gpu/drm/meson/meson_drv.c | 315 +++-
drivers/gpu/drm/meson/meson_drv.c | 313 +++-
drivers/gpu/drm/meson/meson_drv.h | 49 +-
drivers/gpu/drm/meson/meson_encoder_cvbs.c | 61 +-
drivers/gpu/drm/meson/meson_encoder_hdmi.c | 69 +-
Expand All @@ -26,14 +29,14 @@ Special thank to Martin Blumenstingl.
drivers/phy/amlogic/Kconfig | 10 +
drivers/phy/amlogic/Makefile | 1 +
drivers/phy/amlogic/phy-meson-cvbs-dac.c | 375 ++++
21 files changed, 3577 insertions(+), 126 deletions(-)
21 files changed, 3576 insertions(+), 125 deletions(-)
create mode 100644 Documentation/devicetree/bindings/phy/amlogic,meson-cvbs-dac-phy.yaml
create mode 100644 drivers/gpu/drm/meson/meson_transwitch_hdmi.c
create mode 100644 drivers/gpu/drm/meson/meson_transwitch_hdmi.h
create mode 100644 drivers/phy/amlogic/phy-meson-cvbs-dac.c

diff --git a/Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml b/Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml
index 0c72120a..160b84f8 100644
index cb0a90f0..96c32747 100644
--- a/Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml
+++ b/Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml
@@ -66,8 +66,12 @@ properties:
Expand Down Expand Up @@ -65,7 +68,7 @@ index 0c72120a..160b84f8 100644
power-domains:
maxItems: 1
description: phandle to the associated power domain
@@ -125,6 +138,9 @@ examples:
@@ -130,6 +143,9 @@ examples:
#size-cells = <0>;
amlogic,canvas = <&canvas>;

Expand Down Expand Up @@ -187,7 +190,7 @@ index 8e3860d5..9a56cdf7 100644

aiu: audio-controller@5400 {
diff --git a/arch/arm/boot/dts/amlogic/meson8.dtsi b/arch/arm/boot/dts/amlogic/meson8.dtsi
index 4f22ab45..a9ed099f 100644
index 59932fbf..6c27d520 100644
--- a/arch/arm/boot/dts/amlogic/meson8.dtsi
+++ b/arch/arm/boot/dts/amlogic/meson8.dtsi
@@ -314,6 +314,113 @@ mali: gpu@c0000 {
Expand Down Expand Up @@ -423,7 +426,7 @@ index 4f22ab45..a9ed099f 100644

&hwrng {
diff --git a/arch/arm/boot/dts/amlogic/meson8b.dtsi b/arch/arm/boot/dts/amlogic/meson8b.dtsi
index 5979209f..e75d07b5 100644
index 5198f517..da9216ee 100644
--- a/arch/arm/boot/dts/amlogic/meson8b.dtsi
+++ b/arch/arm/boot/dts/amlogic/meson8b.dtsi
@@ -276,6 +276,116 @@ mali: gpu@c0000 {
Expand Down Expand Up @@ -677,7 +680,7 @@ index 6725dd9f..fcb2ad97 100644
compatible = "amlogic,meson8m2-wdt", "amlogic,meson8b-wdt";
};
diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
index 823909da..ba9f1bc8 100644
index 615fdd0c..eff3e34b 100644
--- a/drivers/gpu/drm/meson/Kconfig
+++ b/drivers/gpu/drm/meson/Kconfig
@@ -10,6 +10,7 @@ config DRM_MESON
Expand All @@ -688,7 +691,7 @@ index 823909da..ba9f1bc8 100644

config DRM_MESON_DW_HDMI
tristate "HDMI Synopsys Controller support for Amlogic Meson Display"
@@ -17,3 +18,11 @@ config DRM_MESON_DW_MIPI_DSI
@@ -24,3 +25,11 @@ config DRM_MESON_DW_MIPI_DSI
default y if DRM_MESON
select DRM_DW_MIPI_DSI
select GENERIC_PHY_MIPI_DPHY
Expand All @@ -701,16 +704,16 @@ index 823909da..ba9f1bc8 100644
+ select REGMAP_MMIO
+ select SND_SOC_HDMI_CODEC if SND_SOC
diff --git a/drivers/gpu/drm/meson/Makefile b/drivers/gpu/drm/meson/Makefile
index 3afa31bd..817a5270 100644
index 43071bdb..c44cb6c5 100644
--- a/drivers/gpu/drm/meson/Makefile
+++ b/drivers/gpu/drm/meson/Makefile
@@ -6,3 +6,4 @@ meson-drm-y += meson_encoder_hdmi.o
@@ -7,3 +7,4 @@ meson-drm-y += meson_encoder_hdmi.o meson_encoder_dsi.o
obj-$(CONFIG_DRM_MESON) += meson-drm.o
obj-$(CONFIG_DRM_MESON_DW_HDMI) += meson_dw_hdmi.o
obj-$(CONFIG_DRM_MESON_DW_MIPI_DSI) += meson_dw_mipi_dsi.o
+obj-$(CONFIG_DRM_MESON_TRANSWITCH_HDMI) += meson_transwitch_hdmi.o
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index bb72fda9..15f019ac 100644
index cb674966..e8134e4c 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -12,6 +12,7 @@
Expand All @@ -721,7 +724,7 @@ index bb72fda9..15f019ac 100644
#include <linux/platform_device.h>
#include <linux/soc/amlogic/meson-canvas.h>

@@ -132,30 +133,147 @@ static struct regmap_config meson_regmap_config = {
@@ -133,30 +134,147 @@ static struct regmap_config meson_regmap_config = {
.max_register = 0x1000,
};

Expand Down Expand Up @@ -888,7 +891,7 @@ index bb72fda9..15f019ac 100644
}

struct meson_drm_soc_attr {
@@ -164,13 +282,29 @@ struct meson_drm_soc_attr {
@@ -165,13 +283,29 @@ struct meson_drm_soc_attr {
};

static const struct meson_drm_soc_attr meson_drm_soc_attrs[] = {
Expand Down Expand Up @@ -919,7 +922,7 @@ index bb72fda9..15f019ac 100644
{ /* sentinel */ }
}
},
@@ -211,67 +345,123 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
@@ -212,67 +346,123 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
priv->compat = match->compat;
priv->afbcd.ops = match->afbcd_ops;

Expand Down Expand Up @@ -1066,9 +1069,9 @@ index bb72fda9..15f019ac 100644

/* Assign limits per soc revision/package */
for (i = 0 ; i < ARRAY_SIZE(meson_drm_soc_attrs) ; ++i) {
@@ -287,11 +477,11 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
@@ -288,11 +478,11 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
*/
ret = drm_aperture_remove_framebuffers(false, &meson_driver);
ret = drm_aperture_remove_framebuffers(&meson_driver);
if (ret)
- goto free_drm;
+ goto exit_cvbs_dac_phy;
Expand All @@ -1080,7 +1083,7 @@ index bb72fda9..15f019ac 100644
drm->mode_config.max_width = 3840;
drm->mode_config.max_height = 2160;
drm->mode_config.funcs = &meson_mode_config_funcs;
@@ -306,7 +496,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
@@ -307,7 +497,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
if (priv->afbcd.ops) {
ret = priv->afbcd.ops->init(priv);
if (ret)
Expand All @@ -1089,7 +1092,7 @@ index bb72fda9..15f019ac 100644
}

/* Encoder Initialization */
@@ -353,7 +543,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
@@ -362,7 +552,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
if (ret)
goto uninstall_irq;

Expand All @@ -1098,7 +1101,7 @@ index bb72fda9..15f019ac 100644

return 0;

@@ -365,6 +555,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
@@ -371,6 +561,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
exit_afbcd:
if (priv->afbcd.ops)
priv->afbcd.ops->exit(priv);
Expand All @@ -1109,7 +1112,7 @@ index bb72fda9..15f019ac 100644
free_drm:
drm_dev_put(drm);

@@ -401,6 +595,10 @@ static void meson_drv_unbind(struct device *dev)
@@ -415,6 +609,10 @@ static void meson_drv_unbind(struct device *dev)

if (priv->afbcd.ops)
priv->afbcd.ops->exit(priv);
Expand All @@ -1120,7 +1123,7 @@ index bb72fda9..15f019ac 100644
}

static const struct component_master_ops meson_drv_master_ops = {
@@ -415,6 +613,8 @@ static int __maybe_unused meson_drv_pm_suspend(struct device *dev)
@@ -429,6 +627,8 @@ static int __maybe_unused meson_drv_pm_suspend(struct device *dev)
if (!priv)
return 0;

Expand All @@ -1129,16 +1132,16 @@ index bb72fda9..15f019ac 100644
return drm_mode_config_helper_suspend(priv->drm);
}

@@ -425,6 +625,7 @@ static int __maybe_unused meson_drv_pm_resume(struct device *dev)
@@ -439,6 +639,7 @@ static int __maybe_unused meson_drv_pm_resume(struct device *dev)
if (!priv)
return 0;

+ meson_video_clock_init(priv);
meson_vpu_init(priv);
meson_venc_init(priv);
meson_vpp_init(priv);
@@ -507,6 +708,18 @@ static int meson_drv_remove(struct platform_device *pdev)
return 0;
@@ -521,6 +722,18 @@ static void meson_drv_remove(struct platform_device *pdev)
component_master_del(&pdev->dev, &meson_drv_master_ops);
}

+static struct meson_drm_match_data meson_drm_m8_data = {
Expand All @@ -1156,7 +1159,7 @@ index bb72fda9..15f019ac 100644
static struct meson_drm_match_data meson_drm_gxbb_data = {
.compat = VPU_COMPATIBLE_GXBB,
};
@@ -526,6 +739,12 @@ static struct meson_drm_match_data meson_drm_g12a_data = {
@@ -540,6 +753,12 @@ static struct meson_drm_match_data meson_drm_g12a_data = {
};

static const struct of_device_id dt_match[] = {
Expand All @@ -1170,7 +1173,7 @@ index bb72fda9..15f019ac 100644
.data = (void *)&meson_drm_gxbb_data },
{ .compatible = "amlogic,meson-gxl-vpu",
diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meson_drv.h
index c62ee358..fe0a8f87 100644
index 3f9345c1..59f80fcc 100644
--- a/drivers/gpu/drm/meson/meson_drv.h
+++ b/drivers/gpu/drm/meson/meson_drv.h
@@ -7,21 +7,28 @@
Expand Down Expand Up @@ -1372,10 +1375,10 @@ index 3f73b211..833f701f 100644
.get_modes = meson_encoder_cvbs_get_modes,
.atomic_enable = meson_encoder_cvbs_atomic_enable,
diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
index 53231bfd..f950c557 100644
index 25ea7655..a3e6f86e 100644
--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
@@ -188,13 +188,13 @@ static void meson_encoder_hdmi_atomic_enable(struct drm_bridge *bridge,
@@ -190,13 +190,13 @@ static void meson_encoder_hdmi_atomic_enable(struct drm_bridge *bridge,
{
struct meson_encoder_hdmi *encoder_hdmi = bridge_to_meson_encoder_hdmi(bridge);
struct drm_atomic_state *state = bridge_state->base.state;
Expand All @@ -1390,7 +1393,7 @@ index 53231bfd..f950c557 100644
int vic;

connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
@@ -215,7 +215,14 @@ static void meson_encoder_hdmi_atomic_enable(struct drm_bridge *bridge,
@@ -217,7 +217,14 @@ static void meson_encoder_hdmi_atomic_enable(struct drm_bridge *bridge,

dev_dbg(priv->dev, "\"%s\" vic %d\n", mode->name, vic);

Expand All @@ -1406,7 +1409,7 @@ index 53231bfd..f950c557 100644
ycrcb_map = VPU_HDMI_OUTPUT_CRYCB;
yuv420_mode = true;
} else if (encoder_hdmi->output_bus_fmt == MEDIA_BUS_FMT_UYVY8_1X16)
@@ -227,17 +234,22 @@ static void meson_encoder_hdmi_atomic_enable(struct drm_bridge *bridge,
@@ -229,17 +236,22 @@ static void meson_encoder_hdmi_atomic_enable(struct drm_bridge *bridge,
/* VCLK Set clock */
meson_encoder_hdmi_set_vclk(encoder_hdmi, mode);

Expand Down Expand Up @@ -1440,7 +1443,7 @@ index 53231bfd..f950c557 100644

dev_dbg(priv->dev, "%s\n", priv->venc.hdmi_use_enci ? "VENCI" : "VENCP");

@@ -260,7 +272,11 @@ static void meson_encoder_hdmi_atomic_disable(struct drm_bridge *bridge,
@@ -262,7 +274,11 @@ static void meson_encoder_hdmi_atomic_disable(struct drm_bridge *bridge,
writel_relaxed(0, priv->io_base + _REG(ENCP_VIDEO_EN));
}

Expand All @@ -1453,7 +1456,7 @@ index 53231bfd..f950c557 100644
MEDIA_BUS_FMT_YUV8_1X24,
MEDIA_BUS_FMT_UYVY8_1X16,
MEDIA_BUS_FMT_UYYVYY8_0_5X24,
@@ -274,13 +290,27 @@ meson_encoder_hdmi_get_inp_bus_fmts(struct drm_bridge *bridge,
@@ -276,13 +292,27 @@ meson_encoder_hdmi_get_inp_bus_fmts(struct drm_bridge *bridge,
u32 output_fmt,
unsigned int *num_input_fmts)
{
Expand Down Expand Up @@ -1483,7 +1486,7 @@ index 53231bfd..f950c557 100644
*num_input_fmts = 1;
input_fmts = kcalloc(*num_input_fmts,
sizeof(*input_fmts),
@@ -432,8 +462,11 @@ int meson_encoder_hdmi_init(struct meson_drm *priv)
@@ -436,8 +466,11 @@ int meson_encoder_hdmi_init(struct meson_drm *priv)

drm_connector_attach_max_bpc_property(meson_encoder_hdmi->connector, 8, 8);

Expand Down Expand Up @@ -3874,10 +3877,10 @@ index 2a82119e..a2c1bf1a 100644
meson_venci_cvbs_clock_config(priv);
return;
diff --git a/drivers/gpu/drm/meson/meson_venc.c b/drivers/gpu/drm/meson/meson_venc.c
index fcd532db..b28d4890 100644
index 3bf0d6e4..d834359c 100644
--- a/drivers/gpu/drm/meson/meson_venc.c
+++ b/drivers/gpu/drm/meson/meson_venc.c
@@ -60,10 +60,6 @@
@@ -62,10 +62,6 @@

/* HHI Registers */
#define HHI_GCLK_MPEG2 0x148 /* 0x52 offset in data sheet */
Expand All @@ -3888,7 +3891,7 @@ index fcd532db..b28d4890 100644
#define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 offset in data sheet */

struct meson_cvbs_enci_mode meson_cvbs_enci_pal = {
@@ -1749,31 +1745,47 @@ void meson_venc_enable_vsync(struct meson_drm *priv)
@@ -1957,31 +1953,47 @@ void meson_venc_enable_vsync(struct meson_drm *priv)
writel_relaxed(VENC_INTCTRL_ENCI_LNRST_INT_EN,
priv->io_base + _REG(VENC_INTCTRL));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
meson8/meson8b/meson8m2: drm: Forcefully enable XRGB format
From bea6640cf697b0ed3aa501cbf433366025f3522a Mon Sep 17 00:00:00 2001
From: hzy <[email protected]>
Date: Sat, 18 Nov 2023 01:22:03 +0800
Subject: [PATCH 2/3] meson8/meson8b/meson8m2: drm: Forcefully enable XRGB format

Signed-off-by: hzy <[email protected]>
---
drivers/gpu/drm/meson/meson_plane.c | 2 ++
1 file changed, 2 insertions(+)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 52f7e89824d04588df6b634aaf815001d0f33c19 Mon Sep 17 00:00:00 2001
From cb981ffba971bc50770dd4d816f42b3d2467211c Mon Sep 17 00:00:00 2001
From: hzy <[email protected]>
Date: Fri, 17 Nov 2023 22:54:18 +0800
Subject: [PATCH 3/3] drm/meson: Support meson{8,8b}-hdmi-tx components
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Revert "mmc: core: Set HS clock speed before sending HS CMD13"
From bde767e5a71e397dd4488de48d6b323d2916f477 Mon Sep 17 00:00:00 2001
From: hzy <[email protected]>
Date: Sat, 18 Nov 2023 01:22:04 +0800
Subject: [PATCH] Revert "mmc: core: Set HS clock speed before sending HS CMD13"

This reverts commit 4bc31edebde51fcf8ad0794763b8679a7ecb5ec0.

---
drivers/mmc/core/mmc.c | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 89cd48fc..a776ac64 100644
index 4a4bab9a..2af8f1e5 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1391,17 +1391,13 @@ static int mmc_select_hs400es(struct mmc_card *card)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
Revert "pwm: meson: modify and simplify calculation in meson_pwm_get_state"
From 764701e2399b2fa66991e4339e3735a836203c87 Mon Sep 17 00:00:00 2001
From: hzy <[email protected]>
Date: Sat, 18 Nov 2023 01:22:04 +0800
Subject: [PATCH] Revert "pwm: meson: modify and simplify calculation in meson_pwm_get_state"

This reverts commit 6b9352f3f8a1a35faf0efc1ad1807ee303467796.
---
drivers/pwm/pwm-meson.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index 33107204a951..1d0b69d08cdd 100644
index 25519cdd..63cf9719 100644
--- a/drivers/pwm/pwm-meson.c
+++ b/drivers/pwm/pwm-meson.c
@@ -351,8 +351,18 @@ static int meson_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
@@ -322,8 +322,18 @@ static int meson_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
channel->lo = FIELD_GET(PWM_LOW_MASK, value);
channel->hi = FIELD_GET(PWM_HIGH_MASK, value);

Expand Down
6 changes: 3 additions & 3 deletions patch/kernel/archive/meson-6.6/odroidc1-dts-Enable-HDMI.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 9e961c5c05f0b90d1fde647c996077c84d198157 Mon Sep 17 00:00:00 2001
From e9d0d7bb75ff8234d717fb640c020ffe303a8d11 Mon Sep 17 00:00:00 2001
From: Martin Blumenstingl <[email protected]>
Date: Fri, 20 Mar 2020 15:17:51 +0100
Subject: [PATCH 57/89] ARM: dts: meson8b: odroid-c1: enable HDMI for the
Subject: [PATCH] ARM: dts: meson8b: odroid-c1: enable HDMI for the
Odroid-C1 - WiP

WiP

Signed-off-by: Martin Blumenstingl <[email protected]>
---
arch/arm/boot/dts/amlogic/meson8b-odroidc1.dts | 59 ++++++++++++++++++++++++++
.../arm/boot/dts/amlogic/meson8b-odroidc1.dts | 59 +++++++++++++++++++
1 file changed, 59 insertions(+)

diff --git a/arch/arm/boot/dts/amlogic/meson8b-odroidc1.dts b/arch/arm/boot/dts/amlogic/meson8b-odroidc1.dts
Expand Down
Loading

0 comments on commit e56cf50

Please sign in to comment.