From patchwork Tue Dec 1 09:13:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 7734151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD092BEEE1 for ; Tue, 1 Dec 2015 09:16:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16359206AC for ; Tue, 1 Dec 2015 09:16:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4684C206AB for ; Tue, 1 Dec 2015 09:16:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3h14-0004yQ-3x; Tue, 01 Dec 2015 09:14:30 +0000 Received: from mail-pa0-f68.google.com ([209.85.220.68]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3h0a-0004IX-Er; Tue, 01 Dec 2015 09:14:02 +0000 Received: by pacfl14 with SMTP id fl14so28500849pac.1; Tue, 01 Dec 2015 01:13:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9mb1i6+/OZhYfJTXoCU4xqg2ByTRIZuatbCE+653uZ4=; b=mN5hoRvhU+4LqTQ2z2CbCsk+uF+JFJsqSruN80NSKOBGodZToWC7YWrpQ00lny6tz5 6tAmEGhrRKv3n/1ZQvwpvKRr1X41ZUPAiHMvszCtGq9oZLvERElBtkcJE0kB+xST1c3+ xDKD4TlXQB+OOVHR6zUW8vwd8/zkjguLCkGVd3j909AQEi6rSt9rIDk5fr5DsuV75fN8 BvTcIWx3kcqM6O0SGeWW5/nNMnfiuZctPypde7S0LfV4khrSoKg2TxTdmcYnAKH0wmS/ giJbLUuTKf9rZZmrcqCPI0hkJDL2KrvuqAB98nGkqeFTvv3WP4Mu38CNaLgYU2S+vkyZ LMuQ== X-Received: by 10.98.8.139 with SMTP id 11mr78334792pfi.35.1448961222424; Tue, 01 Dec 2015 01:13:42 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 24sm56401167pfm.75.2015.12.01.01.13.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Dec 2015 01:13:41 -0800 (PST) From: Caesar Wang To: Heiko Stuebner , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] clk: rockchip: Force rk3368 PWM clock (and its parents) on Date: Tue, 1 Dec 2015 17:13:24 +0800 Message-Id: <1448961206-23769-2-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448961206-23769-1-git-send-email-wxt@rock-chips.com> References: <1448961206-23769-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151201_011400_660241_B90AE99E X-CRM114-Status: GOOD ( 13.19 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Turquette , Stephen Boyd , Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-clk@vger.kernel.org, Caesar Wang MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This's similar with the rk3288 SoCs. From: Douglas Anderson Quick summary: Most rk3368 boards (especially those with Pmic that followed the lead rom rk3368-evb-act8846) have a PWM regulator on them for vdd_logic. This is the main voltage for all kinds of misc stuff including the memory controller. On these boards it is critically important to make sure that the PWM never ever glitches and never loses its clock. Any glitch could crash the system. Right now there are no users of the PWM regulator and also Linux thinks that the PWM regulator is disabled. Things happen to work because firmware configured the PWM and Linux doesn't touch it. ..and the PWM's clock is marked as "ignore unused". ...but things _stop_ working if we turn off serial console. Why? Because: 1. Serial console shares a parent clock with the PWM (pclk_cpu) 2. If we have no serial console then nobody is holding pclk_cpu on at reboot time. It gets disabled. We need to fix a lot of the above problems, but until we get everything right the cleanest "hack" seems like it is to just keep the "rk_pwm" clock on always. Signed-off-by: Caesar Wang --- drivers/clk/rockchip/clk-rk3368.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c index 7e6b783..5385fef 100644 --- a/drivers/clk/rockchip/clk-rk3368.c +++ b/drivers/clk/rockchip/clk-rk3368.c @@ -819,6 +819,15 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = { }; static const char *const rk3368_critical_clocks[] __initconst = { + /* + * HACK: Make sure this stays enabled so all its parents (like pclk_cpu) + * stay enabled. CLK_IGNORE_UNUSED doesn't take care of parents. + * + * This is temporary until the PWM driver enables the right clock, which + * it can't do until we get the ordering _just right_ and never glitch + * the voltage of the PWM regulator. Ick. + */ + "pclk_pwm1", "pclk_pd_pmu", };