xref: /linux/drivers/gpu/drm/ast/ast_post.h (revision 4b99990cdf9560e8a071640baf19f312e6ae02f4)
1 /* SPDX-License-Identifier: MIT */
2 
3 #ifndef AST_POST_H
4 #define AST_POST_H
5 
6 #include <linux/limits.h>
7 #include <linux/types.h>
8 
9 struct ast_device;
10 
11 /* DRAM timing tables */
12 struct ast_dramstruct {
13 	u32 index;
14 	u32 data;
15 };
16 
17 /* control commands */
18 #define __AST_DRAMSTRUCT_UDELAY         0xff00
19 #define __AST_DRAMSTRUCT_INVALID        0xffff
20 
21 #define __AST_DRAMSTRUCT_INDEX(_name) \
22 	(__AST_DRAMSTRUCT_ ## _name)
23 
24 #define __AST_DRAMSTRUCT_INIT(_index, _value) \
25 	{ (_index), (_value) }
26 
27 #define AST_DRAMSTRUCT_REG(_reg, _value) \
28 	__AST_DRAMSTRUCT_INIT(_reg, _value)
29 #define AST_DRAMSTRUCT_UDELAY(_usecs) \
30 	__AST_DRAMSTRUCT_INIT(__AST_DRAMSTRUCT_UDELAY, _usecs)
31 #define AST_DRAMSTRUCT_INVALID \
32 	__AST_DRAMSTRUCT_INIT(__AST_DRAMSTRUCT_INVALID, U32_MAX)
33 
34 #define AST_DRAMSTRUCT_IS_REG(_entry, _reg) \
35 	((_entry)->index == (_reg))
36 #define AST_DRAMSTRUCT_IS(_entry, _name) \
37 	((_entry)->index == __AST_DRAMSTRUCT_INDEX(_name))
38 
39 bool mmc_test(struct ast_device *ast, u32 datagen, u8 test_ctl);
40 bool mmc_test_burst(struct ast_device *ast, u32 datagen);
41 
42 /* ast_2000.c */
43 void ast_2000_set_def_ext_reg(struct ast_device *ast);
44 
45 /* ast_2300.c */
46 void ast_2300_set_def_ext_reg(struct ast_device *ast);
47 
48 #endif
49