From patchwork Sun Jan 28 16:19:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 126080 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp1783068ljd; Sun, 28 Jan 2018 08:29:05 -0800 (PST) X-Google-Smtp-Source: AH8x22740Qv+36RF4+md5tnQrutLoxIkzgB8pNOXFV7KFZLIpm+OnOiOmMSyXz7qiTPfVMzcwZtB X-Received: by 10.80.146.134 with SMTP id k6mr42894812eda.107.1517156945322; Sun, 28 Jan 2018 08:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517156945; cv=none; d=google.com; s=arc-20160816; b=mt3JgOCfS3cbTD8LHvqY9MaOV33IgG0Tc+61xVylA5iir8GQlCRgOvXhli15H+KRpC tJkdkOnyI9MrxlzuUOZI/v1Mak9lLfwDCus0kYExHZ6rB0/ZdzHBdTfe/pKHOUMdVUKJ UpVOyjvudTPrl2/8zRtw8NorJV5FvztwC2vzEjMwvp+UXwsg5yH0Q5pU2ibUYhS1Kaaw haGKfjkbyDCmtDnzvLoAVLOyGetUFLpDFUzjPdl16cQ+9qf3o/xQgt+XdUYZdLicoe/D kWo/NiE3Dzb9rOapIV9FkHBfiO5f3l0Nzo39wK/JgPStDxEusLXItDGeq98oH1Jqz32v pQDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=c4Wc8XJI+zRYVkzCCPgu+Bgspz4msLIkbmjantFYb80=; b=0zO900JdE/kF6ZwDGFo8pH7s5ZOc+lh4506BX4NAF7KmH9hH3DAxK8mGpvdRTDgvu9 NoCO0wr38zoUlWF/8RE5gOd32G20WbBgTohCFixhvTSUdhZ1xh81ZY+VhPfLmqUDpn1E CyLhvdZv8deab5/3j/xNKe/VwUICqJg00clp1zeH97LctoRibZM/P4yUrlOkzLDLn07S sLZjGoROfAPD/DofOwDuLtQcAXK/txAf5Vu6KZnoHafrY/pa6uGenywpZ4+6oCsjATii 2DUEi6rveg3z47K4uu7F6Ibgh8B3laPa/4aKPfiy4w2zP8zZt2wE9r4rHIf/BpA1dhdW aI9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Be7uq7PY; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x7si875880edi.455.2018.01.28.08.29.05; Sun, 28 Jan 2018 08:29:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Be7uq7PY; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id F0468C21DA1; Sun, 28 Jan 2018 16:28:32 +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_DNSWL_BLOCKED, 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 806D2C22051; Sun, 28 Jan 2018 16:26:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B1D2AC22048; Sun, 28 Jan 2018 16:25:25 +0000 (UTC) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by lists.denx.de (Postfix) with ESMTPS id EAEDDC21E2F for ; Sun, 28 Jan 2018 16:25:24 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id e76so2783471pfk.1 for ; Sun, 28 Jan 2018 08:25:24 -0800 (PST) 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=fl6g0Et3pVQOlF1JaYuwY5jptX9UCebNxtw/W1t5lCY=; b=Be7uq7PY3OKVdcZx5tG6Pf5s+MIsBF/i9ORGJshiPV/f2r7c9DAXgIe8pS1/Kzrvm8 VwJKLFvyhd9ehwXJ6MgSZu/sXPeI1C7+GTQ0i7RQerHvJBAQC3vaexGS/7urOwnn6okT wJnacvX1IaIVE9evvXPWyelQlBrThg5whsxVmZma7L3mQ0dHFOMsgrpz2U+7pD6fxJwM 7zW0+Cl5Jq1vBwi+9zQ9UdoqGwoT4eQwUzrK/+PrXJWjLT685IMwEQVFn4dglW6A9bcP wqe1CLp1VxPLnv+fmoxinZXmvcxsSLmA3Q0mjEQ242oGYHobICTmL2qgmYbvwy00NNW6 IBAw== 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=fl6g0Et3pVQOlF1JaYuwY5jptX9UCebNxtw/W1t5lCY=; b=q5ZcIof/TaglDHUHaKZv0MRXQ1594OjmaVi6irwz4OoEOxgTMM7BZW9K89A3tUoG2X emPPGAHniIDTFrkaNN+dCf1HqdgRa6EcSCv8+EsufAgZzBD2rO7XRUMM5xC35BVcmk8P v9axphva4Fq7TLlORXLjA28AeZF0dkQb+pKO/Do+2ps3JOxnSBw4gG6bBeYAtwEMbYxV Ldyqzps7rKMbE1M5SA3ZO5pwh7aWGv+FDp5zE5LTW9tS1PTeKbhbXqtUEO4mT8O2o2wi RgF+J0b2yUrMruPVQWEx+RZp7LGD95dFf3UJyynAOc0GKgFNbNR8PasInz8qmaLp6/E3 IDGw== X-Gm-Message-State: AKwxytcrb09n2QjkSaeQXGfqRkPaEouu4NE0ZiQDAPDNtsQeFkmS2YC/ cC65lwTsS/u18Co7WEHY4hpVb9ky X-Received: by 10.101.101.200 with SMTP id y8mr20108916pgv.0.1517156723263; Sun, 28 Jan 2018 08:25:23 -0800 (PST) Received: from localhost.localdomain ([115.97.187.51]) by smtp.gmail.com with ESMTPSA id y79sm26075776pfb.177.2018.01.28.08.25.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Jan 2018 08:25:22 -0800 (PST) From: Jagan Teki X-Google-Original-From: Jagan Teki To: u-boot@lists.denx.de Date: Sun, 28 Jan 2018 21:49:26 +0530 Message-Id: <1517156391-11353-6-git-send-email-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517156391-11353-1-git-send-email-jagan@amarulasolutions.com> References: <1517156391-11353-1-git-send-email-jagan@amarulasolutions.com> Cc: Marek Vasut , Maxime Ripard Subject: [U-Boot] [PATCH v3 05/30] 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" From: Jun Nie Enable OTG clock and deassert reset Signed-off-by: Jun Nie [jagan: fixed AHB_GATE_OFFSET_OTG_DEVICE to use H3/H5/A64] Signed-off-by: Jagan Teki Reviewed-by: Jagan Teki Cc: Marek Vasut --- arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 1 + drivers/usb/musb-new/sunxi.c | 8 ++++++++ 2 files changed, 9 insertions(+) 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 46c8bd2..c3b8fa4 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -266,6 +266,11 @@ static int sunxi_musb_init(struct musb *musb) #ifdef CONFIG_SUNXI_GEN_SUN6I setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0); #endif +#if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I) + setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_OTG_DEVICE)); + setbits_le32(&ccm->ahb_reset0_cfg, BIT(AHB_GATE_OFFSET_OTG_DEVICE)); +#endif + sunxi_usb_phy_init(0); USBC_ConfigFIFO_Base(); @@ -380,6 +385,9 @@ static int musb_usb_remove(struct udevice *dev) #ifdef CONFIG_SUNXI_GEN_SUN6I clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0); #endif +#if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I) + clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_OTG_DEVICE); +#endif clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_USB0); free(host->host);