[coreboot-gerrit] New patch to review for coreboot: soc/intel/quark: Add USB device port support

Leroy P Leahy (leroy.p.leahy@intel.com) gerrit at coreboot.org
Mon May 23 01:52:00 CEST 2016


Leroy P Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14941

-gerrit

commit 077930c5520e54beda8ccdc792a41b431f6e0b93
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Sun May 22 09:55:22 2016 -0700

    soc/intel/quark: Add USB device port support
    
    Add initialization for the USB device port.
    
    TEST=Build and run on Galileo Gen2
    
    Change-Id: Icf83747f778f6e1ac976cd448a94311030e79e4f
    Signed-off-by: Lee Leahy <leroy.p.leahy at intel.com>
---
 src/soc/intel/quark/ehci.c                 | 27 ++++++++++++++++++++++++---
 src/soc/intel/quark/include/soc/pci_devs.h |  3 +++
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/soc/intel/quark/ehci.c b/src/soc/intel/quark/ehci.c
index ed9112c..8e534a5 100644
--- a/src/soc/intel/quark/ehci.c
+++ b/src/soc/intel/quark/ehci.c
@@ -32,7 +32,7 @@
  * reference clock and Port2 as a USB device port, the following sequence must
  * be followed
  */
-static const struct reg_script init_script[] = {
+static const struct reg_script ehci_init_script[] = {
 
 	/* Set packet buffer OUT/IN thresholds */
 	REG_MMIO_RMW32(R_IOH_EHCI_INSNREG01,
@@ -85,10 +85,31 @@ static const struct reg_script init_script[] = {
 	REG_SCRIPT_END
 };
 
+static const struct reg_script usb_device_port_init_script[] = {
+
+	/* Mask and clear controller interrupts */
+	REG_MMIO_WRITE32(R_IOH_USBDEVICE_D_INTR_MSK_UDC_REG,
+		V_IOH_USBDEVICE_D_INTR_MSK_UDC_REG),
+	REG_MMIO_WRITE32(R_IOH_USBDEVICE_D_INTR_UDC_REG,
+		V_IOH_USBDEVICE_D_INTR_MSK_UDC_REG),
+
+	/* Mask and clear end point interrupts */
+	REG_MMIO_WRITE32(R_IOH_USBDEVICE_EP_INTR_MSK_UDC_REG,
+		V_IOH_USBDEVICE_EP_INTR_MSK_UDC_REG),
+	REG_MMIO_WRITE32(R_IOH_USBDEVICE_EP_INTR_UDC_REG,
+		V_IOH_USBDEVICE_EP_INTR_MSK_UDC_REG),
+	REG_SCRIPT_END
+};
+
 static void init(device_t dev)
 {
-	printk(BIOS_INFO, "Initializing USB PLLs\n");
-	reg_script_run_on_dev(dev, init_script);
+	if ((dev->path.pci.devfn & 7) == EHCI_FUNC) {
+		printk(BIOS_INFO, "Initializing USB PLLs\n");
+		reg_script_run_on_dev(dev, ehci_init_script);
+	} else {
+		printk(BIOS_INFO, "Initializing USB device port\n");
+		reg_script_run_on_dev(dev, usb_device_port_init_script);
+	}
 }
 
 static struct device_operations device_ops = {
diff --git a/src/soc/intel/quark/include/soc/pci_devs.h b/src/soc/intel/quark/include/soc/pci_devs.h
index 02e2c32..67d8d32 100644
--- a/src/soc/intel/quark/include/soc/pci_devs.h
+++ b/src/soc/intel/quark/include/soc/pci_devs.h
@@ -33,6 +33,9 @@
 /* IO Fabric 1 */
 #define SIO1_DEV		0x14
 #define HSUART1_DEV		SIO1_DEV
+#define USB_DEV_PORT_FUNC	2
+#define EHCI_FUNC		3
+#define OHCI_FUNC		4
 #define HSUART1_FUNC		5
 
 /* IO Fabric 2 */



More information about the coreboot-gerrit mailing list