Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8619257imu; Thu, 15 Nov 2018 14:42:27 -0800 (PST) X-Google-Smtp-Source: AJdET5dluL8DJZEr2v47cIiStzYzRLwqRvmj6E2RRPsfcviDV/2p2rFiIsKMdQfztUQ4UFlGjC1a X-Received: by 2002:a63:5442:: with SMTP id e2-v6mr7661810pgm.316.1542321747648; Thu, 15 Nov 2018 14:42:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542321747; cv=none; d=google.com; s=arc-20160816; b=OeIRHzpHSGfT8s1B1qloFwdBjf/3qFKTu7eQSL31FJZQskLP3C86R5df0+0q3rX2iU wCXwdaFhAvjDX9p4FjtW3w3FftfOgclBuLxXlyJEoE2WLoqHsrP9M/IJOC1+/1y8kifq +17Rwv++PxN8+0maOMLoqD4YF/3iAe+gNkO8u5WeoUbjggpbBFyfAC5+ObI5iuE7BACQ Zg4h+GsZmtPV2JdlAJpbeiueV4N3StbHihNpgwEG775WPjUWJWAkOQAe2y2s7BmoKSgO CJ2kpanA7W8qFhVzvVq97msrWoearoFD171Wklitknm7JpWgugvT7fK9ZhlxzU4R2JuK McJw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=o1OnMjerHobgxeRKJqmEmHVjTlKqDa43MFe3VfFeUNA=; b=pN1xomMhMKyg6G4V+1y6MrGLJYs6kV1kUkDq3Jm4ORyG6Fnuz3MVuYrJI1GLT7JV/C FsJveFEc0Yv6m404vN/0jLaZdtanLalff81G05mqZACuc/VgMYZ4EkNpLkWToleEYjYI 3jaXvVTKGaCWwlOQ5pL04g9Mc6SaDA7K19+YX+Zzu6HEA4sAt/7lFTQkMJywR9Do6K0C xNGrgZaqWW3+I3uZrNTriVot3duHkPo14JkuSSfzOcO/iVLIkImnYNdme6QMCC4Srg5v 4dC3hbR6ocRFNVw3cha8rx8d+DU7R+Spx1Dkmtg3hmTpqb0uffYcRoAb+A8bMX5ol7cw wCfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=Eo3DyDfA; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si7875990pli.346.2018.11.15.14.42.13; Thu, 15 Nov 2018 14:42:27 -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=@googlemail.com header.s=20161025 header.b=Eo3DyDfA; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389044AbeKPIvH (ORCPT + 99 others); Fri, 16 Nov 2018 03:51:07 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50348 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725916AbeKPIvG (ORCPT ); Fri, 16 Nov 2018 03:51:06 -0500 Received: by mail-wm1-f67.google.com with SMTP id 124-v6so20444959wmw.0; Thu, 15 Nov 2018 14:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o1OnMjerHobgxeRKJqmEmHVjTlKqDa43MFe3VfFeUNA=; b=Eo3DyDfAUUClIgS3T9isr4frWLqyrNYCZ3u9sqvGgS78wGuCJQ0iVnxcpEwpvcXCUt MAxkSLGjzchwLIDSDIbGbVafUkJD7OKIqBpfU9fCSEPyj+tgHi56vcChIk6aYnNfRL18 KK+psZw0dUc5FOBb6qQpWIP0qGeda/DJzkIYW1JnK2r5W1OPoEpmROcjunOXv4PXjfiU AFv5n1yvljcOe6MMQRtMjRcSISGiY8DBTqbNgutCU/nn6s5tRCDf+kynDOsmqsmyVGyX tYMwZ5hq3kk07DJhP4FO+TVIFQJxqTkAM9X7NLu593mPxpnBIszfVwmFv8kfZUp7vfyX Y25w== 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=o1OnMjerHobgxeRKJqmEmHVjTlKqDa43MFe3VfFeUNA=; b=s85dNpex7TmKhBKfMJHRQ3aGyczDZyzhFX8TORuSK93H9VuvQe1h10TXhY034ETbgM cptEXuM33axRNDZWcGa2dx+89scYtiPeZUuhyeiWjfeRkye/nfEBAsdVWtaUpKGDNcUd a53arOAwvXZZRpBlbI66AHr8taEjzxdYlmF0g1WMGrapJiF7hMu3Nrg47HzeD161YVrC vpx6QtvmWqWgQtfnVNAS4BWPhAC4QEOj23oiKJN82hGbRw4E0qLVcU511u9zpcBVr23w ytiq2Ofj1NIW+XTWqGbfN2IkmZzsDm/K8TRb8VrTk6tOqoPgMTZJ81e7TAusynao7QR8 yixw== X-Gm-Message-State: AGRZ1gIb4nCiTnJ712YpOOZtGghV2qVIobuS1B2rzjaHO3e3+d4fVcSM Omz1/2VnKEBlidkK+ZtK4T0= X-Received: by 2002:a1c:1792:: with SMTP id 140-v6mr614417wmx.117.1542321680273; Thu, 15 Nov 2018 14:41:20 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD717A100B85ACE585A885C51.dip0.t-ipconnect.de. [2003:dc:d717:a100:b85a:ce58:5a88:5c51]) by smtp.googlemail.com with ESMTPSA id x12sm2076388wmc.37.2018.11.15.14.41.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Nov 2018 14:41:19 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, jbrunet@baylibre.com, narmstrong@baylibre.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mturquette@baylibre.com, sboyd@kernel.org, Martin Blumenstingl Subject: [PATCH v2 4/6] clk: meson: meson8b: add support for more M/N values in sys_pll Date: Thu, 15 Nov 2018 23:40:46 +0100 Message-Id: <20181115224048.13511-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115224048.13511-1-martin.blumenstingl@googlemail.com> References: <20181115224048.13511-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The sys_pll on the EC-100 board is configured to 1584MHz at boot (either by u-boot, firmware or chip defaults). This is achieved by using M = 66, N = 1 (24MHz * 66 / 1). At boot the CPU clock is running off sys_pll divided by 2 which results in 792MHz. Thus M = 66 is considered to be a "safe" value for Meson8b. To achieve 1608MHz (one of the CPU OPPs on Meson8 and Meson8m2) we need M = 67, N = 1. I ran "stress --cpu 4" while infinitely cycling through all available frequencies on my Meson8m2 board and could not spot any issues with this setting (after ~12 hours of running this). On Meson8, Meson8b and Meson8m2 we also want to be able to use 408MHz and 816MHz CPU frequencies. These can be achieved by dividing sys_pll by 4 (for 408MHz) or 2 (for 816MHz). That means that sys_pll has to run at 1632MHz which can be generated using M = 68, N = 1. Similarily we also want to be able to use 1008MHz as CPU frequency. This means that sys_pll has to run either at 1008MHz or 2016MHz. The former would result in an M value of 42, which is lower than the smallest value used by the 3.10 GPL kernel sources from Amlogic (50 is the lower limit there). Thus we need to run sys_pll at 2016MHz which can ge generated using M = 84, N = 1. I tested M = 68 and M = 84 on my Meson8b Odroid-C1 and my Meson8m2 board by running "stress --cpu 4" while infinitely cycling thorugh all available frequencies. I could not spot any issues after ~12 hours of running this. Amlogic's 3.10 GPL kernel sources have more M/N combinations. I did not add them yet because M = 74 (to achieve close to 1800MHz on Meson8) and M = 82 (to achieve close to 1992MHz on Meson8 as well) caused my Meson8m2 board to hang randomly. It's not clear why this is (for example because the board's voltage regulator design is bad, some missing bits for these values in our clk-pll driver, etc.). Thus the following M values from the Amlogic 3.10 GPL kernel sources are skipped as of now: 69, 70, 71, 72, 73, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98 Signed-off-by: Martin Blumenstingl Acked-by: Jerome Brunet --- drivers/clk/meson/meson8b.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index 41a5025364f9..b07a92ed7de3 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -43,6 +43,11 @@ static const struct pll_params_table sys_pll_params_table[] = { PLL_PARAMS(62, 1), PLL_PARAMS(63, 1), PLL_PARAMS(64, 1), + PLL_PARAMS(65, 1), + PLL_PARAMS(66, 1), + PLL_PARAMS(67, 1), + PLL_PARAMS(68, 1), + PLL_PARAMS(84, 1), { /* sentinel */ }, }; -- 2.19.1