Author: hailfinger Date: 2008-08-21 19:34:06 +0200 (Thu, 21 Aug 2008) New Revision: 793
Modified: coreboot-v3/northbridge/amd/geodelx/raminit.c Log: Move GeodeLX register name array to .rodata and make my checker happy. This one is far from obvious, so let me explain: Basically, *msrnames[] is an array of pointers (strings) and pointers need relocation. That's why they end up in .data.rel.ro.local and make lots of trouble. This should fix the crash Ron was seeing when register name printing was enabled.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Ronald G. Minnich rminnich@gmail.com
Modified: coreboot-v3/northbridge/amd/geodelx/raminit.c =================================================================== --- coreboot-v3/northbridge/amd/geodelx/raminit.c 2008-08-21 16:04:41 UTC (rev 792) +++ coreboot-v3/northbridge/amd/geodelx/raminit.c 2008-08-21 17:34:06 UTC (rev 793) @@ -35,7 +35,29 @@
u8 spd_read_byte(u16 device, u8 address);
+const static unsigned long msrs[] = { + MC_CF07_DATA, + MC_CF8F_DATA, + MC_CF1017_DATA, + GLCP_DELAY_CONTROLS, + MC_CFCLK_DBUG, + MC_CF_PMCTR, + GLCP_SYS_RSTPLL +};
+/* If you ever change any of the strings below, make sure the char array size + * is the length of the longest string +1 + */ +const static char msrnames[][20] = { + "MC_CF07_DATA", + "MC_CF8F_DATA", + "MC_CF1017_DATA", + "GLCP_DELAY_CONTROLS", + "MC_CFCLK_DBUG", + "MC_CF_PMCTR", + "PLL reg" +}; + /** * Dump key MSR values for RAM init. You can call this function and then use it to * compare to a factory BIOS setting. @@ -43,24 +65,6 @@ */ void dumplxmsrs(void) { - const static unsigned long msrs[] = { - MC_CF07_DATA, - MC_CF8F_DATA, - MC_CF1017_DATA, - GLCP_DELAY_CONTROLS, - MC_CFCLK_DBUG, - MC_CF_PMCTR, - GLCP_SYS_RSTPLL - }; - const static const char *msrnames[] = { - "MC_CF07_DATA", - "MC_CF8F_DATA", - "MC_CF1017_DATA", - "GLCP_DELAY_CONTROLS", - "MC_CFCLK_DBUG", - "MC_CF_PMCTR", - "PLL reg" - }; int i;
for (i = 0; i < ARRAY_SIZE(msrs); i++) {