From patchwork Sun Apr 17 21:37:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: allow new amd agesa code to skip check for globals in romstage Date: Sun, 17 Apr 2011 21:37:12 -0000 From: Scott X-Patchwork-Id: 2883 Message-Id: To: Recently the 3 projects using the new AMD reference code have been failing the check for globals (or statics) in romstage. This causes ASRock E350M1, AMD Inagua, and AMD Persimmon builds to fail with the message "Do not use global variables in romstage". The message is working as intended. It is detecting data declared as 'static' when 'static const' was intended. The code executes correctly because it never tries to modify the data. To make reference code updates easy, it is probably best to avoid modifying the AMD provided code if possible. The following change bypasses the "Do not use global variables in romstage" check for the AMD reference code only. Signed-off-by: Scott Duplichan Acked-by: Stefan Reinauer Index: src/arch/x86/init/bootblock.ld =================================================================== --- src/arch/x86/init/bootblock.ld (revision 6510) +++ src/arch/x86/init/bootblock.ld (working copy) @@ -48,6 +48,8 @@ *(.note) *(.comment.*) *(.note.*) - } - _bogus = ASSERT((SIZEOF(.bss) + SIZEOF(.data)) == 0, "Do not use global variables in romstage"); + } + + CONFIG_AMD_AGESA = DEFINED(CONFIG_AMD_AGESA) ? CONFIG_AMD_AGESA : 0; + _bogus = ASSERT((SIZEOF(.bss) + SIZEOF(.data)) == 0 || CONFIG_AMD_AGESA, "Do not use global variables in romstage"); }