difos/target/linux/bcm27xx/patches-6.12/950-0614-drm-vc4-drv-Add-support-for-2712-D-step.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

62 lines
2.3 KiB
Diff

From 95a86603ec34cf26af3ba4178ffc94dd99fbfe69 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 25 Oct 2024 18:15:53 +0100
Subject: [PATCH] drm/vc4: drv: Add support for 2712 D-step
Add in the compatible string and VC4_GEN_ enum for the D-step
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241025-drm-vc4-2712-support-v2-22-35efa83c8fc0@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_drv.c | 1 +
drivers/gpu/drm/vc4/vc4_drv.h | 1 +
drivers/gpu/drm/vc4/vc4_hvs.c | 4 ++++
drivers/gpu/drm/vc4/vc4_regs.h | 3 +++
4 files changed, 9 insertions(+)
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -462,6 +462,7 @@ static void vc4_platform_drm_shutdown(st
static const struct of_device_id vc4_of_match[] = {
{ .compatible = "brcm,bcm2711-vc5", .data = (void *)VC4_GEN_5 },
+ /* NB GEN_6_C will be corrected on D0 hw to GEN_6_D via vc4_hvs_bind */
{ .compatible = "brcm,bcm2712-vc6", .data = (void *)VC4_GEN_6_C },
{ .compatible = "brcm,bcm2835-vc4", .data = (void *)VC4_GEN_4 },
{ .compatible = "brcm,cygnus-vc4", .data = (void *)VC4_GEN_4 },
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -85,6 +85,7 @@ enum vc4_gen {
VC4_GEN_4,
VC4_GEN_5,
VC4_GEN_6_C,
+ VC4_GEN_6_D,
};
struct vc4_dev {
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
@@ -1532,6 +1532,10 @@ static int vc4_hvs_bind(struct device *d
if (vc4->gen >= VC4_GEN_6_C) {
hvs->regset.regs = vc6_hvs_regs;
hvs->regset.nregs = ARRAY_SIZE(vc6_hvs_regs);
+
+ if (VC4_GET_FIELD(HVS_READ(SCALER6_VERSION), SCALER6_VERSION) ==
+ SCALER6_VERSION_D0)
+ vc4->gen = VC4_GEN_6_D;
} else {
hvs->regset.regs = vc4_hvs_regs;
hvs->regset.nregs = ARRAY_SIZE(vc4_hvs_regs);
--- a/drivers/gpu/drm/vc4/vc4_regs.h
+++ b/drivers/gpu/drm/vc4/vc4_regs.h
@@ -527,6 +527,9 @@
#define SCALER5_DLIST_START 0x00004000
#define SCALER6_VERSION 0x00000000
+# define SCALER6_VERSION_MASK VC4_MASK(7, 0)
+# define SCALER6_VERSION_C0 0x00000053
+# define SCALER6_VERSION_D0 0x00000054
#define SCALER6_CXM_SIZE 0x00000004
#define SCALER6_LBM_SIZE 0x00000008
#define SCALER6_UBM_SIZE 0x0000000c