Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4602606ybl; Mon, 9 Dec 2019 13:45:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxuHuhUjSa4L58tnZKxNnaw4e8RVhAA+Gt9Ay5neGdajrzVMlUTadlqdyeD4XUaNnMp2TNX X-Received: by 2002:a54:4595:: with SMTP id z21mr1164299oib.136.1575927910577; Mon, 09 Dec 2019 13:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575927910; cv=none; d=google.com; s=arc-20160816; b=kSuZiRb/ssAIbu959HZF2JPZU4BwxQXigypgVQvA/b67fZ9TQTPNA0rgs4J/5Fmab4 VHcG6o6xKYS0GrrxPvyisY47YLaa6JRCVBBpRNZFVtiJ6xpm6NAz1+/NCLzPICCEBQVt w5C0CmZ53s3p46rOt5ei2hVd0ErYf8ODxOut6YvheOHaLGfroMjn3+QwD56szRKxj9Nl D3CsrA3OFHjeuPvbjllz9KlmbDXAgrp1C5JXjFXocZmVGc/ZLr/V+bxPNUIiTPVUojjg muXWM/ZD6Sld83h8zOBeVT0+QUqJMrX+6EgUgv7uivKUWDgpZEwngJrYug225J46vSmJ 4Bfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=44lDiZC/HyWHizJUTFlT+jmrIvxAJf5o2GDXJq7Fi20=; b=zuybitjKUAS7oCp7RrnPAYgyf8YeqWn97SyCX0/uV8YZcqMnc0ikcurt5bhXBuRNew DujkrCUTR89ljtp/D3ZpHweaUEoUMKkoBC00FuiaeOnR788FT4zsf3XndEp97wjqFA1U dZHG5Wt9/n5nZr7TqPRXq0675VN6wu2PCLcbWIUlZuj5hQ2mQD3NbyyJHmgxOGxhO5SP 5x4Nwq335JQ78PSJt0zH55SDEmt+5FCXdBB/llY1Qbris4Go4kDQvjfVo08NBfKfM7/a 4OnXLpCwoosbez8zSr+AG3TrNbyVAzAypyQTq2pFLIFbr813YVs3h16kDT/F/kI2e5YI UjMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NgdntmBj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c195si733905oib.266.2019.12.09.13.44.58; Mon, 09 Dec 2019 13:45:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NgdntmBj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbfLIVoS (ORCPT + 99 others); Mon, 9 Dec 2019 16:44:18 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38917 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727073AbfLIVoP (ORCPT ); Mon, 9 Dec 2019 16:44:15 -0500 Received: by mail-wm1-f65.google.com with SMTP id s14so907098wmh.4; Mon, 09 Dec 2019 13:44:14 -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=44lDiZC/HyWHizJUTFlT+jmrIvxAJf5o2GDXJq7Fi20=; b=NgdntmBjBBI7US/R8tQl9uYXTQr/3n2UwD+ASgV5d10EsibdIvI3Yo2xWBOK2JZGC0 VSvP9nitBOAADTY5KKwBWnkcx3ADbR4uMJDh4F4aW7GGex5dFBNS3KfP/iynk4baKZF8 0uTQhnNkTPhorbEUxDAhb0b6plLaUedcyWca5RDus++kDJKdE/RPxy853xrDmSad2SaT kIDEwVecCWDzrqPCgBy7eSzsdzibyEpVH/1MW65aVkTVSIe+DKudP5+capDKPT41agrT ssxkUpDdksUpHcO3tLySr3fx2bvLTNaKX+V6VKKf/Nb7ALYJ/B9svms03W2dQCELd5g4 WFRA== 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=44lDiZC/HyWHizJUTFlT+jmrIvxAJf5o2GDXJq7Fi20=; b=nmjg0f5YSpF8kWT4PGoyWLiWSYzK2botz8bacZVXq0w3B0dJInktWBIJei/FWh3cRm OgMYPEtcLlf0TpauY5YRoUBYBHu+o7fXdyOfhnTfniuFO1X/sKLuyM24xo6mCqpU2sm2 PGN7GZIf/laMIsDNUdFg9AaREUjp2rO8LXks9cMoQUGiRYnijDNorA7q0epA3xcZiKks zAF0c02Fx5WrL7+DqccOmzuLDQ1QafgOtIqZT1EehSTUEK1SctbrPU8PiSxL0wUuKqqB bVeSkOlBMxXbLz+5U0LYvzUuAGc3SxPDkF/0qMFoPLllWkN3+WjsOQJ+wKTLhedMnela SHag== X-Gm-Message-State: APjAAAWCNzXZ1YChtN9do7Rxx5Qzx5/OLAr/3mUbiAdZijLMn7gjQumY XrVJzQtA2dqFg+UT2F57IUrtpyX6X7A= X-Received: by 2002:a1c:a984:: with SMTP id s126mr1225626wme.146.1575927853828; Mon, 09 Dec 2019 13:44:13 -0800 (PST) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id z6sm757714wmz.12.2019.12.09.13.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 13:44:13 -0800 (PST) From: Al Cooper To: linux-kernel@vger.kernel.org Cc: Al Cooper , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, Florian Fainelli , Kishon Vijay Abraham I , linux-arm-kernel@lists.infradead.org, Mark Rutland , Rob Herring , Srinath Mannam Subject: [PATCH v2 resend 10/13] phy: usb: PHY's MDIO registers not accessible without device installed Date: Mon, 9 Dec 2019 16:42:46 -0500 Message-Id: <20191209214249.41137-11-alcooperx@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191209214249.41137-1-alcooperx@gmail.com> References: <20191209214249.41137-1-alcooperx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When there is no device connected and FSM is enabled, the XHCI puts the PHY into suspend mode. When the PHY is put into suspend mode the USB LDO powers down the PHY. This causes the MDIO to be inaccessible and its registers reset to default. The fix is to disable FSM. Signed-off-by: Al Cooper --- drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c b/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c index bf138867efb1..fe3f653c64a7 100644 --- a/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c +++ b/drivers/phy/broadcom/phy-brcm-usb-init-synopsis.c @@ -56,6 +56,7 @@ #define USB_PHY_PLL_LDO_CTL 0x08 #define USB_PHY_PLL_LDO_CTL_AFE_CORERDY_MASK 0x00000004 #define USB_PHY_UTMI_CTL_1 0x04 +#define USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK 0x00000800 #define USB_PHY_UTMI_CTL_1_PHY_MODE_MASK 0x0000000c #define USB_PHY_UTMI_CTL_1_PHY_MODE_SHIFT 2 #define USB_PHY_STATUS 0x20 @@ -229,6 +230,14 @@ static void usb_init_common_7211b0(struct brcm_usb_init_params *params) usb_init_common(params); + /* + * Disable FSM, otherwise the PHY will auto suspend when no + * device is connected and will be reset on resume. + */ + reg = brcm_usb_readl(usb_phy + USB_PHY_UTMI_CTL_1); + reg &= ~USB_PHY_UTMI_CTL_1_POWER_UP_FSM_EN_MASK; + brcm_usb_writel(reg, usb_phy + USB_PHY_UTMI_CTL_1); + usb2_eye_fix_7211b0(params); } -- 2.17.1