[coreboot-gerrit] Change in ...coreboot[master]: nb/intel/gm45: Make fetching the blc_pwm freq global

Arthur Heymans (Code Review) gerrit at coreboot.org
Thu Nov 29 12:29:20 CET 2018


Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/29925


Change subject: nb/intel/gm45: Make fetching the blc_pwm freq global
......................................................................

nb/intel/gm45: Make fetching the blc_pwm freq global

This can be used to select the proper VBT.

Change-Id: Id3f6ba3ae31a5ab47f44d207678c1c4a6a43b7ec
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
M src/northbridge/intel/gm45/gm45.h
M src/northbridge/intel/gm45/gma.c
2 files changed, 8 insertions(+), 5 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/29925/1

diff --git a/src/northbridge/intel/gm45/gm45.h b/src/northbridge/intel/gm45/gm45.h
index 95863d9..37e1ddc 100644
--- a/src/northbridge/intel/gm45/gm45.h
+++ b/src/northbridge/intel/gm45/gm45.h
@@ -443,6 +443,7 @@
 	int pwm_freq; /* In Hz */
 };
 int get_blc_values(const struct blc_pwm_t **entries);
+int get_blc_pwm_freq_value(void);
 
 
 #if ENV_RAMSTAGE && !defined(__SIMPLE_DEVICE__)
diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
index 34cf367..511225f 100644
--- a/src/northbridge/intel/gm45/gma.c
+++ b/src/northbridge/intel/gm45/gma.c
@@ -41,6 +41,8 @@
 
 static struct resource *gtt_res = NULL;
 
+char edid_ascii_string[EDID_ASCII_STRING_LENGTH + 1];
+
 u32 gtt_read(u32 reg)
 {
 	return read32(res2mmio(gtt_res, reg, 0));
@@ -668,7 +670,7 @@
 		return (blc_mod << 16) | blc_mod;
 }
 
-static int get_blc_pwm_freq_value(const char *edid_ascii_string)
+int get_blc_pwm_freq_value(void)
 {
 	static int blc_pwm_freq = -1;
 	const struct blc_pwm_t *blc_pwm;
@@ -701,8 +703,7 @@
 	return blc_pwm_freq;
 }
 
-static void gma_pm_init_post_vbios(struct device *const dev,
-				const char *edid_ascii_string)
+static void gma_pm_init_post_vbios(struct device *const dev)
 {
 	const struct northbridge_intel_gm45_config *const conf = dev->chip_info;
 
@@ -739,7 +740,7 @@
 	reg8 = 100;
 	if (conf->duty_cycle != 0)
 		reg8 = conf->duty_cycle;
-	pwm_freq = get_blc_pwm_freq_value(edid_ascii_string);
+	pwm_freq = get_blc_pwm_freq_value();
 	if (pwm_freq < 0 && conf->default_pwm_freq != 0)
 		pwm_freq = conf->default_pwm_freq;
 
@@ -780,7 +781,8 @@
 	decode_edid(edid_data_lvds, sizeof(edid_data_lvds), &edid_lvds);
 
 	/* Post VBIOS init */
-	gma_pm_init_post_vbios(dev, edid_lvds.ascii_string);
+	memcpy(edid_ascii_string, edid_lvds.ascii_string, sizeof(edid_ascii_string));
+	gma_pm_init_post_vbios(dev);
 
 	int vga_disable = (pci_read_config16(dev, D0F0_GGC) & 2) >> 1;
 

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/29925
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id3f6ba3ae31a5ab47f44d207678c1c4a6a43b7ec
Gerrit-Change-Number: 29925
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro at das-labor.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181129/c2a48333/attachment.html>


More information about the coreboot-gerrit mailing list