Kyösti Mälkki has uploaded this change for review.

View Change

sb/amd/cimx,hudson: Use common enable_usbdebug

Due the file's previous location under amd/sb800, usbdebug feature
got removed from fam14 with fam10 deprecation, this brings it back.

Change-Id: Id658001179898b94fdc179c539b92637af5095b8
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
---
M src/southbridge/amd/agesa/hudson/Makefile.inc
M src/southbridge/amd/agesa/hudson/enable_usbdebug.c
M src/southbridge/amd/cimx/sb800/Makefile.inc
M src/southbridge/amd/pi/hudson/Makefile.inc
D src/southbridge/amd/pi/hudson/enable_usbdebug.c
5 files changed, 5 insertions(+), 67 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/07/38007/1
diff --git a/src/southbridge/amd/agesa/hudson/Makefile.inc b/src/southbridge/amd/agesa/hudson/Makefile.inc
index b8eb5b9..7c802ca 100644
--- a/src/southbridge/amd/agesa/hudson/Makefile.inc
+++ b/src/southbridge/amd/agesa/hudson/Makefile.inc
@@ -18,10 +18,7 @@

bootblock-y += bootblock.c
bootblock-y += early_setup.c
-bootblock-$(CONFIG_USBDEBUG) += enable_usbdebug.c

-romstage-y += enable_usbdebug.c
-ramstage-y += enable_usbdebug.c
romstage-y += early_setup.c

ramstage-$(CONFIG_SPI_FLASH) += spi.c
@@ -33,6 +30,7 @@
romstage-y += imc.c
ramstage-y += imc.c

+all-y += enable_usbdebug.c
all-y += reset.c

smm-y += smihandler.c smi_util.c
diff --git a/src/southbridge/amd/agesa/hudson/enable_usbdebug.c b/src/southbridge/amd/agesa/hudson/enable_usbdebug.c
index 47b5990..112aa54 100644
--- a/src/southbridge/amd/agesa/hudson/enable_usbdebug.c
+++ b/src/southbridge/amd/agesa/hudson/enable_usbdebug.c
@@ -17,19 +17,16 @@
#define __SIMPLE_DEVICE__

#include <stdint.h>
-#include <arch/io.h>
+#include <amdblocks/acpimmio.h>
#include <device/mmio.h>
#include <device/pci_ehci.h>
-#include <device/pci_def.h>
-#include "hudson.h"

#define DEBUGPORT_MISC_CONTROL 0x80

pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx)
{
/* Enable all of the USB controllers */
- outb(0xEF, PM_INDEX);
- outb(0x7F, PM_DATA);
+ pm_write8(0xef, 0x7f);

if (hcd_idx == 3)
return PCI_DEV(0, 0x16, 2);
diff --git a/src/southbridge/amd/cimx/sb800/Makefile.inc b/src/southbridge/amd/cimx/sb800/Makefile.inc
index 2c51648..aad9732 100644
--- a/src/southbridge/amd/cimx/sb800/Makefile.inc
+++ b/src/southbridge/amd/cimx/sb800/Makefile.inc
@@ -36,9 +36,7 @@
romstage-y += ramtop.c
ramstage-y += ramtop.c

-bootblock-$(CONFIG_USBDEBUG) += ../../sb800/enable_usbdebug.c
-romstage-$(CONFIG_USBDEBUG) += ../../sb800/enable_usbdebug.c
-ramstage-$(CONFIG_USBDEBUG) += ../../sb800/enable_usbdebug.c
+all-y += ../../agesa/hudson/enable_usbdebug.c

ramstage-y += smbus.c
ramstage-y += lpc.c
diff --git a/src/southbridge/amd/pi/hudson/Makefile.inc b/src/southbridge/amd/pi/hudson/Makefile.inc
index 9d985e6d..b62e559 100644
--- a/src/southbridge/amd/pi/hudson/Makefile.inc
+++ b/src/southbridge/amd/pi/hudson/Makefile.inc
@@ -30,10 +30,8 @@

bootblock-y += bootblock.c
bootblock-y += early_setup.c
-bootblock-$(CONFIG_USBDEBUG) += enable_usbdebug.c

romstage-y += early_setup.c
-romstage-y += enable_usbdebug.c
romstage-$(CONFIG_HUDSON_IMC_FWM) += imc.c
romstage-y += smbus.c
romstage-y += smbus_spd.c
@@ -42,7 +40,6 @@
verstage-y += early_setup.c
verstage-$(CONFIG_HUDSON_UART) += uart.c

-ramstage-y += enable_usbdebug.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += fadt.c
ramstage-$(CONFIG_SOUTHBRIDGE_AMD_PI_KERN) += gpio.c
ramstage-y += hda.c
@@ -60,6 +57,7 @@
ramstage-$(CONFIG_HUDSON_UART) += uart.c
ramstage-y += usb.c

+all-y += ../../agesa/hudson/enable_usbdebug.c
all-y += reset.c

smm-y += smihandler.c
diff --git a/src/southbridge/amd/pi/hudson/enable_usbdebug.c b/src/southbridge/amd/pi/hudson/enable_usbdebug.c
deleted file mode 100644
index 9ad03dc..0000000
--- a/src/southbridge/amd/pi/hudson/enable_usbdebug.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2010 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-// Use simple device model for this file even in ramstage
-#define __SIMPLE_DEVICE__
-
-#include <stdint.h>
-#include <arch/io.h>
-#include <device/mmio.h>
-#include <device/pci_ehci.h>
-#include <device/pci_def.h>
-#include "hudson.h"
-
-#define DEBUGPORT_MISC_CONTROL 0x80
-
-pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx)
-{
- /* Enable all of the USB controllers */
- outb(0xEF, PM_INDEX);
- outb(0x7F, PM_DATA);
-
- if (hcd_idx == 3)
- return PCI_DEV(0, 0x16, 0);
- else if (hcd_idx == 2)
- return PCI_DEV(0, 0x13, 0);
- else
- return PCI_DEV(0, 0x12, 0);
-}
-
-void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port)
-{
- u8 *base_regs = pci_ehci_base_regs(dev);
- u32 reg32;
-
- /* Write the port number to DEBUGPORT_MISC_CONTROL[31:28]. */
- reg32 = read32(base_regs + DEBUGPORT_MISC_CONTROL);
- reg32 &= ~(0xf << 28);
- reg32 |= (port << 28);
- reg32 |= (1 << 27); /* Enable Debug Port port number remapping. */
- write32(base_regs + DEBUGPORT_MISC_CONTROL, reg32);
-}

To view, visit change 38007. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id658001179898b94fdc179c539b92637af5095b8
Gerrit-Change-Number: 38007
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-MessageType: newchange