[coreboot-gerrit] Patch set updated for coreboot: 28e37e9 fsp_baytrail: Allow selection of USB controller from Kconfig

Martin Roth (gaumless@gmail.com) gerrit at coreboot.org
Wed Dec 3 05:22:58 CET 2014


Martin Roth (gaumless at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7497

-gerrit

commit 28e37e9f39cd43c45dec9740e2cddfc7fdc4345e
Author: Martin Roth <martin.roth at se-eng.com>
Date:   Sun Nov 16 21:12:16 2014 -0700

    fsp_baytrail: Allow selection of USB controller from Kconfig
    
    Allow the selection of EHCI or XHCI from Kconfig instead of just from
    the devicetree.
    
    This adds 3 choices:
    - Follow devicetree - expects only one of the two controllers to be
    enabled in the devicetree, and sets the controller to that mode.
    - Use XHCI controller - Selects the XHCI controller and disables the
    EHCI controller.  The XHCI controller should be enabled in devicetree.
    It doesn't matter whether or not the EHCI controller is enabled in
    devicetree.
    - Use EHCI controller - Selects the EHCI controller and disables the
    XHCI controller.  The EHCI controller should be enabled in devicetree.
    It doesn't matter whether or not the XHCI controller is enabled in
    devicetree.
    
    If both EHCI and XHCI controllers are enabled in devicetree, one or
    the other should be selected here.
    
    This can be overridden again in the mainboard using CMOS data if
    available on that particular platform.
    
    Change-Id: I82d756d5f2ed61b06f936a3f5fcb7a23d43a8244
    Signed-off-by: Martin Roth <martin.roth at se-eng.com>
---
 src/soc/intel/fsp_baytrail/fsp/Kconfig            | 26 +++++++++++++++++++++++
 src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.c |  8 +++++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/src/soc/intel/fsp_baytrail/fsp/Kconfig b/src/soc/intel/fsp_baytrail/fsp/Kconfig
index 73800d6..cc3c3d0 100644
--- a/src/soc/intel/fsp_baytrail/fsp/Kconfig
+++ b/src/soc/intel/fsp_baytrail/fsp/Kconfig
@@ -39,3 +39,29 @@ config FSP_LOC
 
 	  The Bay Trail FSP is built with a preferred base address of
 	  0xFFFC0000.
+
+choice
+	prompt "Select the USB Controller to use"
+	default BAYTRAIL_USB_DEVICETREE
+	help
+	  This option allows you to select the USB Controller - EHCI or XHCI.
+
+config BAYTRAIL_USB_DEVICETREE
+	bool "Follow devicetree"
+	help
+	  Sets the active controller to match the controller that's enabled in
+	  the devicetree.cb file.
+
+config BAYTRAIL_USB_XHCI
+	bool "Use XHCI controller"
+	help
+	  Sets the active controller to XHCI.  The XHCI controller must be enabled
+	  in devicetree.  The EHCI controller will be ignored if it's enabled.
+
+config BAYTRAIL_USB_EHCI
+	bool "Use EHCI controller"
+	help
+	  Sets the active controller to EHCI.  The EHCI controller must be enabled
+	  in devicetree.  The XHCI controller will be ignored if it's enabled.
+endchoice
+
diff --git a/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.c b/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.c
index c6b5f9c..402e2f9 100644
--- a/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.c
+++ b/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.c
@@ -188,10 +188,14 @@ static void ConfigureDefaultUpdData(FSP_INFO_HEADER *FspInfo, UPD_DATA_REGION *U
 					UpdData->PcdeMMCBootMode = EMMC_4_5 - EMMC_DISABLED;
 				break;
 			case XHCI_DEV_FUNC:
-				UpdData->PcdEnableXhci = dev->enabled;
+				if (CONFIG_BAYTRAIL_USB_XHCI ||
+					(CONFIG_BAYTRAIL_USB_DEVICETREE && dev->enabled))
+					UpdData->PcdEnableXhci = 1;
 				break;
 			case EHCI_DEV_FUNC:
-				UpdData->PcdEnableXhci = !(dev->enabled);
+				if (CONFIG_BAYTRAIL_USB_EHCI ||
+					(CONFIG_BAYTRAIL_USB_DEVICETREE && dev->enabled))
+					UpdData->PcdEnableXhci = 0;
 				break;
 
 			case LPE_DEV_FUNC:



More information about the coreboot-gerrit mailing list