Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
litedram
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel LiteX
litedram
Commits
2c608619
Unverified
Commit
2c608619
authored
Feb 02, 2021
by
enjoy-digital
Committed by
GitHub
Feb 02, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #232 from antmicro/jboc/init-mr
init: make the write leveling MR bit configurable
parents
83b31f4f
b3ce5828
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
litedram/init.py
litedram/init.py
+10
-8
test/reference/ddr3_init.h
test/reference/ddr3_init.h
+3
-1
test/reference/ddr4_init.h
test/reference/ddr4_init.h
+3
-1
No files found.
litedram/init.py
View file @
2c608619
...
...
@@ -220,7 +220,7 @@ def get_ddr3_phy_init_sequence(phy_settings, timing_settings):
(
"ZQ Calibration"
,
0x0400
,
0
,
"DFII_COMMAND_WE|DFII_COMMAND_CS"
,
200
),
]
return
init_sequence
,
mr1
return
init_sequence
,
{
1
:
mr1
}
# DDR4 ---------------------------------------------------------------------------------------------
...
...
@@ -443,7 +443,7 @@ def get_ddr4_phy_init_sequence(phy_settings, timing_settings):
(
"ZQ Calibration"
,
0x0400
,
0
,
"DFII_COMMAND_WE|DFII_COMMAND_CS"
,
200
),
]
return
init_sequence
,
mr1
return
init_sequence
,
{
1
:
mr1
}
# Init Sequence ------------------------------------------------------------------------------------
...
...
@@ -568,11 +568,13 @@ const unsigned long sdram_dfii_pix_rddata_addr[SDRAM_PHY_PHASES] = {{
"""
.
format
(
sdram_dfii_pix_rddata_addr
=
",
\
n
\
t
"
.
join
(
sdram_dfii_pix_rddata_addr
))
r
+=
"
\
n
"
init_sequence
,
mr
1
=
get_sdram_phy_init_sequence
(
phy_settings
,
timing_settings
)
init_sequence
,
mr
=
get_sdram_phy_init_sequence
(
phy_settings
,
timing_settings
)
if
phy_settings
.
memtype
in
[
"DDR3"
,
"DDR4"
]:
# The value of MR1 needs to be modified during write leveling
r
+=
"#define DDRX_MR1 {}
\
n
\
n
"
.
format
(
mr1
)
# The value of MR1[7] needs to be modified during write leveling
r
+=
"#define DDRX_MR_WRLVL_ADDRESS {}
\
n
"
.
format
(
1
)
r
+=
"#define DDRX_MR_WRLVL_RESET {}
\
n
"
.
format
(
mr
[
1
])
r
+=
"#define DDRX_MR_WRLVL_BIT {}
\
n
\
n
"
.
format
(
7
)
r
+=
"static void init_sequence(void)
\
n
{
\
n
"
for
comment
,
a
,
ba
,
cmd
,
delay
in
init_sequence
:
...
...
@@ -625,10 +627,10 @@ def get_sdram_phy_py_header(phy_settings, timing_settings):
r
+=
"dfii_command_rddata = 0x20
\
n
"
r
+=
"
\
n
"
init_sequence
,
mr
1
=
get_sdram_phy_init_sequence
(
phy_settings
,
timing_settings
)
init_sequence
,
mr
=
get_sdram_phy_init_sequence
(
phy_settings
,
timing_settings
)
if
mr
1
is
not
None
:
r
+=
"ddrx_mr1 = 0x{:x}
\
n
"
.
format
(
mr
1
)
if
mr
is
not
None
and
1
in
mr
:
r
+=
"ddrx_mr1 = 0x{:x}
\
n
"
.
format
(
mr
[
1
]
)
r
+=
"
\
n
"
r
+=
"init_sequence = [
\
n
"
...
...
test/reference/ddr3_init.h
View file @
2c608619
...
...
@@ -70,7 +70,9 @@ const unsigned long sdram_dfii_pix_rddata_addr[SDRAM_PHY_PHASES] = {
CSR_SDRAM_DFII_PI3_RDDATA_ADDR
};
#define DDRX_MR1 6
#define DDRX_MR_WRLVL_ADDRESS 1
#define DDRX_MR_WRLVL_RESET 6
#define DDRX_MR_WRLVL_BIT 7
static
void
init_sequence
(
void
)
{
...
...
test/reference/ddr4_init.h
View file @
2c608619
...
...
@@ -71,7 +71,9 @@ const unsigned long sdram_dfii_pix_rddata_addr[SDRAM_PHY_PHASES] = {
CSR_SDRAM_DFII_PI3_RDDATA_ADDR
};
#define DDRX_MR1 769
#define DDRX_MR_WRLVL_ADDRESS 1
#define DDRX_MR_WRLVL_RESET 769
#define DDRX_MR_WRLVL_BIT 7
static
void
init_sequence
(
void
)
{
...
...
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