Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp697403ybv; Thu, 13 Feb 2020 07:57:28 -0800 (PST) X-Google-Smtp-Source: APXvYqzaJa1AHaqRyYVMTBqe/U9al9nur6pn0yyKkuovBAUzT3Cc+h6ZOnI1p/xlnkckyjhMFwYy X-Received: by 2002:aca:5ad5:: with SMTP id o204mr3229470oib.2.1581609448289; Thu, 13 Feb 2020 07:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581609448; cv=none; d=google.com; s=arc-20160816; b=pgqiQDP2/YgD3f6CBIPJkY74fx/Mz98PMigtFhkvrCeAu8URUQtHpbIvX612eddjw8 jqX4al63dK0eBAA+KhBUYT4pCS2On6nND8UJlxEm969/jXz/wciCeEY6pOz7OiL7a5b6 xY9dAgY7oDBiDbSWn83XNhZ50fvofDzP1m02qhM/KYTrRamcEIU6+yhbAeg/ewZy5hSm bQveQBaOO/LqhgWW9Mvu8pPiV2+Gqgx9JdwYJy8VjcZPXltgbArW+/Vfy/sUeGD4zDol QeLZrHW0OfJAQsGuhb7b1VMxCnfAw9YRW0XCnXEUi3O1wxJXS7iMrRwOp7bZ/j5RazZA dk3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hpGDP/eaiFZ4dJnDPgWxBwLl+ojQl9qeA9yptOjMT6k=; b=0NAdYrEBNmubVzBRhGMCJGm1eQv1Kuyy+DfBDUAkISDoIC2B/ekV0U/j7LxxXqc9tE kJdmdJtN/Y4VaALw+YcZBsDq6eMy3SvM/F9/c8i/0taSuKVZHRpMbycJLvSD1fE3HBBk TErrtXv+5Wy19982O+gzxTbBmGCYWGCPcRNG8i6ItMzaEp0HfNGDHiDhaNmZYpKcGIzb 9PYT0c1QDt8T6YBCnGc0IHcISzGh8lQMpCdsYHGCAG+Es9EE77tRLB9m8WyQSfCWZIwx jH5Q90sSEMRjvJdiDJlEm45NkWcup5Hfzk5IDmg0n2EfxcVCC53jiiCgaxb6mNb8gM3A g49w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PXRyQcVh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m26si1412873otn.307.2020.02.13.07.57.15; Thu, 13 Feb 2020 07:57:28 -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=@kernel.org header.s=default header.b=PXRyQcVh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728973AbgBMPZV (ORCPT + 99 others); Thu, 13 Feb 2020 10:25:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:35640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728476AbgBMPXr (ORCPT ); Thu, 13 Feb 2020 10:23:47 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1BDDB24689; Thu, 13 Feb 2020 15:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607427; bh=SIsmPf3abXu8RlcQgswvaUTqnh7SxIEE2Cc3DW6G/Lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PXRyQcVh2bRSt42lR4BuYhUaswJg+d8efIFUQhrlgQjeaAtQuWdC/qvilPvQrxSGn c5i0KHD2O1regvfocFwFna3HSU61ZqBpxmV3MYdXA3/lpMJsKohH1yupWHOI2r0J+/ zgdV5xedasEimZJQmhhtartgP2tQDaspriB+IknA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Hunter , Stephen Warren , Thierry Reding Subject: [PATCH 4.9 041/116] ARM: tegra: Enable PLLP bypass during Tegra124 LP1 Date: Thu, 13 Feb 2020 07:19:45 -0800 Message-Id: <20200213151858.904073922@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151842.259660170@linuxfoundation.org> References: <20200213151842.259660170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephen Warren commit 1a3388d506bf5b45bb283e6a4c4706cfb4897333 upstream. For a little over a year, U-Boot has configured the flow controller to perform automatic RAM re-repair on off->on power transitions of the CPU rail[1]. This is mandatory for correct operation of Tegra124. However, RAM re-repair relies on certain clocks, which the kernel must enable and leave running. PLLP is one of those clocks. This clock is shut down during LP1 in order to save power. Enable bypass (which I believe routes osc_div_clk, essentially the crystal clock, to the PLL output) so that this clock signal toggles even though the PLL is not active. This is required so that LP1 power mode (system suspend) operates correctly. The bypass configuration must then be undone when resuming from LP1, so that all peripheral clocks run at the expected rate. Without this, many peripherals won't work correctly; for example, the UART baud rate would be incorrect. NVIDIA's downstream kernel code only does this if not compiled for Tegra30, so the added code is made conditional upon the chip ID. NVIDIA's downstream code makes this change conditional upon the active CPU cluster. The upstream kernel currently doesn't support cluster switching, so this patch doesn't test the active CPU cluster ID. [1] 3cc7942a4ae5 ARM: tegra: implement RAM repair Reported-by: Jonathan Hunter Cc: stable@vger.kernel.org Signed-off-by: Stephen Warren Signed-off-by: Thierry Reding Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-tegra/sleep-tegra30.S | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/arch/arm/mach-tegra/sleep-tegra30.S +++ b/arch/arm/mach-tegra/sleep-tegra30.S @@ -382,6 +382,14 @@ _pll_m_c_x_done: pll_locked r1, r0, CLK_RESET_PLLC_BASE pll_locked r1, r0, CLK_RESET_PLLX_BASE + tegra_get_soc_id TEGRA_APB_MISC_BASE, r1 + cmp r1, #TEGRA30 + beq 1f + ldr r1, [r0, #CLK_RESET_PLLP_BASE] + bic r1, r1, #(1<<31) @ disable PllP bypass + str r1, [r0, #CLK_RESET_PLLP_BASE] +1: + mov32 r7, TEGRA_TMRUS_BASE ldr r1, [r7] add r1, r1, #LOCK_DELAY @@ -641,7 +649,10 @@ tegra30_switch_cpu_to_clk32k: str r0, [r4, #PMC_PLLP_WB0_OVERRIDE] /* disable PLLP, PLLA, PLLC and PLLX */ + tegra_get_soc_id TEGRA_APB_MISC_BASE, r1 + cmp r1, #TEGRA30 ldr r0, [r5, #CLK_RESET_PLLP_BASE] + orrne r0, r0, #(1 << 31) @ enable PllP bypass on fast cluster bic r0, r0, #(1 << 30) str r0, [r5, #CLK_RESET_PLLP_BASE] ldr r0, [r5, #CLK_RESET_PLLA_BASE]