From patchwork Thu Jun 13 16:12:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10992637 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 799EB14C0 for ; Thu, 13 Jun 2019 16:12:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68511212BE for ; Thu, 13 Jun 2019 16:12:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C36A2022C; Thu, 13 Jun 2019 16:12:32 +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 0FF392675C for ; Thu, 13 Jun 2019 16:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732850AbfFMQM3 (ORCPT ); Thu, 13 Jun 2019 12:12:29 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43132 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731923AbfFMQM2 (ORCPT ); Thu, 13 Jun 2019 12:12:28 -0400 Received: by mail-wr1-f66.google.com with SMTP id p13so11317997wru.10; Thu, 13 Jun 2019 09:12:27 -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=TTiPdwEAgHOGKlQkeUgO2qBXD6lEqHC+l7tfRjpfR/o=; b=sXcnLITHWXiKaEech4XlXblZFp3F7j8V906RSKFPLB7Za+DUskoL9/Vh1ajkmMXA8/ algfcxD8R6aeAibeN7+5FatmsDKXCAnyHY/uyZl1HPQREBvVFx9uS49HOUZAt0oFOx28 xQK3BXohVed1A7Tfng4KWwXs513pJLG1Eg8yhBeLPqYTWqnVtbw1ahbpxxc/VTsjyf5q rbb9siOo68V9jq++vDkyloMljvIqKYWvvQadq+gLUr4SGw0k883pgk0OQbtB/OOkZ8vo lvM6W2MQs1oeovDpecnoAa3EQwSLtySNLJrksq1B2ERHubsPnFAb+LqFajbQEJoPA7ZZ u0kw== 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=TTiPdwEAgHOGKlQkeUgO2qBXD6lEqHC+l7tfRjpfR/o=; b=L+Z4sbrPG1Mvz8uCwpg0WlQW2+yGYWerCZ6jejAa+XU5h/RYArp0iYZAWmnZ6fHio8 lVhFQhB37zuenW5Con27ptb/GzVygy1wooSZdXDc+yvACybTwy3z98MrDrZaMP/xJZqu SkC52cjiPs+a0AvjrQnL1D6M0yIfhXrxdGvZWl4i5M15XHRAPEURcpQ0Bnb9WrKQ6YeA zz2gFXU2T5gA6tgP7aQ+h59rqbaznfWZ4AYPodZmMjbk0L0FetW4Qg2tVdLn+b/LXqWc fTrJhsr8CETFO/qcLWi7OZ5507bWx4DTTsCm9/ZuULZG7UE9f0vNEDcXYlLmY2ARtcXo Zk1Q== X-Gm-Message-State: APjAAAWGyTxCv3dnYCFmYybIf43Qunws5rG5dy1i0VDZRxZqhQQ+ciUs Fk46U2JvinBAFZRhWxSVgag= X-Google-Smtp-Source: APXvYqzCF4+cv2sqxVy4DWHNNvX2XrgbhRmOuEM/C5UlZsAgEp+oKIUlpDJmj7wKbk7ClXUZ8znUKw== X-Received: by 2002:adf:d4cc:: with SMTP id w12mr7047604wrk.121.1560442346713; Thu, 13 Jun 2019 09:12:26 -0700 (PDT) Received: from localhost (p2E5BEF36.dip0.t-ipconnect.de. [46.91.239.54]) by smtp.gmail.com with ESMTPSA id t6sm383671wmb.29.2019.06.13.09.12.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 09:12:26 -0700 (PDT) From: Thierry Reding To: Michael Turquette , Stephen Boyd Cc: Jonathan Hunter , Peter De Schrijver , Alex Frid , linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 1/3] clk: tegra: Do not warn unnecessarily Date: Thu, 13 Jun 2019 18:12:23 +0200 Message-Id: <20190613161225.2531-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding There is no need to warn if the reference PLL is enabled with the correct defaults. Only warn if the boot values don't match the defaults. Signed-off-by: Thierry Reding Acked-by: Jon Hunter --- drivers/clk/tegra/clk-tegra210.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index e1ba62d2b1a0..4904ac4a75db 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -984,8 +984,6 @@ static void tegra210_pllre_set_defaults(struct tegra_clk_pll *pllre) pllre->params->defaults_set = true; if (val & PLL_ENABLE) { - pr_warn("PLL_RE already enabled. Postponing set full defaults\n"); - /* * PLL is ON: check if defaults already set, then set those * that can be updated in flight. @@ -1012,6 +1010,9 @@ static void tegra210_pllre_set_defaults(struct tegra_clk_pll *pllre) writel_relaxed(val, clk_base + pllre->params->ext_misc_reg[0]); udelay(1); + if (!pllre->params->defaults_set) + pr_warn("PLL_RE already enabled. Postponing set full defaults\n"); + return; } From patchwork Thu Jun 13 16:12:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10992635 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 120441515 for ; Thu, 13 Jun 2019 16:12:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0148926224 for ; Thu, 13 Jun 2019 16:12:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E962F2654B; Thu, 13 Jun 2019 16:12:30 +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 9971526224 for ; Thu, 13 Jun 2019 16:12:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731923AbfFMQM3 (ORCPT ); Thu, 13 Jun 2019 12:12:29 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43134 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732462AbfFMQM3 (ORCPT ); Thu, 13 Jun 2019 12:12:29 -0400 Received: by mail-wr1-f65.google.com with SMTP id p13so11318056wru.10; Thu, 13 Jun 2019 09:12:28 -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=s0i9gRi09/oGUA11For9Kvn21dqQw45xZsXt0yfAJX0=; b=g/3vTUcZq4KHkSNqTUEoDTziVddP4E2+sRb0suzuTmXWBVLcI4Qu7qrWpkE+D2q73z a7vWmWJYx4yIOgESu8aall9prIBvgVMyWp3PRpEte4Mag7lPM3/K4B/+x5SGlK9CHaQD YccP9Q2DCpJ0SEds6hXZE8DlJgKS3gjpGKwUkcxtSZuAm9Vauqk+p2OikNIxL2J0FzEZ 638d0epGL5jZ4iQAIggFil6KvDYvcxoqcZ/srADn3yZdIFmpQCoVZiRIIKKA02pxXmAa wHxwtJ8q5DA8y3p3V5av26hJd7OpzSDVJhAMvUYOZONQLl2gZDxUNIEjkc7VeWWzU6JZ nSHw== 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=s0i9gRi09/oGUA11For9Kvn21dqQw45xZsXt0yfAJX0=; b=JUTDTlisL5kW44WqaIrmgNkGVd33j/BDQ7Yt+CrsHLU/JFMKQPRsnWli3AOkriTj8V 3BcYdL7C2wUAM++2zUmu+8vzTeB9ojo6vtGNzu/ZQgkBFf55ULiMS9Q7IuT63Y0Ashh4 brPIRMel/S8LGS48VaMC5UEea5uitdSkI6QAUBFRnXLGNfzsWHQrWXJrzn+A/db1Enlo N6nRqY5IA8pfaoAYGxDa02qo0r8RqqeMhHO9KK7siSm7z+L27oSMrgf/wjmgBzVLu4st kqj408LIKMIn4oKBl+zW9e329wcTSNlebMV1fbbF6x3RmNTvCVTyQVKuIzkk8/LlvBR5 h3ew== X-Gm-Message-State: APjAAAU1UI8K+mB7heDNdKLfN+OaEwL7UoOHj1pjm+MRKu42NXq2p6MU VoGRcAfd8xf7HKYJbpEW5kY= X-Google-Smtp-Source: APXvYqyDKiWVEjncCAs2vzL/67ex2a37zE8LDO8ZxjMgJuX4cz9eVwGbTbFJJusBTTt8Zs3IFHiXeA== X-Received: by 2002:a5d:4cca:: with SMTP id c10mr6428366wrt.233.1560442348024; Thu, 13 Jun 2019 09:12:28 -0700 (PDT) Received: from localhost (p2E5BEF36.dip0.t-ipconnect.de. [46.91.239.54]) by smtp.gmail.com with ESMTPSA id d3sm179133wrs.8.2019.06.13.09.12.27 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 09:12:27 -0700 (PDT) From: Thierry Reding To: Michael Turquette , Stephen Boyd Cc: Jonathan Hunter , Peter De Schrijver , Alex Frid , linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 2/3] clk: tegra: Warn if an enabled PLL is in IDDQ Date: Thu, 13 Jun 2019 18:12:24 +0200 Message-Id: <20190613161225.2531-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190613161225.2531-1-thierry.reding@gmail.com> References: <20190613161225.2531-1-thierry.reding@gmail.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding A PLL in IDDQ doesn't work, whether it's enabled or not. This is not a configuration that makes sense, so warn about it. Signed-off-by: Thierry Reding Acked-by: Jon Hunter --- drivers/clk/tegra/clk-tegra210.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index 4904ac4a75db..793c7acaf4e2 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -1003,8 +1003,12 @@ static void tegra210_pllre_set_defaults(struct tegra_clk_pll *pllre) _pll_misc_chk_default(clk_base, pllre->params, 0, val, ~mask & PLLRE_MISC0_WRITE_MASK); - /* Enable lock detect */ + /* The PLL doesn't work if it's in IDDQ. */ val = readl_relaxed(clk_base + pllre->params->ext_misc_reg[0]); + if (val & PLLRE_MISC0_IDDQ) + pr_warn("unexpected IDDQ bit set for enabled clock\n"); + + /* Enable lock detect */ val &= ~mask; val |= PLLRE_MISC0_DEFAULT_VALUE & mask; writel_relaxed(val, clk_base + pllre->params->ext_misc_reg[0]); From patchwork Thu Jun 13 16:12:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10992639 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 D28331515 for ; Thu, 13 Jun 2019 16:12:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2E5B2267B for ; Thu, 13 Jun 2019 16:12:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B68722654B; Thu, 13 Jun 2019 16:12:33 +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 6A10926223 for ; Thu, 13 Jun 2019 16:12:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387729AbfFMQMc (ORCPT ); Thu, 13 Jun 2019 12:12:32 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38220 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732462AbfFMQMb (ORCPT ); Thu, 13 Jun 2019 12:12:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id d18so21411630wrs.5; Thu, 13 Jun 2019 09:12:30 -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=Wk6QpWbPHxyMczqqineUBiLTVajQMdvzH6F9gBM8PvU=; b=r9SJYnDMMoP7KesraASlSyc8784X/rHIoZTyIJ9IT/JGjQPexWVn132Z0M+CoRKF4D g6Va0RmKvKSVFqH1oV4aA8qJk70zu2E+i/I5QYQ5yya9KQXMf3vhtVreQGtWcn+SWj8+ Lez7op9T8p0tl5mr1I4x//+pz4+soli65/BZpy5m9AF7jV79NV4zlWAbg5du4AON6tfX bOTqvpV0heNnqgYhZ2hxfl8SrRBnyeFmzvlnF+J6QJMv86Ka4Cv5GbwzmIjkjzRKOi2i 2lBKv1AafEzGHITr3OLyoATR6w532ipLggjP1cKsC7OFUhfxWkLfFdSXbwH1gAPg/Ycy u39w== 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=Wk6QpWbPHxyMczqqineUBiLTVajQMdvzH6F9gBM8PvU=; b=PZs0KatYci0sbrF/UzpOnMoopYpP0xThYAO6SyewwJftTV7KqaaNqFkemIlQ18CloG HSbBnGf9wXlMrtUepI9KfnHlM1HiBmfjf5/CtBeABDs0w9pHcf7cI9mEwDjAyGFnRIst zNinLSW0upwbBRG8FOivtRijZywhNuYSsrTtMTDpw23nmeC4Ymrt8CfdinL6/lqCNrWJ ukcdfaJEt/lYHSu8RQ8hraFWqrAc0aOR44qPJ6tY/lUZti1+o6kqhg37IMWF7WNkpL/W h9BO0C2bJQSlLkBfeBQF5N/GILjKQaA7jNHLfdksqu9siRTmAN78gLCfSacPxBAuBewQ oDhw== X-Gm-Message-State: APjAAAWqyCqBU8iGld4lN5NjfJPzfXPK05MIuU4vmTySLJKZIv95Sfmh mbBmE8yWUtGFpaTxr9gEKTM= X-Google-Smtp-Source: APXvYqz/Tg4g2AVUkAv5kL3Qqod1gGcIdwXtLjHhAQ4a7wouh9hquIK5XzLFdu/A96F/YECIRjOXFg== X-Received: by 2002:a5d:5112:: with SMTP id s18mr57934185wrt.111.1560442349392; Thu, 13 Jun 2019 09:12:29 -0700 (PDT) Received: from localhost (p2E5BEF36.dip0.t-ipconnect.de. [46.91.239.54]) by smtp.gmail.com with ESMTPSA id q15sm150497wrr.19.2019.06.13.09.12.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 09:12:28 -0700 (PDT) From: Thierry Reding To: Michael Turquette , Stephen Boyd Cc: Jonathan Hunter , Peter De Schrijver , Alex Frid , linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 3/3] clk: tegra: Do not enable PLL_RE_VCO on Tegra210 Date: Thu, 13 Jun 2019 18:12:25 +0200 Message-Id: <20190613161225.2531-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190613161225.2531-1-thierry.reding@gmail.com> References: <20190613161225.2531-1-thierry.reding@gmail.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding It turns out that this PLL is not used on Tegra210, so there's no need to enable it via the init table. Remove the init table entry for this PLL to avoid it getting enabled at boot time. If the bootloader enabled it and forgot to turn it off, the common clock framework will now know to disable it because it is unused. Signed-off-by: Thierry Reding Acked-by: Jon Hunter --- drivers/clk/tegra/clk-tegra210.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index 793c7acaf4e2..13537e4458b5 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -3337,7 +3337,6 @@ static struct tegra_clk_init_table init_table[] __initdata = { { TEGRA210_CLK_DFLL_SOC, TEGRA210_CLK_PLL_P, 51000000, 1 }, { TEGRA210_CLK_DFLL_REF, TEGRA210_CLK_PLL_P, 51000000, 1 }, { TEGRA210_CLK_SBC4, TEGRA210_CLK_PLL_P, 12000000, 1 }, - { TEGRA210_CLK_PLL_RE_VCO, TEGRA210_CLK_CLK_MAX, 672000000, 1 }, { TEGRA210_CLK_XUSB_GATE, TEGRA210_CLK_CLK_MAX, 0, 1 }, { TEGRA210_CLK_XUSB_SS_SRC, TEGRA210_CLK_PLL_U_480M, 120000000, 0 }, { TEGRA210_CLK_XUSB_FS_SRC, TEGRA210_CLK_PLL_U_48M, 48000000, 0 },