From patchwork Tue May 12 18:24:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Stratiienko X-Patchwork-Id: 1288805 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FE7sc//s; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49M94547sBz9sSF for ; Wed, 13 May 2020 06:52:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 34F5081CD5; Tue, 12 May 2020 22:52:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FE7sc//s"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4972881C65; Tue, 12 May 2020 20:25:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5440081986 for ; Tue, 12 May 2020 20:25:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=r.stratiienko@gmail.com Received: by mail-lf1-x142.google.com with SMTP id b26so11408625lfa.5 for ; Tue, 12 May 2020 11:25:07 -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:mime-version :content-transfer-encoding; bh=jzkpuqzxql4F6Uh7rmCCgQ3FUSQru0CbT7xIY1B3lwU=; b=FE7sc//sIor6Hdot1W1DCbb/W9LaYA1px695Wf8K3kir08Cl4L0KfeN0FsBfF9fY+V kF7eR4JrDLuOQDOgIvzqFY8sJ228TXjNQVPTPG5Ns6wcDXnARF2H8cK5mq0SnRNDjwvI 687VupA5bcr9xjEdMstpFY107/3neoLZrcbkOtuYxTnmtDO/TDvp7FTjbT+fsVXxjLHe gF8EW87yXNe6VDR+mQ/16EFQFpukiCfG5D5Ach0IXiL+AoR/a55UhS6kIQG4DCdC0P1Z DSVtVP7vlOhkDaCxMTZYvyfnJsBOjaclk4iCCeL96nH/bJNx6dPZMO3jSRjEC2FiAb7G Typw== 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:mime-version :content-transfer-encoding; bh=jzkpuqzxql4F6Uh7rmCCgQ3FUSQru0CbT7xIY1B3lwU=; b=eBkFZIMIQsrLRtkrfYicGkOcfh99CUWV+sMHs7skGeH1iyA9GdszisncAW8jDq2NyT NFxIhFYzmVTyA6eK2qkcaQeKSUao8qygqn0N26RO++nvrrP2nc0L8bol5kzJGTsMYV96 3PK7e8Y5GgNRiT7Lrp6u89Mh48LCr5vDcHS/I50SPuMUpTZlRGJoCRMFrmdm5Zq+E8m5 9gFJMYcvRpMDJJgKltSTvlpTUsUzmlExvDvgb1N10UnFJC56lmHOIuPrQUJM5pCBnQI+ GV0G9/R1sMwYCD0tUKPQS+oIXh4KqX3P2WCjliVgSJsI8j6iAUAHXm8L4vsnC8+qD6DU 3UGw== X-Gm-Message-State: AOAM533aVpAaO+bA/tctXg3FdQ1J28y/fofmlcK3C6OLkBomEbice2e7 cPc794y54NYOd43jUwnQ9xz5w346AC4= X-Google-Smtp-Source: ABdhPJyUMIPJbph24UU+5oQPxpZ3yqIDlarR6pAy/g1JT1+WF04zpw4RdU7Yl4lgeEpijMeUUNqgNA== X-Received: by 2002:a19:7418:: with SMTP id v24mr15379628lfe.15.1589307906335; Tue, 12 May 2020 11:25:06 -0700 (PDT) Received: from localhost.localdomain ([149.255.131.2]) by smtp.gmail.com with ESMTPSA id t13sm13413601ljd.38.2020.05.12.11.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 11:25:05 -0700 (PDT) From: Roman Stratiienko To: u-boot@lists.denx.de Cc: Roman Stratiienko , Ondrej Jirman , Icenowy Zheng , Marek Vasut , linux-sunxi@googlegroups.com Subject: [PATCH] phy: sun4i-usb: Align H6 initialization logic with the kernel Date: Tue, 12 May 2020 21:24:49 +0300 Message-Id: <20200512182449.3000065-1-r.stratiienko@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 12 May 2020 22:52:31 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean H6 SOC needs additional initialization of PHY registers. Corresponding changes can be found in the kernel patch [1]. Without this changes there is no enumeration of 'musb' gadget. [1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ae409cc7c3cdb9ac4a1dba3eae70efec3d6b6c79 Fixes: 35fa673e0e5f ("sunxi: phy: Add USB PHY support for Allwinner H6") Signed-off-by: Roman Stratiienko --- CC: Ondrej Jirman CC: Icenowy Zheng CC: Marek Vasut CC: linux-sunxi@googlegroups.com --- drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 612c428cf5..688ee7d4cc 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -279,7 +279,8 @@ static int sun4i_usb_phy_init(struct phy *phy) return ret; } - if (data->cfg->type == sun8i_a83t_phy) { + if (data->cfg->type == sun8i_a83t_phy || + data->cfg->type == sun50i_h6_phy) { if (phy->id == 0) { val = readl(data->base + data->cfg->phyctl_offset); val |= PHY_CTL_VBUSVLDEXT; @@ -321,7 +322,8 @@ static int sun4i_usb_phy_exit(struct phy *phy) int ret; if (phy->id == 0) { - if (data->cfg->type == sun8i_a83t_phy) { + if (data->cfg->type == sun8i_a83t_phy || + data->cfg->type == sun50i_h6_phy) { void __iomem *phyctl = data->base + data->cfg->phyctl_offset;