Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3110345lqt; Tue, 23 Apr 2024 10:31:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXt0P5uHbRTE+wBTfuSwqwmlmjD1lGVsQMBNVcvksNIjZnfsSJ5vxeAAKxxcnx+O8RJCBq6Q289YKQUs0mdKhChunJZW+ZFjwM+bOVt2A== X-Google-Smtp-Source: AGHT+IE8rtacB69uuY7P1yUVj5pNglt1bGSjnWaAOGfKROCClRQn49jrwqGwp8/AU4On2Timv+qd X-Received: by 2002:a05:6a00:a02:b0:6ea:c767:4699 with SMTP id p2-20020a056a000a0200b006eac7674699mr4526643pfh.13.1713893465253; Tue, 23 Apr 2024 10:31:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713893465; cv=pass; d=google.com; s=arc-20160816; b=w93i7fwzMUA+Bb81uX8ennZB0Zz8yEg5drLlPcyW2t0JPHQHXzt+tVjVUgp99c1t7d CQjoB8qrApA0k0kGajY8Tlw19psdblFFqAmviT0026BIRjIslJRY6px5Rx6NiDMbkKgi BXRukBZ7y11knaWslcZ/dcJ/eBBREY+6EOu4cxwEY2olrzADRMc0zIPUPaf8jYVnYJ8K 36rGeIj/E34BfsFD90rpB7ZNZwp00rKdBwba+XTuBQflneNWJRz2PO4a3DPau4Kf1Bmk Z4cqx8MPfvjz9j/WILoIGprSPo2L6NXpdAPVkPHUsRQin/7XuwepiDDM9uV2jCNBYKWa FtAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=7PAyFdu9H0sY3Lt54kr3wrNBIQI45vetjxyjmFr1cOo=; fh=R0GyLLYQw+E0dExbv8uQcsq/sibxEadSPnwCv5E3J+Y=; b=cAub9yasZuKWDCvTyc8qT0h0hlHB6KK0EyYX/Xtol749sVtEBTIPfanDAeBSBvcRRH kxdY4S0O9EZvNmi41Kwj9jLOdEW1Dg55VSNxlWs1j5x35FKaPbCjr8jcLyBDlTKJiij5 ZQKUyDogB8CHeeiUhWddrjqkNF1odl4iW2ob9hbtDRsQzrQ7NIvRocVCckGMAUtaxl8L 8uusJ7Ija5PKZDSE5V7bNncxB830IIQSv77g2E36ovYTwNPf2cfKVw6TsbPbsSjc63OB u5/F79ijOsU2zTjFLWw14r4/GeAWmSlWBv+1chZowu6LJv5yKjFd+PiMEGMuwEwX2Jno DJDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UAqppM+c; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-155634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155634-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c2-20020aa78e02000000b006eaaec3424fsi9760498pfr.186.2024.04.23.10.31.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 10:31:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UAqppM+c; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-155634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155634-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3B637B249C9 for ; Tue, 23 Apr 2024 17:08:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D2D513FD7C; Tue, 23 Apr 2024 17:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UAqppM+c" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6288813E05C for ; Tue, 23 Apr 2024 17:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713891990; cv=none; b=vCoOVDDAGeAuvGXvm3w59U7QQAS832k7BlOthAicwujQbBZbWZ3TltSwFS3b4/i79YVlfkvY5JGyr+4p0QcU3+Dew8gIDZ8mjgI7waaVeVMTybTAfJRb0oLtKukO1TvcUoDRTlb7R0TK8QZmP3LdCS1VVwB8EoJLcsyBYOPtazw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713891990; c=relaxed/simple; bh=1BGjDVhru+5/yOFEbbagkzyjgP7K72hcwEVM+kRJzS0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=STFTW4woucYPvaTxi4hcKPS6FEAs9nJylvep5enEeo9kzX51ooOnO+2+JxRrCvjanxLQ/JemTzN3rNuLbWfGkB8dpIYiGYEaZvzSB1j1b7BIi6mVhU7iXeYWuVybRZA2Kd8Dl4iz5WTS/ipxC46P8NmiV0PaWRe4wdXI4n+lIkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UAqppM+c; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a588405be6cso95077666b.2 for ; Tue, 23 Apr 2024 10:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713891987; x=1714496787; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7PAyFdu9H0sY3Lt54kr3wrNBIQI45vetjxyjmFr1cOo=; b=UAqppM+chKH61EnIriaFT5as5fVionuFjUPlqsXg2Rq9sX5XOusjfwrgw6UF8puq5i RGVe+p4t2j4t+Vec8GJJNgva3//nTLEV62ZxLgZfnehH1QzP8QnHGA+qbU/v2K6IDjxH TtyM2Eraufg+dSNsGSmpLIYSUJjvdCOc7GmQ3S3q8ZV8NgPL5gsenop2VjtqxkXfaE8r oM6CEhfPfT+zQEV0Af/y0ddFV5D+uM9kExv9Gib56UDK3/kiFvV6ZUUe+AfsSVj0GyPl nQiZjDIus5VG41JZhqcuGZZ9ku15n0lVN8nuBc0KNWU1JAkfgPQ53DXG+DWXIHWhadPj BdRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713891987; x=1714496787; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7PAyFdu9H0sY3Lt54kr3wrNBIQI45vetjxyjmFr1cOo=; b=PmTy+Bnp3O48sbqqrge1+qwHBqrdrDsjwstdg+/7XZ/BriQr7Jd2GvAdiUCaZTrru2 1tCJJ2HJCSfQzQrTGisclQ2xgvD7FTs3cuRyle9bdWWY0fr+L52TmFEDst0oJ4745Osc I61bCEsfa/0bb5aq6cnCZal5L5JL5P5cNSyHRtkTCr9i516Ce1y0FDCdQpYEzLmBXJjC 730ItuNMdW36l/qHSKwNT8RyqgFU61D2dei3ua/RXf25Iv4QSHG/Aen3Kq/7w3ndwE6U fpvtN8HGaLR2oO2STjIxL61Flxts60EBiS2KSL56EeQCVw5JXWyABWqu1cj10c+JEZ0a LJtw== X-Forwarded-Encrypted: i=1; AJvYcCUBzAFHnaVXfJyzlBgIIloKY5PWPqrbGysMOw4b5gdhlZ3EJL2ZShZJSxPAwSj/p8Vpb8/+fodkWLip9rZZzGRuaW4m41rq7b4vZCuT X-Gm-Message-State: AOJu0Yx+yCvoBAUxP1NiC1bagF371Y4OHWQkOVpfUIhR53G7FFp0UL0Q HX8wrxZJ3gGOgG4jfW47xL9bRt+/WgYmPhVGexAJMv3LLqTtbDq2iSOWsbKKoSw= X-Received: by 2002:a17:906:578d:b0:a58:734d:f111 with SMTP id k13-20020a170906578d00b00a58734df111mr2664615ejq.11.1713891986669; Tue, 23 Apr 2024 10:06:26 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id t22-20020a1709063e5600b00a5209dc79c1sm7351624eji.146.2024.04.23.10.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 10:06:26 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 23 Apr 2024 18:06:06 +0100 Subject: [PATCH 4/7] phy: exynos5-usbdrd: set ref clk freq in exynos850_usbdrd_utmi_init() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240423-usb-phy-gs101-v1-4-ebdcb3ac174d@linaro.org> References: <20240423-usb-phy-gs101-v1-0-ebdcb3ac174d@linaro.org> In-Reply-To: <20240423-usb-phy-gs101-v1-0-ebdcb3ac174d@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Griffin , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar , Sam Protsenko Cc: Krzysztof Kozlowski , Tudor Ambarus , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 While commit 255ec3879dd4 ("phy: exynos5-usbdrd: Add 26MHz ref clk support") correctly states that CLKRSTCTRL[7:5] doesn't need to be set on modern Exynos platforms, SSPPLLCTL[2:0] should be programmed with the frequency of the reference clock for the USB2.0 phy. Do so. Fixes: 691525074db9 ("phy: exynos5-usbdrd: Add Exynos850 support") Signed-off-by: André Draszik --- Feel free to drop the Fixes: if you think that is unwarranted here. --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index d69187c22613..0f9078689856 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -155,6 +155,9 @@ #define CLKRST_PORT_RST BIT(1) #define CLKRST_PHY_SW_RST BIT(3) +#define EXYNOS850_DRD_SSPPLLCTL 0x30 +#define SSPPLLCTL_FSEL GENMASK(2, 0) + #define EXYNOS850_DRD_UTMI 0x50 #define UTMI_FORCE_SLEEP BIT(0) #define UTMI_FORCE_SUSPEND BIT(1) @@ -788,6 +791,31 @@ static void exynos850_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) reg |= HSP_VBUSVLDEXT | HSP_VBUSVLDEXTSEL; writel(reg, regs_base + EXYNOS850_DRD_HSP); + reg = readl(regs_base + EXYNOS850_DRD_SSPPLLCTL); + reg &= ~SSPPLLCTL_FSEL; + switch (phy_drd->extrefclk) { + case EXYNOS5_FSEL_50MHZ: + reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 7); + break; + case EXYNOS5_FSEL_26MHZ: + reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 6); + break; + case EXYNOS5_FSEL_24MHZ: + reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 2); + break; + case EXYNOS5_FSEL_20MHZ: + reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 1); + break; + case EXYNOS5_FSEL_19MHZ2: + reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 0); + break; + default: + dev_warn(phy_drd->dev, "unsupported ref clk: %#.2x\n", + phy_drd->extrefclk); + break; + } + writel(reg, regs_base + EXYNOS850_DRD_SSPPLLCTL); + /* Power up PHY analog blocks */ reg = readl(regs_base + EXYNOS850_DRD_HSP_TEST); reg &= ~HSP_TEST_SIDDQ; -- 2.44.0.769.g3c40516874-goog