Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3487726ybz; Mon, 4 May 2020 04:05:05 -0700 (PDT) X-Google-Smtp-Source: APiQypJZ+Vy69/WOjHvEBXEgiDBsTp1WmUyMU54aIJHb/GYFcJWnHzWDwbzoiQUNl1xU2VOCtyAi X-Received: by 2002:a17:906:49d0:: with SMTP id w16mr14069459ejv.364.1588590305002; Mon, 04 May 2020 04:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588590304; cv=none; d=google.com; s=arc-20160816; b=gWj3h+yVL2GsifKY3E72A07oH7NC+uIICqotKRzi4paxB35k7DnwPYKiS1IhZI5JPR 4hIU4nRZaXkk2Ai433KNccqraw8Oi7Q9iFrDBn+6pQr00GcnZwvjP4ZAuPukhYsATOyt 37wkXblj4nxhGaf1N1wVveaTmrumxZVdJDrCDQmPWItrxgyYCVTN05giVRBGmSa/RtSl fun3Dg8ODmh7PDr9cMJHLSva6oPl1FhUKAL5+NJzXIWNki0bwMaP8KNeLJ8FWO/3dMqK Mi2Kwok4m8d5p5wPZaG2vt+/Oze3uXm8RYr2MqthrPSfwN+kLjd5ZyUPjtjdK8TrHvZm PVBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=j78pwgAoPIBXpzCPQa9obI1dS/AtoekTWfi/Z9wgTpE=; b=qXL2/n3qdtwaxyH6vIjM/uI4kB3nLtiUnuLmwOTPDibdRZux9xfhH2HmY5OTgR++D+ SL1IjLHSGL0luT13CZl1GSPEllO3Uzgh2hV3l7kmnzDCntojHH3mYXO4rQR5X4FH0trq /z7E8MHGVOJ1aHo6l4WdHtZoKqESAicJcZARphcxxl4dmHbLmpFHm4LtuoCQ1I3RuFeZ pay4/r4xFiNZ6Wu+wpcy7LsbLtuPvYsL+SJSFyqEkiCEgUEeiB08E0MZpErkJDHFRKra t3bUF1f5WXYJfyNAnV+bUEpOoPvq0LWsZK75+mv3NGrLG4o4naDk2SpXtuxX3iapGtaO LFtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FMqEVASM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id bm6si5111505edb.608.2020.05.04.04.04.41; Mon, 04 May 2020 04:05:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FMqEVASM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728493AbgEDLA1 (ORCPT + 99 others); Mon, 4 May 2020 07:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726797AbgEDLA0 (ORCPT ); Mon, 4 May 2020 07:00:26 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FF44C061A0E; Mon, 4 May 2020 04:00:26 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id x4so7929448wmj.1; Mon, 04 May 2020 04:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j78pwgAoPIBXpzCPQa9obI1dS/AtoekTWfi/Z9wgTpE=; b=FMqEVASMwd4jsKWMbAfOMx/EXRykuKYV/52Xl+u4cPeVIB+mJWcN7ENXhsbR7M4YJc INi2krmc920kV+fanUnf0LILJH2Vmh/gmmgk4A7BXBQAfzTu+Zm58kFeDWvGGfM5dAHJ 7R9XZXqsajrXS7/zCRbwZQGQrHHzAvouV68ESanU82QXWL2QQyIVUeA7sdBOosriWGXE SRtWN7QSzU6D579adzQtB5mdv/NeBhdlq+ZidnENn7rHNGyscMVcKK0DoRAVJBDpCrq+ XeKGgCNTrGfGaVKG9C1tN6Isl3gKQkdvJTBKgL6n9rwYTdKQ7ijEgpd+WTIW3CmHcxI0 y8GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j78pwgAoPIBXpzCPQa9obI1dS/AtoekTWfi/Z9wgTpE=; b=F0tVNgwmMKkgeK20DeZNOdAFkQzzQAmgXm48HJzqjGVNSrnOiADofDpUNCLmsGejGd sxr1o/xzTO4f6I1n2JTF6AZM3ufZioKrmKk3BeUaGzQAc+e1cg0FAChCR79svzxIQ3k4 BcDhAsZsXKNgdstpusyBDULzXSYNzxS2LFoyFHMjyVQbeDRzjGVgiTKZqFLnxhqQEOjH y95sPc+++wX+RKkhLV3/atrdihce6SdFyhpo4OScho8Fzx+jWJbrKg3WqOBV+kEb5pwL u1wQe9/XloSGOdygzrWb/aP/ebqJWoF0FmSa5bbeSWOE56bEkbl0XTzkigxXfodhmbf8 O1Ow== X-Gm-Message-State: AGi0Pub1b3iNNBqsjfaTe3afORtCW/j1S+SAMcwNjxwcpzBo+ZkuzWAj zpeMmfjbAEBKWBXqfJ/B2V8/I5ceeibZeyAK03M= X-Received: by 2002:a05:600c:c9:: with SMTP id u9mr13753067wmm.15.1588590025222; Mon, 04 May 2020 04:00:25 -0700 (PDT) MIME-Version: 1.0 References: <20200502114752.1048500-1-martin.blumenstingl@googlemail.com> <20200502114752.1048500-6-martin.blumenstingl@googlemail.com> In-Reply-To: <20200502114752.1048500-6-martin.blumenstingl@googlemail.com> From: hex dump Date: Mon, 4 May 2020 13:00:10 +0200 Message-ID: Subject: Re: [PATCH 5/6] phy: amlogic: meson8b-usb2: unset the IDDQ bit during PHY power-on To: Martin Blumenstingl Cc: kishon@ti.com, robh+dt@kernel.org, vkoul@kernel.org, devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org, narmstrong@baylibre.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 2, 2020 at 1:48 PM Martin Blumenstingl wrote: > > The vendor driver unsets the set_iddig bit during power-on as well and > sets it when suspending the PHY. I did not notice this in the vendor > driver first, because it's part of the dwc_otg driver there (instead of > their PHY code). While here, also add all other REG_DBG_UART register > bit definitions. > > Signed-off-by: Martin Blumenstingl Tested-by: hexdump > --- > drivers/phy/amlogic/phy-meson8b-usb2.c | 44 +++++++++++++++++++------- > 1 file changed, 32 insertions(+), 12 deletions(-) > > diff --git a/drivers/phy/amlogic/phy-meson8b-usb2.c b/drivers/phy/amlogic/phy-meson8b-usb2.c > index 7236b8885f07..436dfa1a8a04 100644 > --- a/drivers/phy/amlogic/phy-meson8b-usb2.c > +++ b/drivers/phy/amlogic/phy-meson8b-usb2.c > @@ -78,6 +78,17 @@ > #define REG_ADP_BC_ACA_PIN_FLOAT BIT(26) > > #define REG_DBG_UART 0x10 > + #define REG_DBG_UART_BYPASS_SEL BIT(0) > + #define REG_DBG_UART_BYPASS_DM_EN BIT(1) > + #define REG_DBG_UART_BYPASS_DP_EN BIT(2) > + #define REG_DBG_UART_BYPASS_DM_DATA BIT(3) > + #define REG_DBG_UART_BYPASS_DP_DATA BIT(4) > + #define REG_DBG_UART_FSV_MINUS BIT(5) > + #define REG_DBG_UART_FSV_PLUS BIT(6) > + #define REG_DBG_UART_FSV_BURN_IN_TEST BIT(7) > + #define REG_DBG_UART_LOOPBACK_EN_B BIT(8) > + #define REG_DBG_UART_SET_IDDQ BIT(9) > + #define REG_DBG_UART_ATE_RESET BIT(10) > > #define REG_TEST 0x14 > #define REG_TEST_DATA_IN_MASK GENMASK(3, 0) > @@ -172,20 +183,24 @@ static int phy_meson8b_usb2_power_on(struct phy *phy) > regmap_update_bits(priv->regmap, REG_CTRL, REG_CTRL_SOF_TOGGLE_OUT, > REG_CTRL_SOF_TOGGLE_OUT); > > - if (priv->dr_mode == USB_DR_MODE_HOST && > - priv->match->host_enable_aca) { > - regmap_update_bits(priv->regmap, REG_ADP_BC, > - REG_ADP_BC_ACA_ENABLE, > - REG_ADP_BC_ACA_ENABLE); > + if (priv->dr_mode == USB_DR_MODE_HOST) { > + regmap_update_bits(priv->regmap, REG_DBG_UART, > + REG_DBG_UART_SET_IDDQ, 0); > > - udelay(ACA_ENABLE_COMPLETE_TIME); > + if (priv->match->host_enable_aca) { > + regmap_update_bits(priv->regmap, REG_ADP_BC, > + REG_ADP_BC_ACA_ENABLE, > + REG_ADP_BC_ACA_ENABLE); > > - regmap_read(priv->regmap, REG_ADP_BC, ®); > - if (reg & REG_ADP_BC_ACA_PIN_FLOAT) { > - dev_warn(&phy->dev, "USB ID detect failed!\n"); > - clk_disable_unprepare(priv->clk_usb); > - clk_disable_unprepare(priv->clk_usb_general); > - return -EINVAL; > + udelay(ACA_ENABLE_COMPLETE_TIME); > + > + regmap_read(priv->regmap, REG_ADP_BC, ®); > + if (reg & REG_ADP_BC_ACA_PIN_FLOAT) { > + dev_warn(&phy->dev, "USB ID detect failed!\n"); > + clk_disable_unprepare(priv->clk_usb); > + clk_disable_unprepare(priv->clk_usb_general); > + return -EINVAL; > + } > } > } > > @@ -196,6 +211,11 @@ static int phy_meson8b_usb2_power_off(struct phy *phy) > { > struct phy_meson8b_usb2_priv *priv = phy_get_drvdata(phy); > > + if (priv->dr_mode == USB_DR_MODE_HOST) > + regmap_update_bits(priv->regmap, REG_DBG_UART, > + REG_DBG_UART_SET_IDDQ, > + REG_DBG_UART_SET_IDDQ); > + > clk_disable_unprepare(priv->clk_usb); > clk_disable_unprepare(priv->clk_usb_general); > > -- > 2.26.2 >