From patchwork Mon Jul 2 20:53:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 938178 X-Patchwork-Delegate: jagannadh.teki@gmail.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="dZp5nkKw"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41KKGc1Ws1z9s3C for ; Tue, 3 Jul 2018 06:53:28 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CA257C21E96; Mon, 2 Jul 2018 20:53:22 +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_H3, RCVD_IN_MSPIKE_WL, 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 0D176C21DA6; Mon, 2 Jul 2018 20:53:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0E74CC21DA6; Mon, 2 Jul 2018 20:53:18 +0000 (UTC) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by lists.denx.de (Postfix) with ESMTPS id 54262C21DA2 for ; Mon, 2 Jul 2018 20:53:18 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id a7-v6so8480932plp.3 for ; Mon, 02 Jul 2018 13:53:18 -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; bh=9cLXBR3HKu8S1hgYShhl1Nhu4aKCSrYhU+Q+xY1ouHE=; b=dZp5nkKwLkNdiJkHvdsng8rhr8b8sOa6K2K8Nohfc72kThb7qFMCwE1YvNvEI7nqTU boj0YWCsV+gfRUMhnn1NXxgHkIWdWOWHpwkPLJenhFj3WLgtPhl1LxJQahRu/CORBlHg sK3VdT3PzFYhhxyibZeF6BvfLB4E/RUPMDYC6o2+ivCJESQYVthWdedVUWMe4DyTdlCU cn6UrA7YWi5qtyxWMl9SvdasGWP/8VGZzm6bCmNDMrNjpwN/EudMuhNT9M5mYnprS7NF 2hQiv86cD6e7nH9T9BDLFpnDfUQU5o/oOY9ClWRtDmtbn04Ouuy5gYY5aSHkaEPIwWzu PEiA== 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; bh=9cLXBR3HKu8S1hgYShhl1Nhu4aKCSrYhU+Q+xY1ouHE=; b=rT+BmiXgf9AyU8uzELZVB2/9yXOuS0iUpebIBnfY10dgjFicK83lL/uidGH3QYT56+ WYGdQna42FI76AISXc8RtKy9FzIqrpBd4viFZIEqfNORlUUnvmJbTV9aey84lsfztUlb sIRbycFF4d9IkBTI6SnQiOFEgdDDaO+q1FrgEm9zpSA3JOyL+Cu2NgJjGhD6IdNFOjEQ dniIt2XL8apzbjzcaSf7j9DL+WPNO0zB0Pk2DWZrf+PAm0OuOq7yjcjRvXDZrAIt7wRC Mq/dH+XDkKA9nJYPkSVw8LfiU21bBY0tyfyTJYrySw2d7MpuI0cifovQ0VdaegT9MoEX qafg== X-Gm-Message-State: APt69E2Va9HkEAXA7FuvSyaDKxKXzzL3ybZ7xM18q8ZLmeOEsAWfH2ee ecbraYYlNpFTDVFWmRiLK5M= X-Google-Smtp-Source: ADUXVKJ+UuqiWlg//EjS9CmaprhJPv6/SdQ/9ywrBRttLlTKthZH9KY9i92yx3xBbXNcAcMz4A/e8w== X-Received: by 2002:a17:902:4c88:: with SMTP id b8-v6mr26450538ple.285.1530564796726; Mon, 02 Jul 2018 13:53:16 -0700 (PDT) Received: from localhost.localdomain ([115.97.190.51]) by smtp.gmail.com with ESMTPSA id z26-v6sm48824246pfd.60.2018.07.02.13.53.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 13:53:16 -0700 (PDT) From: Jagan Teki X-Google-Original-From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Marek Vasut Date: Tue, 3 Jul 2018 02:23:02 +0530 Message-Id: <20180702205302.26912-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 Cc: Tom Rini , linux-sunxi , u-boot@lists.denx.de Subject: [U-Boot] [PATCH] arm64: allwinner: a64: Disable ehci1 and ohci1 for bananapi, nanopi 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" During usb shutdown or 'usb reset' all the necessary clocks on the specific controller will disable. Usually this shutdown happen during U-Boot proper handoff to Linux. There is an issue in Allwinner A64, is during OHCI1 shutdown the controller is unable to access the register space so the Linux boot hangs at this place. This particular condition occur when we enable both the controllers, so this patch will disable OHCI1 and EHCI1 for bananapi-m64 and nanopi-a64 boards. It will re-enable the same once the issue got fixed. Log: => usb reset resetting USB... PHY0: mask = 0x101, usb_clk_cfg = 0x30202 sunxi_musb_exit: ahb_gate0 = 0x33004540, reset0_cfg = 0x33004540 EHCI failed to shut down host controller. ehci_usb_remove: ahb_gate0 = 0x32004540, reset0_cfg = 0x32004540 ohci_usb_remove: ahb_gate0 = 0x22004540, reset0_cfg = 0x22004540 ohci_usb_remove: mask = 0x10000, usb_clk_cfg = 0x20202 PHY1: mask = 0x202, usb_clk_cfg = 0x0 ehci_usb_remove: ahb_gate0 = 0x20004540, reset0_cfg = 0x20004540 << hang here >> Signed-off-by: Jagan Teki --- Note: Reason for this patch, since we have week to release. Hopefully this will fix in coming releases. debugging: ========= Allwinner A64 share common PHY between OTG & Host controller, so it's job of OTG to shutdown the controller. But unfortunately there is no shutdown call from command(usb reset) or handoff code for OTG controller in gadget mode, UCLASS_USB_DEV_GENERIC. So, we added glue code to shutdown musb, and it's shutdown propely. Then we found an issue of disabling OHCI1 gate clock during OHCI0 shutdown. ohci driver is trying to clear BIT(16) for OHCI0, but it also clears BIT(17), which is for OHCI1. fortunately this is resolved when we clear usb_clk_cfg after reset0_cfg and ahb_gate0, but OHCI1 still hang. so, we still need to figure it out. Any help appreciated. Above log reproduced on https://github.com/amarula/u-boot-amarula/tree/sun-dev repo since it has some fixes and improvements wrt mainline code. arch/arm/dts/sun50i-a64-bananapi-m64.dts | 8 -------- arch/arm/dts/sun50i-a64-nanopi-a64.dts | 8 -------- 2 files changed, 16 deletions(-) diff --git a/arch/arm/dts/sun50i-a64-bananapi-m64.dts b/arch/arm/dts/sun50i-a64-bananapi-m64.dts index dcde4a4881..32e3402998 100644 --- a/arch/arm/dts/sun50i-a64-bananapi-m64.dts +++ b/arch/arm/dts/sun50i-a64-bananapi-m64.dts @@ -72,10 +72,6 @@ status = "okay"; }; -&ehci1 { - status = "okay"; -}; - &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&i2c1_pins>; @@ -120,10 +116,6 @@ status = "okay"; }; -&ohci1 { - status = "okay"; -}; - &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>; diff --git a/arch/arm/dts/sun50i-a64-nanopi-a64.dts b/arch/arm/dts/sun50i-a64-nanopi-a64.dts index 778636c73a..ba36944caa 100644 --- a/arch/arm/dts/sun50i-a64-nanopi-a64.dts +++ b/arch/arm/dts/sun50i-a64-nanopi-a64.dts @@ -70,10 +70,6 @@ status = "okay"; }; -&ehci1 { - status = "okay"; -}; - /* i2c1 connected with gpio headers like pine64, bananapi */ &i2c1 { pinctrl-names = "default"; @@ -100,10 +96,6 @@ status = "okay"; }; -&ohci1 { - status = "okay"; -}; - &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>;