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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF202C433F5 for ; Wed, 13 Oct 2021 14:17:09 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0EE7360F4A for ; Wed, 13 Oct 2021 14:17:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0EE7360F4A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D7E4835AF; Wed, 13 Oct 2021 16:16:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="mTh5ED8l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3F95E83373; Wed, 13 Oct 2021 16:16:44 +0200 (CEST) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AD962835A8 for ; Wed, 13 Oct 2021 16:16:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82f.google.com with SMTP id c20so2652542qtb.2 for ; Wed, 13 Oct 2021 07:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=eAEr/Igpx5sA5KWXc126y/CrkKm0wup0GkVes8jxks8=; b=mTh5ED8lH2RlNpbfwlFik3LlxNll03Sdyx8iT4jb77QCzqaLXNN2kDdHZRvyfcnMXB AYYkAnAr45mMl81lU/GxiMAawtitJGaLvWSJQCyFhPsqS1YYlSMSI0ypnkdeT1iCtyfR r2P9QnMCQIE9X09xifN4T4OtRxFEz0sbRc6pE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=eAEr/Igpx5sA5KWXc126y/CrkKm0wup0GkVes8jxks8=; b=yZ/tv1pNzlpk3HWuF+x2uqmWofgaks9ar0stNg0iuD6zIvCL7mA1esQS/dO5gG7WMk X3tk7tr8SU51hrSHAc8kt2HhPpQtq3Tn5YrVQ9DZIUrnuG/C7uMAFWpNgnwutQmfAAe1 0IAYuSrYDuFqS9C8qsyTiH0ob4cn7/cHIz8UDn2nXxyQ5oDbFiKQOCP6ITZfXagpUU6N s6Jz193x+iFuJk2tXSbNFJ+jNWcxRp/UNthaSMLFe1UUKEbCugJmXapqR7JAKiwQPuTA 5gl1aUUZY8UrnYlF1OEFIw6kt7+u0gdizbhHkTM3cITvy+4nFClLbhC+3XNM+N/5zEGU xNmA== X-Gm-Message-State: AOAM530iw5zbG6Jm0YKt0nvkaYVnj2Elb1sMz4JP26Alg8QRzB6+kSA9 qbabxIZYbSzNwKi1A3EW4d+Ntd4G8FoH+A== X-Google-Smtp-Source: ABdhPJyBrDm7NTlsVc+OUpcxe8gfR1R4AztKqOkc2rhzpPrqy/u0ZTr3i33oUMJR8F2Xhk6FfNvkrw== X-Received: by 2002:a05:622a:55:: with SMTP id y21mr20357811qtw.39.1634134595441; Wed, 13 Oct 2021 07:16:35 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-e98d-c49f-f596-1fb5.res6.spectrum.com. [2603:6081:7b01:cbda:e98d:c49f:f596:1fb5]) by smtp.gmail.com with ESMTPSA id b71sm5818294qkg.131.2021.10.13.07.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 07:16:34 -0700 (PDT) Date: Wed, 13 Oct 2021 10:16:33 -0400 From: Tom Rini To: Mark Tomlinson Cc: u-boot@lists.denx.de, sjg@chromium.org Subject: Re: [PATCH v2] rtc: ds1307: Handle oscillator-stop bit correctly Message-ID: <20211013141633.GS7964@bill-the-cat> References: <20210927211041.2079-1-mark.tomlinson@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+gatv7KW/UGBXrbE" Content-Disposition: inline In-Reply-To: <20210927211041.2079-1-mark.tomlinson@alliedtelesis.co.nz> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --+gatv7KW/UGBXrbE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 28, 2021 at 10:10:42AM +1300, Mark Tomlinson wrote: > The DS1307 driver was originally based on the DS1337 driver. However, > the functionality of the clock set/get functions has diverged. In the > original DS1337 driver, the set/get functions did the following: > 1) Setting the clock ensured the oscillator was enabled. > 2) Getting the clock checked and reset the oscillator-stop flag. > The DS1307 does not have an oscillator-stop flag, but the driver tried > (incorrectly) to emulate this by ensuring the oscillator was running. It > really makes no sense to start a stopped clock without setting it. >=20 > This patch makes the DS1307 driver behave like the original DS1337 > driver again. For the DS1307 itself, this is just a removal of code, > since there is no oscillator-fail bit to check or reset, and the clock > is started when it is set. Since the DS1307 driver can now also be used > for the DS1337 and DS1340 which do have this bit, add code to handle the > oscillator-stop bit in the same was the original DS1337 driver did -- > i.e. report that the oscillator had stopped and clear the flag. >=20 > This means that setting the date using the date command (which does both > a get and a set) will now clear the oscillator-stop flag in addition to > setting and starting the clock. >=20 > The old-style (non-DM) code has not been updated and will be removed in > a future patch. Note that this older code does not support the DS1337, > as there is a separate driver for this. Also note that the original (DM) > code used the wrong control-register address for the DS1337. >=20 > Signed-off-by: Mark Tomlinson Applied to u-boot/master, thanks! --=20 Tom --+gatv7KW/UGBXrbE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFm6kEACgkQFHw5/5Y0 tyziSQv/VXnGUgDgV92noHw099I4Eu4A7uTGbrtHtnHr22EAbcgDc2SaibMft1lr dLomETL0A+KMglFD0JhvwABNr3eGf8ds4lFHH9ZTsHQ8e5A0srUkHz/pM6ZxpYSb BgnrW7rqQqSCAyiqVLi41iufZeqwr2EqOEDK35QbyDRH6SIriZcDQpmAVTJOKOIA 28DPFOLDWWPullTNMfX8sJafizMqdQI8T3Jywd7ZeAEHAZrAKgvm5vyRWegPbjSG 0zheALvRvlyUeBKaD1sVpSs+Wz20/rSULiXbq4+riQu7JX3OlsJV0zAxEOW8RsGa XldO7qUC4JZlbd+1Xud0HOP4ndn8Cz1ndTuXdOVpSuGY/H6RVwAdkJnGd5NyVNbT hah74cswTW/PFnigWHHMyuVDN3kJkCvEZWHfwfqAYAQ/hdWgEi1U/r3xI5s3Q+/X k3n9mqIjeMZM0gR2XIMuukWYbg0kG8QtMXzDzLiegOCq1eisXxyktSSoPiPVJTLw 6EuLOXDu =pyuN -----END PGP SIGNATURE----- --+gatv7KW/UGBXrbE--