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

Martin Roth (gaumless@gmail.com) gerrit at coreboot.org
Wed Nov 19 03:56:05 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 ebdfb26bfa1bb3fa09dc8b3544e79776f3b5ac3e
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.
    
    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 f3a9461..c7a0a2d 100644
--- a/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.c
+++ b/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.c
@@ -154,7 +154,9 @@ static void ConfigureDefaultUpdData(UPD_DATA_REGION *UpdData)
 						UpdData->PcdSataMode?"AHCI":"IDE");
 				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 LPE_DEV_FUNC:
 				if (dev->enabled && config->LpeAcpiModeEnable ==
@@ -231,7 +233,9 @@ static void ConfigureDefaultUpdData(UPD_DATA_REGION *UpdData)
 			case PCIE_PORT4_DEV_FUNC:
 				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 SIO_DMA2_DEV_FUNC:
 				UpdData->PcdEnableDma1 = dev->enabled;



More information about the coreboot-gerrit mailing list