From f1321e1dedacec68d823c115b4c5c0263f87f869 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Thu, 21 Aug 2008 17:34:06 +0000 Subject: [PATCH] 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 Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/coreboot-v3@793 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- northbridge/amd/geodelx/raminit.c | 40 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/northbridge/amd/geodelx/raminit.c b/northbridge/amd/geodelx/raminit.c index 86878e13a2..c206bd608e 100644 --- a/northbridge/amd/geodelx/raminit.c +++ b/northbridge/amd/geodelx/raminit.c @@ -35,6 +35,28 @@ static const u8 num_col_addr[] = { 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 @@ -43,24 +65,6 @@ u8 spd_read_byte(u16 device, u8 address); */ 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++) {