1 From 831c6e8c68a66678e8329a382823dc83c483dcc8 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 27 Apr 2023 09:30:49 +0200
4 Subject: [PATCH] drm/vc4: txp: Add support for BCM2712 MOP
6 The BCM2712 has an evolution of what used to be called TXP in the
7 earlier SoCs, but is now called MOP.
9 There's a few differences still, so we can add a new compatible to deal
12 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
14 drivers/gpu/drm/vc4/vc4_txp.c | 18 +++++++++++++++++-
15 1 file changed, 17 insertions(+), 1 deletion(-)
17 --- a/drivers/gpu/drm/vc4/vc4_txp.c
18 +++ b/drivers/gpu/drm/vc4/vc4_txp.c
19 @@ -388,6 +388,7 @@ static const struct drm_connector_funcs
20 static void vc4_txp_encoder_disable(struct drm_encoder *encoder)
22 struct drm_device *drm = encoder->dev;
23 + struct vc4_dev *vc4 = to_vc4_dev(drm);
24 struct vc4_txp *txp = encoder_to_vc4_txp(encoder);
27 @@ -406,7 +407,8 @@ static void vc4_txp_encoder_disable(stru
28 WARN_ON(TXP_READ(TXP_DST_CTRL) & TXP_BUSY);
31 - TXP_WRITE(TXP_DST_CTRL, TXP_POWERDOWN);
32 + if (vc4->gen < VC4_GEN_6)
33 + TXP_WRITE(TXP_DST_CTRL, TXP_POWERDOWN);
37 @@ -510,6 +512,19 @@ static irqreturn_t vc4_txp_interrupt(int
41 +const struct vc4_txp_data bcm2712_mop_data = {
44 + .debugfs_name = "mop_regs",
45 + .hvs_available_channels = BIT(2),
48 + .encoder_type = VC4_ENCODER_TYPE_TXP0,
49 + .has_byte_enable = true,
50 + .size_minus_one = true,
51 + .supports_40bit_addresses = true,
54 const struct vc4_txp_data bcm2835_txp_data = {
57 @@ -616,6 +631,7 @@ static int vc4_txp_remove(struct platfor
60 static const struct of_device_id vc4_txp_dt_match[] = {
61 + { .compatible = "brcm,bcm2712-mop", .data = &bcm2712_mop_data },
62 { .compatible = "brcm,bcm2835-txp", .data = &bcm2835_txp_data },