soc/broadwell: set EM4/EM5 registers based on cdclk

The EM4/EM5 registers in the mini-HD audio device must be set based
on the GPU cdclk value in order for HDMI audio to function properly.
Add variables to save the correct values when initializing the GPU,
and accessor functions to retrieve them in order to set the registers
when initializing the mini-HD audio device.

Change-Id: Icce7d5981f0b2ccb09d3861b28b843a260c8aeba
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/17718
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/src/soc/intel/broadwell/minihd.c b/src/soc/intel/broadwell/minihd.c
index 5014b08..a9fc3d6 100644
--- a/src/soc/intel/broadwell/minihd.c
+++ b/src/soc/intel/broadwell/minihd.c
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <soc/intel/common/hda_verb.h>
 #include <soc/ramstage.h>
+#include <soc/igd.h>
 
 static const u32 minihd_verb_table[] = {
 	/* coreboot specific header */
@@ -101,6 +102,10 @@
 					       minihd_verb_table);
 		}
 	}
+
+	/* Set EM4/EM5 registers */
+	write32(base + 0x0100c, igd_get_reg_em4());
+	write32(base + 0x01010, igd_get_reg_em5());
 }
 
 static struct device_operations minihd_ops = {