Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbdHPHPy (ORCPT ); Wed, 16 Aug 2017 03:15:54 -0400 Received: from 9.mo3.mail-out.ovh.net ([87.98.184.141]:50857 "EHLO 9.mo3.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580AbdHPHPw (ORCPT ); Wed, 16 Aug 2017 03:15:52 -0400 X-Greylist: delayed 1326 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Aug 2017 03:15:51 EDT Subject: Re: [PATCH] i2c: aspeed: Retain delay/setup/hold values when configuring bus frequency To: Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery Cc: Ryan Chen , linux-aspeed@lists.ozlabs.org, Wolfram Sang , OpenBMC Maillist , Brendan Higgins , Linux Kernel Mailing List , linux-i2c@vger.kernel.org References: <20170815072102.23067-1-andrew@aj.id.au> <247768a3-074f-70ad-6132-39d1443ce210@kaod.org> <1502866778.4493.84.camel@kernel.crashing.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <7d2aa1d5-f3c7-4581-f7e8-36b1f9d4d80d@kaod.org> Date: Wed, 16 Aug 2017 09:15:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1502866778.4493.84.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 17376576213290879988 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelkedrleekgdduvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 27 On 08/16/2017 08:59 AM, Benjamin Herrenschmidt wrote: > On Wed, 2017-08-16 at 08:53 +0200, Cédric Le Goater wrote: >>>> divisor = DIV_ROUND_UP(bus->parent_clk_frequency, bus->bus_frequency); >>>> - clk_reg_val = bus->get_clk_reg_val(divisor); >>>> + clk_reg_val = readl(bus->base + ASPEED_I2C_AC_TIMING_REG1); >>>> + clk_reg_val &= (ASPEED_I2CD_TIME_TBUF_MASK | >>>> + ASPEED_I2CD_TIME_THDSTA_MASK | >>>> + ASPEED_I2CD_TIME_TACST_MASK); >>> >>> Instead of keeping the u-boot values (which appear to be hard-coded), >>> should we instead put the known working values in the register? >> >> Yes. I was wondering where the initial setting was from on the AST400. > > Well, the AST2500 hard codes them in HW, so it makes some amount of > sense to use whatever aspeed platform.S hard codes in u-boot for the > 2400. The values look reasonably sane. > > If we ever see a need to change them, we can add DT props etc... but > for now I'd just not bother. > > The way it is now, at least, if I have problems, I can tweak the values > with devmem and try again without the driver overwriting them :-) ah yes. that is useful I agree. C.