From patchwork Fri Jan 5 16:15:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 856108 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="AiLWKyhy"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zCqbv1nZgz9s1h for ; Sat, 6 Jan 2018 03:18:51 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A9A2BC21E90; Fri, 5 Jan 2018 16:17:54 +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=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 BE710C21E16; Fri, 5 Jan 2018 16:17:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0A4A4C21ED6; Fri, 5 Jan 2018 16:16:59 +0000 (UTC) Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by lists.denx.de (Postfix) with ESMTPS id 6BE6FC21E52 for ; Fri, 5 Jan 2018 16:16:55 +0000 (UTC) Received: by mail-pl0-f65.google.com with SMTP id bi12so3283156plb.6 for ; Fri, 05 Jan 2018 08:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mD5uEG5aGkJr6nK+TNoPr02MpsYSvL8Y32VQS/VzLro=; b=AiLWKyhyK3GuYMEG9xTXWLcpEhPe9Ze6yUrRLbz/YJoOBNyhPr0yhqXSNZ257UUO2e YXNwpFrKnbFAPPeqTwEBKQS7Ig7dI8NwN48C+umXRa7S4hCqGLjPxQJqZf9CZfpI/COH OpDSevykxIYxstHtGA0/QZGDoDvzbebDTM3EU= 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=mD5uEG5aGkJr6nK+TNoPr02MpsYSvL8Y32VQS/VzLro=; b=CsEuYdsxlevbvRVeah8eybY7v4zOB8qvPXU6sAkFtVGq7jbaEqeJ6t+KFr8sljU7Sc NAxC2+J7IqvAUY3L9NU8QvI0cg2phkRpRm999+4QjrUxm8xQ1p4CRvEEPSfW8fQdJz6q JSLJUCc7z5RYmAQ0u0EKe4u4uzvQrkzU0wM4h1RotA0iytNc5hMebbUNVDKtu7QuCg2i 7gmdA9Nxz5e1lWRPEf84ZlqiFB6UwVdRuudQjvRo0VBwBoOWgspD/m6h8p8eQ4gz7ML3 beI4oigYTltbHfWJq6zAWYFbmMdsMBLMRySVJ3vNqYUQrOVpUy7LV7PhB0Y0oed43lye epeg== X-Gm-Message-State: AKGB3mJ7BzD4+LUl0jHm5LO4ydpxMB1Q/cdA8/EkayNX0iDki0XBhTv5 gEQ5fxBQ85doXfkGIqlAUynk/Q== X-Google-Smtp-Source: ACJfBosSyAsia0SRGsl6DRln/sPsCxWjmRJo0+0ikBucJJMAyys9MwnYXaYwxuc+dEmdd3jXW4esyQ== X-Received: by 10.84.242.150 with SMTP id d22mr3638871pll.136.1515169014169; Fri, 05 Jan 2018 08:16:54 -0800 (PST) Received: from localhost.localdomain (61-216-91-114.HINET-IP.hinet.net. [61.216.91.114]) by smtp.gmail.com with ESMTPSA id k80sm14337459pfh.30.2018.01.05.08.16.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jan 2018 08:16:53 -0800 (PST) From: Jun Nie To: jagannadh.teki@gmail.com, wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Sat, 6 Jan 2018 00:15:57 +0800 Message-Id: <1515168960-18960-6-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515168960-18960-1-git-send-email-jun.nie@linaro.org> References: <1515168960-18960-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [[PATCH v2] 5/8] sunxi: musb: Enable OTG device clock for H3 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" Enable OTG clock and deassert reset Signed-off-by: Jun Nie --- arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 1 + drivers/usb/musb-new/sunxi.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h index 2c82d0a..624d624 100644 --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h @@ -279,6 +279,7 @@ struct sunxi_ccm_reg { #define AHB_GATE_OFFSET_USB_EHCI2 26 #define AHB_GATE_OFFSET_USB_EHCI1 25 #define AHB_GATE_OFFSET_USB_EHCI0 24 +#define AHB_GATE_OFFSET_OTG_DEVICE 23 #else #define AHB_GATE_OFFSET_USB_OHCI1 30 #define AHB_GATE_OFFSET_USB_OHCI0 29 diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index 0005c1e..ce7365b 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -264,7 +264,10 @@ static int sunxi_musb_init(struct musb *musb) setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_USB0); #ifdef CONFIG_SUNXI_GEN_SUN6I - setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0); + setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_OTG_DEVICE)); + setbits_le32(&ccm->ahb_reset0_cfg, + BIT(AHB_GATE_OFFSET_USB0) | + BIT(AHB_GATE_OFFSET_OTG_DEVICE)); #endif sunxi_usb_phy_init(0); @@ -376,6 +379,7 @@ static int musb_usb_remove(struct udevice *dev) sunxi_usb_phy_exit(0); #ifdef CONFIG_SUNXI_GEN_SUN6I clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0); + clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_OTG_DEVICE); #endif clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_USB0);