huangcm
2025-07-03 a76b2fadf6ad4adf86e241e3753a63efe03ef80c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
*********************************************************************************************************
*                                                AR100 SYSTEM
*                                     AR100 Software System Develop Kits
*                                                dram module
*
*                                    (c) Copyright 2012-2016, Sunny China
*                                             All Rights Reserved
*
* File    : dram.h
* By      : Sunny
* Version : v1.0
* Date    : 2012-4-28
* Descript: dram driver public header.
* Update  : date                auther      ver     notes
*           2012-4-28 10:28:51  Sunny       1.0     Create this file.
*********************************************************************************************************
*/
#ifndef __DRAM_H__
#define __DRAM_H__
 
#include "autoconf.h"
 
#ifdef CFG_DDR3
#define DRAM_TYPE_DDR3
#endif
 
#ifdef CFG_DDR4
#define DRAM_TYPE_DDR4
#endif
 
#ifdef CFG_LPDDR3
#define DRAM_TYPE_LPDDR3
#endif
 
#ifdef CFG_LPDDR4
#define DRAM_TYPE_LPDDR4
#endif
 
#define __dram_para_t dram_para_t
 
typedef struct dram_para {
   /* normal configuration */
   unsigned int dram_clk;
   /* dram_type, DDR2: 2, DDR3: 3, LPDDR2: 6, LPDDR3: 7, DDR3L: 31 */
   unsigned int dram_type;
   unsigned int dram_dx_odt;
   unsigned int dram_dx_dri;
   unsigned int dram_ca_dri;
   unsigned int dram_para0;
 
   /* control configuration */
   unsigned int dram_para1;
   unsigned int dram_para2;
 
   /* timing configuration */
   unsigned int dram_mr0;
   unsigned int dram_mr1;
   unsigned int dram_mr2;
   unsigned int dram_mr3;
   unsigned int dram_mr4;
   unsigned int dram_mr5;
   unsigned int dram_mr6;
   unsigned int dram_mr11;
   unsigned int dram_mr12;
   unsigned int dram_mr13;
   unsigned int dram_mr14;
   unsigned int dram_mr16;
   unsigned int dram_mr17;
   unsigned int dram_mr22;
 
   unsigned int        dram_tpr0;  /*DRAMTMG0*/
   unsigned int        dram_tpr1;  /*DRAMTMG1*/
   unsigned int        dram_tpr2;  /*DRAMTMG2*/
   unsigned int        dram_tpr3;  /*DRAMTMG3*/
   unsigned int        dram_tpr6;  /*DRAMTMG8*/
 
   /* reserved for future use */
   unsigned int        dram_tpr10;
   unsigned int        dram_tpr11;
   unsigned int        dram_tpr12;
   unsigned int        dram_tpr13;
   unsigned int        dram_tpr14;
} __dram_para_t;
 
#define DELAY_FOR_DRAM
 
extern unsigned int dram_power_save_process(__dram_para_t *para);
extern unsigned int dram_power_up_process(__dram_para_t *para);
#endif /* __DRAM_H__ */