]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/vc4: drv: Add support for 2712 D-step
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Fri, 25 Oct 2024 17:15:53 +0000 (18:15 +0100)
committerDave Stevenson <dave.stevenson@raspberrypi.com>
Wed, 27 Nov 2024 14:37:20 +0000 (14:37 +0000)
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
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_hvs.c
drivers/gpu/drm/vc4/vc4_regs.h

index 3f3e1a2860478fd261279fc59c544ded7c1804cc..ee5df153c2a611da3c6aca642ab9a72879ab3086 100644 (file)
@@ -466,6 +466,7 @@ static void vc4_platform_drm_shutdown(struct platform_device *pdev)
 
 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 },
index de2107e593c2b39d63a03a75c6b1670cdcdbef96..e3983a44e35ea1891cf1a49cc044836245928968 100644 (file)
@@ -85,6 +85,7 @@ enum vc4_gen {
        VC4_GEN_4,
        VC4_GEN_5,
        VC4_GEN_6_C,
+       VC4_GEN_6_D,
 };
 
 struct vc4_dev {
index 7c2dccfdb58db78aacf6e578764f1d47afb16335..a353b51243a5dc716a6276c221c3dc10a66fed3a 100644 (file)
@@ -1532,6 +1532,10 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
        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);
index 731b13742ef5bf646e68f63ef83c0f983da8c40d..df44a4a4009fffcdd0641005ed75978a99bf9af1 100644 (file)
 #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