From patchwork Mon Jul 22 18:59:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 11053287 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70FC313AC for ; Mon, 22 Jul 2019 18:59:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 650E422B1F for ; Mon, 22 Jul 2019 18:59:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5943B285B7; Mon, 22 Jul 2019 18:59:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0DE722B1F for ; Mon, 22 Jul 2019 18:59:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbfGVS7v (ORCPT ); Mon, 22 Jul 2019 14:59:51 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:38041 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfGVS7u (ORCPT ); Mon, 22 Jul 2019 14:59:50 -0400 Received: by mail-pl1-f196.google.com with SMTP id az7so19551720plb.5; Mon, 22 Jul 2019 11:59:49 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=+BPPPji4KmMPm/LztN/u6Pt6WF0WdMzxA5bRmk4V+jc=; b=K5kBznP9TrTX6mK2UwTBWA0b1ZHBf7PBwvgbGv7SGT6Nsob+xzS03qXm7sk3xh7GkJ 0NKg2BQA9BWzMFULMSN7zIkCox5HpecJKFh3NqUuX/6m0dvv39wieOWOS32YFBobK2zy Agb4M74KgFJ3FjCkVbOa7kQVLmC0q9MjQxrMeKhki4T4g5u3y9epGkMBjNMzesVIGa8v yCxzI9qV7+5q7xgF9rLiSzpWeaEPJz/tP10MfgPkTlAQRDigFJG1HX/TCt57t/UL2Ox+ +TNodYNdPctkqKX3JvAt7F7tHA7wOPpRBgQdJjtHGI3VsLiNXHRqkkRAtB3hu0DU9g1f RoxQ== 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:mime-version:content-transfer-encoding; bh=+BPPPji4KmMPm/LztN/u6Pt6WF0WdMzxA5bRmk4V+jc=; b=DWK+/Zk70m+P3LmQ6ThhypuR2pRs3XN192WC5UUGtB2ggM6ZHzGhyuWV9sXGJvG5Fi /e8eggswSKWhu7nTyyaaSBdo7rWXaJjWc2KxKiTRMiJtWqH0e8H95MypLIJeqTXnUbMw 9yAlPM8Reppmcu/QFYfskqMw0o3DiecjBiLKmVrQdLIvjyWGZraPoIYrFR/t/NWcHwql REQwDjSiib3DJZ9jAAcn8mrnhJm6qyydswXs/UR7sh5RRRVFp8/lblA3IScz7HwWTOta INw2SWfndWT8bpHiocY119V50MJY/17BddUVW/OLSzUpawcBZ2xIBRTK4vUQditqAJny Ovxg== X-Gm-Message-State: APjAAAV7CrC/fRlzPMbiRTTJhzC0A+Eai68sQ1iS4WVDNZfdyZRRsOR5 aZQDTRwR5QzNcXATmsgI0QlYCCKjo70= X-Google-Smtp-Source: APXvYqxmBWHEKsY7z47iIqt7mkTYxNQkFloTQSjYLhZvsRcNoJkjHyvFOCmLFzxEi7Lf3myeENUJ2A== X-Received: by 2002:a17:902:ba96:: with SMTP id k22mr78590271pls.44.1563821989510; Mon, 22 Jul 2019 11:59:49 -0700 (PDT) Received: from localhost.localdomain ([103.51.73.174]) by smtp.gmail.com with ESMTPSA id h1sm30777675pgv.93.2019.07.22.11.59.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 11:59:49 -0700 (PDT) From: Anand Moon To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Kishon Vijay Abraham I , Kukjin Kim , Krzysztof Kozlowski , Anand Moon , Bartlomiej Zolnierkiewicz Subject: [RFC/RFT 1/5] phy: exynos5-usbdrd: read from correct offset of xhci linksystem Date: Tue, 23 Jul 2019 00:29:34 +0530 Message-Id: <20190722185938.9043-2-linux.amoon@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190722185938.9043-1-linux.amoon@gmail.com> References: <20190722185938.9043-1-linux.amoon@gmail.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Read from linksystem offset to update the xhci version. Signed-off-by: Anand Moon --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index 646259bee909..3c14bf7718c1 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -397,7 +397,8 @@ static int exynos5_usbdrd_phy_init(struct phy *phy) * Setting the Frame length Adj value[6:1] to default 0x20 * See xHCI 1.0 spec, 5.2.4 */ - reg = LINKSYSTEM_XHCI_VERSION_CONTROL | + reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_LINKSYSTEM); + reg |= LINKSYSTEM_XHCI_VERSION_CONTROL | LINKSYSTEM_FLADJ(0x20); writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_LINKSYSTEM); From patchwork Mon Jul 22 18:59:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 11053289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB36F13B1 for ; Mon, 22 Jul 2019 18:59:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADDCE22B1F for ; Mon, 22 Jul 2019 18:59:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1C3A285B7; Mon, 22 Jul 2019 18:59:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46DF822B1F for ; Mon, 22 Jul 2019 18:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbfGVS7z (ORCPT ); Mon, 22 Jul 2019 14:59:55 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42931 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfGVS7x (ORCPT ); Mon, 22 Jul 2019 14:59:53 -0400 Received: by mail-pf1-f196.google.com with SMTP id q10so17807021pff.9; Mon, 22 Jul 2019 11:59:53 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=/gER2LLimplLra53LgK/rnRcfXZIC+CQ7D3TqLh+KSw=; b=pJjV5yjMe02NhQ3bEXBOGJ6gbi/w396J1CJqb/pC8BkzUjSnxK0ShHcCjRDGUnMGwD zJuAwDy++CHBprRUYbUjeZFMvsBpV++VRfjlvTbihaoWDqxGBWT9ah8WfraLzFa/X+H5 y75ii/JdnvxE7UY4/FCUrPJqfPyRW/JIzE0IFx/lhjGforNYO9T3JQTCroJD4n6MlqOC hZV4nmFTHdaBmM2cHRMm6yr2Gcl/6KmPw92h7BNdI649e8AowRhsrzh/akHYkdQy1kwa Hliwuq9C5dOx1EoV2MfFPt65vvxU9tTlYLQXQ+E7bSN8IxfO5bxLtPfDh00Ww+fDcHba 9NkA== 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:mime-version:content-transfer-encoding; bh=/gER2LLimplLra53LgK/rnRcfXZIC+CQ7D3TqLh+KSw=; b=XrlZrQ6OQkPPkqSkWscp1iB6XhRVmhPQrDOkNiwX2vq/4su6B0FOnBXgAiA5kCCsq9 zWbUQCw6U2p1dpEPBZkjllJ2DR0zwL9IWkZh06P43qQgj6yvU3Si9dyHgLTdSjMCfJ5U SNfksR/rRGcRDLVJKOzLyCjHUNz0bI7Eoccqe4+KJU4b/zvGeS/jqLAbIg9A143Wxw/y efTduIBKvDj+WRNfZqKde72XwVZKXUlPdkyRVCfu0at3eswbccGsFg+zOS3FEaxd5frB YwirAqiDSoiYZ68z24zodGfkrc3+XL6iGWTCGrqwrkYUw0q8VMVIYAbH1yVPCwMh56Cs Tbgg== X-Gm-Message-State: APjAAAUWjN4bngxat3eB5UX91vmeFMjdG9OZn3svyuWdJcMMZe9A2GxB N3Mg1LQwX0Ucn7BoQzd3IV2d0JlOa/w= X-Google-Smtp-Source: APXvYqz+z95RCeo9mRoNfWnHGolQodU0RqnIuj6kGs1oNVW/IeXDDkxoMFwG1vGy/N2WBXyK9jW2ww== X-Received: by 2002:a63:7a06:: with SMTP id v6mr73572823pgc.115.1563821992488; Mon, 22 Jul 2019 11:59:52 -0700 (PDT) Received: from localhost.localdomain ([103.51.73.174]) by smtp.gmail.com with ESMTPSA id h1sm30777675pgv.93.2019.07.22.11.59.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 11:59:52 -0700 (PDT) From: Anand Moon To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Kishon Vijay Abraham I , Kukjin Kim , Krzysztof Kozlowski , Anand Moon , Bartlomiej Zolnierkiewicz Subject: [RFC/RFT 2/5] phy: exynos5-usbdrd: add missing tuning of the phyutmi signal Date: Tue, 23 Jul 2019 00:29:35 +0530 Message-Id: <20190722185938.9043-3-linux.amoon@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190722185938.9043-1-linux.amoon@gmail.com> References: <20190722185938.9043-1-linux.amoon@gmail.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add missing tuning of phyutmi controls to enter suspend and resume state. Signed-off-by: Anand Moon --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 32 ++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index 3c14bf7718c1..135114d51bc1 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -42,7 +42,13 @@ #define EXYNOS5_DRD_PHYUTMI 0x08 +#define PHYUTMI_TXBITSTUFFENH BIT(8) +#define PHYUTMI_TXBITSTUFFEN BIT(7) #define PHYUTMI_OTGDISABLE BIT(6) +#define PHYUTMI_IDPULLUP BIT(5) +#define PHYUTMI_DRVVBUS BIT(4) +#define PHYUTMI_DPPULLDOWN BIT(3) +#define PHYUTMI_DMPULLDOWN BIT(2) #define PHYUTMI_FORCESUSPEND BIT(1) #define PHYUTMI_FORCESLEEP BIT(0) @@ -402,6 +408,23 @@ static int exynos5_usbdrd_phy_init(struct phy *phy) LINKSYSTEM_FLADJ(0x20); writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_LINKSYSTEM); + reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYUTMI); + /* High-Byte Transmit Bit-Stuffing Enable */ + reg |= PHYUTMI_TXBITSTUFFENH; + /* Low-Byte Transmit Bit-Stuffing Enable */ + reg |= PHYUTMI_TXBITSTUFFEN; + /* release force_sleep & force_suspend */ + reg &= ~(PHYUTMI_FORCESLEEP | PHYUTMI_FORCESUSPEND); + /* DP/DM Pull Down Disable */ + reg &= ~(PHYUTMI_DMPULLDOWN | PHYUTMI_DPPULLDOWN); + /* drvvbus controller signal controls the VBUS valid comparator */ + reg &= ~PHYUTMI_OTGDISABLE; + /* controller signal controls the VBUS Valid comparator */ + reg |= PHYUTMI_DRVVBUS; + /* Enable ID Sampling */ + reg |= PHYUTMI_IDPULLUP; + writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYUTMI); + reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM0); /* Select PHY CLK source */ reg &= ~PHYPARAM0_REF_USE_PAD; @@ -452,9 +475,14 @@ static int exynos5_usbdrd_phy_exit(struct phy *phy) if (ret) return ret; - reg = PHYUTMI_OTGDISABLE | + reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYUTMI); + reg |= PHYUTMI_OTGDISABLE | PHYUTMI_FORCESUSPEND | - PHYUTMI_FORCESLEEP; + PHYUTMI_FORCESLEEP | + PHYUTMI_DMPULLDOWN | + PHYUTMI_DPPULLDOWN; + reg &= ~(PHYUTMI_DRVVBUS | PHYUTMI_IDPULLUP | + PHYUTMI_TXBITSTUFFENH | PHYUTMI_TXBITSTUFFEN); writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYUTMI); /* Resetting the PHYCLKRST enable bits to reduce leakage current */ From patchwork Mon Jul 22 18:59:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 11053291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C28613B1 for ; Mon, 22 Jul 2019 18:59:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D34E22B1F for ; Mon, 22 Jul 2019 18:59:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0183B285B7; Mon, 22 Jul 2019 18:59:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9735322B1F for ; Mon, 22 Jul 2019 18:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727401AbfGVS75 (ORCPT ); Mon, 22 Jul 2019 14:59:57 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:39659 "EHLO mail-pf1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727036AbfGVS74 (ORCPT ); Mon, 22 Jul 2019 14:59:56 -0400 Received: by mail-pf1-f177.google.com with SMTP id f17so13822901pfn.6; Mon, 22 Jul 2019 11:59:56 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=RTpdlQyeL6bUmfZxFwZVri3i7nbPBO/dWR0GM1UFauc=; b=Uie7vKzMH8rhSaqDU+aMcGpqyxjCAEwwYHOs8Zz8U3B2wZObu/hBnRQpJYvhmIGgDw IHk/K6jpfG6wXsMB1qUT1sh/ChhrsYn3LxIcUCmrK6vZRbrVceM3II59gJ3kh+MlrX2x 1DuHiX4OOmXS/GL5pG5qPgTuSdp7IAnFiZQTc6QW4YS1+Bjmh9K4aQZf6t0rqhuNHfuw QTYoUNyzdiW3NvWNC+WPdBiUeQGJU4eWLZBmKDyTCJLNj8TNHpSgKm/m3oO5L/BOzi6X OiJd4btOFqQz+abdaTlUTE83JA2iCBDkjFgg1DkkEOhNW/Odd8tjV65+H+egp+j8fJWA 9F3A== 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:mime-version:content-transfer-encoding; bh=RTpdlQyeL6bUmfZxFwZVri3i7nbPBO/dWR0GM1UFauc=; b=bWXtMcPWQk1VJ/Qa3xyF+qbc5l/dl6JPk7Gecwtb5DAtxxq11qp7OSXYiZLXYm6dBP ArzQLE9PI8dBNJ8+nhKvV/Rzy0M7DRNb9KSKjTKj7DwwMvS4McEITK/1D5qp1dDYAze6 Bp2XoIncgEVC2WvX6+xuZ2idcyyjjRI6e8QkHD+rxJNCF5v1QNki0/6T48zPaujpy2aE RzOdY5wbLY1Znl/LRUcCnxxEY7jNpqyCLVDVQSfSXn7ZhS3zuB53sqiewTiBZXz7nB/w l/tqRT1ygttVck9ftyV/xiUcuCSmoWBErrWZGSsbLs7Asopbg5LfZ/joVZ4JQWVPEGUs pTyA== X-Gm-Message-State: APjAAAW8oGTBzWX/6sH7FLaHyNZu0EgT8lyi1RBFNbJVo3go8bs28eVK j5dLEzn0L66iPX1q41uZh/7iikt5nVE= X-Google-Smtp-Source: APXvYqztAcyiJIByeuZ9Vv/e8q5WaFPy7KjT+3hxXXN1zGRIHD3y1yeHD3EkCpYt7gjV3RCQsz+iPQ== X-Received: by 2002:a63:c750:: with SMTP id v16mr56466432pgg.320.1563821995654; Mon, 22 Jul 2019 11:59:55 -0700 (PDT) Received: from localhost.localdomain ([103.51.73.174]) by smtp.gmail.com with ESMTPSA id h1sm30777675pgv.93.2019.07.22.11.59.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 11:59:55 -0700 (PDT) From: Anand Moon To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Kishon Vijay Abraham I , Kukjin Kim , Krzysztof Kozlowski , Anand Moon , Bartlomiej Zolnierkiewicz Subject: [RFC/RFT 3/5] phy: exynos5-usbdrd: UTMI tune signal Date: Tue, 23 Jul 2019 00:29:36 +0530 Message-Id: <20190722185938.9043-4-linux.amoon@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190722185938.9043-1-linux.amoon@gmail.com> References: <20190722185938.9043-1-linux.amoon@gmail.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Tune USB2.0 (UTMI+) TX signal for high speed data transfer. Signed-off-by: Anand Moon --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 42 +++++++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index 135114d51bc1..54a513ca15e4 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -33,6 +33,8 @@ #define EXYNOS5_FSEL_24MHZ 0x5 #define EXYNOS5_FSEL_50MHZ 0x7 +#define __set(v, a, b) (((v) << (b)) & GENMASK(a, b)) + /* EXYNOS5: USB 3.0 DRD PHY registers */ #define EXYNOS5_DRD_LINKSYSTEM 0x04 @@ -108,8 +110,17 @@ #define EXYNOS5_DRD_PHYPARAM0 0x1c #define PHYPARAM0_REF_USE_PAD BIT(31) -#define PHYPARAM0_REF_LOSLEVEL_MASK (0x1f << 26) -#define PHYPARAM0_REF_LOSLEVEL (0x9 << 26) +#define PHYPARAM0_REF_LOSLEVEL(x) __set(x, 30, 26) +#define PHYPARAM0_TXVREFTUNE(x) __set(x, 25, 22) +#define PHYPARAM0_TXISETUNE(x) __set(x, 21, 20) +#define PHYPARAM0_TXRESTUNE(x) __set(x, 19, 18) +#define PHYPARAM0_TXPREEMPPULSETUNE BIT(17) +#define PHYPARAM0_TXPREEMPAMPTUNE(x) __set(x, 16, 15) +#define PHYPARAM0_TXHSXVTUNE(x) __set(x, 14, 13) +#define PHYPARAM0_TXFSLSTUNE(x) __set(x, 12, 9) +#define PHYPARAM0_SQRXTUNE(x) __set(x, 8, 6) +#define PHYPARAM0_OTGTUNE(x) __set(x, 5, 3) +#define PHYPARAM0_COMPDISTUNE(x) __set(x, 2, 0) #define EXYNOS5_DRD_PHYPARAM1 0x20 @@ -365,9 +376,30 @@ static void exynos5_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) u32 reg; reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM0); - /* Set Loss-of-Signal Detector sensitivity */ - reg &= ~PHYPARAM0_REF_LOSLEVEL_MASK; - reg |= PHYPARAM0_REF_LOSLEVEL; + /* Set Loss-of-Signal Detector sensitivity */ + reg |= (PHYPARAM0_REF_USE_PAD | + /* Sets the sensitivity level for the Loss-of-Signal detector */ + PHYPARAM0_REF_LOSLEVEL(0x9) | + /* Adjusts the high-speed DC level voltage */ + PHYPARAM0_TXVREFTUNE(0x3) | + /* Adjust the rise/fal timie of the high-speed waveform */ + PHYPARAM0_TXISETUNE(0x1) | + /* Adjusts the driver source impedance */ + PHYPARAM0_TXRESTUNE(0x1) | + /* HS Transmitter Pre-Emphasis Duration Control */ + PHYPARAM0_TXPREEMPPULSETUNE | + /* HS Transmitter Pre-Emphasis Current Control */ + PHYPARAM0_TXPREEMPAMPTUNE(0x0) | + /* Transmitter High-Speed Crossover Adjustment */ + PHYPARAM0_TXHSXVTUNE(0x3) | + /* FS/LS Source Impedance Adjustment */ + PHYPARAM0_TXFSLSTUNE(0x3) | + /* Squelch Threshold Adjustment */ + PHYPARAM0_SQRXTUNE(0x3) | + /* VBUS Valid Threshold Adjustment */ + PHYPARAM0_OTGTUNE(0x6) | + /* Disconnect Threshold Adjustment */ + PHYPARAM0_COMPDISTUNE(0x6)); writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM0); reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM1); From patchwork Mon Jul 22 18:59:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 11053295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C859813AC for ; Mon, 22 Jul 2019 19:00:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA84E285AA for ; Mon, 22 Jul 2019 19:00:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF0FB285B9; Mon, 22 Jul 2019 19:00:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57E2C285AA for ; Mon, 22 Jul 2019 19:00:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727805AbfGVTAA (ORCPT ); Mon, 22 Jul 2019 15:00:00 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:46260 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727721AbfGVS77 (ORCPT ); Mon, 22 Jul 2019 14:59:59 -0400 Received: by mail-pl1-f175.google.com with SMTP id c2so19537648plz.13; Mon, 22 Jul 2019 11:59:59 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=zz5vAjKnwObHWdgiR69vnrMUFdCw0YpjqKvOUe5J6MQ=; b=d6MMjgcgq7A5Ok7sC1mvq8Y7Wf/C/AbAtJI0wx9bGY4LJJDTTd0vQVHuitO2plMEyq s651WhX3usFjBAenymrYvEPR3lbhKenTx0jmJU6miKE7/atUIiKfrBoNG2ef4g9tLLVE LheTn+WTo/fecBYSmVujWJvETdofqQuuS9X6FH2EzkWgzBV5HCJ7zylD6lSW8IO5VgUr nha9fg8eP8GlVrc3Fw6sjREvttunn9yPpGeTarp9+jV48N58mLUDgtUXRvotX5TGYvOS vSXYtNoIDim5DoM834ci3JXYBNtu0sOWTuYlom0yBD34s/1T3PNVEIu+63qEV0ddOA+j Khew== 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:mime-version:content-transfer-encoding; bh=zz5vAjKnwObHWdgiR69vnrMUFdCw0YpjqKvOUe5J6MQ=; b=KBztWVrTzfUYukMK7e/OT72/i+b7g0bDtGUcOSQMo5tYVm+AdWOXlebOO1jmt3rui9 p1w32jNA3l9EECIVCg4QL5DYjKG0OGVenry1iPPTfNGcudh7DeZ1sg2w7/xa0qAYsIl4 wnwByiFekF0jUFNTXCv9GnYNn9jEvBPIv+BOt6yZtjsiIuyoqcHwmC49HJIydskQRBtt sVVq26aA2g4rv4niMzsETxvMBU94hN1yDDKxz+1sLUg7xLOzzSrnaQyr5LLpa2gYbBVY 9IPcbhOOIgNI7G9BbzYjkMAwCYkU3E26a2d3axKl12Khuo7Q1UUlImjhuUo/2f2wuxap g14A== X-Gm-Message-State: APjAAAXt52RwmfMOwaPs3T/jsVNDmAqeAYJMcFiVObqp5HHIU0aNZony cyIlPApCXQQdzT14CGMZN0nrCJvrr/Y= X-Google-Smtp-Source: APXvYqzWw+Rq9/ABGsPQPWP/BkeiCKWfr3/1wKZdxsrMxEEqcLGp5JqqrkgZS13L+ODsPeeJYwBo9w== X-Received: by 2002:a17:902:2865:: with SMTP id e92mr37369159plb.264.1563821998707; Mon, 22 Jul 2019 11:59:58 -0700 (PDT) Received: from localhost.localdomain ([103.51.73.174]) by smtp.gmail.com with ESMTPSA id h1sm30777675pgv.93.2019.07.22.11.59.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 11:59:58 -0700 (PDT) From: Anand Moon To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Kishon Vijay Abraham I , Kukjin Kim , Krzysztof Kozlowski , Anand Moon , Bartlomiej Zolnierkiewicz Subject: [RFC/RFT 4/5] phy: exynos5-usbdrd: PIPE3 tune signal Date: Tue, 23 Jul 2019 00:29:37 +0530 Message-Id: <20190722185938.9043-5-linux.amoon@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190722185938.9043-1-linux.amoon@gmail.com> References: <20190722185938.9043-1-linux.amoon@gmail.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Tune USB3.0 (PIPE3) PHY TX signal for high and supper speed data transfer. Signed-off-by: Anand Moon --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index 54a513ca15e4..4f16c4f82ae5 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -124,8 +124,10 @@ #define EXYNOS5_DRD_PHYPARAM1 0x20 -#define PHYPARAM1_PCS_TXDEEMPH_MASK (0x1f << 0) -#define PHYPARAM1_PCS_TXDEEMPH (0x1c) +#define PHYPARAM1_TX0_TERM_OFFSET(x) __set(x, 30, 26) +#define PHYPARAM1_TX_SWING_FULL(x) __set(x, 18, 12) +#define PHYPRAAM1_PCS_TX_DEEMPH_6DB(x) __set(x, 11, 6) +#define PHYPRAAM1_PCS_TX_DEEMPH_3P5DB(x) __set(x, 5, 0) #define EXYNOS5_DRD_PHYTERM 0x24 @@ -360,10 +362,16 @@ static void exynos5_usbdrd_pipe3_init(struct exynos5_usbdrd_phy *phy_drd) { u32 reg; - reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM1); /* Set Tx De-Emphasis level */ - reg &= ~PHYPARAM1_PCS_TXDEEMPH_MASK; - reg |= PHYPARAM1_PCS_TXDEEMPH; + reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM1); + /* Transmitter Termination Offset */ + reg |= PHYPARAM1_TX0_TERM_OFFSET(0x5) | + /* Tx Amplitude (Full Swing mode) */ + PHYPARAM1_TX_SWING_FULL(0x3F) | + /* Tx De-Emphasis at 6 dB */ + PHYPRAAM1_PCS_TX_DEEMPH_6DB(0x20) | + /* Tx De-Emphasis at 3.5 dB */ + PHYPRAAM1_PCS_TX_DEEMPH_3P5DB(0x15); writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM1); reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYTEST); From patchwork Mon Jul 22 18:59:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 11053293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67AF2912 for ; Mon, 22 Jul 2019 19:00:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ADCD22B1F for ; Mon, 22 Jul 2019 19:00:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EB0A285B7; Mon, 22 Jul 2019 19:00:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 294B822B1F for ; Mon, 22 Jul 2019 19:00:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728260AbfGVTAD (ORCPT ); Mon, 22 Jul 2019 15:00:03 -0400 Received: from mail-pf1-f176.google.com ([209.85.210.176]:36554 "EHLO mail-pf1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728089AbfGVTAC (ORCPT ); Mon, 22 Jul 2019 15:00:02 -0400 Received: by mail-pf1-f176.google.com with SMTP id r7so17817394pfl.3; Mon, 22 Jul 2019 12:00:02 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=2EEUYjnGaUl9ucppac7Vlvrro4YfGIW1udHJMvAbzNY=; b=Gg6zxIa6eGeXZJ5jeI3xk/ohzr7R/9FakiB0Et0JQ7OLf045kqWgM5Z4jCn3z98YDq 8mv1O2RP/m+mehED//4JTwExwiKGHC1puq7pWHOsd17aIMk08qIUrn5FuZR00W5sv4Xn Ijci7yEv4aurL2RO3SpR3nN63uIa0QtYzT5XfFD25v7eCcu44gSjbNtB7ZqZuI2+LNH3 HX5+JWfhuTx4u/x4R81PVLuFYFTMHa3aHjpPn9SrHXUufn+hDCySZGPXc4Ge8SCuancR qQ8Mbo+LbXtqbbh1qRXKlIGkEoi6aF5vxZM4HqofExFcLJ/az6jy2O/YKzV0KhX9oX8P 1c6A== 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:mime-version:content-transfer-encoding; bh=2EEUYjnGaUl9ucppac7Vlvrro4YfGIW1udHJMvAbzNY=; b=nr6yw3vbLxy10JABEULgjuNZ1v2vZz8Zh4sR0mvLtVYin4r9cmf7ibNKr/M2hutxKc aP4YiTWiVNpZandHdN6TUrYQ5rgrTKWdLd4nDusX6QH0YVs/QR9OeE3H9Jx9TvIjen3U Kbf25Sn7wfxyZJGF4plx6jHqRqDjxTjbKYfywHNcPYo24qhTvWVUorkhxC9o74cffoxv NgJFlI8SZijWTnTvFpa3LVDqfEJm9vg7rCpbWLIBnB76cpwCHqCgazG4f2vrYRTTJg1j YMvGka24CsJNUkFU9E75UZzkx4p4D8q0cs57b1rs98m9yjUubxStPfvpimRvmjvEfP8p BG2w== X-Gm-Message-State: APjAAAVbBuE+ozXzk6Zs14oEziDBzS2BroC3Mj/1wZnHmY110KFKGv1K DyvxT/FGYLHcKGDjMtI+BxbKFD0krWQ= X-Google-Smtp-Source: APXvYqweoCQrdRLyt6Lvlwgf0GH+d0SEoqwkDbqTeK4Vj3mPKooNv35TnANWukNaspcRrOetUJ6eDg== X-Received: by 2002:a17:90a:c70c:: with SMTP id o12mr52841519pjt.62.1563822001690; Mon, 22 Jul 2019 12:00:01 -0700 (PDT) Received: from localhost.localdomain ([103.51.73.174]) by smtp.gmail.com with ESMTPSA id h1sm30777675pgv.93.2019.07.22.11.59.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 12:00:01 -0700 (PDT) From: Anand Moon To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Cc: Kishon Vijay Abraham I , Kukjin Kim , Krzysztof Kozlowski , Anand Moon , Bartlomiej Zolnierkiewicz Subject: [RFC/RFT 5/5] phy: exynos5-usbdrd: drop duplicate setting PIPE3 tune signal Date: Tue, 23 Jul 2019 00:29:38 +0530 Message-Id: <20190722185938.9043-6-linux.amoon@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190722185938.9043-1-linux.amoon@gmail.com> References: <20190722185938.9043-1-linux.amoon@gmail.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drop duplicate configuration setting of PIPE tune signal. Signed-off-by: Anand Moon --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index 4f16c4f82ae5..f6d2f359d88a 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -410,12 +410,6 @@ static void exynos5_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) PHYPARAM0_COMPDISTUNE(0x6)); writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM0); - reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM1); - /* Set Tx De-Emphasis level */ - reg &= ~PHYPARAM1_PCS_TXDEEMPH_MASK; - reg |= PHYPARAM1_PCS_TXDEEMPH; - writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYPARAM1); - /* UTMI Power Control */ writel(PHYUTMI_OTGDISABLE, phy_drd->reg_phy + EXYNOS5_DRD_PHYUTMI);