public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/12] x86: dfi-bt700: Add xHCI USB hub reset
Date: Mon, 17 Jul 2017 16:03:26 +0200	[thread overview]
Message-ID: <20170717140329.8199-9-sr@denx.de> (raw)
In-Reply-To: <20170717140329.8199-1-sr@denx.de>

The xHCI USB hub is connected to an GPIO on the DFI BayTrail SoM. For
correct operation, it needs to get reset upon power-up. Otherwise it
may happen that the hub is not detected after a software reboot.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
---
 board/dfi/dfi-bt700/Kconfig     |  1 +
 board/dfi/dfi-bt700/dfi-bt700.c | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/board/dfi/dfi-bt700/Kconfig b/board/dfi/dfi-bt700/Kconfig
index 88c4ddeee9..58a0188f87 100644
--- a/board/dfi/dfi-bt700/Kconfig
+++ b/board/dfi/dfi-bt700/Kconfig
@@ -20,6 +20,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	select X86_RESET_VECTOR if !EFI_STUB
 	select INTEL_BAYTRAIL
 	select BOARD_ROMSIZE_KB_8192
+	select BOARD_LATE_INIT
 
 config PCIE_ECAM_BASE
 	default 0xe0000000
diff --git a/board/dfi/dfi-bt700/dfi-bt700.c b/board/dfi/dfi-bt700/dfi-bt700.c
index 8645bdc795..3dd2036d11 100644
--- a/board/dfi/dfi-bt700/dfi-bt700.c
+++ b/board/dfi/dfi-bt700/dfi-bt700.c
@@ -28,3 +28,30 @@ int board_early_init_f(void)
 
 	return 0;
 }
+
+int board_late_init(void)
+{
+	struct gpio_desc desc;
+	int ret;
+
+	ret = dm_gpio_lookup_name("F10", &desc);
+	if (ret)
+		debug("gpio ret=%d\n", ret);
+	ret = dm_gpio_request(&desc, "xhci_hub_reset");
+	if (ret)
+		debug("gpio_request ret=%d\n", ret);
+	ret = dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
+	if (ret)
+		debug("gpio dir ret=%d\n", ret);
+
+	/* Pull xHCI hub reset to low (active low) */
+	dm_gpio_set_value(&desc, 0);
+
+	/* Wait at least 5 ms, so lets choose 10 to be safe */
+	mdelay(10);
+
+	/* Pull xHCI hub reset to high (active low) */
+	dm_gpio_set_value(&desc, 1);
+
+	return 0;
+}
-- 
2.13.3

  parent reply	other threads:[~2017-07-17 14:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 14:03 [U-Boot] [PATCH 01/12] x86: theadorable-x86-dfi-bt700: Add Micron SPI support and move VIDEO blob Stefan Roese
2017-07-17 14:03 ` [U-Boot] [PATCH 02/12] x86: dfi: Add option to select different config headers for baseboards Stefan Roese
2017-07-18  1:14   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 03/12] x86: conga: " Stefan Roese
2017-07-18  1:14   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 04/12] x86: theadorable-x86: Add header file for common defines and env Stefan Roese
2017-07-18  1:14   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 05/12] x86: conga-qeval20-qa3-e3845: Select CONFIG_BOARD_LATE_INIT Stefan Roese
2017-07-18  1:14   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 06/12] x86: Add defconfig for theadorable-x86-conga with PCIe x4 blobs Stefan Roese
2017-07-18  1:14   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 07/12] x86: theadorable-x86-conga-qa3-e3845_defconfig: Misc defconfig updates Stefan Roese
2017-07-18  1:15   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 08/12] x86: theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig: " Stefan Roese
2017-07-18  1:15   ` Bin Meng
2017-07-17 14:03 ` Stefan Roese [this message]
2017-07-18  1:15   ` [U-Boot] [PATCH 09/12] x86: dfi-bt700: Add xHCI USB hub reset Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 10/12] x86: dfi-bt700.dtsi: Enable xHCI and add GPIO for the xHCI HUB reset Stefan Roese
2017-07-18  1:15   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 11/12] x86: conga-qeval20-qa3-e3845.dts: Enable xHCI support in dts Stefan Roese
2017-07-18  1:15   ` Bin Meng
2017-07-17 14:03 ` [U-Boot] [PATCH 12/12] x86: theadorable-x86-xxx_defconfig: Misc defconfig updates Stefan Roese
2017-07-18  1:15   ` Bin Meng
2017-07-18  1:14 ` [U-Boot] [PATCH 01/12] x86: theadorable-x86-dfi-bt700: Add Micron SPI support and move VIDEO blob Bin Meng
2017-07-18  1:21   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170717140329.8199-9-sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox