aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/intel/sandybridge/raminit.c
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2016-03-26 17:20:02 +0100
committerMartin Roth <martinroth@google.com>2016-05-04 19:59:02 +0200
commit9c9bde3aa35922cf680c91f9260dd7905cc8cb6b (patch)
treee7906cdb35066496285b751c1dc2d4e26615ef79 /src/northbridge/intel/sandybridge/raminit.c
parent2ccb74b6e97381ce2b2f8520076204f7737ade4c (diff)
nb/intel/sandybridge/raminit: support calling dram_freq multiple times
The PLL will never lock if the requested frequency is already set. As the fallback may request the same frequency again exit early to prevent a hang. Test system: * Gigabyte GA-B75M-D3H * Intel Pentium CPU G2130 Change-Id: I625b2956346d8c50cca84def6190c076bf99dbec Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/14174 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/northbridge/intel/sandybridge/raminit.c')
-rw-r--r--src/northbridge/intel/sandybridge/raminit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c
index 0c191b2abd..1ed77ebd44 100644
--- a/src/northbridge/intel/sandybridge/raminit.c
+++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -810,6 +810,17 @@ static void dram_freq(ramctr_timing * ctrl)
/* Frequency mulitplier. */
u32 FRQ = get_FRQ(ctrl->tCK);
+ /* The PLL will never lock if the required frequency is
+ * already set. Exit early to prevent a system hang.
+ */
+ reg1 = MCHBAR32(0x5e04);
+ val2 = (u8) reg1;
+ if (val2 == FRQ) {
+ printk(BIOS_DEBUG, "MCU frequency is set at : %d MHz\n",
+ (1000 << 8) / ctrl->tCK);
+ return;
+ }
+
/* Step 2 - Select frequency in the MCU */
reg1 = FRQ;
reg1 |= 0x80000000; // set running bit