]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/ast: Use constants for A2P registers
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 27 Mar 2026 13:32:58 +0000 (14:32 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 8 Apr 2026 09:04:48 +0000 (11:04 +0200)
A2P is the AHB-to-P Bridge. A2P registers are located at the memory
range at [0x1e720000, 0x1e73ffff]. Refer to them with constants named
AST_REG_A2P<n>, where <n> is the byte offset into the range.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patch.msgid.link/20260327133532.79696-7-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_2300.c
drivers/gpu/drm/ast/ast_reg.h

index 1fe947178124eaf88b3c0e063f30ed8fd84bb3d8..96d9909d942c4bd2c56ab6fee9c20d3e32397ef5 100644 (file)
@@ -508,7 +508,7 @@ CBR_DONE2:
        dlli  = (dllmin[1] + dllmax[1]) >> 1;
        dlli <<= 8;
        dlli += (dllmin[0] + dllmax[0]) >> 1;
-       ast_moutdwm(ast, AST_REG_MCR68, ast_mindwm(ast, 0x1E720058) | (dlli << 16));
+       ast_moutdwm(ast, AST_REG_MCR68, ast_mindwm(ast, AST_REG_A2P58) | (dlli << 16));
        return status;
 } /* CBRDLL2 */
 
@@ -826,7 +826,7 @@ ddr3_init_start:
                data = ast_mindwm(ast, AST_REG_MCR1C);
                data = (data >> 8) & 0xff;
        }
-       ast_moutdwm(ast, 0x1E720058, ast_mindwm(ast, AST_REG_MCR68) & 0xffff);
+       ast_moutdwm(ast, AST_REG_A2P58, ast_mindwm(ast, AST_REG_MCR68) & 0xffff);
        data = ast_mindwm(ast, AST_REG_MCR18) | 0xC00;
        ast_moutdwm(ast, AST_REG_MCR18, data);
 
@@ -1188,7 +1188,7 @@ ddr2_init_start:
                data = ast_mindwm(ast, AST_REG_MCR1C);
                data = (data >> 8) & 0xff;
        }
-       ast_moutdwm(ast, 0x1E720058, ast_mindwm(ast, AST_REG_MCR08) & 0xffff);
+       ast_moutdwm(ast, AST_REG_A2P58, ast_mindwm(ast, AST_REG_MCR08) & 0xffff);
        data = ast_mindwm(ast, AST_REG_MCR18) | 0xC00;
        ast_moutdwm(ast, AST_REG_MCR18, data);
 
index e8d4991186ca09a6fe265a8d20b8e4845649dfdf..730072a3c2cd166bddce1abdd46fb1c3081b8f41 100644 (file)
 #define AST_REG_SCU104                         AST_REG_SCU(0x104)
 #define AST_REG_SCU160                         AST_REG_SCU(0x160)
 
+/*
+ * AHB-to-P Bus Bridge (0x1e720000 - 0x1e73ffff)
+ */
+
+#define AST_REG_A2P_BASE                       (0x1e720000)
+#define AST_REG_A2P(__offset)                  (AST_REG_A2P_BASE + (__offset))
+#define AST_REG_A2P58                          AST_REG_A2P(0x58)
+
 #endif