From patchwork Fri Sep 21 10:35:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 973156 X-Patchwork-Delegate: trini@ti.com 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="cCaXumKJ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42Gqw41tm9z9s89 for ; Fri, 21 Sep 2018 20:44:04 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E1AF6C21E6C; Fri, 21 Sep 2018 10:40:17 +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.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C448EC21EC3; Fri, 21 Sep 2018 10:37:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 297A8C21EB9; Fri, 21 Sep 2018 10:36:53 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by lists.denx.de (Postfix) with ESMTPS id B72E9C21E2F for ; Fri, 21 Sep 2018 10:36:46 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id 207-v6so2658883wme.5 for ; Fri, 21 Sep 2018 03:36:46 -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; bh=0mMQzzH+TNiYV/SMLjy4GZnOq6es2ybsOT7Qxa4+I8w=; b=cCaXumKJVbie75qYxKbwbJMorMjzf9HclCU8uZma3+oTZcj/v701UJGDhHyBfKs14i DaAbHuFiep/CJy42COR2bkqeRKZ/8CVX/oSgEwqC3eKnNALIpSIQGwtyZPDJFfPpvUgy XnsrWMLXUXtcFPbNPUx5iVr1P/uEViXHz5CxvAjDcLK0NbHO6GpvT3ivZ8zj0DeJeABt tyT2gIwIE9jT1K4KFZ5vaOvJ7Q7f0SNIs7A6Zw9ECGjDZzORqWp17upM+gMyUQXeOjTO oBEnEmnyNyZ13xTglaZqYDi7grV13pB29urATHezRX/d5DJ9t+nNOqYDd0f8eFVaHX6Z DrVA== 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; bh=0mMQzzH+TNiYV/SMLjy4GZnOq6es2ybsOT7Qxa4+I8w=; b=UZxyRs3OlF2nqWVOaE4bzQUgq3SzOR5VDGKOcFYOIP+wZNsA4pFscOZrUvH8Dnvldy 2v02SJed9eRfZBEATaoZY3QHc5cNn7PvwmSC/15JXTeXR4dxFop2en55nPxNH3/vxWUQ jlhcxe1UU3FG94jEQ0h0dx2IfVqYLDcnacVYmYQsZaSCWdbXPlao/0WJUty2WP3YTiEV h/yYxQXWzpG2+OWqIw34/h7nmzeWIPGPrrhN4YroIJN25/1h6qtcWxzXjp9L7NL4STQ0 Np/OjaFbiLZfYR1ccBNIhcNFZM6oVyMLvJpLUd4WW1nehRWBN0CLmjEXAIQSLXRqVlyJ NaSA== X-Gm-Message-State: APzg51DnSdGMpMT7etGqRRrULGx8vqUz+LAlr//ce/Sa79Zd9Qw+Kytn BEmp25oy5Tu0vFohT98rHvKqM/9PfnYCrQ== X-Google-Smtp-Source: ANB0VdbU9VSXshfCCvNdr/EWyHwg67g/D3QrLdJ7bEUrlkxT8oXZBtc7iXWr9VOlefSwHUzpBB2yew== X-Received: by 2002:a1c:6705:: with SMTP id b5-v6mr6740250wmc.78.1537526205975; Fri, 21 Sep 2018 03:36:45 -0700 (PDT) Received: from localhost.localdomain ([5.102.238.49]) by smtp.gmail.com with ESMTPSA id 204-v6sm6770843wmh.25.2018.09.21.03.36.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 03:36:45 -0700 (PDT) From: Ramon Fried To: u-boot@lists.denx.de Date: Fri, 21 Sep 2018 13:35:52 +0300 Message-Id: <20180921103555.16240-11-ramon.fried@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180921103555.16240-1-ramon.fried@gmail.com> References: <20180921103555.16240-1-ramon.fried@gmail.com> Cc: Marek Vasut Subject: [U-Boot] [PATCH v2 10/14] usb:ci_udc: Introduce init_after_reset phy function 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" MSM variant of Chipidea must reinitalize the phy after controller reset. Introduce ci_init_after_reset() weak function that can be used to achieve the above init. Signed-off-by: Ramon Fried Reviewed-by: Lukasz Majewski --- Changes in v2: None drivers/usb/gadget/ci_udc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 2b9dbf06b9..8d23fab3b7 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -104,6 +104,10 @@ static struct usb_ep_ops ci_ep_ops = { .free_request = ci_ep_free_request, }; +__weak void ci_init_after_reset(struct ehci_ctrl *ctrl) +{ +} + /* Init values for USB endpoints. */ static const struct usb_ep ci_ep_init[5] = { [0] = { /* EP 0 */ @@ -887,6 +891,8 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) writel(USBCMD_ITC(MICRO_8FRAME) | USBCMD_RST, &udc->usbcmd); udelay(200); + ci_init_after_reset(controller.ctrl); + writel((unsigned long)controller.epts, &udc->epinitaddr); /* select DEVICE mode */