From patchwork Wed Nov 14 22:57:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10683351 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 26E4D14BA for ; Wed, 14 Nov 2018 23:00:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 150532BFFC for ; Wed, 14 Nov 2018 23:00:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 062982BFFB; Wed, 14 Nov 2018 23:00:05 +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 9DA132BFFB for ; Wed, 14 Nov 2018 23:00:05 +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=7AbY8b4VT7hdu4kM0xhm96HQhxB5EL9PMBunOpx8LH0=; b=B9briqUIRaWvzW pdyd5fasLEmmLUYkoW0MSLT2y0YEAAdTY04KowYfTyJLzWw3hBb4rr4JqhBeXAJKgPhWRpa7BXcDz Y8C+s8+uCQHznXMiDZ9UZRmfjV7Wi6+yiNXuUyPIOKFDEGHTPbX6mw4WKxlmZxp/utZ+Mkvuz0i5U ENlpxZnQCPK7hrk9RdwvQt21Rtltkf8yB0JZzxkNr0lPLh75ZJ0cwYhVMLPB6Ib1gnLGJUCJACtNS 22gmnh1PSdBM4ZHJECCIz/m3qwIGGH/HPGkeCM0wb10WDH5RJTMascKoXelqGaZUftxkyD6et6UVM KooJLm9T35LTMgmfNCCQ==; 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 1gN48d-0001ej-Br; Wed, 14 Nov 2018 22:59:59 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gN46r-00088S-Ng; Wed, 14 Nov 2018 22:58:11 +0000 Received: by mail-wr1-x444.google.com with SMTP id p4so9934652wrt.7; Wed, 14 Nov 2018 14:57:59 -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=ZdbHJpWfnE4dGFR/ow//dClXtqW/EtX9HERAF4Q8i2I=; b=DQNvAzeGWkDxCVEsx+IXCEhNio/mPxQMG97/B+xXkSL7iRylj5EJqHMfE5L/l79LEI BYH+tJT/xmTKXKwTaqnvryiD1pjpVGn11HL8UA95kXKbEFaCr2bkIRvSV/IFnOFpexfy Ttm7BWgf8zqcc1Q4sGgDHARksHcPqUf98oY7iWDICv1GWKNU/iRJwfHcdUEk+DAQ3+oY V1XWGoBar70LN7gKrxrDW0s34qDuNImNBCcLJzEa/2+6h4cgMu26vdyFv09WrfDs5cRy Z2a2e7QxqOac41BXUaaF6ZTE0aVBIp8mBygWXneOUdDQDD60yKR90biJSg6SDQg/97Ws LTvA== 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=ZdbHJpWfnE4dGFR/ow//dClXtqW/EtX9HERAF4Q8i2I=; b=qgcvoctw70H5h1+l2cABsO0iMRyYeiTNryL5fI3IV9DEZaHOYN8AxazPrWp2Bqb9rE cEtSsa/qVj3aytAjcm5sDttm36g8dWbdga4HiYAP2BJN0ubWhdghCvTvK+7VyrWupOEZ i9GfVIiEj2mQ4CxpSMZmNa54r1l0S1q7Wb2NT9DvYAwnGm26hADIEDyH6rl+8cpsFSdf bdvWe5bBznizXWrC1HYi1Ixi1ZvXL0bfWOXH1SR2ydW+wYH/v/40qV8Z6u1DxOE0FG2K tlN4ZYGWtubH8Ggp17sApg03dF6VuFP8nRWr1ep9HN2Guh00BcrKce7bfyULho+ifZbk X/aQ== X-Gm-Message-State: AGRZ1gK1E7Fb2igDx2xFl8Mkksoa9ZIF6vaWgAXd+N9Zmf90Ki7xiZBr drL5m71CenUUwmHypQllLc3b3Ol5 X-Google-Smtp-Source: AJdET5db3Eo5Ii1AFuVT0vAIGJ2PQTwq1hpyQmM9c7jYQnz+74k5zml2zBkq5Sh0E2c6Y4bUaOS5Zw== X-Received: by 2002:a5d:6684:: with SMTP id l4mr3952933wru.154.1542236277466; Wed, 14 Nov 2018 14:57:57 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD717A100301AB549B11D5ACB.dip0.t-ipconnect.de. [2003:dc:d717:a100:301a:b549:b11d:5acb]) by smtp.googlemail.com with ESMTPSA id n7-v6sm18987784wrt.60.2018.11.14.14.57.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 14:57:56 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, jbrunet@baylibre.com, narmstrong@baylibre.com Subject: [RFC v1 6/7] clk: meson: meson8b: add support for more M/N values in sys_pll Date: Wed, 14 Nov 2018 23:57:24 +0100 Message-Id: <20181114225725.2821-7-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181114225725.2821-1-martin.blumenstingl@googlemail.com> References: <20181114225725.2821-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-20181114_145809_783596_E295C14E X-CRM114-Status: GOOD ( 14.42 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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 d566dd5bc567..c06a1a7faa4c 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 */ }, };