drivers/gpu/drm/ast/ast_2300.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/ast/ast_2300.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/ast/ast_2300.c- Extension
.c- Size
- 39920 bytes
- Lines
- 1458
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/pci.hlinux/sizes.hdrm/drm_drv.hdrm/drm_managed.hdrm/drm_print.hast_drv.hast_post.h
Detected Declarations
struct ast2300_dram_paramfunction filesfunction mmc_test2function mmc_test_burst2function mmc_test_singlefunction mmc_test_single2function cbr_testfunction cbr_scanfunction cbr_test2function cbr_scan2function cbr_test3function cbr_scan3function finetuneDQI_Lfunction finetuneDQSIfunction cbr_dll2function get_ddr3_infofunction ddr3_initfunction get_ddr2_infofunction ddr2_initfunction ast_post_chip_2300function ast_2300_postfunction ast_2300_detect_tx_chipfunction ast_2300_detect_widescreen
Annotated Snippet
struct ast2300_dram_param {
u32 dram_type;
u32 dram_chipid;
u32 dram_freq;
u32 vram_size;
u32 odt;
u32 wodt;
u32 rodt;
u32 dram_config;
u32 reg_PERIOD;
u32 reg_MADJ;
u32 reg_SADJ;
u32 reg_MRS;
u32 reg_EMRS;
u32 reg_AC1;
u32 reg_AC2;
u32 reg_DQSIC;
u32 reg_DRV;
u32 reg_IOZ;
u32 reg_DQIDLY;
u32 reg_FREQ;
u32 madj_max;
u32 dll2_finetune_step;
};
/*
* DQSI DLL CBR Setting
*/
#define CBR_SIZE0 ((1 << 10) - 1)
#define CBR_SIZE1 ((4 << 10) - 1)
#define CBR_SIZE2 ((64 << 10) - 1)
#define CBR_PASSNUM 5
#define CBR_PASSNUM2 5
#define CBR_THRESHOLD 10
#define CBR_THRESHOLD2 10
#define TIMEOUT 5000000
#define CBR_PATNUM 8
static const u32 pattern[8] = {
0xFF00FF00,
0xCC33CC33,
0xAA55AA55,
0x88778877,
0x92CC4D6E,
0x543D3CDE,
0xF1E843C7,
0x7C61D253
};
static u32 mmc_test2(struct ast_device *ast, u32 datagen, u8 test_ctl)
{
u32 data, timeout;
ast_moutdwm(ast, AST_REG_MCR70, 0x00000000);
ast_moutdwm(ast, AST_REG_MCR70, (datagen << 3) | test_ctl);
timeout = 0;
do {
data = ast_mindwm(ast, AST_REG_MCR70) & 0x1000;
if (++timeout > TIMEOUT) {
ast_moutdwm(ast, AST_REG_MCR70, 0x0);
return 0xffffffff;
}
} while (!data);
data = ast_mindwm(ast, AST_REG_MCR78);
data = (data | (data >> 16)) & 0xffff;
ast_moutdwm(ast, AST_REG_MCR70, 0x00000000);
return data;
}
static u32 mmc_test_burst2(struct ast_device *ast, u32 datagen)
{
return mmc_test2(ast, datagen, 0x41);
}
static bool mmc_test_single(struct ast_device *ast, u32 datagen)
{
return mmc_test(ast, datagen, 0xc5);
}
static u32 mmc_test_single2(struct ast_device *ast, u32 datagen)
{
return mmc_test2(ast, datagen, 0x05);
}
static int cbr_test(struct ast_device *ast)
{
u32 data;
int i;
data = mmc_test_single2(ast, 0);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/pci.h`, `linux/sizes.h`, `drm/drm_drv.h`, `drm/drm_managed.h`, `drm/drm_print.h`, `ast_drv.h`, `ast_post.h`.
- Detected declarations: `struct ast2300_dram_param`, `function files`, `function mmc_test2`, `function mmc_test_burst2`, `function mmc_test_single`, `function mmc_test_single2`, `function cbr_test`, `function cbr_scan`, `function cbr_test2`, `function cbr_scan2`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.