Received: by 10.213.65.68 with SMTP id h4csp255007imn; Tue, 13 Mar 2018 03:21:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELsJLc0pO722gp/2kQMYMKqSCegoo+hTj8HfQzlvihrLyAo5zAfKQ5vSW6slBtYmQKdZkX15 X-Received: by 10.99.9.195 with SMTP id 186mr64549pgj.152.1520936518497; Tue, 13 Mar 2018 03:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520936518; cv=none; d=google.com; s=arc-20160816; b=O+1V60U2AQ5xPKFWHk6d+7gaKKBXnOU6kzpMaQtIgYPz8iEZmmgRUaqgm5KyefIRQF 4GDQtgENloW9Ww7VcT3zK/SaV+tFOP1d3/UdxtBiWlG4lPRveA7y2W6TNxWW9sbSZdpq YEjBFBmpaPdUAt8R0oVmDKGa57o5Qm6jZcs0AyJ7YCWDl8rflnSmJIvg87fWlSkezHtu 49IX2DRhe3z3tb9wOZiTI8g+v0DrLBelAoZXoMQAnEzAx2c0A4QcPcyCUgG9oeG93sdl s+qNVeNKTSe9+xTQRosP2cX1pfK5tOOA4qnf9zQAvtmGU+axSQnWq1VxCLVAZwDCSYQT 5E/g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=f8lHF+RYDIIXkC8H34Kz5XbdidliZWf1EGUjtQjJnqo=; b=PJpxf4DmEWBxkd1JWwpEc/ptIAWv5m1qNHyuaFeeN78Y4tU5OgwzTH9Fc4lwx76FqL 8EL2YivdZOJXmssMYMIlgBw0+o2J8GPXkWuD4rGmQUJlHUHcAn0hTCQfKaIhvzofU4Tj vQRSeHIrw2F/fybHjNBc27baGvcHlSM95Qy1oqIqSsGAzqyRK1CQ3kgaS3+io7y10ubD tD6LrAnx9K0N0Tu7WMlAMS+x4mB8yUjh8/0MSrWmGc/7zrdKnWN0q+DL0KaTdyVnPYR/ BoKYdzDI4Ef3xcDCc901gq1MYGmqxRLs6kMXA2hhTB3oobOOkLoDJwDm2QSZuF9E6mks VkNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MJbXzTvT; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14si15314pgo.360.2018.03.13.03.21.43; Tue, 13 Mar 2018 03:21:58 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=MJbXzTvT; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932570AbeCMKUq (ORCPT + 99 others); Tue, 13 Mar 2018 06:20:46 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35756 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752181AbeCMKUo (ORCPT ); Tue, 13 Mar 2018 06:20:44 -0400 Received: by mail-wr0-f193.google.com with SMTP id n12so9840004wra.2; Tue, 13 Mar 2018 03:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=f8lHF+RYDIIXkC8H34Kz5XbdidliZWf1EGUjtQjJnqo=; b=MJbXzTvTUSpI177Nta624jjjhjAdrI2Uf3JQrMPe4HQ4QsXM+wYIDFBLIyhn7E7rqQ OTgNoIyEhd0hhzM79R2Q6UzSZplMLRZanoFlO1nbaEux41MHDGHAaiElYuHcy71ngmUf c26PyxI2WTQsJ0YPK2xLgHKYgKU23nrtZuKTh8X2zUb3dAP3tWF9Iz7ZmTINP2G5rNfw af0Gs8MYxcVwMeN3Tx3Qb4y6p/vBLMpegyM2+3/mBFAD8FhJ2h8li3xsBX2MEhgLRbla CeSc5x+HzYVY8KqML/6UltCfn2c37vqq5u0ncFqEwulZ6n4WCHBKnoesDug4U9YEhkUT VxNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f8lHF+RYDIIXkC8H34Kz5XbdidliZWf1EGUjtQjJnqo=; b=o8g+ghsZCYA24Ddp28WYwXCs24s06D0FEIwu12NGeV8VDSLpEw/UxYLFYd7c06+um+ y587zLSSNVlGviIImceA/eJT/ces8UJQ/9O4nrBPKJZYwDI+DkMkoVKhiSNAldn2GqoG 4gvTjfCZSZZaq2MncRb4cG2Mp8Bn3FOCJGc8jeL1kr//oBcLQzorPXLOK06DhccDOrPy GmvOEeSgPnxBIlShDIIrK3lwLxXvf1/e31Xkg0fxZ/d5gx+GmC9euhZPPO7emSUfCTDK cd4dz1zNTztK08B4woTRG/PEFw2oC+MmuFhorzlhPKtnM+S5dSp638suz5RnYekqoRXO YOjA== X-Gm-Message-State: AElRT7FuHRm1UI3+QDPr8n5TmBj5cBtsgCodaF/MyhGPU/qNY+xcAYzz 5ky6wdL8i7LnDTwEJNKiY7DB/Q== X-Received: by 10.28.141.131 with SMTP id p125mr295392wmd.0.1520936442828; Tue, 13 Mar 2018 03:20:42 -0700 (PDT) Received: from [192.168.2.41] ([46.227.18.67]) by smtp.gmail.com with ESMTPSA id d4sm181032wmh.42.2018.03.13.03.20.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 03:20:41 -0700 (PDT) Subject: Re: [PATCH] clk: mvebu: armada-38x: add support for missing clocks To: Gregory CLEMENT Cc: Stephen Boyd , Michael Turquette , Gregory CLEMENT , Ralph Sennhauser , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180308090300.23544-1-richard.genoud@gmail.com> <87h8pq4s92.fsf@bootlin.com> <877eqm4s68.fsf@bootlin.com> From: Richard Genoud Message-ID: Date: Tue, 13 Mar 2018 11:20:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <877eqm4s68.fsf@bootlin.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/03/2018 14:23, Gregory CLEMENT wrote: > Hi, > > On jeu., mars 08 2018, Gregory CLEMENT wrote: > >> Hi Richard, >> >> On jeu., mars 08 2018, Richard Genoud wrote: >> >>> Clearfog boards can come with a CPU clocked at 1600MHz (commercial) >>> or 1333MHz (industrial). >>> >>> They have also some dip-switches to select a different clock (666, 800, >>> 1066, 1200). >> >> The patch looks goo and it will also be usefull for any other board >> using these frequencies, thanks for this. I have only one small comment, >> see below. > > > I forgot to mention that you can add my > > Acked-by: Gregory CLEMENT > > Thanks, > > Gregory > >> >> >>> >>> The funny thing is that the recovery button is on the MPP34 fq selector. >>> So, when booting an industrial board with this button down, the frequency >>> 666MHz is selected (and the kernel didn't boot). >>> >>> This patch add all the missing clocks. >>> >>> The only mode I didn't test is 2GHz (uboot found 4294MHz instead :/ ). >>> >>> Signed-off-by: Richard Genoud >>> --- >>> drivers/clk/mvebu/armada-38x.c | 14 +++++++------- >>> 1 file changed, 7 insertions(+), 7 deletions(-) >>> >>> diff --git a/drivers/clk/mvebu/armada-38x.c b/drivers/clk/mvebu/armada-38x.c >>> index 394aa6f03f01..9ff4ea63932d 100644 >>> --- a/drivers/clk/mvebu/armada-38x.c >>> +++ b/drivers/clk/mvebu/armada-38x.c >>> @@ -46,11 +46,11 @@ static u32 __init armada_38x_get_tclk_freq(void __iomem *sar) >>> } >>> >>> static const u32 armada_38x_cpu_frequencies[] __initconst = { >>> - 0, 0, 0, 0, >>> - 1066 * 1000 * 1000, 0, 0, 0, >>> + 666 * 1000 * 1000, 0, 800 * 1000 * 1000, 0, >>> + 1066 * 1000 * 1000, 0, 1200 * 1000 * 1000, 0, >>> 1332 * 1000 * 1000, 0, 0, 0, >>> 1600 * 1000 * 1000, 0, 0, 0, >>> - 1866 * 1000 * 1000, >>> + 1866 * 1000 * 1000, 0, 0, 2000 * 1000 * 1000, >> >> Maybe you could add a comment here to say that the 2GHz mode didn't have >> been tested. Well, if I add a comment there saying "2GHz mode hasn't been tested", I'm afraid it will stay there forever, even after being tested. (if it's working, nobody will look at it, and if it's not, it's in the commit message anyway). I was also thinking that this could go in -stable since it fixes a hang. In this case, commit 9593f4f56cf5 ("clk: mvebu: armada-38x: add support for 1866MHz variants") should also go with it. Thanks ! >> >> Thanks, >> Gregory >> >> >>> }; >>> >>> static u32 __init armada_38x_get_cpu_freq(void __iomem *sar) >>> @@ -76,11 +76,11 @@ static const struct coreclk_ratio armada_38x_coreclk_ratios[] __initconst = { >>> }; >>> >>> static const int armada_38x_cpu_l2_ratios[32][2] __initconst = { >>> - {0, 1}, {0, 1}, {0, 1}, {0, 1}, >>> - {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> - {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> + {1, 2}, {0, 1}, {1, 2}, {0, 1}, >>> + {1, 2}, {0, 1}, {1, 2}, {0, 1}, >>> {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> + {1, 2}, {0, 1}, {0, 1}, {1, 2}, >>> {0, 1}, {0, 1}, {0, 1}, {0, 1}, >>> {0, 1}, {0, 1}, {0, 1}, {0, 1}, >>> {0, 1}, {0, 1}, {0, 1}, {0, 1}, >>> @@ -91,7 +91,7 @@ static const int armada_38x_cpu_ddr_ratios[32][2] __initconst = { >>> {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> - {1, 2}, {0, 1}, {0, 1}, {0, 1}, >>> + {1, 2}, {0, 1}, {0, 1}, {7, 15}, >>> {0, 1}, {0, 1}, {0, 1}, {0, 1}, >>> {0, 1}, {0, 1}, {0, 1}, {0, 1}, >>> {0, 1}, {0, 1}, {0, 1}, {0, 1}, >> >> -- >> Gregory Clement, Bootlin (formerly Free Electrons) >> Embedded Linux and Kernel engineering >> http://bootlin.com >