On 23/03/2026 16:56, Thomas Zimmermann wrote:
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.
Thanks, it looks good to me.
Reviewed-by: Jocelyn Falempe <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
---
drivers/gpu/drm/ast/ast_2300.c | 6 +++---
drivers/gpu/drm/ast/ast_reg.h | 8 ++++++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_2300.c b/drivers/gpu/drm/ast/ast_2300.c
index 1fe947178124..96d9909d942c 100644
--- a/drivers/gpu/drm/ast/ast_2300.c
+++ b/drivers/gpu/drm/ast/ast_2300.c
@@ -508,7 +508,7 @@ static bool cbr_dll2(struct ast_device *ast, struct
ast2300_dram_param *param)
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 @@ static void ddr3_init(struct ast_device *ast, struct ast2300_dram_param *param)
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 @@ static void ddr2_init(struct ast_device *ast, struct ast2300_dram_param *param)
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);
diff --git a/drivers/gpu/drm/ast/ast_reg.h b/drivers/gpu/drm/ast/ast_reg.h
index e8d4991186ca..730072a3c2cd 100644
--- a/drivers/gpu/drm/ast/ast_reg.h
+++ b/drivers/gpu/drm/ast/ast_reg.h
@@ -188,4 +188,12 @@
#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