Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
0471a131
Commit
0471a131
authored
Aug 18, 2014
by
Luc Verhaegen
Browse files
meminfo: fill in tpr4 on sun7i
Signed-off-by:
Luc Verhaegen
<
libv@skynet.be
>
parent
cac31a40
Changes
1
Hide whitespace changes
Inline
Side-by-side
meminfo.c
View file @
0471a131
...
...
@@ -182,6 +182,7 @@ dram_clock_read(struct dram_para *dram_para)
#define SUNXI_IO_DRAM_BASE 0x01C01000
#define SUNXI_IO_DRAM_SIZE 0x00001000
#define SUNXI_IO_DRAM_CCR 0x000
/* controller configuration register */
#define SUNXI_IO_DRAM_DCR 0x004
/* dram configuration */
#define SUNXI_IO_DRAM_IOCR 0x008
/* i/o configuration */
...
...
@@ -190,6 +191,7 @@ dram_clock_read(struct dram_para *dram_para)
#define SUNXI_IO_DRAM_TPR2 0x01C
/* dram timing parameters register 2 */
#define SUNXI_IO_DRAM_ZQCR0 0x0A8
/* zq control register 0 */
#define SUNXI_IO_DRAM_ZQCR1 0x0AC
/* zq control register 1 */
#define SUNXI_IO_DRAM_MR 0x1F0
/* mode register */
#define SUNXI_IO_DRAM_EMR 0x1F4
/* extended mode register */
...
...
@@ -230,6 +232,13 @@ dram_parameters_read(struct dram_para *dram_para)
dram_para
->
tpr3
=
(
dllcr0
<<
16
)
|
(
dllcr4
<<
12
)
|
(
dllcr3
<<
8
)
|
(
dllcr2
<<
4
)
|
dllcr1
;
if
(
soc_version
==
SUNXI_SOC_SUN7I
)
{
if
(
sunxi_io_read
(
base
,
SUNXI_IO_DRAM_CCR
)
&
0x20
)
dram_para
->
tpr4
|=
0x01
;
if
(
!
(
sunxi_io_read
(
base
,
SUNXI_IO_DRAM_ZQCR1
)
&
0x01000000
))
dram_para
->
tpr4
|=
0x02
;
}
dram_para
->
cas
=
(
sunxi_io_read
(
base
,
SUNXI_IO_DRAM_MR
)
>>
4
)
&
0x0F
;
dram_para
->
emr1
=
sunxi_io_read
(
base
,
SUNXI_IO_DRAM_EMR
);
dram_para
->
emr2
=
sunxi_io_read
(
base
,
SUNXI_IO_DRAM_EMR2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment