From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8275C43334 for ; Fri, 10 Jun 2022 10:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245306AbiFJKpu (ORCPT ); Fri, 10 Jun 2022 06:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346972AbiFJKns (ORCPT ); Fri, 10 Jun 2022 06:43:48 -0400 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BA162533CF; Fri, 10 Jun 2022 03:40:23 -0700 (PDT) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 80A23100003; Fri, 10 Jun 2022 10:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1654857622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CPqa3snjp+V3swy+paQVl3SWlOSGmf0pkLwY6FTDI9U=; b=boAs/cHxD1v49A/IVeVtIuEz8fBNz17KEqTSD8TF0pb3tuwqKcx8ieyXiAvkchawghAV6Z PAZwqCV0PZ49VSLYs9l/wEVXJZQbf/mZhMpMTRM/w0eZnFZr0GbP1cCJvU5zhJebNZDtIl kx90AMeV+gMRuniOD3vAbNsbhrjHAf/rHRuYiHs+VQAQSOtjE/Q9DASLesAreXrLPNIXS6 rop2qSp/Nok87u1iW2IvGGldHlL9pQzrqPcK8lSQDinIvuQOmGjXzZdUW0MePrVKLB6hPy pGiDY36c8H4pB8JHRoGFI8lNpN6NZ0+wMLtQElyftguowNu+A67z91TE8dBikQ== Date: Fri, 10 Jun 2022 12:40:16 +0200 From: Alexandre Belloni To: Peter Korsgaard Cc: "Neeli, Srinivas" , Srinivas Neeli , "a.zummo@towertech.it" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "michal.simek@xilinx.com" , "sgoud@xilinx.com" , "shubhraj@xilinx.com" , "neelisrinivas18@gmail.com" , "devicetree@vger.kernel.org" , "linux-rtc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "git@xilinx.com" Subject: Re: [PATCH V6 2/2] rtc: zynqmp: Add calibration set and get support Message-ID: References: <20220609140833.1784738-1-srinivas.neeli@xilinx.com> <20220609140833.1784738-2-srinivas.neeli@xilinx.com> <87r13x28o4.fsf@dell.be.48ers.dk> <87mtel287y.fsf@dell.be.48ers.dk> <87pmjgyghw.fsf@dell.be.48ers.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pmjgyghw.fsf@dell.be.48ers.dk> Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org On 10/06/2022 12:12:11+0200, Peter Korsgaard wrote: > >>>>> "Neeli," == Neeli, Srinivas writes: > > Hi, > > >> >> Where do you see that? ug1085 rev2.2 still lists: > >> >> > >> >> Programming Sequences > >> >> init rtc > >> >> 1. Write the value 0019_8231h into the calibration register, CALIB_WRITE. > >> >> > >> > >> > This is a very weird value. Last time I had a look, I couldn't find an > > >> explanation for it. > >> > >> Agreed. I am not arguing that it is sensible, I just wondered where this new > >> value comes from? > >> > > This information is missing in our TRM, as per the internal RTC IP > > design specification document, the calibration value should be crystal > > clock frequency minus one. > > For a crystal oscillator of 32.768KHz(0x8000) frequency, the calibration value will be 0x7FFF. > > > Will update TRM with the required information. > > Ok, great! > > Please put this change in a separate commit from the get/set logic. I'm not sure it is worth it as it is probably being set (to the wrong value) from your device tree anyway and the driver won't forcefully change it in that case. The worse that can happen is that your new boards will have the correct value. -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com