From a425b960914003ece27612233929b1be2fc2c15a Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 5 Mar 2015 20:18:21 +0100 Subject: AMD Fam10h: Only create _PR scope if it is filled in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The former pstates_algorithm() function has two early exit points now, and so it might never get around to writing pstates data. Change-Id: I19ca937375c6d33b78bd5b1859fa5c25473be9b6 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/8610 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki --- src/cpu/amd/model_10xxx/fidvid.c | 2 +- src/cpu/amd/model_10xxx/powernow_acpi.c | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/amd/model_10xxx/fidvid.c b/src/cpu/amd/model_10xxx/fidvid.c index a3f3075dd8..798d538a53 100644 --- a/src/cpu/amd/model_10xxx/fidvid.c +++ b/src/cpu/amd/model_10xxx/fidvid.c @@ -79,7 +79,7 @@ Fam10 Bios and Kernel Development Guide #31116, rev 3.48, April 22, 2010 11.- finalPstateChange() from init_fidvid_Stage2 (BKDG says just "may", anyway) 12.- generate ACPI for p-states. - generated in powernow_acpi.c pstates_algorithm() + generated in powernow_acpi.c amd_generate_powernow() "must also be completed" diff --git a/src/cpu/amd/model_10xxx/powernow_acpi.c b/src/cpu/amd/model_10xxx/powernow_acpi.c index 09726a0cda..bf97099cf2 100644 --- a/src/cpu/amd/model_10xxx/powernow_acpi.c +++ b/src/cpu/amd/model_10xxx/powernow_acpi.c @@ -79,7 +79,7 @@ static void write_pstates_for_core(u8 pstate_num, u16 *pstate_feq, u32 *pstate_p * processor combination is installed. If it does break please fix the * code in the proper locations! */ -static void pstates_algorithm(u32 pcontrol_blk, u8 plen, u8 onlyBSP) +void amd_generate_powernow(u32 pcontrol_blk, u8 plen, u8 onlyBSP) { u8 processor_brand[49]; u32 *v; @@ -260,17 +260,12 @@ static void pstates_algorithm(u32 pcontrol_blk, u8 plen, u8 onlyBSP) Pstate_latency[index]); } + char pscope[] = "\\_PR"; + + acpigen_write_scope(pscope); for (index = 0; index < cmp_cap; index++) write_pstates_for_core(Pstate_num, Pstate_feq, Pstate_power, Pstate_latency, Pstate_control, Pstate_status, index, pcontrol_blk, plen, onlyBSP); -} - -void amd_generate_powernow(u32 pcontrol_blk, u8 plen, u8 onlyBSP) -{ - char pscope[] = "\\_PR"; - - acpigen_write_scope(pscope); - pstates_algorithm(pcontrol_blk, plen, onlyBSP); acpigen_pop_len(); } -- cgit v1.2.3