Patchwork Make various DEBUG defines user-configurable in menuconfig

login
register
about
Submitter Uwe Hermann
Date 2009-10-20 16:19:51
Message ID <20091020161951.GD22215@greenwood>
Download mbox | patch
Permalink /patch/443/
State Accepted, archived
Headers show

Comments

Uwe Hermann - 2009-10-20 16:19:51
See patch.

Note that we need code-fixes for some chipsets and board when enabling
some of the DEBUG options (my guess is that code was never tested much),
but this is not related to my patch, those problems have been there
already:

 - Some romcc boards throw "too few registers" errors if you enable
   extra debugging options. That can partly fixed by changing code or
   by changing -mcpu=i386 to -mcpu=p2 or similar (if possible for the
   board/CPU).

 - Some chipset code needs fixing as boards won't even compile if some
   of the DEBUG options are enabled.

 - And there are further DEBUG* defines which are not so easily
   converted (e.g. some use integers like LOGLEVEL does, instead of
   just boolean on/off). I will have a look at converting more of those
   to kconfig later.


Uwe.
Myles Watson - 2009-10-20 17:37:02
I like the idea of having Options that we use more available.

DEBUG_SMI was the default.  Now it isn't.
DEBUG_RAM_SETUP was the default for i440bx & vx800
in the Kontron code,

 #if CONFIG_DEFAULT_CONSOLE_LOGLEVEL > 8
This never does anything, since 8 is SPEW.

I think it's too dangerous to play with options like this if we haven't
tested it in hardware.  Right now I'd like to match newconfig and kill it as
quickly as possible.  Supporting two versions and trying to keep them in
sync is too hard.

Thanks,
Myles
Uwe Hermann - 2009-10-21 19:16:00
On Tue, Oct 20, 2009 at 11:37:02AM -0600, Myles Watson wrote:
> I like the idea of having Options that we use more available.
> 
> DEBUG_SMI was the default.  Now it isn't.
> DEBUG_RAM_SETUP was the default for i440bx & vx800

True, but that's intentional. Just like the "use lzma" or "execute vga blob"
options these are now global, user-configurable (as opposed to per-board
in Options.lb in newconfig). The old per-board or per-chipset defaults don't
matter much, the user chooses if he/she wants the option.

I think these options are good candidates for filtering in the compare
script.


> in the Kontron code,
>  #if CONFIG_DEFAULT_CONSOLE_LOGLEVEL > 8
> This never does anything, since 8 is SPEW.

Due to the recent LOGLEVEL changes, yes. We should do a repo-wide
fixing of any such occurences (there may be more of them). This is
unrelated to my patch though, the check is no longer correct with and
without the patch.

I'll post a followup-patch for this issue if nobody beats me to it.


> Right now I'd like to match newconfig and kill it as
> quickly as possible.

Sure, same here. I don't think this patch interferes with this effort
though.


Uwe.
Myles Watson - 2009-10-21 19:23:21
> On Tue, Oct 20, 2009 at 11:37:02AM -0600, Myles Watson wrote:
> > I like the idea of having Options that we use more available.
> >
> > DEBUG_SMI was the default.  Now it isn't.
> > DEBUG_RAM_SETUP was the default for i440bx & vx800
> 
> True, but that's intentional. Just like the "use lzma" or "execute vga
> blob"
> options these are now global, user-configurable (as opposed to per-board
> in Options.lb in newconfig). The old per-board or per-chipset defaults
> don't
> matter much, the user chooses if he/she wants the option.
> 
> I think these options are good candidates for filtering in the compare
> script.
As long as the functionality isn't changed, I agree.  I don't have any of
the affected boards to test.

> > in the Kontron code,
> >  #if CONFIG_DEFAULT_CONSOLE_LOGLEVEL > 8
> > This never does anything, since 8 is SPEW.
> 
> Due to the recent LOGLEVEL changes, yes.
Before the changes you pointed out to me that SPEW was 8.

> We should do a repo-wide
> fixing of any such occurences (there may be more of them). This is
> unrelated to my patch though, the check is no longer correct with and
> without the patch.
I was pointing out that it isn't compiled in, so if it breaks abuild, it
will break abuild when the CONSOLE_LOGLEVEL line changes.

> I'll post a followup-patch for this issue if nobody beats me to it.
> 
> 
> > Right now I'd like to match newconfig and kill it as
> > quickly as possible.
> 
> Sure, same here. I don't think this patch interferes with this effort
> though.
As long as all of the code that gets enabled/disabled is only print
statements, that's probably true.  I was worried that some of these boards
may depend on the correct setting of those debug flags to be functional.

Thanks,
Myles
Uwe Hermann - 2009-10-21 21:04:09
On Wed, Oct 21, 2009 at 01:23:21PM -0600, Myles Watson wrote:
> As long as all of the code that gets enabled/disabled is only print
> statements, that's probably true.  I was worried that some of these boards
> may depend on the correct setting of those debug flags to be functional.

I don't think so, and if that were the case it'd be a bug anyway.


Uwe.
Myles Watson - 2009-10-21 21:08:33
On Wed, Oct 21, 2009 at 3:04 PM, Uwe Hermann <uwe@hermann-uwe.de> wrote:

> On Wed, Oct 21, 2009 at 01:23:21PM -0600, Myles Watson wrote:
> > As long as all of the code that gets enabled/disabled is only print
> > statements, that's probably true.  I was worried that some of these
> boards
> > may depend on the correct setting of those debug flags to be functional.
>
> I don't think so, and if that were the case it'd be a bug anyway.
>
Unfortunately Coreboot is not yet bug free.

Thanks,
Myles
Stefan Reinauer - 2009-10-22 08:02:11
Myles Watson wrote:
>>> Right now I'd like to match newconfig and kill it as
>>> quickly as possible.
>>>       
>> Sure, same here. I don't think this patch interferes with this effort
>> though.
>>     
> As long as all of the code that gets enabled/disabled is only print
> statements, that's probably true.  I was worried that some of these boards
> may depend on the correct setting of those debug flags to be functional.
>   
Which boards are that?

Stefan
Myles Watson - 2009-10-22 15:00:14
> > As long as all of the code that gets enabled/disabled is only print
> > statements, that's probably true.  I was worried that some of these
> boards
> > may depend on the correct setting of those debug flags to be functional.
> >
> Which boards are that?
There are lots of boards affected by this patch, and especially some of the
DEBUG_CAR stuff looked like copy-paste from other places.  I don't think we
should encourage people to change those settings until they've been tested,
or at least until someone is willing to go through and make sure that it
only enables/disables print statements.

Thanks,
Myles

Patch

Convert all DEBUG_SMBUS, DEBUG_SMI, and DEBUG_RAM_SETUP custom and
local #defines into globally configurable kconfig options (and Options.lb
options for as long as newconfig still exists) which can be enabled
by the user in the "Debugging" menu.

The respective menu items only appear if a board is selected where the
chipset code actually provides such additional DEBUG output.

All three variables default to 0 / off for now.

Also, drop a small chunk of dead/useless code in the
src/northbridge/via/cn700/raminit.c file, which would otherwise break
compilation.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>

Index: src/southbridge/via/vt8237r/vt8237r.h
===================================================================
--- src/southbridge/via/vt8237r/vt8237r.h	(Revision 4815)
+++ src/southbridge/via/vt8237r/vt8237r.h	(Arbeitskopie)
@@ -65,7 +65,7 @@ 
 #define I2C_TRANS_CMD			0x40
 #define CLOCK_SLAVE_ADDRESS		0x69
 
-#if DEBUG_SMBUS == 1
+#if CONFIG_DEBUG_SMBUS
 #define PRINT_DEBUG(x)		print_debug(x)
 #define PRINT_DEBUG_HEX16(x)	print_debug_hex16(x)
 #else
Index: src/southbridge/intel/i82801gx/i82801gx_smihandler.c
===================================================================
--- src/southbridge/intel/i82801gx/i82801gx_smihandler.c	(Revision 4815)
+++ src/southbridge/intel/i82801gx/i82801gx_smihandler.c	(Arbeitskopie)
@@ -28,8 +28,6 @@ 
 #include "i82801gx.h"
 #include "i82801gx_power.h"
 
-#define DEBUG_SMI
-
 #define APM_CNT		0xb2
 #define   CST_CONTROL	0x85 // 0x85 crashes the box
 #define   PST_CONTROL	0x80 // 0x80 crashes the box
Index: src/Kconfig
===================================================================
--- src/Kconfig	(Revision 4815)
+++ src/Kconfig	(Arbeitskopie)
@@ -404,5 +404,52 @@ 
 	  If enabled, you will be able to set breakpoints for gdb debugging.
 	  See src/arch/i386/lib/c_start.S for details.
 
+config DEBUG_RAM_SETUP
+	bool "Output verbose RAM init debug messages"
+	default n
+	depends on (NORTHBRIDGE_AMD_AMDFAM10 \
+		 || NORTHBRIDGE_AMD_AMDK8 \
+		 || NORTHBRIDGE_VIA_CN700 \
+		 || NORTHBRIDGE_VIA_CX700 \
+		 || NORTHBRIDGE_VIA_VX800 \
+		 || NORTHBRIDGE_INTEL_E7501 \
+		 || NORTHBRIDGE_INTEL_I440BX \
+		 || NORTHBRIDGE_INTEL_I82810 \
+		 || NORTHBRIDGE_INTEL_I82830 \
+		 || NORTHBRIDGE_INTEL_I945)
+	help
+	  This option enables additional RAM init related debug messages.
+	  It is recommended to enable this when debugging issues on your
+	  board which might be RAM init related.
+
+	  Note: This option will increase the size of the coreboot image.
+
+	  If unsure, say N.
+
+config DEBUG_SMBUS
+	bool "Output verbose SMBus debug messages"
+	default n
+	depends on (SOUTHBRIDGE_VIA_VT8237R \
+		 || NORTHBRIDGE_VIA_VX800 \
+		 || NORTHBRIDGE_VIA_CX700 \
+		 || NORTHBRIDGE_AMD_AMDK8)
+	help
+	  This option enables additional SMBus (and SPD) debug messages.
+
+	  Note: This option will increase the size of the coreboot image.
+
+	  If unsure, say N.
+
+config DEBUG_SMI
+	bool "Output verbose SMI debug messages"
+	default n
+	depends on SOUTHBRIDGE_INTEL_I82801GX
+	help
+	  This option enables additional SMI related debug messages.
+
+	  Note: This option will increase the size of the coreboot image.
+
+	  If unsure, say N.
+
 endmenu
 
Index: src/cpu/x86/smm/smihandler.c
===================================================================
--- src/cpu/x86/smm/smihandler.c	(Revision 4815)
+++ src/cpu/x86/smm/smihandler.c	(Arbeitskopie)
@@ -27,8 +27,6 @@ 
 
 void southbridge_smi_set_eos(void);
 
-#define DEBUG_SMI
-
 typedef enum { SMI_LOCKED, SMI_UNLOCKED } smi_semaphore;
 
 /* SMI multiprocessing semaphore */
@@ -168,7 +166,7 @@ 
 
 	node=nodeid();
 
-#ifdef DEBUG_SMI
+#if CONFIG_DEBUG_SMI
 	console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
 #else
 	console_loglevel = 1;
Index: src/mainboard/kontron/986lcd-m/auto.c
===================================================================
--- src/mainboard/kontron/986lcd-m/auto.c	(Revision 4815)
+++ src/mainboard/kontron/986lcd-m/auto.c	(Arbeitskopie)
@@ -381,7 +381,7 @@ 
 	i945_late_initialization();
 
 #if CONFIG_DEFAULT_CONSOLE_LOGLEVEL > 8
-#if defined(DEBUG_RAM_SETUP)
+#if CONFIG_DEBUG_RAM_SETUP
 	sdram_dump_mchbar_registers();
 #endif
 
Index: src/mainboard/amd/pistachio/cache_as_ram_auto.c
===================================================================
--- src/mainboard/amd/pistachio/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/amd/pistachio/cache_as_ram_auto.c	(Arbeitskopie)
@@ -51,7 +51,6 @@ 
 
 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
-#include "northbridge/amd/amdk8/debug.c"
 #include "superio/ite/it8712f/it8712f_early_serial.c"
 
 #include "cpu/amd/mtrr/amd_earlymtrr.c"
@@ -61,6 +60,7 @@ 
 
 #include "southbridge/amd/rs690/rs690_early_setup.c"
 #include "southbridge/amd/sb600/sb600_early_setup.c"
+#include "northbridge/amd/amdk8/debug.c" /* After sb600_early_setup.c! */
 
 /* CAN'T BE REMOVED! crt0.S will use it. I don't know WHY!*/
 static void memreset(int controllers, const struct mem_controller *ctrl)
Index: src/mainboard/amd/dbm690t/cache_as_ram_auto.c
===================================================================
--- src/mainboard/amd/dbm690t/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/amd/dbm690t/cache_as_ram_auto.c	(Arbeitskopie)
@@ -57,7 +57,6 @@ 
 
 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
-#include "northbridge/amd/amdk8/debug.c"
 #include "superio/ite/it8712f/it8712f_early_serial.c"
 
 #include "cpu/amd/mtrr/amd_earlymtrr.c"
@@ -67,6 +66,7 @@ 
 
 #include "southbridge/amd/rs690/rs690_early_setup.c"
 #include "southbridge/amd/sb600/sb600_early_setup.c"
+#include "northbridge/amd/amdk8/debug.c" /* After sb600_early_setup.c! */
 
 /* CAN'T BE REMOVED! crt0.S will use it. I don't know WHY!*/
 static void memreset(int controllers, const struct mem_controller *ctrl)
Index: src/mainboard/amd/serengeti_cheetah_fam10/cache_as_ram_auto.c
===================================================================
--- src/mainboard/amd/serengeti_cheetah_fam10/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/amd/serengeti_cheetah_fam10/cache_as_ram_auto.c	(Arbeitskopie)
@@ -29,8 +29,6 @@ 
 #define RAMINIT_SYSINFO 1
 #define CACHE_AS_RAM_ADDRESS_DEBUG 1
 
-#define DEBUG_SMBUS 1
-
 #define SET_NB_CFG_54 1
 
 //used by raminit
Index: src/mainboard/msi/ms7135/cache_as_ram_auto.c
===================================================================
--- src/mainboard/msi/ms7135/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/msi/ms7135/cache_as_ram_auto.c	(Arbeitskopie)
@@ -30,9 +30,6 @@ 
 /* Used by raminit. */
 #define QRANK_DIMM_SUPPORT 1
 
-/* Turn this on for SMBus debugging output. */
-#define DEBUG_SMBUS 0
-
 #if CONFIG_LOGICAL_CPUS == 1
 #define SET_NB_CFG_54 1
 #endif
Index: src/mainboard/msi/ms9282/cache_as_ram_auto.c
===================================================================
--- src/mainboard/msi/ms9282/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/msi/ms9282/cache_as_ram_auto.c	(Arbeitskopie)
@@ -38,8 +38,6 @@ 
 //if we want to wait for core1 done before DQS training, set it to 0
 #define K8_SET_FIDVID_CORE0_ONLY 1
 
-#define DEBUG_SMBUS 1
-
 #include <stdint.h>
 #include <string.h>
 #include <device/pci_def.h>
Index: src/mainboard/msi/ms9185/cache_as_ram_auto.c
===================================================================
--- src/mainboard/msi/ms9185/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/msi/ms9185/cache_as_ram_auto.c	(Arbeitskopie)
@@ -44,8 +44,6 @@ 
 //if we want to wait for core1 done before DQS training, set it to 0
 #define K8_SET_FIDVID_CORE0_ONLY 1
 
-#define DEBUG_SMBUS 1
-
 #include <stdint.h>
 #include <string.h>
 #include <device/pci_def.h>
Index: src/mainboard/msi/ms7260/cache_as_ram_auto.c
===================================================================
--- src/mainboard/msi/ms7260/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/msi/ms7260/cache_as_ram_auto.c	(Arbeitskopie)
@@ -24,7 +24,6 @@ 
 #define __ROMCC__
 
 // #define CACHE_AS_RAM_ADDRESS_DEBUG 1
-// #define DEBUG_SMBUS 1
 // #define RAM_TIMING_DEBUG 1
 // #define DQS_TRAIN_DEBUG 1
 // #define RES_DEBUG 1
Index: src/mainboard/asus/a8v-e_se/cache_as_ram_auto.c
===================================================================
--- src/mainboard/asus/a8v-e_se/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/asus/a8v-e_se/cache_as_ram_auto.c	(Arbeitskopie)
@@ -40,8 +40,6 @@ 
 /* If we want to wait for core1 done before DQS training, set it to 0. */
 #define K8_SET_FIDVID_CORE0_ONLY 1
 
-/* #define DEBUG_SMBUS 1 */
-
 #include <stdint.h>
 #include <string.h>
 #include <device/pci_def.h>
@@ -59,10 +57,10 @@ 
 #include "lib/delay.c"
 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
-#include "northbridge/amd/amdk8/debug.c"
 #include "northbridge/amd/amdk8/early_ht.c"
 #include "superio/winbond/w83627ehg/w83627ehg_early_serial.c"
 #include "southbridge/via/vt8237r/vt8237r_early_smbus.c"
+#include "northbridge/amd/amdk8/debug.c" /* After vt8237r_early_smbus.c! */
 #include "cpu/amd/mtrr/amd_earlymtrr.c"
 #include "cpu/x86/bist.h"
 #include "northbridge/amd/amdk8/setup_resource_map.c"
Index: src/mainboard/asus/a8n_e/cache_as_ram_auto.c
===================================================================
--- src/mainboard/asus/a8n_e/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/asus/a8n_e/cache_as_ram_auto.c	(Arbeitskopie)
@@ -30,9 +30,6 @@ 
 /* Used by raminit. */
 #define QRANK_DIMM_SUPPORT 1
 
-/* Turn this on for SMBus debugging output. */
-#define DEBUG_SMBUS 0
-
 #if CONFIG_LOGICAL_CPUS == 1
 #define SET_NB_CFG_54 1
 #endif
Index: src/mainboard/asus/m2v-mx_se/cache_as_ram_auto.c
===================================================================
--- src/mainboard/asus/m2v-mx_se/cache_as_ram_auto.c	(Revision 4815)
+++ src/mainboard/asus/m2v-mx_se/cache_as_ram_auto.c	(Arbeitskopie)
@@ -44,8 +44,6 @@ 
 #define K8_REV_F_SUPPORT_F0_F1_WORKAROUND 0
 #endif
 
-/* #define DEBUG_SMBUS 1 */
-
 #include <stdint.h>
 #include <string.h>
 #include <device/pci_def.h>
Index: src/config/Options.lb
===================================================================
--- src/config/Options.lb	(Revision 4815)
+++ src/config/Options.lb	(Arbeitskopie)
@@ -1162,3 +1162,21 @@ 
 	comment "Leave a hole for PCIe config space in the device allocator"
 end
 
+define CONFIG_DEBUG_RAM_SETUP
+	default 0
+	export always
+	comment "Output verbose RAM init debug messages"
+end
+
+define CONFIG_DEBUG_SMBUS
+	default 0
+	export always
+	comment "Output verbose SMBus debug messages"
+end
+
+define CONFIG_DEBUG_SMI
+	default 0
+	export always
+	comment "Output verbose SMI debug messages"
+end
+
Index: src/northbridge/via/cx700/raminit.c
===================================================================
--- src/northbridge/via/cx700/raminit.c	(Revision 4815)
+++ src/northbridge/via/cx700/raminit.c	(Arbeitskopie)
@@ -24,10 +24,8 @@ 
 #include <delay.h>
 #include "cx700_registers.h"
 
-// #define DEBUG_RAM_SETUP 1
-
 /* Debugging macros. */
-#if defined(DEBUG_RAM_SETUP)
+#if CONFIG_DEBUG_RAM_SETUP
 #define PRINTK_DEBUG(x...)      printk_debug(x)
 #else
 #define PRINTK_DEBUG(x...)
Index: src/northbridge/via/cx700/cx700_early_smbus.c
===================================================================
--- src/northbridge/via/cx700/cx700_early_smbus.c	(Revision 4815)
+++ src/northbridge/via/cx700/cx700_early_smbus.c	(Arbeitskopie)
@@ -48,10 +48,7 @@ 
 #define SMBUS_DELAY()		outb(0x80, 0x80)
 
 /* Debugging macros. */
-
-// #define DEBUG_SMBUS 1
-
-#ifdef DEBUG_SMBUS
+#if CONFIG_DEBUG_SMBUS
 #define PRINT_DEBUG(x)		print_debug(x)
 #define PRINT_DEBUG_HEX16(x)	print_debug_hex16(x)
 #else
@@ -102,7 +99,7 @@ 
 		SMBUS_DELAY();
 		++loops;
 	}
-#ifdef DEBUG_SMBUS
+#if CONFIG_DEBUG_SMBUS
 	/* Some systems seem to have a flakey SMBus. No need to spew a lot of
 	 * errors on those, once we know that SMBus access is principally
 	 * working.
@@ -234,7 +231,7 @@ 
 }
 
 /* Debugging Function */
-#ifdef DEBUG_SMBUS
+#ifdef CONFIG_DEBUG_SMBUS
 static void dump_spd_data(const struct mem_controller *ctrl)
 {
 	int dimm, offset, regs;
Index: src/northbridge/via/vx800/raminit.c
===================================================================
--- src/northbridge/via/vx800/raminit.c	(Revision 4815)
+++ src/northbridge/via/vx800/raminit.c	(Arbeitskopie)
@@ -21,9 +21,7 @@ 
 #include <sdram_mode.h>
 #include <delay.h>
 
-#define DEBUG_RAM_SETUP 1
-
-#ifdef DEBUG_RAM_SETUP
+#if CONFIG_DEBUG_RAM_SETUP
 #define PRINT_DEBUG_MEM(x)		print_debug(x)
 #define PRINT_DEBUG_MEM_HEX8(x)		print_debug_hex8(x)
 #define PRINT_DEBUG_MEM_HEX16(x)	print_debug_hex16(x)
Index: src/northbridge/via/vx800/vx800_early_smbus.c
===================================================================
--- src/northbridge/via/vx800/vx800_early_smbus.c	(Revision 4815)
+++ src/northbridge/via/vx800/vx800_early_smbus.c	(Arbeitskopie)
@@ -49,11 +49,7 @@ 
 
 #define SMBUS_DELAY()		outb(0x80, 0x80)
 
-/* Debugging macros. Only necessary if something isn't working right */
-
-#define DEBUG_SMBUS 1
-
-#ifdef DEBUG_SMBUS
+#ifdef CONFIG_DEBUG_SMBUS
 #define PRINT_DEBUG(x)		print_debug(x)
 #define PRINT_DEBUG_HEX16(x)	print_debug_hex16(x)
 #else
@@ -289,7 +285,7 @@ 
 }
 
 /* Debugging Function */
-#ifdef DEBUG_SMBUS
+#if CONFIG_DEBUG_SMBUS
 static void dump_spd_data(void)
 {
 	int dimm, offset, regs;
Index: src/northbridge/via/cn700/raminit.c
===================================================================
--- src/northbridge/via/cn700/raminit.c	(Revision 4815)
+++ src/northbridge/via/cn700/raminit.c	(Arbeitskopie)
@@ -25,9 +25,7 @@ 
 #include <delay.h>
 #include "cn700.h"
 
-// #define DEBUG_RAM_SETUP 1
-
-#ifdef DEBUG_RAM_SETUP
+#ifdef CONFIG_DEBUG_RAM_SETUP
 #define PRINT_DEBUG_MEM(x)		print_debug(x)
 #define PRINT_DEBUG_MEM_HEX8(x)		print_debug_hex8(x)
 #define PRINT_DEBUG_MEM_HEX16(x)	print_debug_hex16(x)
@@ -51,12 +49,6 @@ 
 	reg &= 0xf8;		/* Clear bits 2-0. */
 	reg |= command;
 	pci_write_config8(dev, DRAM_MISC_CTL, reg);
-
-	PRINT_DEBUG_MEM("    Sending RAM command 0x");
-	PRINT_DEBUG_MEM_HEX8(reg);
-	PRINT_DEBUG_MEM(" to 0x");
-	PRINT_DEBUG_MEM_HEX32(0 + addr_offset);
-	PRINT_DEBUG_MEM("\r\n");
 }
 
 /**
Index: src/northbridge/amd/amdk8/raminit_f.c
===================================================================
--- src/northbridge/amd/amdk8/raminit_f.c	(Revision 4815)
+++ src/northbridge/amd/amdk8/raminit_f.c	(Arbeitskopie)
@@ -39,9 +39,7 @@ 
 #error This file needs CONFIG_USE_PRINTK_IN_CAR
 #endif
 
-#define RAM_TIMING_DEBUG 0
-
-#if RAM_TIMING_DEBUG == 1
+#if DEBUG_RAM_SETUP
 #define printk_raminit printk_debug
 #else
 #define printk_raminit(fmt, arg...)
Index: src/northbridge/amd/amdk8/debug.c
===================================================================
--- src/northbridge/amd/amdk8/debug.c	(Revision 4815)
+++ src/northbridge/amd/amdk8/debug.c	(Arbeitskopie)
@@ -174,11 +174,8 @@ 
 	}
 }
 
-#ifndef DEBUG_SMBUS
-#define DEBUG_SMBUS 0
-#endif
+#if CONFIG_DEBUG_SMBUS
 
-#if DEBUG_SMBUS == 1
 static void dump_spd_registers(const struct mem_controller *ctrl)
 {
 	int i;
Index: src/northbridge/amd/amdfam10/debug.c
===================================================================
--- src/northbridge/amd/amdfam10/debug.c	(Revision 4815)
+++ src/northbridge/amd/amdfam10/debug.c	(Arbeitskopie)
@@ -220,12 +220,8 @@ 
 	}
 }
 
-#ifndef DEBUG_SMBUS
-#define DEBUG_SMBUS 0
-#endif
+#if CONFIG_DEBUG_SMBUS
 
-#if DEBUG_SMBUS == 1
-
 static void dump_spd_registers(const struct mem_controller *ctrl)
 {
 	int i;
Index: src/northbridge/amd/amdfam10/raminit_amdmct.c
===================================================================
--- src/northbridge/amd/amdfam10/raminit_amdmct.c	(Revision 4815)
+++ src/northbridge/amd/amdfam10/raminit_amdmct.c	(Arbeitskopie)
@@ -23,21 +23,16 @@ 
 	printk_debug("%s%08x\n", strval, val);
 }
 
-
-#define RAMINIT_DEBUG 1
-
-
 static  void print_tx(const char *strval, u32 val)
 {
-#if RAMINIT_DEBUG == 1
+#if CONFIG_DEBUG_RAM_SETUP
 	print_raminit(strval, val);
 #endif
 }
 
-
 static  void print_t(const char *strval)
 {
-#if RAMINIT_DEBUG == 1
+#if CONFIG_DEBUG_RAM_SETUP
 	print_debug(strval);
 #endif
 }
Index: src/northbridge/intel/e7501/raminit.c
===================================================================
--- src/northbridge/intel/e7501/raminit.c	(Revision 4815)
+++ src/northbridge/intel/e7501/raminit.c	(Arbeitskopie)
@@ -22,10 +22,7 @@ 
 // Unfortunately the code seems to chew up several K of space.
 //#define VALIDATE_DIMM_COMPATIBILITY
 
-// Uncomment this to enable local debugging messages
-//#define DEBUG_RAM_CONFIG
-
-#if defined(DEBUG_RAM_CONFIG)
+#if CONFIG_DEBUG_RAM_SETUP
 #define RAM_DEBUG_MESSAGE(x)	print_debug(x)
 #define RAM_DEBUG_HEX32(x)		print_debug_hex32(x)
 #define RAM_DEBUG_HEX8(x)		print_debug_hex8(x)
Index: src/northbridge/intel/i855pm/raminit.c
===================================================================
--- src/northbridge/intel/i855pm/raminit.c	(Revision 4815)
+++ src/northbridge/intel/i855pm/raminit.c	(Arbeitskopie)
@@ -17,6 +17,7 @@ 
 
 /* converted to C 6/2004 yhlu */
 
+/* TODO: Fix code to use CONFIG_DEBUG_RAM_SETUP. */
 #define DEBUG_RAM_CONFIG 2
 #undef ASM_CONSOLE_LOGLEVEL
 #define ASM_CONSOLE_LOGLEVEL 8
Index: src/northbridge/intel/i440bx/raminit.c
===================================================================
--- src/northbridge/intel/i440bx/raminit.c	(Revision 4815)
+++ src/northbridge/intel/i440bx/raminit.c	(Arbeitskopie)
@@ -28,11 +28,8 @@ 
 Macros and definitions.
 -----------------------------------------------------------------------------*/
 
-/* Uncomment this to enable debugging output. */
-#define DEBUG_RAM_SETUP 1
-
 /* Debugging macros. */
-#if defined(DEBUG_RAM_SETUP)
+#if CONFIG_DEBUG_RAM_SETUP
 #define PRINT_DEBUG(x)		print_debug(x)
 #define PRINT_DEBUG_HEX8(x)	print_debug_hex8(x)
 #define PRINT_DEBUG_HEX16(x)	print_debug_hex16(x)
Index: src/northbridge/intel/i945/raminit.c
===================================================================
--- src/northbridge/intel/i945/raminit.c	(Revision 4815)
+++ src/northbridge/intel/i945/raminit.c	(Arbeitskopie)
@@ -24,10 +24,8 @@ 
 #include "raminit.h"
 #include "i945.h"
 
-#define DEBUG_RAM_SETUP
-
 /* Debugging macros. */
-#if defined(DEBUG_RAM_SETUP)
+#if CONFIG_DEBUG_RAM_SETUP
 #define PRINTK_DEBUG(x...)	printk_debug(x)
 #else
 #define PRINTK_DEBUG(x...)
@@ -73,7 +71,7 @@ 
 	read32(offset);
 }
 
-#ifdef DEBUG_RAM_SETUP
+#if CONFIG_DEBUG_RAM_SETUP
 static void sdram_dump_mchbar_registers(void)
 {
 	int i;
Index: src/northbridge/intel/i82810/raminit.c
===================================================================
--- src/northbridge/intel/i82810/raminit.c	(Revision 4815)
+++ src/northbridge/intel/i82810/raminit.c	(Arbeitskopie)
@@ -29,11 +29,8 @@ 
 Macros and definitions.
 -----------------------------------------------------------------------------*/
 
-/* Uncomment this to enable debugging output. */
-// #define DEBUG_RAM_SETUP 1
-
 /* Debugging macros. */
-#if defined(DEBUG_RAM_SETUP)
+#if CONFIG_DEBUG_RAM_SETUP
 #define PRINT_DEBUG(x)		print_debug(x)
 #define PRINT_DEBUG_HEX8(x)	print_debug_hex8(x)
 #define PRINT_DEBUG_HEX16(x)	print_debug_hex16(x)
Index: src/northbridge/intel/i82830/raminit.c
===================================================================
--- src/northbridge/intel/i82830/raminit.c	(Revision 4815)
+++ src/northbridge/intel/i82830/raminit.c	(Arbeitskopie)
@@ -29,11 +29,8 @@ 
 Macros and definitions.
 -----------------------------------------------------------------------------*/
 
-/* Uncomment this to enable debugging output. */
-/* #define DEBUG_RAM_SETUP 1 */
-
 /* Debugging macros. */
-#if defined(DEBUG_RAM_SETUP)
+#if CONFIG_DEBUG_RAM_SETUP
 #define PRINT_DEBUG(x)		print_debug(x)
 #define PRINT_DEBUG_HEX8(x)	print_debug_hex8(x)
 #define PRINT_DEBUG_HEX16(x)	print_debug_hex16(x)