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 4F970C00140 for ; Sun, 31 Jul 2022 18:58:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231146AbiGaS6U (ORCPT ); Sun, 31 Jul 2022 14:58:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbiGaS6T (ORCPT ); Sun, 31 Jul 2022 14:58:19 -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 A61F2DFEE for ; Sun, 31 Jul 2022 11:58:18 -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 1oIE8f-0004uc-1G; Sun, 31 Jul 2022 20:58:09 +0200 Received: from pengutronix.de (unknown [IPv6:2a01:4f8:1c1c:29e9:22:41ff:fe00:1400]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) 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 39135BEBD0; Sun, 31 Jul 2022 18:58:05 +0000 (UTC) Date: Sun, 31 Jul 2022 20:58:03 +0200 From: Marc Kleine-Budde To: Dario Binacchi Cc: Max Staudt , linux-kernel@vger.kernel.org, linux-can@vger.kernel.org, Oliver Hartkopp , michael@amarulasolutions.com, Amarula patchwork , Jeroen Hofstee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wolfgang Grandegger , netdev@vger.kernel.org Subject: Re: [RFC PATCH v3 8/9] can: slcan: add support to set bit time register (btr) Message-ID: <20220731185803.bdg4dugwf4dv2owk@pengutronix.de> References: <20220727192839.707a3453.max@enpas.org> <20220727182414.3mysdeam7mtnqyfx@pengutronix.de> <20220728090228.nckgpmfe7rpnfcyr@pengutronix.de> <20220728105049.43gbjuctezxzmm4j@pengutronix.de> <20220728125734.1c380d25.max@enpas.org> <20220729073352.rfxdyjvttjp7rnfk@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="46pf6oluekbhoi4p" 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-can@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-can@vger.kernel.org --46pf6oluekbhoi4p Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 31.07.2022 17:54:01, Dario Binacchi wrote: > > If an adapter follows 100% the official firmware doc the BTR registers > > are interpreted as SJA1000 with 8 MHz CAN clock. >=20 > I checked the sources and documentation of the usb adapter I used (i. > e. Https://www.fischl.de/usbtin/): > ... > sxxyyzz[CR] Set can bitrate registers of MCP2515. You > can set non-standard baudrates which are not supported by the "Sx" > command. I hope the effective clock speed is documented somewhere, as you need this information to set the registers. > xx: CNF1 as hexadecimal value (00-FF) > yy: CNF2 as hexadecimal value (00-FF) > zz: CNF3 as hexadecimal value > ... >=20 > Different from what is reported by can232_ver3_Manual.pdf : >=20 > sxxyy[CR] Setup with BTR0/BTR1 CAN bit-rates where xx and yy is a= hex > value. This command is only active if the CAN >=20 > And here is the type of control carried out by the slcan_attach for > the btr parameter: > https://github.com/linux-can/can-utils/blob/master/slcan_attach.c#L144 > When I would have expected a different check (i. e. if (strlen(btr) > 4). > Therefore it is possible that each adapter uses these bytes in its own > way as well as > in the content and also in the number of bytes. I expected something like that. 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 | --46pf6oluekbhoi4p Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmLm0LkACgkQrX5LkNig 013AQwf/eh8bIF53PTKoQPbikvqT6o6izoKdHiIuQetbs61GRgGpOo2jXKUjRrLu l6BiXmM7OvXDW26Y1+Wqu/DgTkL90vyy7UOyKjGQ+NnwDVYHUvwDfLTSBXXO4DKH rMhQ1imz68YcRUfd9EMyLOKKOux7sim1a1Xtksgy1C6hLmpiKhLwpNqe/4xA1KxM N3rLrliHOdxYNIlYzFXXuyrtNXD6CsSpAjq9DANHQ/kfLmWGwj6ijXGknP7KR2Rz rYU1dEQjNaDOtNwpnGpDPVrbOIFZDb30b/OOvUrJ1HpkjeuttOX7Mw/OnDLE1ReJ DSODRfUZWnK2LSQkf4TEvUkCpHw7fw== =aL16 -----END PGP SIGNATURE----- --46pf6oluekbhoi4p--