From patchwork Thu Nov 15 22:40:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10685205 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 334FA14DB for ; Thu, 15 Nov 2018 22:42:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 230412D591 for ; Thu, 15 Nov 2018 22:42:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 169E72D52E; Thu, 15 Nov 2018 22:42:54 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B185F2D35B for ; Thu, 15 Nov 2018 22:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=aKqoOebh7TUiz+EhGCqVj7CopHRUKL66NU9U3uBt/eE=; b=ndPaDtkyZuE/h5 zeBwRg1D80R9qk9O0g2uOomdUcnWfGzUi4mNkz+C6cco8EKZZoEuu3RNeWNStGxZt9dVh7+M/ElCx 4Ij7O4LiwPwZLLsmkYkqph/RKT6kuuJvq2itGOjFCwmYNdIs7VQteD4Xe7cwip4qxEreZUNelUen4 IzNE4dZIv5ujtHAxJ9QltjwTxgSOmSmJccUmSQn9tWgoeDJDb3OuvphcNaE94OAG3cFk8+JD2bHVq 9ah9hqu8BchkkVC4p+Zw0c3puznw7h+YOpsSExA4zErbLr9g5RwTHxTL07C+4cWxfTvvt3MmMXQhl IStcVQJx8Ci3YaAEoqLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNQLS-0002eL-2h; Thu, 15 Nov 2018 22:42:42 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNQKK-0001Or-CX; Thu, 15 Nov 2018 22:41:33 +0000 Received: by mail-wm1-x341.google.com with SMTP id u13-v6so19474368wmc.4; 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=XB0brvVSdK/j4m7zbXLcTJikjx51Y1O24eaEUxcJFIBT4zY2+qBeCINTSSly64wKDC FuAajUcYdy8m9hLtH0I/ppP8QWZc1dmK6O18oSu2Yu4xUrNptySbR382+SdEiYpB6lm9 PG9I1JeGfwYCfeN3Coh5Bo9t8CUQxmVAcmxcSmugZphoM8wQRw+DmfKlIcFtPQE7bGAX rrqv9MRB2JTGXuy6bsyoBJQsaeIjQo9SYXBxUnDsgr65lc1xmMnt8p2PGcvtCqXHnWvJ X22N4JHxTNWJXlCN+Tqmy6pnyOe9PyoPd4eOsTXW7zHwDtHZmbdsWr2qXxdXq2hC/fei LBfg== X-Gm-Message-State: AGRZ1gIACuIFYal3doyRF1FMSvTN3YPsklUz8ixzv0eYQbJ99HdzSTK7 ohyXQW3Y0oso40iYzZgA52FmJ4YI X-Google-Smtp-Source: AJdET5d+RuTFE5gNqRCuFYp4DNf62o0rc6lVciTY5Nxsgcfi1MaxXIzfiSEcItssW9iRHGdd6hMfpA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181115_144132_435121_10F66EFA X-CRM114-Status: GOOD ( 14.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sboyd@kernel.org, Martin Blumenstingl , mturquette@baylibre.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */ }, };