From patchwork Fri Aug 28 15:52:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 11743259 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87618138A for ; Fri, 28 Aug 2020 15:52:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F73B2075B for ; Fri, 28 Aug 2020 15:52:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="r74dcj4E"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=agner.ch header.i=@agner.ch header.b="ESh/+xyD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F73B2075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=agner.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=JkKFJL6aJCIYn4A22snMmkBAXEnivFRuNnU+fd8+eg4=; b=r74dcj4Ej1N6IHeAOu0X7Z4G6g NqnjAan96PQRpm4YCAubcED3iGC5B2A5H/Rev8iPnpOGO5d8tm8h1Wd3XFdVdEVPcltKz48+e4Nbd 69DmL2UZlORXcnKg91kYbNLm12/7R9gudOTW6IK9qFy2Visagz6AmD/0KIQmLI4jb1CYXJGjq4cmp tEA0gZRbx5ZpG1S0c8RhjzQ83GNeIOMas/nm/rMr+e/KCFdNOBJOlBYHJSNNrScB/eAwrkyOhByCq 7B9D5xUbA0LSzL1+9ZmXAjJgYhgPV5M6cqeWL+VUafjegVpD/LYzmGrCftKXj4aPMaFCmy92AeIr2 E0Bjf9vw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBgfz-0006Qo-Ev; Fri, 28 Aug 2020 15:52:27 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBgfw-0006Pt-Dk; Fri, 28 Aug 2020 15:52:25 +0000 Received: from allenwind.lan (unknown [IPv6:2a02:169:3df5::4db]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 447C45C95F7; Fri, 28 Aug 2020 17:52:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1598629942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=o6gJHPgz29HyNEp7tVvUTXqsiIrqG4vlD8Mvx37LylM=; b=ESh/+xyDYVvJ0e5ntEQbTNpgABcwit7kFnkvpxvH/HXkMmBvKoqsGEMhpd3SetmXSR8hhR YB8LxM6gBrlXsQZuPOgXBUBdWYH2M+lzZLHEs/TJykZT9bb+i4ak69GCTxmKryt2N3Q3Ny 0khkg0/Jv+TIk7HtSOQtsweLLPLHa1A= From: Stefan Agner To: narmstrong@baylibre.com, jbrunet@baylibre.com Subject: [PATCH v2] clk: meson: g12a: mark fclk_div2 as critical Date: Fri, 28 Aug 2020 17:52:05 +0200 Message-Id: <577e0129e8ee93972d92f13187ff4e4286182f67.1598629915.git.stefan@agner.ch> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam: Yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_115224_630001_0705272F X-CRM114-Status: GOOD ( 18.94 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sboyd@kernel.org, khilman@baylibre.com, mturquette@baylibre.com, linux-kernel@vger.kernel.org, stefan@agner.ch, Anand Moon , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Amlogic Meson G12b platform, similar to fclk_div3, the fclk_div2 seems to be necessary for the system to operate correctly as well. Typically, the clock also gets chosen by the eMMC peripheral. This probably masked the problem so far. However, when booting from a SD card the clock seems to get disabled which leads to a system freeze. Let's mark this clock as critical, fixing boot from SD card on G12b platforms. Fixes: 085a4ea93d54 ("clk: meson: g12a: add peripheral clock controller") Cc: Marek Szyprowski Signed-off-by: Stefan Agner Tested-by: Anand Moon --- drivers/clk/meson/g12a.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c index fad616cac01e..6d44cadc06af 100644 --- a/drivers/clk/meson/g12a.c +++ b/drivers/clk/meson/g12a.c @@ -298,6 +298,17 @@ static struct clk_regmap g12a_fclk_div2 = { &g12a_fclk_div2_div.hw }, .num_parents = 1, + /* + * Similar to fclk_div3, it seems that this clock is used by + * the resident firmware and is required by the platform to + * operate correctly. + * Until the following condition are met, we need this clock to + * be marked as critical: + * a) Mark the clock used by a firmware resource, if possible + * b) CCF has a clock hand-off mechanism to make the sure the + * clock stays on until the proper driver comes along + */ + .flags = CLK_IS_CRITICAL, }, };