Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp378773pxb; Mon, 16 Aug 2021 07:31:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNUWa6HzPoKZJigAXZSMSQdHB4PWfLMAFy3L6BSq1ZAfF03YCndwpCuAM0HHg+qd9UK7yy X-Received: by 2002:a6b:8f4a:: with SMTP id r71mr13400866iod.12.1629124315447; Mon, 16 Aug 2021 07:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629124315; cv=none; d=google.com; s=arc-20160816; b=irUWIaqzs0bnCArHtqEMv2p7rvXiVMaank+2tSlLxGl68i3hd+KfuClaMbBh6ewMdc ZaNUWEM/FG0ScmJp2JLEXuaFpfbfbNFalgTg8p1SF42L5sEkHdZD1xiHqpReLo2uYGna hmg6l2g/elYU4jwbe0VwWHHFXC10f1dDjdZ3nNIQaMyWfMdRPwF667FjYPsBI9naEbc4 SVCJI3pBGTvJABtV/bgaWKMpc9W/nh1EVBuJLvRhU4m/HyV1MQul1sO0CwcDRduSyRBf WBFtL9hX2gbW+MpChRuVtzQ3CHyB77MNhr1ImtMfUmGEYnJDM402eP0pcUOPivdzrdfW LN/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HQD5Z3g6IAVAlPS9Jb81p1tpF4GrGSEytNO0PPCb1NI=; b=lsFvwRoBxjhR6yD5bxj1emlf8zHC+4T4dF/0zk7Q43fcKRZU0Od05BvYL3avcEktBn 1A53SIb98bwts+3CpGzFH/Z66AhS2Ta7xCUTM8C3JApl8vQ6akhv5a6tclZU4+MRRq1g 8nvisH6WUVWqIinzFuQIMWMHKLUEURkKudLxGVVwDpUds+NC59wRrRxGSfIhXekBuCb/ YGbSiE/ewcxlGE0eZxpPQvjleRvZAphoY1ZGI3bADsWgFI5kFqeuZ07TmG9m+tTJfwNG q+pkvp65Hb+2eS676OoExW78OWQkfrpQOdS16decFxA8oAJRd8kzrigkP6T/BMzOEH54 FuBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si10855127ilh.8.2021.08.16.07.31.43; Mon, 16 Aug 2021 07:31:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232145AbhHPObb (ORCPT + 99 others); Mon, 16 Aug 2021 10:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbhHPOba (ORCPT ); Mon, 16 Aug 2021 10:31:30 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF48C061764 for ; Mon, 16 Aug 2021 07:30:59 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFddg-0008S1-5t; Mon, 16 Aug 2021 16:30:56 +0200 Received: from pengutronix.de (unknown [IPv6:2a02:810a:8940:aa0:3272:cc96:80a9:1a01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 4EC7A668425; Mon, 16 Aug 2021 14:30:54 +0000 (UTC) Date: Mon, 16 Aug 2021 16:30:52 +0200 From: Marc Kleine-Budde To: Vincent MAILHOL Cc: linux-can , Stefan =?utf-8?B?TcOkdGpl?= , netdev , open list Subject: Re: [PATCH v5 2/7] can: bittiming: allow TDC{V,O} to be zero and add can_tdc_const::tdc{v,o,f}_min Message-ID: <20210816143052.3brm6ny26jy3nbkq@pengutronix.de> References: <20210815033248.98111-1-mailhol.vincent@wanadoo.fr> <20210815033248.98111-3-mailhol.vincent@wanadoo.fr> <20210816084235.fr7fzau2ce7zl4d4@pengutronix.de> <20210816122519.mme272z6tqrkyc6x@pengutronix.de> <20210816123309.pfa57tke5hrycqae@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="huzcw6f2bihja6yc" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --huzcw6f2bihja6yc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 16.08.2021 23:10:29, Vincent MAILHOL wrote: [...] > After the discussion I had with Stefan, I assumed mcp251xxfd also > used relative TDCO. However, in the mcp15xxfd family manual, > Equation 3-10: "Secondary Sample Point" on page 18 states that: >=20 > | SSP =3D TDCV + TDCO >=20 > As I commented above, this is the formula of the absolute > TDCO. Furthermore, in the example you shared, TDCO is > 16 (absolute), not 0 (relative). ACK > *BUT*, if this is the absolute TDCO, I just do not get how it can > be negative (I already elaborated on this in the past: if you > subtract from TDCV, you are measuring the previous bit...) >=20 > Another thing which is misleading to me is that the mcp15xxfd > family manual lists the min and max values for most of the > bittiming parameters but not for TDCO. >=20 > Finally, I did a bit of research and found that: > http://ww1.microchip.com/downloads/en/DeviceDoc/Section_56_Controller_Are= a_Network_with_Flexible_Data_rate_DS60001549A.pdf Interesting. This data sheet is older than the one of the mcp2518fd. > This is *not* the mcp25xxfd datasheet but it is still from > Microship and as you will see, it is mostly similar to the > mcp25xxfd except for, you guessed it, the TDCO. >=20 > It reads: > | TDCMOD<1:0>: Transmitter Delay Compensation Mode bits > | Secondary Sample Point (SSP). > | 10 =3D Auto; measure delay and add CFDxDBTCFG.TSEG1; add TDCO > | 11 =3D Auto; measure delay and add CFDxDBTCFG.TSEG1; add TDCO > | 01 =3D Manual; Do not measure, use TDCV plus TDCO from the register > | 00 =3D Disable >=20 > | TDCO<6:0>: Transmitter Delay Compensation Offset bits > | Secondary Sample Point (SSP). Two's complement; offset can be > positive, zero, or negative. > | 1111111 =3D -64 x SYSCLK > | . > | . > | . > | 0111111 =3D 63 x SYSCLK > | . > | . > | . > | 0000000 =3D 0 x SYSCLK >=20 > Here, you can clearly see that the TDCO has the exact same range > as the one of the mcp25xxfd but the description of TDCMOD > changes, telling us that: >=20 > | SSP =3D TDCV (measured delay) + CFDxDBTCFG.TSEG1 (sample point) + TDCO >=20 > Which means this is a relative TDCO. >=20 > I just do not get how two documents from Microchip can have the > TDCO relative range of -64..63 but use a different formula. I am > sorry but at that point, I just do not understand what is going > on with your controller... Me neither. I'll ask my microchip contact. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --huzcw6f2bihja6yc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmEadpkACgkQqclaivrt 76nijQf/f5cgGi+vnS1wIdty9F4nhLbpuwe1ue79JyYYwv+BgvHv7LrERh0Gd6SB r8yrq5x7ZTXqmRci1fMH0gQF6DctKaKnzU69MV6P00CbtbOET7uXNDbvtqoX59Y8 RNNQYgNnaWXXMDgHJJeOQhiJeFzkMlStNJbNENoDU2+HJkGTVag+XAKbtgKxWE2O 33x6ejiAMRpKiSPNRruLy8HzVVYzpOc7LgGhB7oHyOsJignUiSphSa+ew/oErrqI AwGh6CBrsq7lC+trq8GdL+vRWkMaW0YuUbgjz6zRWV4I1aH5d4wmWh9Sr1UzkcGY vtP6s1l8k4rnaothQa1caTRRSlekOA== =1N+4 -----END PGP SIGNATURE----- --huzcw6f2bihja6yc--