From patchwork Fri Jan 5 07:36:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 123475 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp491357qgn; Thu, 4 Jan 2018 23:38:06 -0800 (PST) X-Google-Smtp-Source: ACJfBovkM0JkeJX0Zt93SmEdc/0mDT+vXebnIL43tR0dcv3GDN61PYdwmmTL7SXFU6BTEPXz4ahw X-Received: by 10.80.217.76 with SMTP id u12mr2881443edj.171.1515137886076; Thu, 04 Jan 2018 23:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515137886; cv=none; d=google.com; s=arc-20160816; b=enw6+Q0VhXWXW5rLgh6e+i6JC9+PJDMuizHfF+2W1tRkVgEyA1xiEDcsYvI09CZHq8 PSdOxMbJ7/QSQFBeY38o3qaYlVbfypKZOR5uHGS1jUNn2Ar5Eex5h+XThAKzNSGied4Q Nt5Zek7vrh6PQS14V505/CPdsvSL43rPBlNnAIckXPY+5d46Gqq9LY+fvj4BVSQetqAt vSINil38chJU+fh0rHnX3B7XCr3Mtua0U5rMFnktaC9mxDOlTjXDj/sXA7seYufwTGip zSBZIQFLkvEbT0AyR2FsTuxKms9XAM+Loucn9ecCQOy8BRv2nrI0mmzf9tc6NTdkqC4+ ZxOg== 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=ujzP99FCQ82UPJghZPcZi55ef8cWZ5kLnZhBwQ3+Ais=; b=sln+sz3RnNlfNZYyw4xQ+K/sLBkQvA/b3hHWWnBXWUzGoo+PLrXc5rFLwDLXY7Ssgx 8wUgiGgYqte6UrgU7f2CnhjJI3lFpFTCBaxmg12PHHbkV5QUku+Az/5aSx7qtbTKWO73 H6l7NQ/Kl2IxGxFX699p3O53W5FFSRbK9e2pvZ9mo0cHWM2aLXbN75CPmqYtWnX+FjvO BYHAcMBtWDcxbDUJr4qKxroKnBLFBNEHBy9Z6pBafUaNMZ7j7GoCZwl2lRbbmblxB8iI Wj7J6p44dPAs006wp/7j55CJtS8dyKM+HSwBtpWyRQ1fbzPqtYbhyg5KO0p025s4Yxru mpzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JwbKGB6R; 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=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id b15si784245edf.329.2018.01.04.23.38.05; Thu, 04 Jan 2018 23:38:06 -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=@linaro.org header.s=google header.b=JwbKGB6R; 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=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id A48C1C21E24; Fri, 5 Jan 2018 07:37:44 +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_DNSWL_NONE, 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 09F11C21E35; Fri, 5 Jan 2018 07:37:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 40566C21DD9; Fri, 5 Jan 2018 07:37:32 +0000 (UTC) Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by lists.denx.de (Postfix) with ESMTPS id 60DC7C21DE9 for ; Fri, 5 Jan 2018 07:37:28 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id o2so2621981plk.12 for ; Thu, 04 Jan 2018 23:37:28 -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=h/uiOs8vX/kTZ/RbQ2nhH5QcKDz7Z+zCilPXw739beE=; b=JwbKGB6RuM+xrJWZYHYrflzhycU7lLZbYQg59lC1ndfjXaMKGgAASiwor/YVds1WSr uXuyANtdqC0RGX4eMRNDtGE8WqVuWYuCpglUA7WqJYW9bnA+nvtsIr90ej98/ZH3Ov4+ Cgr2fDrmqzM/QOvfLXVNqQ82EVrWCXp9nMAT0= 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=h/uiOs8vX/kTZ/RbQ2nhH5QcKDz7Z+zCilPXw739beE=; b=AkMggQy+Z5y6XMveCiwPolNpbXHSGADsFVFNPd3BUaLrZxDFTLrHYMs9+dkUqHQUxk IdKrT2NkOaih1E4d+RQMMwPAczyV0D9x0XpO8xyiyGOkP07Ga/lMsqoDEC9McoqMrZOB LWM741bO+BLbAAjOs5kS5A+pc0bVBTLki4iKPNooyLG/tcXXSSpI0nr4ChH59Bk1e6F8 ankshBWMyfOkZfaiPRrQkXBeMGHG3iPU7WGtMMLAnPze51W7IBoIappzC3TN1x9JqrdK 1Uc7uZ4x+Rx18rJt+1J804BK3eDYfABBHlT1PkZRLCj25DUsS9hKE8IvIAGnHnDDryMC 8MTA== X-Gm-Message-State: AKGB3mKU74sn+d6wMhW5DmyjEFxm7zbFaAltqxLSCKnka3QkKKNbW2TO JnejgCuZuWVz0TuEb7GNYDjtkQ== X-Received: by 10.159.206.134 with SMTP id bg6mr2261004plb.311.1515137846947; Thu, 04 Jan 2018 23:37:26 -0800 (PST) Received: from localhost.localdomain ([45.56.153.113]) by smtp.gmail.com with ESMTPSA id b9sm9553789pgs.3.2018.01.04.23.37.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 23:37:25 -0800 (PST) From: Jun Nie To: wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Fri, 5 Jan 2018 15:36:56 +0800 Message-Id: <1515137821-30583-2-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> References: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/6] sunxi: h3: add usb_otg and OHCI/EHCI for usbc0 on 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" Allwinner H3 have a dual-routed USB PHY0 -- routed to either OHCI/EHCI or MUSB controller. Signed-off-by: Jun Nie --- arch/arm/dts/sun8i-h3.dtsi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/dts/sun8i-h3.dtsi b/arch/arm/dts/sun8i-h3.dtsi index afa6079..ae1e861 100644 --- a/arch/arm/dts/sun8i-h3.dtsi +++ b/arch/arm/dts/sun8i-h3.dtsi @@ -218,6 +218,19 @@ #size-cells = <0>; }; + usb_otg: usb@01c19000 { + compatible = "allwinner,sun8i-h3-musb"; + reg = <0x01c19000 0x400>; + clocks = <&ccu CLK_BUS_OTG>; + resets = <&ccu RST_BUS_OTG>; + interrupts = ; + interrupt-names = "mc"; + phys = <&usbphy 0>; + phy-names = "usb"; + extcon = <&usbphy 0>; + status = "disabled"; + }; + usbphy: phy@01c19400 { compatible = "allwinner,sun8i-h3-usb-phy"; reg = <0x01c19400 0x2c>, @@ -250,6 +263,25 @@ #phy-cells = <1>; }; + ehci0: usb@01c1a000 { + compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; + reg = <0x01c1a000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>; + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; + status = "disabled"; + }; + + ohci0: usb@01c1a400 { + compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; + reg = <0x01c1a400 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>, + <&ccu CLK_USB_OHCI0>; + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; + status = "disabled"; + }; + ehci1: usb@01c1b000 { compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; reg = <0x01c1b000 0x100>; From patchwork Fri Jan 5 07:36: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: 123479 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp492405qgn; Thu, 4 Jan 2018 23:39:26 -0800 (PST) X-Google-Smtp-Source: ACJfBosjJbwneKewU+jPZVK9H9SjAeOMPlC+FSAx6Z8VqB7oV8d9HRWK78Tj5SvUQ6j8mjonqEWQ X-Received: by 10.80.217.76 with SMTP id u12mr2885730edj.171.1515137966450; Thu, 04 Jan 2018 23:39:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515137966; cv=none; d=google.com; s=arc-20160816; b=CTDn572O+oHbzHDqHK3WHPMMYUmNL3S+GKB/B+hTmBwPouZpXWxlb4PHnaDR/fXaRc gyTpLIi9umGlyJXNYyt4+wTNPMl9f32n+TV9Ikm10rlagEPWTajMpA80t4moGezZIhdD bB9AqHtDOLBD5xyL/9izIiVXplKuGTBIqUq70frCr87M7tBwaqfnwbNBX+jOY3vYfgYM 6fEAC5Yqg2CScaUkY6GX506yVSqdz93cr4mboJvOMnnnMeWse7bPzkDqZ06ngrHyegIs J8l51bhsWuP8Uw/aWwL5RPNeoRLlSaNSDJJ3O0K9eRosGtjM1z1xRcpLTe0LM+/lP4BE GhBg== 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=QkhDobY/y3/AUs06hagd0y6xJrnonCv8N+cStu+qUng=; b=J1mCIzLxSsLSka3LWpvLuWo8sXJDW/nkm2jo6L+55O+0M9u1vzbOy+ZY1m/OfZnx72 Aj4dVkbBhegOJhLhxcS4B7yVo/4yFKj6Y7kglof2CigMIKRVLZdHJoTmF2OS3QSVmqsT DY4Jy9Lp9uWmktdVNWFDjDzg6E8bFSQOkbFtYCB2XqAONNmLwqGYnkinCgjIr+tjp13e GlspRTyeTnM5LLhNYjsxBu6yTfKtehrOi4I8O19k2LYlD++u3hY7e8v7Xi5/kUeTre8u kQutlTLahQtxQebV58gT8SHm9tblMgpqSUDBJqd0XIII0JFS6kzUfK4+iuV5G2kpoF8s Mx5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WTsAXwmg; 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=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id s39si3533881eda.89.2018.01.04.23.39.26; Thu, 04 Jan 2018 23:39:26 -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=@linaro.org header.s=google header.b=WTsAXwmg; 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=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 08E92C21E1D; Fri, 5 Jan 2018 07:38:23 +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_DNSWL_NONE, 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 3498CC21E06; Fri, 5 Jan 2018 07:38:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C6E01C21E0E; Fri, 5 Jan 2018 07:37:38 +0000 (UTC) Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by lists.denx.de (Postfix) with ESMTPS id CB86CC21E06 for ; Fri, 5 Jan 2018 07:37:36 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id n13so2634036plp.11 for ; Thu, 04 Jan 2018 23:37:36 -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=1Ilnws27UaIqbKdrxOqfIgmpqDBNEoe73Wb2iFMudwY=; b=WTsAXwmgtyzPzgd8oNp+J1I4Pok6EGQ1zvHa4EL/mzoxPk77UEtkemp7PxT9FcEbAm qAQ2Z1EOJnm/gXfxJpdpAnUsz4u0qwf+BSCAHJg1wKW133IOOHVg2UpE+4Xa6Y3gDPVw O4dqt9HhZLlrc2wsX4FiJe9/+Lee5dBDftXH0= 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=1Ilnws27UaIqbKdrxOqfIgmpqDBNEoe73Wb2iFMudwY=; b=Xlu7MoaK6A3c51hFSDI4xs2HJ3KGZMgsu53moU+fKIi6V6SomtXA94+/yWlXl1H7II eo0f8l8skhVDkCPZd37drAfp82LL3jCCFxlM720HPw4d174b1ljibi4yo1cN+tN6ZG4b YdudwGl+qCISkU5xuVWxXif4qN6B5eu5GF7iW51bpvKqT/QriUYS9XhD5A4z+G5iYW/2 offZIpcHDFG23ZGGElRes6Fro143/KoAgAbCCL4MVrhaO3sPk38GshBkBcm+y5WC3dhe aiMToYxzu5zNsJWAgL77oq0gayuWa9gZHVR+jK7LTsbQgqTzsY7chepHEc1+9VKJfdQ6 AJNA== X-Gm-Message-State: AKGB3mIFD7mZTDbrcaebpoDHqFJ3s1XYFaTkAch/J+hXmYh666LQN/Rz StzXcuJmfp0KGb+nv9yTT50lcA== X-Received: by 10.159.247.129 with SMTP id e1mr2245844pls.222.1515137855543; Thu, 04 Jan 2018 23:37:35 -0800 (PST) Received: from localhost.localdomain ([45.56.153.113]) by smtp.gmail.com with ESMTPSA id b9sm9553789pgs.3.2018.01.04.23.37.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 23:37:34 -0800 (PST) From: Jun Nie To: wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Fri, 5 Jan 2018 15:36:57 +0800 Message-Id: <1515137821-30583-3-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> References: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 2/6] sunxi: musb: Add fifo config 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" Add fifo config for H3 as H3 differ with other SoC on ep number. Signed-off-by: Jun Nie Reviewed-by: Jagan Teki --- drivers/usb/musb-new/sunxi.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index 7ee44ea..0005c1e 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -290,10 +290,42 @@ static const struct musb_platform_ops sunxi_musb_ops = { .disable = sunxi_musb_disable, }; +#if defined(CONFIG_MACH_SUN8I_H3) +static struct musb_fifo_cfg sunxi_musb_fifo_config[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 3, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 3, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 4, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 4, .style = FIFO_RX, .maxpacket = 512, }, +}; +#else +static struct musb_fifo_cfg sunxi_musb_fifo_config[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 3, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 3, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 4, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 4, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 5, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 5, .style = FIFO_RX, .maxpacket = 512, }, +}; +#endif + static struct musb_hdrc_config musb_config = { + .fifo_cfg = sunxi_musb_fifo_config, + .fifo_cfg_size = ARRAY_SIZE(sunxi_musb_fifo_config), .multipoint = 1, .dyn_fifo = 1, +#if defined(CONFIG_MACH_SUN8I_H3) .num_eps = 6, +#else + .num_eps = 5, +#endif .ram_bits = 11, }; From patchwork Fri Jan 5 07:36:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 123476 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp491865qgn; Thu, 4 Jan 2018 23:38:42 -0800 (PST) X-Google-Smtp-Source: ACJfBouWRkBdebKF3Rz6A61lGNKs6Kx7s7BZl0K4q4RuWZszbveN0+tqN4idHwkm6yBR3UU1hhIN X-Received: by 10.80.183.216 with SMTP id i24mr2905505ede.257.1515137922073; Thu, 04 Jan 2018 23:38:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515137922; cv=none; d=google.com; s=arc-20160816; b=0bfJg+Z83IGvns0MpnXlKTo/GcgV+UKFlhA0oVErdAvfkVfGwz5vjwDqQZFsd3OxY5 gSRmMUpLMEGKjN+gtFenOB0jlYz0mukylXeejWydWy/tTmx9185l70+Yjvp2U9AR0EQ8 Uui6+oKn7wxJRG/i8djnlfT0n8qlduJjmeNt0rOqVqgs5B06tOoQCCNpNqgA8IMHXQ+h Klj4VvmGkdOIihfX4yk2JlG4LQy6xvSdFg83JgZAGwV59cUh9g+iqYDXXd1ss2XqoTQR RB5mvsPnWRZqmUQ7luS7J/5ToBfdlPgZZ/40SG/1xx0jt+9PFIen0P+6hkppmWYGV+R3 2Eeg== 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=pr0xlFYFsAYw1bMO2R7wENwb4gDF1eVu6Hs+BS9B5bk=; b=jXuBV6e9Frtb8NiEz1MKr7vfggEZg+WT0YvSP0Gxcz3fRrNBw6cmBd49wqJcABlqfI VinCBFpq+3QJ5SmOf8ps/1Q/t0cS6kzMTDxgG12vVln9GNztJrGPWJTUSbwXrfsL4gu/ JA5L5+4nRlScFgodXotIN0VMOw4huHIdJota0iTNmikdsjaw7eN+Bbe57fNZJdckedER ClXZFCExOMHWIqv1UbZxvZ/GSQQ1x9f4nDhvponj7JDJvUwVXVks/+0J+yDI0ONMqggH ix6TGQjgZUFBuVcmKdsVW5j2jqQTqCMEiDPT+9bV1ksQ36XdRMFKnZU5T6g02w4q2jSk kU3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DFKCYIgr; 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=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id y93si3828391edy.358.2018.01.04.23.38.41; Thu, 04 Jan 2018 23:38:42 -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=@linaro.org header.s=google header.b=DFKCYIgr; 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=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id AFB0CC21DC5; Fri, 5 Jan 2018 07:38:05 +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_DNSWL_BLOCKED, 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 65E52C21DD9; Fri, 5 Jan 2018 07:38:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 33459C21DD9; Fri, 5 Jan 2018 07:37:43 +0000 (UTC) Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by lists.denx.de (Postfix) with ESMTPS id 85CE2C21E16 for ; Fri, 5 Jan 2018 07:37:42 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id t67so1725141pgc.5 for ; Thu, 04 Jan 2018 23:37:42 -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=hktDAHNZharS8aE32qKIEZ3nQ+nD8CQVpxghBFlGQbA=; b=DFKCYIgrFzELINt4SKHeAa+zSEelh+njAglVzZfZZRcS9cDfC6AeKfasYxMzRd6l6n hlQQp5T07kDpsbxrkD8A6kJ9YEvDYIqX9PUHgTiyAo+57s2IF068FCYZWaHFI2yaEGR7 cE8WiZ+Dtc7zyh15BxmzPPbhraD6Ta8w6+l4c= 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=hktDAHNZharS8aE32qKIEZ3nQ+nD8CQVpxghBFlGQbA=; b=oQg4Wu5+oOfc+VtUxXtj8j4UjiBdomVtwI9Vr3yJc82I5Vxd1m//YnWuikQSCCTBTH qx3fwH1ASzb2v2rTWGBAo/t9zYx07p2iJT2IhZ0yQKuajDncFH5v8ptfS2Q55tJb2XUE 13jDaU3EIknxsS9JBiz0xNtUwHfzQCgRqcNbd4JLKH2MDcNyxrs9YJ1CbzrvkZ3FV+Ib mcAnnogpMWcmzuobybDVYvtmfoVwIv3EgZR0HhMN1covJROAEZuG+6LUle3sFT6+LP5I lpOSaty0PD1v6/d3aPlS+Zc6/vq/OR64GO7XzTA9bBkx1TqAq1jpyJGglAQRquXDHrq0 TXSA== X-Gm-Message-State: AKGB3mL/JoaeeMA4JUihnOQhO95uu1qGryD6K+050yNO26f5bjWFK+ho zzuUpOhTZXEDB/KCfsFyxxVXwQ== X-Received: by 10.98.15.203 with SMTP id 72mr2118120pfp.104.1515137861247; Thu, 04 Jan 2018 23:37:41 -0800 (PST) Received: from localhost.localdomain ([45.56.153.113]) by smtp.gmail.com with ESMTPSA id b9sm9553789pgs.3.2018.01.04.23.37.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 23:37:40 -0800 (PST) From: Jun Nie To: wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Fri, 5 Jan 2018 15:36:58 +0800 Message-Id: <1515137821-30583-4-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> References: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 3/6] 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 | 2 ++ arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 4 ++++ drivers/usb/musb-new/sunxi.c | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h index d328df9..0d81791 100644 --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h @@ -280,6 +280,8 @@ struct sunxi_ccm_reg { #define AHB_GATE_OFFSET_USB_EHCI2 27 #define AHB_GATE_OFFSET_USB_EHCI1 26 #define AHB_GATE_OFFSET_USB_EHCI0 25 +#define AHB_GATE_OFFSET_OTG_EHCI 24 +#define AHB_GATE_OFFSET_OTG_DEVICE 23 #else #define AHB_GATE_OFFSET_USB_EHCI1 27 #define AHB_GATE_OFFSET_USB_EHCI0 26 diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h index 2419062..f7050df 100644 --- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h +++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h @@ -64,7 +64,11 @@ #ifdef CONFIG_SUNXI_GEN_SUN6I #if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I) #define SUNXI_USBPHY_BASE 0x01c19000 +#ifndef CONFIG_USB_MUSB_HOST +#define SUNXI_USB0_BASE 0x01c19000 +#else #define SUNXI_USB0_BASE 0x01c1a000 +#endif #define SUNXI_USB1_BASE 0x01c1b000 #define SUNXI_USB2_BASE 0x01c1c000 #define SUNXI_USB3_BASE 0x01c1d000 diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index 0005c1e..6d8242e 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -266,6 +266,16 @@ 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 + +#ifdef CONFIG_MACH_SUNXI_H3_H5 +#ifdef CONFIG_USB_MUSB_HOST + setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_OTG_EHCI); + setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_OTG_EHCI); +#else + setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_OTG_DEVICE); + setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_OTG_DEVICE); +#endif +#endif sunxi_usb_phy_init(0); USBC_ConfigFIFO_Base(); @@ -379,6 +389,15 @@ static int musb_usb_remove(struct udevice *dev) #endif clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_USB0); +#ifdef CONFIG_MACH_SUNXI_H3_H5 +#ifdef CONFIG_USB_MUSB_HOST + clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_OTG_EHCI); + clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_OTG_EHCI); +#else + clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_OTG_DEVICE); + clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_OTG_DEVICE); +#endif +#endif free(host->host); host->host = NULL; From patchwork Fri Jan 5 07:36:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 123478 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp492313qgn; Thu, 4 Jan 2018 23:39:17 -0800 (PST) X-Google-Smtp-Source: ACJfBotQhYsRhR2h6MzjUvPlZYt4aJg/qA2aXCi0NS/RJ/Cwb4Pddp2HXY0NgXfZR2fpclTXDywy X-Received: by 10.80.204.212 with SMTP id b20mr2966009edj.201.1515137957882; Thu, 04 Jan 2018 23:39:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515137957; cv=none; d=google.com; s=arc-20160816; b=NOfZ0Ck6ntuReeTas0wbODl6euJ+uVl+QC7axfaimrIeFqj37KcvHMMyJu+Z8GfQwj WMsI6iYZhTnI105VFXJ4jv/f0/4JT7rwQACVfNuv27cylr+/npWo1nunP9OQm10KA7Fa U2xYxjL0FapQWclKam0xl0GmrZP8ABaZWSGVuxhmB0MwmAKY+06aN2e6bnJ7gtGhMQrQ jpGqkExc02zKTHPun8C+97USMeCGTMeWFw6hVBKNLzTR4fDLjRObrblMJ7uZes49Udhh Nry1jcE3hjT4vqDbXhA+Y7zhFeOEFcgWHrVhqbaUJI8bHSK4DfUGtbT2o4UdE+gvgixt SupQ== 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=V2u7aUpfzS264E/+mFDyjFy/vKaL/cinFyStEq/lOsQ=; b=KgyjSkEi4z+35WIefKw5rpcKk7UdTZT/0OmXR6uDqzdlA6c0A7PqWlY+vRhU9Isp8W 2jUAVqfjl/47F/+49kC+Q3ilHR+2wsIs7hdYCN3/Cg3p/SbyIhKZenymCbe9xIWF3o9D kG5CKwOgPQ5M8UkvXLjdeyrgeMZXhDGWGffCaDToQTGX5SLUQWmUKDsCvFzCXtsZPUlZ 90ay9WVC8fqOwkgoCK4bW7C6I4+v7OrAmGGj/dfzUGzfpAmwPOXVIdtVwyMzzg3jtNgt ayJJvWEj+HU4D1EZGh8TjS6stwTjGxCk4eCEigN6Uv3E6Zkf0YYS9yIgCEbUh9/x6nX0 2o+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Wlj7Ri+G; 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=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id f3si1500076edd.79.2018.01.04.23.39.17; Thu, 04 Jan 2018 23:39:17 -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=@linaro.org header.s=google header.b=Wlj7Ri+G; 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=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 77188C21C51; Fri, 5 Jan 2018 07:38:56 +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_DNSWL_BLOCKED, 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 633A0C21E28; Fri, 5 Jan 2018 07:38:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 49BBBC21DDE; Fri, 5 Jan 2018 07:37:54 +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 6F693C21E0F for ; Fri, 5 Jan 2018 07:37:50 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id bi12so2636849plb.6 for ; Thu, 04 Jan 2018 23:37:50 -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=dQ152zcWCwRotT8+zvQ3j3TSDH8Z/EH6+ZDQsInBotE=; b=Wlj7Ri+GiyeZ1EHcgW2Qni8zWIfkbL1p2ltx7UNZOgZcvbqf4VCXk5TDXYyy/QkDjk Ju+aZMM7teDYvplq4SSE8j8ax+Lb4SCFFwe5cSV6i/8WS4LwQT5asQhjWQhQwDF28DaO l4mcVZRQby+qtd1ltPwohIgMalXUeOeF9Xz+s= 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=dQ152zcWCwRotT8+zvQ3j3TSDH8Z/EH6+ZDQsInBotE=; b=JL+Sc1efWDZ0yk/mNwwb6L2mZsGpzDIbPQBqQjQaUHH0B3sYrsK4VAUncuihjNHlmT rk1uOcUY7b5+NVYTNRMQaH2MnwMJmbXRVe0lpXjbVuRYKfmsKTsTfIXqX8TybJlQk4S3 Dm5NPtq1b1xkdBAY20qxYN+GHd/JrmC3kW7galKpFMnFXSW8T1Nn5G3x05Mqgqe1ZX2y rPr96hlQC3pdY80HpIeQseK1CR8VGWTsdlFlht7pIm5+bz9EFF5eIpyHbmdIwbR4v9Yv 0iPGF5Gp3R0oFuffefJGFSq3QFd0z77ejgi9ech5SRB0SJpAjxB3OvIUZyeVxfeKRgyL hSLg== X-Gm-Message-State: AKGB3mJ6zMgqW4v+DypQ1fl4r9ZC1kxL7zVgmQx/sQ3jzC17tUEQ3jPv EcmgeFMLAFuAa903CE9Qc+Tg6g== X-Received: by 10.84.241.138 with SMTP id b10mr2258893pll.435.1515137869170; Thu, 04 Jan 2018 23:37:49 -0800 (PST) Received: from localhost.localdomain ([45.56.153.113]) by smtp.gmail.com with ESMTPSA id b9sm9553789pgs.3.2018.01.04.23.37.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 23:37:48 -0800 (PST) From: Jun Nie To: wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Fri, 5 Jan 2018 15:36:59 +0800 Message-Id: <1515137821-30583-5-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> References: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 4/6] sunxi: musb: Hack dynamic fifo support for H3 OTG 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" Like other Allwinner SoC, the H3 is missing the config register from the musb hardware block. Use a known working value for it like other SoC. Signed-off-by: Jun Nie --- drivers/usb/musb-new/musb_regs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb-new/musb_regs.h b/drivers/usb/musb-new/musb_regs.h index a3cc38e..3e51003 100644 --- a/drivers/usb/musb-new/musb_regs.h +++ b/drivers/usb/musb-new/musb_regs.h @@ -432,7 +432,8 @@ static inline u8 musb_read_ulpi_buscontrol(void __iomem *mbase) static inline u8 musb_read_configdata(void __iomem *mbase) { -#if defined CONFIG_MACH_SUN8I_A33 || defined CONFIG_MACH_SUN8I_A83T +#if defined(CONFIG_MACH_SUN8I_A33) || defined(CONFIG_MACH_SUN8I_A83T) || \ + defined(CONFIG_MACH_SUN8I_H3) /* allwinner saves a reg, and we need to hardcode this */ return 0xde; #else From patchwork Fri Jan 5 07:37:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 123477 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp492305qgn; Thu, 4 Jan 2018 23:39:17 -0800 (PST) X-Google-Smtp-Source: ACJfBovBWO5VNVSPXv3Itl3pkRwSEwCZuGpNnXL+OJubkEhx3ww3Q4A0ajPwwb2AkkalS9eGbtwS X-Received: by 10.80.163.221 with SMTP id t29mr2988744edb.39.1515137957546; Thu, 04 Jan 2018 23:39:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515137957; cv=none; d=google.com; s=arc-20160816; b=N1K1fzErT491Y8cs6QxrHNZ7niSIhbLfhJLU/zG/NYvW4FLNRM45A2NeXGRfTPHl8B H/DiBBv+WlTlOwqOAPrRe1AuCrdRAy3eEsUAjxq7nqzgI419FEs0Hf6/6C0K2URqHK3Z H2Y+2iW5X0dl48kt9BrfR6ILfQ7N29N2csFCZzPc+raF1jWRvKIOtQF+HXFTXEpa4M+F QzFlXrVxvPGxr0wmQgNtAabdNdM9GhPSfdiLxRQ32MsjXpTY9adyEjStfoW0hg3hIoZw 96DCuncMzAHD8/6LJ/GdZnCYBQPElMXp8HzcsCtplR8ED5xxMkqTDZfMQLQOOnjR4FH5 foXg== 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=lYj6WOPhiFN7wU4e1jc/cgpHrWXziZEZBzQ5d1d89sw=; b=Gq4tY7kWQYmaCQR6zC38z6Hxcf+tYgwTt4HiOghg8XsA3+hKMStrMgMDDj96sVtci1 tIyamPrQ3GrsmafAyWjqLIR/2zVLmvIJLRju99bxxtQTBt5euj2exYvwTRbFlJx8XAjH h3j06gL6wWH+nDudq3C9g4Q3ZvB8fXoCjUK28pisK8moyESlxFA7d3esuiM3vlR6DoIW DgUYMWul3cGyrMOx3TiyLuYStm77N3bPj++Qj4j9+exVjbn/SI5nQ3EYryyRoQKSM9En KoWfjqQdfP2NriWm2Siir1OavtBMxpWq+SRw1vLBdUNSGxDQFGLHSxGijGW7GWOAsXXQ +7Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dmPewsJY; 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=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 35si3484542edp.500.2018.01.04.23.39.17; Thu, 04 Jan 2018 23:39:17 -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=@linaro.org header.s=google header.b=dmPewsJY; 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=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 21053C21DC5; Fri, 5 Jan 2018 07:38:40 +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_DNSWL_BLOCKED, 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 24A2FC21E14; Fri, 5 Jan 2018 07:38:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6E2F6C21DC1; Fri, 5 Jan 2018 07:38:01 +0000 (UTC) Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by lists.denx.de (Postfix) with ESMTPS id 61F44C21DE5 for ; Fri, 5 Jan 2018 07:37:59 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id 77so1723278pgd.8 for ; Thu, 04 Jan 2018 23:37:59 -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=zg3tNK9l6yMwj8b1QUhOzU3EmxLV2FbRwO86A1s/d60=; b=dmPewsJY0dOSdBfqyj8utLLRdxc4merfU4jwsycWrNB1noGIMob7TtRUtY+2Dl9/1j dZN2oGi/rI4UkiKo0Ye494YtaMpUqoEOHudSxnSEcW1RWJcS4eN65R3KyechsVBSu99c uElD0XRnAJ5dRaE1PYTQ4jgMH6JawTwNx2JhQ= 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=zg3tNK9l6yMwj8b1QUhOzU3EmxLV2FbRwO86A1s/d60=; b=TfL64f++Up2F2S8p1PIaeTpZWwe3C19YEUqwWW5CLNdlwr9rVUBveHMN2kamKhzJxG kRfT+0x5VQtrz+oMIHI1Uqr/8Z28gM88/n1VIpTetjUd4SVqzeZXOL1AFb5HEhBYJFqH Az96Fmuvsh+4RHzcvVh+/tki7iZ8SHfAtm6TtgWLE/3JcTZtnx/CPT2UBIsAkbUGsJAj pbLRlF8IsPilFNh1JTdnigZDE8UlKB15TlUVFAzy//J/X3Jqz1QABG4OZoX828/IrPu4 Ffww0joxONyx3pkjKpleVgeyRgWGPvRPt9L3eplyJSLKcjmktY2Fumlfpa+F9m4TLCqd tXYw== X-Gm-Message-State: AKGB3mKt/MkWI2VD7yOEl2U8crsqzHxdJ3ofJm2J8lLk3tIVeLORKfyn +OEhZlHjoOe8lUCXPuzxhPt0Zw== X-Received: by 10.101.82.205 with SMTP id z13mr1856532pgp.134.1515137878126; Thu, 04 Jan 2018 23:37:58 -0800 (PST) Received: from localhost.localdomain ([45.56.153.113]) by smtp.gmail.com with ESMTPSA id b9sm9553789pgs.3.2018.01.04.23.37.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 23:37:57 -0800 (PST) From: Jun Nie To: wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Fri, 5 Jan 2018 15:37:00 +0800 Message-Id: <1515137821-30583-6-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> References: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 5/6] sunxi: usb_phy: Clear PHYCTL register before writing 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" PHYCTL register offset at 0x10 need to be cleared before it's written. Ported from below Linux patch. d699c1d phy: sun4i-usb: change PHYCTL register clearing code Signed-off-by: Jun Nie --- arch/arm/mach-sunxi/usb_phy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/usb_phy.c b/arch/arm/mach-sunxi/usb_phy.c index 2f1cad1..1a6b4b4 100644 --- a/arch/arm/mach-sunxi/usb_phy.c +++ b/arch/arm/mach-sunxi/usb_phy.c @@ -156,8 +156,14 @@ __maybe_unused static void usb_phy_write(struct sunxi_usb_phy *phy, int addr, static void sunxi_usb_phy_config(struct sunxi_usb_phy *phy) { #if defined CONFIG_MACH_SUNXI_H3_H5 - if (phy->id == 0) + if (phy->id == 0) { +#if defined(CONFIG_USB_MUSB_HOST) clrbits_le32(SUNXI_USBPHY_BASE + REG_PHY_UNK_H3, 0x01); +#else + setbits_le32(SUNXI_USBPHY_BASE + REG_PHY_UNK_H3, 0x01); + writel(0, SUNXI_USB0_BASE + SUNXI_USB_CSR); +#endif + } #endif clrbits_le32(phy->base + REG_PMU_UNK_H3, 0x02); } From patchwork Fri Jan 5 07:37:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 123480 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp493995qgn; Thu, 4 Jan 2018 23:41:26 -0800 (PST) X-Google-Smtp-Source: ACJfBou8mYjFlRHJOHtaVi72PcflF/GrdXJnrXoc+k41Oo4serzFGTo7He1NOed6X+Ijm3PwbBtu X-Received: by 10.80.182.55 with SMTP id b52mr2893651ede.112.1515138086634; Thu, 04 Jan 2018 23:41:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515138086; cv=none; d=google.com; s=arc-20160816; b=tIY75Aefw8Tbio58Pbcd0m86KIfrKaZYvAZCASDeOhIzxfjnVztwX6HnLMj1K1kSnS Iv1HdqT9Xpd46ZV7Qjw8c7l9C3jG7zyIHWAP8E/lTMR8GEQ09/Xa0ApTADljMYvHrEDR rbGcN08iS0bNoKu5JVKg8FHJYyhS+BrA+N0/1LR8NlE/99zaCdJ9Fhvfx2E1DGFrXezf kUpva7YkUPie5S0eQn6WS4iKJ005EZxSvxeJSrI5Uv/wsZXXjcoP11rrWeNKZcWxyV56 /Hgn3S41BT9IlTtu25yQt3ADicTTskzYKrN/phXGYWwVT2falKJSPwmK4Yo8ZFnC4etg 4DzA== 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=eGbzWqhN3j5nqAURoyVjkrO4YGS4BxD6cVXI8CczrK8=; b=mQSJIWj8rHF3MLPoHQP/OP2Z2/zLTrndz0UOscvSFxYJMrMOg77qF0kxpZnJjbMZ+T CI/Uck3CknQ/rEgWcLXOtTCaorR6mIFiMt1Px72zNQSdOEPqO6SQKTlUR7jZOeFlfGnH +EzW5uksgRcU4TSrU3RgjF5iykUXGt3P4vcUCc8gfn/93r+GJAomDC/u7YCo3HBHNHCs dCtjguV+f23tYFz3TNJNPMa5KuY+1cIonfZ9KN6T00r02LI2SAemmGHAh7Hg7czJFR7i Z07D06zpblxIDousG6stQQ9sJOszKtL4+cOAvw1XIPXwSgXB/O52bHteqg52/zuU1n0G cmNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YnSwfRDJ; 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=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id h38si4002890ede.369.2018.01.04.23.41.26; Thu, 04 Jan 2018 23:41:26 -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=@linaro.org header.s=google header.b=YnSwfRDJ; 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=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 424A9C21E06; Fri, 5 Jan 2018 07:39:34 +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_DNSWL_BLOCKED, 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 C02C0C21E14; Fri, 5 Jan 2018 07:39:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4912AC21DF0; Fri, 5 Jan 2018 07:38:12 +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 51274C21E24 for ; Fri, 5 Jan 2018 07:38:08 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id bd8so2639291plb.9 for ; Thu, 04 Jan 2018 23:38:08 -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=GfUJICeP89NwMktJbbPtysrYbMtGJR95aLbrL9pXg80=; b=YnSwfRDJAuzwaTQuHxhtpfC4lY3it92jiZUVcs57j6Z1ZSU5/1FcPx2pFyei0P61uC c+f3qCvOmPwRzUAhIBJYSB5nqXGlejymmZD1K/EO+fUkQy7+zn88E98jb5I6TO/vaTcs M+h3yBmMsMgE/HGJuXSzOL+uxBox/xUFt8jdY= 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=GfUJICeP89NwMktJbbPtysrYbMtGJR95aLbrL9pXg80=; b=mKWUhpDmTELx4+uzzkD4vYiHs+gzssNtCAqr8g8ncn/NySNl+uWAxkMwlRtvLarNCC B4ZJgJzta+cRqVtVsS2TIv/2D7ph/Petc4DDc5PVcqo3MySc3Y31A8LuYUhtz45bZERU BnlPQWqmPCf38NIwqo74gQigEat42GH7x9uOTeTIR0DFyQEH1YxVS4lDAV0FGmu4aTD1 1diDN+KHWQHi9vhGU8LZ9pVlqW1Jko3Wvl2IiSIKCcku92B8vnppJ8DCvUnKXuC9ri3s NcnANQRXbP6bG7YxDChTb5IQYCV4KnRdQ63rHxRBFvmwdKJH7YmfHG7clysbqbWd4kCL shiw== X-Gm-Message-State: AKGB3mL00cek9ccRST5ZN2P3Y/z6G24ARXzBf0zQF0sndvhOaqmiK5QY BZi9+w4ToYfx7nlnUcfVhA3ZMQ== X-Received: by 10.159.234.141 with SMTP id d13mr252124plr.74.1515137886974; Thu, 04 Jan 2018 23:38:06 -0800 (PST) Received: from localhost.localdomain ([45.56.153.113]) by smtp.gmail.com with ESMTPSA id b9sm9553789pgs.3.2018.01.04.23.37.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 23:38:05 -0800 (PST) From: Jun Nie To: wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Fri, 5 Jan 2018 15:37:01 +0800 Message-Id: <1515137821-30583-7-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> References: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 6/6] sunxi: Add initial Banana-Pi Zero support 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" Banana-Pi Zero is designed for IOT development using the Allwinner H2+ SOC. Key features - Allwinner H2+, Quad-core Cortex-A7 - 512MB DRAM - microSD slot - Serial Debug Port - Combo WiFi/BT - HDMI Signed-off-by: Jun Nie --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts | 113 ++++++++++++++++++++++++ configs/bananapi_zero_defconfig | 17 ++++ 3 files changed, 131 insertions(+) create mode 100644 arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts create mode 100644 configs/bananapi_zero_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index a895c70..80eec7e 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -327,6 +327,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ sun8i-a83t-cubietruck-plus.dtb \ sun8i-a83t-tbs-a711.dts dtb-$(CONFIG_MACH_SUN8I_H3) += \ + sun8i-h2-plus-bananapi-m2-zero.dtb \ sun8i-h2-plus-orangepi-zero.dtb \ sun8i-h3-bananapi-m2-plus.dtb \ sun8i-h3-orangepi-2.dtb \ diff --git a/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts new file mode 100644 index 0000000..4d96c16 --- /dev/null +++ b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2017 Jun Nie + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "sun8i-h3.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include +#include + +/ { + model = "Banana Pi BPI-M2-Zero"; + compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + + pwr_led { + label = "bananapi-m2-zero:red:pwr"; + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */ + default-state = "on"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + + sw4 { + label = "power"; + linux,code = ; + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + /* + * In different revisions the board have different card detect + * configuration. + */ + broken-cd; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usbphy { + usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + /* USB OTG VBUS is directly connected to 5V without any regulators */ + status = "okay"; +}; diff --git a/configs/bananapi_zero_defconfig b/configs/bananapi_zero_defconfig new file mode 100644 index 0000000..9c78b21 --- /dev/null +++ b/configs/bananapi_zero_defconfig @@ -0,0 +1,17 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_MACH_SUN8I_H3=y +CONFIG_DRAM_CLK=408 +CONFIG_DRAM_ZQ=3881979 +CONFIG_DRAM_ODT_EN=y +CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-bananapi-m2-zero" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SPL=y +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +CONFIG_CMD_USB_MASS_STORAGE=y +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_SPL_ISO_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set +CONFIG_MMC_BROKEN_CD=y +CONFIG_USB_MUSB_GADGET=y