Patchwork Move USB debug port includes out of romstage

login
register
about
Submitter Patrick Georgi
Date 2010-10-05 10:56:41
Message ID <4CAB0469.5080708@georgi-clan.de>
Download mbox | patch
Permalink /patch/2040/
State Accepted
Headers show

Comments

Patrick Georgi - 2010-10-05 10:56:41
Hi,

attached patch does:
- move EHCI_BAR_INDEX to ehci.h - it's constant as per EHCI spec 2.3.1
- move EHCI_BAR and EHCI_DEBUG_OFFSET to Kconfig to be set by USB debug
port enabled southbridges
- drop USB debug code includes from romstage.cs and use romstage-srcs in
the build system instead
- Disable USBDEBUG in abuild, I forgot this by accident before the
previous commit

It's abuild tested.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Uwe Hermann - 2010-10-05 12:21:57
On Tue, Oct 05, 2010 at 12:56:41PM +0200, Patrick Georgi wrote:
> Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>

Looks good.

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


Uwe.
Myles Watson - 2010-10-05 12:46:19
On Tue, Oct 5, 2010 at 4:56 AM, Patrick Georgi <patrick@georgi-clan.de> wrote:
> Hi,
>
> attached patch does:
> - move EHCI_BAR_INDEX to ehci.h - it's constant as per EHCI spec 2.3.1
> - move EHCI_BAR and EHCI_DEBUG_OFFSET to Kconfig to be set by USB debug
> port enabled southbridges
> - drop USB debug code includes from romstage.cs and use romstage-srcs in
> the build system instead
> - Disable USBDEBUG in abuild, I forgot this by accident before the
> previous commit

Since you're changing USBDEBUG code, it seems like a good idea to keep
it in abuild... at least until it has stabilized.

Thanks,
Myles
Patrick Georgi - 2010-10-05 13:40:46
Am 05.10.2010 14:46, schrieb Myles Watson:
> Since you're changing USBDEBUG code, it seems like a good idea to keep
> it in abuild... at least until it has stabilized.
Kept it in.


Patrick
Peter Stuge - 2010-10-05 15:57:13
Patrick Georgi wrote:
> - move EHCI_BAR and EHCI_DEBUG_OFFSET to Kconfig to be set by USB
> debug port enabled southbridges

Only comment is that I really like the

if SOUTH

config FOO
  default xy

endif

pattern in Kconfig files, so that the SOUTH isn't needed in each
place.


//Peter

Patch

Index: src/southbridge/amd/sb600/Kconfig

===================================================================
--- src/southbridge/amd/sb600/Kconfig	(Revision 5909)

+++ src/southbridge/amd/sb600/Kconfig	(Arbeitskopie)

@@ -22,3 +22,11 @@ 

 	select IOAPIC
 	select HAVE_USBDEBUG
 
+config EHCI_BAR
+	hex
+	default 0xfef00000 if SOUTHBRIDGE_AMD_SB600
+
+config EHCI_DEBUG_OFFSET
+	hex
+	default 0xe0 if SOUTHBRIDGE_AMD_SB600
+
Index: src/southbridge/amd/sb600/sb600.h

===================================================================
--- src/southbridge/amd/sb600/sb600.h	(Revision 5909)

+++ src/southbridge/amd/sb600/sb600.h	(Arbeitskopie)

@@ -40,4 +40,5 @@ 

 void sb600_lpc_port80(void);
 void sb600_pci_port80(void);
 
+void sb600_enable_usbdebug(unsigned int port);
 #endif /* SB600_H */
Index: src/southbridge/amd/sb600/Makefile.inc

===================================================================
--- src/southbridge/amd/sb600/Makefile.inc	(Revision 5909)

+++ src/southbridge/amd/sb600/Makefile.inc	(Arbeitskopie)

@@ -8,3 +8,4 @@ 

 driver-y += sb600_ac97.c
 driver-y += sb600_pci.c
 ramstage-y += sb600_reset.c
+romstage-y += sb600_enable_usbdebug.c
Index: src/southbridge/amd/sb600/sb600_enable_usbdebug.c

===================================================================
--- src/southbridge/amd/sb600/sb600_enable_usbdebug.c	(Revision 5909)

+++ src/southbridge/amd/sb600/sb600_enable_usbdebug.c	(Arbeitskopie)

@@ -18,20 +18,19 @@ 

  */
 
 #include <stdint.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
 #include <usbdebug.h>
 #include <device/pci_def.h>
+#include "sb600.h"
 
-#define EHCI_BAR		0xFEF00000	/* EHCI BAR address */
-#define EHCI_BAR_INDEX		0x10		/* TODO: DBUG_PRT[31:29] */
-#define EHCI_DEBUG_OFFSET	0xE0		/* Hardcoded to 0xE0 */
-
 /* Required for successful build, but currently empty. */
 void set_debug_port(unsigned int port)
 {
 	/* TODO: Allow changing the physical USB port used as Debug Port. */
 }
 
-static void sb600_enable_usbdebug(unsigned int port)
+void sb600_enable_usbdebug(unsigned int port)
 {
 	device_t dev = PCI_DEV(0, 0x13, 5); /* USB EHCI, D19:F5 */
 
@@ -39,7 +38,7 @@ 

 	set_debug_port(port);
 
 	/* Set the EHCI BAR address. */
-	pci_write_config32(dev, EHCI_BAR_INDEX, EHCI_BAR);
+	pci_write_config32(dev, EHCI_BAR_INDEX, CONFIG_EHCI_BAR);
 
 	/* Enable access to the EHCI memory space registers. */
 	pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY);
Index: src/southbridge/amd/sb700/Kconfig

===================================================================
--- src/southbridge/amd/sb700/Kconfig	(Revision 5909)

+++ src/southbridge/amd/sb700/Kconfig	(Arbeitskopie)

@@ -27,3 +27,11 @@ 

 	default n
 	depends on SOUTHBRIDGE_AMD_SB700
 
+config EHCI_BAR
+	hex
+	default 0xfef00000 if SOUTHBRIDGE_AMD_SB700
+
+config EHCI_DEBUG_OFFSET
+	hex
+	default 0xe0 if SOUTHBRIDGE_AMD_SB700
+
Index: src/southbridge/amd/sb700/sb700.h

===================================================================
--- src/southbridge/amd/sb700/sb700.h	(Revision 5909)

+++ src/southbridge/amd/sb700/sb700.h	(Arbeitskopie)

@@ -59,4 +59,5 @@ 

 
 #endif
 
+void sb700_enable_usbdebug(unsigned int port);
 #endif /* SB700_H */
Index: src/southbridge/amd/sb700/Makefile.inc

===================================================================
--- src/southbridge/amd/sb700/Makefile.inc	(Revision 5909)

+++ src/southbridge/amd/sb700/Makefile.inc	(Arbeitskopie)

@@ -7,3 +7,4 @@ 

 driver-y += sb700_hda.c
 driver-y += sb700_pci.c
 ramstage-y += sb700_reset.c
+romstage-y += sb700_enable_usbdebug.c
Index: src/southbridge/amd/sb700/sb700_enable_usbdebug.c

===================================================================
--- src/southbridge/amd/sb700/sb700_enable_usbdebug.c	(Revision 5909)

+++ src/southbridge/amd/sb700/sb700_enable_usbdebug.c	(Arbeitskopie)

@@ -19,14 +19,13 @@ 

  */
 
 #include <stdint.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
 #include <usbdebug.h>
 #include <device/pci_def.h>
+#include "sb700.h"
 
-#define EHCI_BAR		0xFEF00000	/* EHCI BAR address */
-#define EHCI_BAR_INDEX		0x10		/* TODO: DBUG_PRT[31:29] */
-#define EHCI_DEBUG_OFFSET	0xE0		/* Hardcoded to 0xE0 */
-
-#define EHCI_EOR		(EHCI_BAR + 0x20)
+#define EHCI_EOR		(CONFIG_EHCI_BAR + 0x20)
 #define DEBUGPORT_MISC_CONTROL	(EHCI_EOR + 0x80)
 
 void set_debug_port(unsigned int port)
@@ -46,12 +45,12 @@ 

  * This code currently only supports the first one, i.e., USB Debug devices
  * attached to physical USB ports belonging to the first EHCI device.
  */
-static void sb700_enable_usbdebug(unsigned int port)
+void sb700_enable_usbdebug(unsigned int port)
 {
 	device_t dev = PCI_DEV(0, 0x12, 2); /* USB EHCI, D18:F2 */
 
 	/* Set the EHCI BAR address. */
-	pci_write_config32(dev, EHCI_BAR_INDEX, EHCI_BAR);
+	pci_write_config32(dev, EHCI_BAR_INDEX, CONFIG_EHCI_BAR);
 
 	/* Enable access to the EHCI memory space registers. */
 	pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY);
Index: src/southbridge/nvidia/ck804/ck804.h

===================================================================
--- src/southbridge/nvidia/ck804/ck804.h	(Revision 5909)

+++ src/southbridge/nvidia/ck804/ck804.h	(Arbeitskopie)

@@ -4,5 +4,6 @@ 

 #include "chip.h"
 
 void ck804_enable(device_t dev);
+void ck804_enable_usbdebug(unsigned int port);
 
 #endif
Index: src/southbridge/nvidia/ck804/Kconfig

===================================================================
--- src/southbridge/nvidia/ck804/Kconfig	(Revision 5909)

+++ src/southbridge/nvidia/ck804/Kconfig	(Arbeitskopie)

@@ -8,3 +8,11 @@ 

 	hex
 	default 0x80 if SOUTHBRIDGE_NVIDIA_CK804
 
+config EHCI_BAR
+	hex
+	default 0xfef00000 if SOUTHBRIDGE_NVIDIA_CK804
+
+config EHCI_DEBUG_OFFSET
+	hex
+	default 0x98 if SOUTHBRIDGE_NVIDIA_CK804
+
Index: src/southbridge/nvidia/ck804/Makefile.inc

===================================================================
--- src/southbridge/nvidia/ck804/Makefile.inc	(Revision 5909)

+++ src/southbridge/nvidia/ck804/Makefile.inc	(Arbeitskopie)

@@ -15,5 +15,8 @@ 

 
 ramstage-$(CONFIG_GENERATE_ACPI_TABLES) += ck804_fadt.c
 
+romstage-y += ck804_enable_usbdebug.c
+
 chipset_bootblock_inc += $(src)/southbridge/nvidia/ck804/romstrap.inc
 chipset_bootblock_lds += $(src)/southbridge/nvidia/ck804/romstrap.lds
+
Index: src/southbridge/nvidia/ck804/ck804_enable_usbdebug.c

===================================================================
--- src/southbridge/nvidia/ck804/ck804_enable_usbdebug.c	(Revision 5909)

+++ src/southbridge/nvidia/ck804/ck804_enable_usbdebug.c	(Arbeitskopie)

@@ -22,8 +22,11 @@ 

  */
 
 #include <stdint.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
 #include <usbdebug.h>
 #include <device/pci_def.h>
+#include "ck804.h"
 
 #if CONFIG_HT_CHAIN_END_UNITID_BASE != 0x20
 #define CK804_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
@@ -31,10 +34,6 @@ 

 #define CK804_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
 #endif
 
-#define EHCI_BAR		0xFEF00000	/* EHCI BAR address */
-#define EHCI_BAR_INDEX		0x10
-#define EHCI_DEBUG_OFFSET	0x98
-
 void set_debug_port(unsigned int port)
 {
 	u32 dword;
@@ -47,7 +46,7 @@ 

 	pci_write_config32(dev, 0x74, dword);
 }
 
-static void ck804_enable_usbdebug(unsigned int port)
+void ck804_enable_usbdebug(unsigned int port)
 {
 	device_t dev = PCI_DEV(0, CK804_DEVN_BASE + 2, 1); /* USB EHCI */
 
@@ -55,7 +54,7 @@ 

 	set_debug_port(port);
 
 	/* Set the EHCI BAR address. */
-	pci_write_config32(dev, EHCI_BAR_INDEX, EHCI_BAR);
+	pci_write_config32(dev, EHCI_BAR_INDEX, CONFIG_EHCI_BAR);
 
 	/* Enable access to the EHCI memory space registers. */
 	pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY);
Index: src/southbridge/nvidia/mcp55/mcp55.h

===================================================================
--- src/southbridge/nvidia/mcp55/mcp55.h	(Revision 5909)

+++ src/southbridge/nvidia/mcp55/mcp55.h	(Arbeitskopie)

@@ -29,4 +29,5 @@ 

 #else
 void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn);
 #endif
+void mcp55_enable_usbdebug(unsigned int port);
 #endif /* MCP55_H */
Index: src/southbridge/nvidia/mcp55/Kconfig

===================================================================
--- src/southbridge/nvidia/mcp55/Kconfig	(Revision 5909)

+++ src/southbridge/nvidia/mcp55/Kconfig	(Arbeitskopie)

@@ -6,3 +6,12 @@ 

 config ID_SECTION_OFFSET
 	hex
 	default 0x80 if SOUTHBRIDGE_NVIDIA_MCP55
+
+config EHCI_BAR
+	hex
+	default 0xfef00000 if SOUTHBRIDGE_NVIDIA_MCP55
+
+config EHCI_DEBUG_OFFSET
+	hex
+	default 0x98 if SOUTHBRIDGE_NVIDIA_MCP55
+
Index: src/southbridge/nvidia/mcp55/Makefile.inc

===================================================================
--- src/southbridge/nvidia/mcp55/Makefile.inc	(Revision 5909)

+++ src/southbridge/nvidia/mcp55/Makefile.inc	(Arbeitskopie)

@@ -15,5 +15,7 @@ 

 
 ramstage-y += mcp55_reset.c
 
+romstage-y += mcp55_enable_usbdebug.c
+
 chipset_bootblock_inc += $(src)/southbridge/nvidia/mcp55/romstrap.inc
 chipset_bootblock_lds += $(src)/southbridge/nvidia/mcp55/romstrap.lds
Index: src/southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c

===================================================================
--- src/southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c	(Revision 5909)

+++ src/southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c	(Arbeitskopie)

@@ -22,8 +22,11 @@ 

  */
 
 #include <stdint.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
 #include <usbdebug.h>
 #include <device/pci_def.h>
+#include "mcp55.h"
 
 #if CONFIG_HT_CHAIN_END_UNITID_BASE != 0x20
 #define MCP55_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
@@ -31,10 +34,6 @@ 

 #define MCP55_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
 #endif
 
-#define EHCI_BAR		0xFEF00000	/* EHCI BAR address */
-#define EHCI_BAR_INDEX		0x10
-#define EHCI_DEBUG_OFFSET	0x98
-
 void set_debug_port(unsigned int port)
 {
 	u32 dword;
@@ -47,7 +46,7 @@ 

 	pci_write_config32(dev, 0x74, dword);
 }
 
-static void mcp55_enable_usbdebug(unsigned int port)
+void mcp55_enable_usbdebug(unsigned int port)
 {
 	device_t dev = PCI_DEV(0, MCP55_DEVN_BASE + 2, 1); /* USB EHCI */
 
@@ -55,7 +54,7 @@ 

 	set_debug_port(port);
 
 	/* Set the EHCI BAR address. */
-	pci_write_config32(dev, EHCI_BAR_INDEX, EHCI_BAR);
+	pci_write_config32(dev, EHCI_BAR_INDEX, CONFIG_EHCI_BAR);
 
 	/* Enable access to the EHCI memory space registers. */
 	pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY);
Index: src/southbridge/intel/i82801gx/i82801gx.h

===================================================================
--- src/southbridge/intel/i82801gx/i82801gx.h	(Revision 5909)

+++ src/southbridge/intel/i82801gx/i82801gx.h	(Arbeitskopie)

@@ -39,10 +39,13 @@ 

 #ifndef __ACPI__
 #define DEBUG_PERIODIC_SMIS 0
 
+#if !defined(ASSEMBLY)
 #if !defined(__PRE_RAM__)
 #include "chip.h"
 extern void i82801gx_enable(device_t dev);
 #endif
+void i82801gx_enable_usbdebug(unsigned int port);
+#endif
 
 #define MAINBOARD_POWER_OFF	0
 #define MAINBOARD_POWER_ON	1
Index: src/southbridge/intel/i82801gx/Kconfig

===================================================================
--- src/southbridge/intel/i82801gx/Kconfig	(Revision 5909)

+++ src/southbridge/intel/i82801gx/Kconfig	(Arbeitskopie)

@@ -24,3 +24,11 @@ 

 	select HAVE_USBDEBUG
 	select USE_WATCHDOG_ON_BOOT
 
+config EHCI_BAR
+	hex
+	default 0xfef00000 if SOUTHBRIDGE_INTEL_I82801GX
+
+config EHCI_DEBUG_OFFSET
+	hex
+	default 0xa0 if SOUTHBRIDGE_INTEL_I82801GX
+
Index: src/southbridge/intel/i82801gx/i82801gx_usb_debug.c

===================================================================
--- src/southbridge/intel/i82801gx/i82801gx_usb_debug.c	(Revision 5909)

+++ src/southbridge/intel/i82801gx/i82801gx_usb_debug.c	(Arbeitskopie)

@@ -18,33 +18,33 @@ 

  */
 
 #include <stdint.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
+#include <console/console.h>
 #include <usbdebug.h>
 #include <device/pci_def.h>
+#include "i82801gx.h"
 
-#define EHCI_BAR		0xFEF00000	/* EHCI BAR address */
-#define EHCI_BAR_INDEX		0x10		/* Hardwired 0x10 (>= ICH4). */
-#define EHCI_DEBUG_OFFSET	0xA0		/* Hardwired 0xa0 (>= ICH5). */
-
 /* Required for successful build, but currently empty. */
 void set_debug_port(unsigned int port)
 {
 	/* Not needed, the ICH* southbridges hardcode physical USB port 1. */
 }
 
-static void i82801gx_enable_usbdebug(unsigned int port)
+void i82801gx_enable_usbdebug(unsigned int port)
 {
 	u32 dbgctl;
 	device_t dev = PCI_DEV(0, 0x1d, 7); /* USB EHCI, D29:F7 */
 
 	/* Set the EHCI BAR address. */
-	pci_write_config32(dev, EHCI_BAR_INDEX, EHCI_BAR);
+	pci_write_config32(dev, EHCI_BAR_INDEX, CONFIG_EHCI_BAR);
 
 	/* Enable access to the EHCI memory space registers. */
 	pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY);
 
 	/* Force ownership of the Debug Port to the EHCI controller. */
 	printk(BIOS_DEBUG, "Enabling OWNER_CNT\n");
-	dbgctl = read32(EHCI_BAR + EHCI_DEBUG_OFFSET);
+	dbgctl = read32(CONFIG_EHCI_BAR + CONFIG_EHCI_DEBUG_OFFSET);
 	dbgctl |= (1 << 30);
-	write32(EHCI_BAR + EHCI_DEBUG_OFFSET, dbgctl);
+	write32(CONFIG_EHCI_BAR + CONFIG_EHCI_DEBUG_OFFSET, dbgctl);
 }
Index: src/southbridge/sis/sis966/Kconfig

===================================================================
--- src/southbridge/sis/sis966/Kconfig	(Revision 5909)

+++ src/southbridge/sis/sis966/Kconfig	(Arbeitskopie)

@@ -6,3 +6,11 @@ 

 config ID_SECTION_OFFSET
 	hex
 	default 0x80 if SOUTHBRIDGE_SIS_SIS966
+
+config EHCI_BAR
+	hex
+	default 0xfef00000 if SOUTHBRIDGE_SIS_SIS966
+
+config EHCI_DEBUG_OFFSET
+	hex
+	default 0x98 if SOUTHBRIDGE_SIS_SIS966
Index: src/southbridge/sis/sis966/Makefile.inc

===================================================================
--- src/southbridge/sis/sis966/Makefile.inc	(Revision 5909)

+++ src/southbridge/sis/sis966/Makefile.inc	(Arbeitskopie)

@@ -9,6 +9,7 @@ 

 driver-y += sis966_pcie.c
 driver-y += sis966_aza.c
 ramstage-y += sis966_reset.c
+romstage-y += sis966_enable_usbdebug.c
 
 chipset_bootblock_inc += $(src)/southbridge/sis/sis966/romstrap.inc
 chipset_bootblock_lds += $(src)/southbridge/sis/sis966/romstrap.lds
Index: src/southbridge/sis/sis966/sis966.h

===================================================================
--- src/southbridge/sis/sis966/sis966.h	(Revision 5909)

+++ src/southbridge/sis/sis966/sis966.h	(Arbeitskopie)

@@ -32,5 +32,6 @@ 

 #include "chip.h"
 
 void sis966_enable(device_t dev);
+void sis966_enable_usbdebug(unsigned int port);
 
 #endif /* SIS966_H */
Index: src/southbridge/sis/sis966/sis966_enable_usbdebug.c

===================================================================
--- src/southbridge/sis/sis966/sis966_enable_usbdebug.c	(Revision 5909)

+++ src/southbridge/sis/sis966/sis966_enable_usbdebug.c	(Arbeitskopie)

@@ -24,8 +24,11 @@ 

 /* TODO: Check whether this actually works (might be copy-paste leftover). */
 
 #include <stdint.h>
+#include <arch/io.h>
+#include <arch/romcc_io.h>
 #include <usbdebug.h>
 #include <device/pci_def.h>
+#include "sis966.h"
 
 #if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
 #define SIS966_DEVN_BASE CONFIG_HT_CHAIN_END_UNITID_BASE
@@ -33,10 +36,6 @@ 

 #define SIS966_DEVN_BASE CONFIG_HT_CHAIN_UNITID_BASE
 #endif
 
-#define EHCI_BAR		0xFEF00000	/* EHCI BAR address */
-#define EHCI_BAR_INDEX		0x10
-#define EHCI_DEBUG_OFFSET	0x98
-
 void set_debug_port(unsigned int port)
 {
 	u32 dword;
@@ -49,7 +48,7 @@ 

 	pci_write_config32(dev, 0x74, dword);
 }
 
-static void sis966_enable_usbdebug(unsigned int port)
+void sis966_enable_usbdebug(unsigned int port)
 {
 	device_t dev = PCI_DEV(0, SIS966_DEVN_BASE + 2, 1); /* USB EHCI */
 
@@ -57,7 +56,7 @@ 

 	set_debug_port(port);
 
 	/* Set the EHCI BAR address. */
-	pci_write_config32(dev, EHCI_BAR_INDEX, EHCI_BAR);
+	pci_write_config32(dev, EHCI_BAR_INDEX, CONFIG_EHCI_BAR);
 
 	/* Enable access to the EHCI memory space registers. */
 	pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY);
Index: src/include/usbdebug.h

===================================================================
--- src/include/usbdebug.h	(Revision 5909)

+++ src/include/usbdebug.h	(Arbeitskopie)

@@ -41,6 +41,7 @@ 

 void set_ehci_debug(unsigned ehci_deug);
 unsigned get_ehci_debug(void);
 void set_debug_port(unsigned port);
+void early_usbdebug_init(void);
 void usbdebug_ram_tx_byte(unsigned char data);
 void usbdebug_tx_byte(unsigned char data);
 
Index: src/include/ehci.h

===================================================================
--- src/include/ehci.h	(Revision 5909)

+++ src/include/ehci.h	(Arbeitskopie)

@@ -23,6 +23,8 @@ 

 #ifndef EHCI_H
 #define EHCI_H
 
+#define EHCI_BAR_INDEX		0x10
+
 /* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
 
 /* Section 2.2 Host Controller Capability Registers */
Index: src/mainboard/asrock/939a785gmh/romstage.c

===================================================================
--- src/mainboard/asrock/939a785gmh/romstage.c	(Revision 5909)

+++ src/mainboard/asrock/939a785gmh/romstage.c	(Arbeitskopie)

@@ -51,12 +51,8 @@ 

 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
 #include "superio/winbond/w83627dhg/w83627dhg_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 
Index: src/mainboard/getac/p470/romstage.c

===================================================================
--- src/mainboard/getac/p470/romstage.c	(Revision 5910)

+++ src/mainboard/getac/p470/romstage.c	(Arbeitskopie)

@@ -27,6 +27,7 @@ 

 #include <device/pnp_def.h>
 #include <cpu/x86/lapic.h>
 #include <lib.h>
+#include <usbdebug.h>
 
 #include <pc80/mc146818rtc.h>
 
Index: src/mainboard/kontron/986lcd-m/romstage.c

===================================================================
--- src/mainboard/kontron/986lcd-m/romstage.c	(Revision 5910)

+++ src/mainboard/kontron/986lcd-m/romstage.c	(Arbeitskopie)

@@ -27,6 +27,7 @@ 

 #include <device/pci_def.h>
 #include <device/pnp_def.h>
 #include <cpu/x86/lapic.h>
+#include <usbdebug.h>
 
 #include "superio/winbond/w83627thg/w83627thg.h"
 
Index: src/mainboard/kontron/kt690/romstage.c

===================================================================
--- src/mainboard/kontron/kt690/romstage.c	(Revision 5909)

+++ src/mainboard/kontron/kt690/romstage.c	(Arbeitskopie)

@@ -53,10 +53,7 @@ 

 #include "northbridge/amd/amdk8/debug.c"
 #include "superio/winbond/w83627dhg/w83627dhg_early_serial.c"
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb600/sb600_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
Index: src/mainboard/gigabyte/m57sli/romstage.c

===================================================================
--- src/mainboard/gigabyte/m57sli/romstage.c	(Revision 5910)

+++ src/mainboard/gigabyte/m57sli/romstage.c	(Arbeitskopie)

@@ -49,10 +49,7 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
-#if CONFIG_USBDEBUG
-#include "southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
Index: src/mainboard/gigabyte/ma78gm/romstage.c

===================================================================
--- src/mainboard/gigabyte/ma78gm/romstage.c	(Revision 5910)

+++ src/mainboard/gigabyte/ma78gm/romstage.c	(Arbeitskopie)

@@ -59,12 +59,8 @@ 

 static int smbus_read_byte(u32 device, u32 address);
 
 #include "superio/ite/it8718f/it8718f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
Index: src/mainboard/gigabyte/ga_2761gxdk/romstage.c

===================================================================
--- src/mainboard/gigabyte/ga_2761gxdk/romstage.c	(Revision 5910)

+++ src/mainboard/gigabyte/ga_2761gxdk/romstage.c	(Arbeitskopie)

@@ -51,13 +51,11 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
-#if CONFIG_USBDEBUG
-#include "southbridge/sis/sis966/sis966_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
+#include "southbridge/sis/sis966/sis966.h"
 #include "southbridge/sis/sis966/sis966_early_smbus.c"
 #include "southbridge/sis/sis966/sis966_enable_rom.c"
 #include "northbridge/amd/amdk8/raminit.h"
Index: src/mainboard/gigabyte/ma785gmt/romstage.c

===================================================================
--- src/mainboard/gigabyte/ma785gmt/romstage.c	(Revision 5910)

+++ src/mainboard/gigabyte/ma785gmt/romstage.c	(Arbeitskopie)

@@ -55,12 +55,8 @@ 

 static int smbus_read_byte(u32 device, u32 address);
 
 #include "superio/ite/it8718f/it8718f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
Index: src/mainboard/amd/mahogany/romstage.c

===================================================================
--- src/mainboard/amd/mahogany/romstage.c	(Revision 5909)

+++ src/mainboard/amd/mahogany/romstage.c	(Arbeitskopie)

@@ -50,12 +50,8 @@ 

 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
 #include "superio/ite/it8718f/it8718f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 
Index: src/mainboard/amd/pistachio/romstage.c

===================================================================
--- src/mainboard/amd/pistachio/romstage.c	(Revision 5909)

+++ src/mainboard/amd/pistachio/romstage.c	(Arbeitskopie)

@@ -45,12 +45,8 @@ 

 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
 #include "superio/ite/it8712f/it8712f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb600/sb600_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 
Index: src/mainboard/amd/dbm690t/romstage.c

===================================================================
--- src/mainboard/amd/dbm690t/romstage.c	(Revision 5909)

+++ src/mainboard/amd/dbm690t/romstage.c	(Arbeitskopie)

@@ -51,10 +51,7 @@ 

 #include "northbridge/amd/amdk8/reset_test.c"
 #include "superio/ite/it8712f/it8712f_early_serial.c"
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb600/sb600_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
Index: src/mainboard/amd/mahogany_fam10/romstage.c

===================================================================
--- src/mainboard/amd/mahogany_fam10/romstage.c	(Revision 5910)

+++ src/mainboard/amd/mahogany_fam10/romstage.c	(Arbeitskopie)

@@ -59,12 +59,8 @@ 

 static int smbus_read_byte(u32 device, u32 address);
 
 #include "superio/ite/it8718f/it8718f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
Index: src/mainboard/amd/tilapia_fam10/romstage.c

===================================================================
--- src/mainboard/amd/tilapia_fam10/romstage.c	(Revision 5910)

+++ src/mainboard/amd/tilapia_fam10/romstage.c	(Arbeitskopie)

@@ -59,12 +59,8 @@ 

 static int smbus_read_byte(u32 device, u32 address);
 
 #include "superio/ite/it8718f/it8718f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
Index: src/mainboard/iei/kino-780am2-fam10/romstage.c

===================================================================
--- src/mainboard/iei/kino-780am2-fam10/romstage.c	(Revision 5910)

+++ src/mainboard/iei/kino-780am2-fam10/romstage.c	(Arbeitskopie)

@@ -62,12 +62,8 @@ 

 static int smbus_read_byte(u32 device, u32 address);
 
 #include "superio/fintek/f71859/f71859_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
Index: src/mainboard/tyan/s2912/romstage.c

===================================================================
--- src/mainboard/tyan/s2912/romstage.c	(Revision 5910)

+++ src/mainboard/tyan/s2912/romstage.c	(Arbeitskopie)

@@ -49,11 +49,8 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
-#if CONFIG_USBDEBUG
-#include "southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
 #include <lib.h>
+#include <usbdebug.h>
 
 #include <cpu/amd/model_fxx_rev.h>
 
Index: src/mainboard/tyan/s2912_fam10/romstage.c

===================================================================
--- src/mainboard/tyan/s2912_fam10/romstage.c	(Revision 5910)

+++ src/mainboard/tyan/s2912_fam10/romstage.c	(Arbeitskopie)

@@ -42,10 +42,7 @@ 

 #include <arch/romcc_io.h>
 #include <cpu/x86/lapic.h>
 #include <console/console.h>
-#if CONFIG_USBDEBUG
-#include "southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 #include <lib.h>
 
 #include <cpu/amd/model_10xxx_rev.h>
Index: src/mainboard/ibase/mb899/romstage.c

===================================================================
--- src/mainboard/ibase/mb899/romstage.c	(Revision 5910)

+++ src/mainboard/ibase/mb899/romstage.c	(Arbeitskopie)

@@ -33,6 +33,7 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
+#include <usbdebug.h>
 #include <cpu/x86/bist.h>
 
 #include "superio/winbond/w83627ehg/w83627ehg_early_serial.c"
Index: src/mainboard/roda/rk886ex/romstage.c

===================================================================
--- src/mainboard/roda/rk886ex/romstage.c	(Revision 5910)

+++ src/mainboard/roda/rk886ex/romstage.c	(Arbeitskopie)

@@ -33,6 +33,7 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
+#include <usbdebug.h>
 #include <cpu/x86/bist.h>
 
 #include "northbridge/intel/i945/i945.h"
Index: src/mainboard/msi/ms9652_fam10/romstage.c

===================================================================
--- src/mainboard/msi/ms9652_fam10/romstage.c	(Revision 5910)

+++ src/mainboard/msi/ms9652_fam10/romstage.c	(Arbeitskopie)

@@ -42,10 +42,7 @@ 

 #include <arch/romcc_io.h>
 #include <cpu/x86/lapic.h>
 #include <console/console.h>
-#if CONFIG_USBDEBUG
-#include "southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 #include <lib.h>
 
 #include <cpu/amd/model_10xxx_rev.h>
Index: src/mainboard/msi/ms7260/romstage.c

===================================================================
--- src/mainboard/msi/ms7260/romstage.c	(Revision 5910)

+++ src/mainboard/msi/ms7260/romstage.c	(Arbeitskopie)

@@ -52,10 +52,7 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
-#if CONFIG_USBDEBUG
-#include "southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 #include <cpu/amd/model_fxx_rev.h>
 #include "southbridge/nvidia/mcp55/mcp55_early_smbus.c"
 #include "northbridge/amd/amdk8/raminit.h"
Index: src/mainboard/jetway/pa78vm5/romstage.c

===================================================================
--- src/mainboard/jetway/pa78vm5/romstage.c	(Revision 5910)

+++ src/mainboard/jetway/pa78vm5/romstage.c	(Arbeitskopie)

@@ -66,10 +66,7 @@ 

 #define SERIAL_DEV PNP_DEV(0x2e, F71863FG_SP1)
 #endif
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
Index: src/mainboard/technexion/tim8690/romstage.c

===================================================================
--- src/mainboard/technexion/tim8690/romstage.c	(Revision 5909)

+++ src/mainboard/technexion/tim8690/romstage.c	(Arbeitskopie)

@@ -51,12 +51,8 @@ 

 #include "northbridge/amd/amdk8/reset_test.c"
 #include "northbridge/amd/amdk8/debug.c"
 #include "superio/ite/it8712f/it8712f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb600/sb600_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 
Index: src/mainboard/technexion/tim5690/romstage.c

===================================================================
--- src/mainboard/technexion/tim5690/romstage.c	(Revision 5909)

+++ src/mainboard/technexion/tim5690/romstage.c	(Arbeitskopie)

@@ -51,12 +51,8 @@ 

 #include "northbridge/amd/amdk8/reset_test.c"
 #include "northbridge/amd/amdk8/debug.c"
 #include "superio/ite/it8712f/it8712f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb600/sb600_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "cpu/x86/bist.h"
 
Index: src/mainboard/nvidia/l1_2pvv/romstage.c

===================================================================
--- src/mainboard/nvidia/l1_2pvv/romstage.c	(Revision 5910)

+++ src/mainboard/nvidia/l1_2pvv/romstage.c	(Arbeitskopie)

@@ -49,10 +49,7 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
-#if CONFIG_USBDEBUG
-#include "southbridge/nvidia/mcp55/mcp55_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
+#include <usbdebug.h>
 #include <lib.h>
 
 #include <cpu/amd/model_fxx_rev.h>
Index: src/mainboard/intel/d945gclf/romstage.c

===================================================================
--- src/mainboard/intel/d945gclf/romstage.c	(Revision 5910)

+++ src/mainboard/intel/d945gclf/romstage.c	(Arbeitskopie)

@@ -33,6 +33,7 @@ 

 #include <pc80/mc146818rtc.h>
 
 #include <console/console.h>
+#include <usbdebug.h>
 #include <cpu/x86/bist.h>
 
 #include "superio/smsc/lpc47m15x/lpc47m15x_early_serial.c"
Index: src/mainboard/asus/m4a785-m/romstage.c

===================================================================
--- src/mainboard/asus/m4a785-m/romstage.c	(Revision 5910)

+++ src/mainboard/asus/m4a785-m/romstage.c	(Arbeitskopie)

@@ -59,12 +59,8 @@ 

 static int smbus_read_byte(u32 device, u32 address);
 
 #include "superio/ite/it8712f/it8712f_early_serial.c"
+#include <usbdebug.h>
 
-#if CONFIG_USBDEBUG
-#include "southbridge/amd/sb700/sb700_enable_usbdebug.c"
-#include "pc80/usbdebug_serial.c"
-#endif
-
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include <cpu/amd/mtrr.h>
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
Index: src/pc80/usbdebug_serial.c

===================================================================
--- src/pc80/usbdebug_serial.c	(Revision 5909)

+++ src/pc80/usbdebug_serial.c	(Arbeitskopie)

@@ -19,13 +19,15 @@ 

  */
 
 #include "../lib/usbdebug.c"
+#include <arch/io.h>
+#include <ehci.h>
 
-static void early_usbdebug_init(void)
+void early_usbdebug_init(void)
 {
 	struct ehci_debug_info *dbg_info = (struct ehci_debug_info *)
 	    (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - sizeof(struct ehci_debug_info));
 
-	usbdebug_init(EHCI_BAR, EHCI_DEBUG_OFFSET, dbg_info);
+	usbdebug_init(CONFIG_EHCI_BAR, CONFIG_EHCI_DEBUG_OFFSET, dbg_info);
 }
 
 void usbdebug_tx_byte(unsigned char data)
Index: util/abuild/abuild

===================================================================
--- util/abuild/abuild	(Revision 5910)

+++ util/abuild/abuild	(Arbeitskopie)

@@ -203,7 +203,6 @@ 

 			echo "CONFIG_SCANBUILD_ENABLE=y" >> .config
 			echo "CONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\"" >> .config
 		fi
-		echo "CONFIG_USBDEBUG=y" >> .config
 	fi
 
 	#yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log