drm/ast: Use constants for A2P registers

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
This commit is contained in:
Thomas Zimmermann 2026-03-27 14:32:58 +01:00
parent 06c076cb30
commit f9f57e03d2
2 changed files with 11 additions and 3 deletions

View File

@ -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);

View File

@ -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