Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5136882imu; Tue, 8 Jan 2019 12:10:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN7U8AdayIaP60tyu3MdUu02OIvIxY4l9/dftzNn+unEaIf9mtuxScezfzmttjshdxcMYfNP X-Received: by 2002:a62:5793:: with SMTP id i19mr3124786pfj.49.1546978234593; Tue, 08 Jan 2019 12:10:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546978234; cv=none; d=google.com; s=arc-20160816; b=iE1jyM7aA5tr9q+g5W9IcBG++VfP8FnZWPpW/BkmqwzkW9vOMTcC9o2+1NI6wsigJF qyCJGzPXR8Q3yDo+BGrFuSkzPmD+MtD2daz1BMCR+cTRHShabp2qUIDkxUgYoe3EFARl v5zGl9UqCAhQkxGV93YkqFfLCAkXlSLu0NbdpeQREiKOgQwY22GgH8g/Ngtq01rKOTkb gfpOW93loyw4jhs3OMFxA1z7qG4X80EsnnU7P1zO3sz5M90h0IJOLi5/tI3ljBQRQUqq 43J8cTuG5KfIy3FvFdiYdSu8Lc8PYrs43X47fUKKYzx7tBfXeqWxJImW+oHfgYW4ksiR JuaA== 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=2CMaB8S5LlqgUqK5szww3P89xKpXhqiqBAQm9nKXVNM=; b=bmOz9lWjA33/OWxX7Ts7ZMj1C94yS4HIHvE7UaJ8QA+s54zUQOtJ7lXWHsUnHD7DdF Lni06Kprrn6ECqa8WesMEIDcA8oidxdGhY+J8YdkXuEKplw4E8r9/zs7MYjPpc120hm4 OfByHoovGOmyz5meyh8vNCucW9liVV5ZtgHym9ce7ZgJr/rbJniw3zW+fqtgqaEh+mI/ TpRoJEY5PCM17hJcPJkXsqwYPQoMoJfeQzlF9lFd1qs6tCZwLi64mGQkukzXN1TLGhSz ZXiKYrZGw2WOGibERn/Nkb0q031M4d7JfJcWrFR3O5/w+z0jg/KPtCfoq6qUZ8SIJz4+ 6DBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JnxmGGXH; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s62si9852920pgc.113.2019.01.08.12.10.18; Tue, 08 Jan 2019 12:10:34 -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=@kernel.org header.s=default header.b=JnxmGGXH; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729681AbfAHT11 (ORCPT + 99 others); Tue, 8 Jan 2019 14:27:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:33436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729605AbfAHT1W (ORCPT ); Tue, 8 Jan 2019 14:27:22 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6782A20883; Tue, 8 Jan 2019 19:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546975641; bh=/yiKT8skie3SGWtl1V7G2gUA9sKuNHe7Fc33UHpocGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JnxmGGXHSLR+BI9fXXuAD41pVJHoku6WANqSY0Mve9PODos1qfDvMGeFg5BkpCbdG 3/zlrNLP6pcc5OtyyaNc2MMdaoLj2F8oxXDpuTojJgPIN++iubRylhHxEEbtpx5fHV WUUdBNUoP4CdDY/8wP3Eme7mkxHOWiz26lnXNpz4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Martin Blumenstingl , Neil Armstrong , Sasha Levin , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 027/117] clk: meson: meson8b: add support for more M/N values in sys_pll Date: Tue, 8 Jan 2019 14:24:55 -0500 Message-Id: <20190108192628.121270-27-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190108192628.121270-1-sashal@kernel.org> References: <20190108192628.121270-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Blumenstingl [ Upstream commit e36c7e9898f2ba34becf37bda37b70e984b0bf4e ] 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 Signed-off-by: Neil Armstrong Link: https://lkml.kernel.org/r/20181115224048.13511-5-martin.blumenstingl@googlemail.com Signed-off-by: Sasha Levin --- 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 346b9e165b7a..a059db63907c 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -42,6 +42,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