From patchwork Mon Apr 1 11:52:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 1072685 X-Patchwork-Delegate: lukma@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DSNP8n8i"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44XrNp0twDz9sMQ for ; Mon, 1 Apr 2019 22:54:34 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id B70BEC21E4E; Mon, 1 Apr 2019 11:53:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7A8D1C21E73; Mon, 1 Apr 2019 11:53:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E1D60C21DF9; Mon, 1 Apr 2019 11:53:03 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id A1A76C21E26 for ; Mon, 1 Apr 2019 11:53:02 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id 8so4462290pfr.4 for ; Mon, 01 Apr 2019 04:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z1xd4YcYKuCPhItqYjXsgWozxha5tIAEQ/IQtw14P6s=; b=DSNP8n8ixMzsHKMsv5bKof10FOYUw5qOjbe0BEkGV7YQ89DVSd79uSGaNMngjThSBU nob1UZsGRHq3L5Eciz1nMiXt8cGlCaKEHGLjLiq6gurwZ0UBSsu+rVQ1YHh40QfkWXij ZXFggfCbl/xUXfETgZEwzZ0LiedvdTzuPWKyiSG7FNpQ6A5LnliqHZgFTbC6Fj8OmtCe cGRR6EZ2qLpTySryVwf7FeEwsZ96r/IqhzTsv+uZ+Sn+Ug6MO+nO1WmYdBegIL0ixcb/ WHMGaBBHOKJoUYed+aJb3L2O4pXd7kDe61zMzcjKn2j0eW0ujZbH8/MtvzUW4kzqndRG RCOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z1xd4YcYKuCPhItqYjXsgWozxha5tIAEQ/IQtw14P6s=; b=VsXfs8fTjOMSHz24ike9ABrswRmZStd9BdI1cgIdvIFNLuSHoiDooA/hD+gyQFgKwN XHQH7KZV2C/QOMt3qucc8zxiZjGagjeKSULPX+g750fV/bQkPmAB0PLDFrnjD0IzJ32a +kr0DmKfRvBpVLxkdWClxcmLCJw2govIP4baszvAzGdWQseILnG8E1Q16fUjpm+0tU/H p0/4j+oRKQh+P+WJl5GYfDR4wc6AEKnxXXhtHmpQMoFG0KU9/3z2tP2LTcMNtPY3BG0r IqZfAE46GdgiZ8orK+QHnI42JcQggGn2Ph8UHZG4uAmKVZ+Dd4g0csNOuoRYaYOS8O2n U44Q== X-Gm-Message-State: APjAAAW9DiE0A9wJiGMkWLZ4khORccOQ4Q5WdRfh1nJxFj137s3+JpJ5 95Hcel47y0bPgEq0TbiixsU= X-Google-Smtp-Source: APXvYqywx8s0myNqKDnjrpxYezPCJA8svoiuzU3AUjYGVrZLTYZ50wnqfGAlDlz+GMmJsdqCpZ/HxA== X-Received: by 2002:a63:465b:: with SMTP id v27mr42297246pgk.165.1554119581324; Mon, 01 Apr 2019 04:53:01 -0700 (PDT) Received: from localhost.localdomain ([103.51.74.132]) by smtp.gmail.com with ESMTPSA id d75sm26170524pga.66.2019.04.01.04.52.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 04:53:00 -0700 (PDT) From: Anand Moon To: Jaehoon Chung , Marek Vasut , Tobias Jakobi , Minkyu Kang , Lukasz Majewski , Simon Glass , Krzysztof Kozlowski Date: Mon, 1 Apr 2019 11:52:29 +0000 Message-Id: <20190401115232.453-4-linux.amoon@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401115232.453-1-linux.amoon@gmail.com> References: <20190401115232.453-1-linux.amoon@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [RFC 3/6] usb: exynos: add init_after_reset for usb reset X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Some host controllers need addidional re-initialization after ehci_reset() so we add .init_after_reset callback which is requires to reinit the phy after controller reset. Signed-off-by: Anand Moon --- drivers/usb/host/ehci-exynos.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index b0f7bd4936..e6a542e092 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -143,6 +143,23 @@ static void exynos5_setup_usb_phy(struct exynos_usb_phy *usb) EHCICTRL_ENAINCR16); } +static int ehci_exynos_init_after_reset(struct ehci_ctrl *ehcntl) +{ + if (cpu_is_exynos4()) { + if (proid_is_exynos4412()) { + /* + * "usb reset" cmd: restart re-initialize the usb driver + */ + exynos_usb_init(); + } + } + return 0; +} + +static const struct ehci_ops exynos_ehci_ops = { + .init_after_reset = ehci_exynos_init_after_reset, +}; + static void exynos4412_setup_usb_phy(struct exynos4412_usb_phy *usb) { writel(CLK_24MHZ, &usb->usbphyclk); @@ -234,7 +251,8 @@ static int ehci_usb_probe(struct udevice *dev) hcor = (struct ehci_hcor *)((uint32_t)ctx->hcd + HC_LENGTH(ehci_readl(&ctx->hcd->cr_capbase))); - return ehci_register(dev, ctx->hcd, hcor, NULL, 0, USB_INIT_HOST); + return ehci_register(dev, ctx->hcd, hcor, &exynos_ehci_ops, + 0, USB_INIT_HOST); } static int ehci_usb_remove(struct udevice *dev)