nb/intel/sandybridge: Relocate get_ODT
function
This function is only used in two places, so move its definition closer. Change-Id: I21d3e04de45f58cef0603b6b75119cae4b1a7aae Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47517 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
This commit is contained in:
parent
2bf28ed632
commit
1a9b5aa462
@ -597,18 +597,6 @@ void dram_jedecreset(ramctr_timing *ctrl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static odtmap get_ODT(ramctr_timing *ctrl, u8 rank, int channel)
|
|
||||||
{
|
|
||||||
/* Get ODT based on rankmap */
|
|
||||||
int dimms_per_ch = (ctrl->rankmap[channel] & 1) + ((ctrl->rankmap[channel] >> 2) & 1);
|
|
||||||
|
|
||||||
if (dimms_per_ch == 1) {
|
|
||||||
return (const odtmap){60, 60};
|
|
||||||
} else {
|
|
||||||
return (const odtmap){120, 30};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void write_mrreg(ramctr_timing *ctrl, int channel, int slotrank, int reg, u32 val)
|
static void write_mrreg(ramctr_timing *ctrl, int channel, int slotrank, int reg, u32 val)
|
||||||
{
|
{
|
||||||
wait_for_iosav(channel);
|
wait_for_iosav(channel);
|
||||||
@ -718,6 +706,18 @@ static void dram_mr0(ramctr_timing *ctrl, u8 rank, int channel)
|
|||||||
write_mrreg(ctrl, channel, rank, 0, make_mr0(ctrl, rank));
|
write_mrreg(ctrl, channel, rank, 0, make_mr0(ctrl, rank));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static odtmap get_ODT(ramctr_timing *ctrl, u8 rank, int channel)
|
||||||
|
{
|
||||||
|
/* Get ODT based on rankmap */
|
||||||
|
int dimms_per_ch = (ctrl->rankmap[channel] & 1) + ((ctrl->rankmap[channel] >> 2) & 1);
|
||||||
|
|
||||||
|
if (dimms_per_ch == 1) {
|
||||||
|
return (const odtmap){60, 60};
|
||||||
|
} else {
|
||||||
|
return (const odtmap){120, 30};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static u32 encode_odt(u32 odt)
|
static u32 encode_odt(u32 odt)
|
||||||
{
|
{
|
||||||
switch (odt) {
|
switch (odt) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user