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 X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 763CEC2D0A8 for ; Wed, 30 Sep 2020 07:27:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16DA92075F for ; Wed, 30 Sep 2020 07:27:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725535AbgI3H1r (ORCPT ); Wed, 30 Sep 2020 03:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbgI3H1q (ORCPT ); Wed, 30 Sep 2020 03:27:46 -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 8324DC061755 for ; Wed, 30 Sep 2020 00:27:46 -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 1kNWWa-0001Zf-FM; Wed, 30 Sep 2020 09:27:40 +0200 Received: from [IPv6:2a03:f580:87bc:d400:b742:a929:3f3f:414e] (2a03-f580-87bc-d400-b742-a929-3f3f-414e.ip6.dokom21.de [IPv6:2a03:f580:87bc:d400:b742:a929:3f3f:414e]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mkl@blackshift.org", Issuer "StartCom Class 1 Client CA" (not verified)) (Authenticated sender: mkl@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 9C31056E305; Wed, 30 Sep 2020 07:27:38 +0000 (UTC) To: =?UTF-8?Q?Magnus_Aagaard_S=c3=b8rensen?= Cc: linux-can@vger.kernel.org, Bas Vermeulen , Thomas Kopp References: <66662c88-aa9a-325d-8152-c5befbfafa2a@pengutronix.de> <1ee0af54-cdd6-4dc7-1956-e302bec716ff@csselectronics.com> From: Marc Kleine-Budde Autocrypt: addr=mkl@pengutronix.de; prefer-encrypt=mutual; keydata= mQINBFFVq30BEACtnSvtXHoeHJxG6nRULcvlkW6RuNwHKmrqoksispp43X8+nwqIFYgb8UaX zu8T6kZP2wEIpM9RjEL3jdBjZNCsjSS6x1qzpc2+2ivjdiJsqeaagIgvy2JWy7vUa4/PyGfx QyUeXOxdj59DvLwAx8I6hOgeHx2X/ntKAMUxwawYfPZpP3gwTNKc27dJWSomOLgp+gbmOmgc 6U5KwhAxPTEb3CsT5RicsC+uQQFumdl5I6XS+pbeXZndXwnj5t84M+HEj7RN6bUfV2WZO/AB Xt5+qFkC/AVUcj/dcHvZwQJlGeZxoi4veCoOT2MYqfR0ax1MmN+LVRvKm29oSyD4Ts/97cbs XsZDRxnEG3z/7Winiv0ZanclA7v7CQwrzsbpCv+oj+zokGuKasofzKdpywkjAfSE1zTyF+8K nxBAmzwEqeQ3iKqBc3AcCseqSPX53mPqmwvNVS2GqBpnOfY7Mxr1AEmxdEcRYbhG6Xdn+ACq Dq0Db3A++3PhMSaOu125uIAIwMXRJIzCXYSqXo8NIeo9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LgIsDvWUG0g3sACfqF6gtMHY2lhQ0RxgxAEx+ULrk/svF6XGDe6iveyc z5Mg5SUggw3rMotqgjMHHRtB3nct6XqgPXVDGYR7nAkXitG+nyG5zWhbhRDglVZ0mLlW9hij z3Emwa94FaDhN2+1VqLFNZXhLwrNC5mlA6LUjCwOL+zb9a07HyjekLyVAdA6bZJ5BkSXJ1CO 5YeYolFjr4YU7GXcSVfUR6fpxrb8N+yH+kJhY3LmS9vb2IXxneE/ESkXM6a2YAZWfW8sgwTm 0yCEJ41rW/p3UpTV9wwE2VbGD1XjzVKl8SuAUfjjcGGys3yk5XQ5cccWTCwsVdo2uAcY1MVM HhN6YJjnMqbFoHQq0H+2YenTlTBn2Wsp8TIytE1GL6EbaPWbMh3VLRcihlMj28OUWGSERxat xlygDG5cBiY3snN3xJyBroh5xk/sHRgOdHpmujnFyu77y4RTZ2W8 Subject: Re: mcp25xxfd driver questions Message-ID: <6bfc53ae-e40c-98b1-af78-66aca4d911cc@pengutronix.de> Date: Wed, 30 Sep 2020 09:27:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <1ee0af54-cdd6-4dc7-1956-e302bec716ff@csselectronics.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xvI2s64vkRgAtraQkUoVZ8QlXmbOrhg3J" 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xvI2s64vkRgAtraQkUoVZ8QlXmbOrhg3J Content-Type: multipart/mixed; boundary="oJ5sjfRwI4qwiGW3Cg3n4vLkni68u5nof"; protected-headers="v1" From: Marc Kleine-Budde To: =?UTF-8?Q?Magnus_Aagaard_S=c3=b8rensen?= Cc: linux-can@vger.kernel.org, Bas Vermeulen , Thomas Kopp Message-ID: <6bfc53ae-e40c-98b1-af78-66aca4d911cc@pengutronix.de> Subject: Re: mcp25xxfd driver questions References: <66662c88-aa9a-325d-8152-c5befbfafa2a@pengutronix.de> <1ee0af54-cdd6-4dc7-1956-e302bec716ff@csselectronics.com> In-Reply-To: <1ee0af54-cdd6-4dc7-1956-e302bec716ff@csselectronics.com> --oJ5sjfRwI4qwiGW3Cg3n4vLkni68u5nof Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 9/30/20 7:32 AM, Magnus Aagaard S=C3=B8rensen wrote: > On 29-09-2020 15:46, Marc Kleine-Budde wrote: >> On 9/29/20 1:07 PM, Magnus Aagaard S=C3=B8rensen wrote: >>> I'm evaluating the MCP2518FD, and have two questions to the driver. > I should clarify that we already have an older internal test board with= =20 > the chip working, using the driver by Martin Sperl. I'm evaluating the = > possibilities to migrate to this driver in the future, since I can see = > it is being mainline, but for now I mainly wish to use it on a new=20 > internal test board. Ah, ok. More users are always welcome. Which SoC are you using? >>> 1. I could not find any references to the GPIOs of the chip. Is it >>> correct that these are not exposed to the host system? >> ACK, gpio support is not implemented yet. Drop me a note, if you need = it. >=20 > On the board I'm currently working on getting up and running, we have n= o=20 > need for GPIOs or any of the other advanced features of the MCP2518FD. = > On our older board, we do utilize the GPIO and oscillator output=20 > functionality of the chip. It works for now with the old driver, so it = > is not a priority. It would be nice to have this functionality in the=20 > future for us. Bas Vermeulen (Cc'ed) is using the mainline driver (or an older version o= f it) and send a pull request for oscillator output (https://github.com/marckleinebudde/linux/pull/5). I did an initial revie= w there. This is a good starting point if you want to contribute (or drop m= e a note for commercial support). >>> 2. When setting the oscillator frequency outside the >>> MCP25XXFD_SYSCLOCK_HZ_MIN and MCP25XXFD_SYSCLOCK_HZ_MAX range, the >>> frequency is compared to the max value scaled by the max PLL value. I= s >>> the intention to compare with the min value? Currently, an external >>> oscillator of 4 MHz and a PLL value of 10, resulting in 40 MHz, is >>> treated as being too low. > >> This is intended. I have no hardware with a 4MHz osc to test, so I dec= ided to >> not support the 4MHz osc for now. If you design new hardware I suggest= to use a >> 40MHz osc, as probably no one has tested the hardware thoroughly in th= e PLL >> mode. If you need 4MHz support, it can be added, given there is hardwa= re. >=20 > I can provide some test information if needed, as I have internal=20 > testing hardware with a 4 MHz oscillator already. Are there any specifi= c=20 > message sequences that needs to be tested? You have to take care of the PLL in the functions mcp25xxfd_chip_clock_en= able(), mcp25xxfd_chip_softreset_check(), mcp25xxfd_chip_clock_init(). The MCP25XXFD_REG_OSC_PLLEN bit has to be set and the MCP25XXFD_REG_OSC_P= LLRDY bit has to be polled. I'm not sure what SPI speed you can use, when communicating with the mcp,= if the PLL is not enabled. Maybe Thomas (Cc'ed) can answer this. I suspect you c= an only use 2MHZ (or rather 85% of it) if you have a 4 MHz OSC with PLL still dis= abled. > The chip will most likely not reach high loads with the setup we have i= n=20 > mind, so I'll manually change the frequency check in the probe function= =20 > for now. This will probably not work, as the driver has to enable the PLL and the = SPI clock has to be really slow. > It's great to hear the reasoning. Thanks for the hard work you and=20 > others have put into this driver and the whole CAN system in linux. Thanks. I'm just standing on the shoulder of giants. This driver was and = is great community work. First of all there was Martin's driver, which shows= how a Linux driver for the chip can look. Then several tireless testers here an= d on github, direct and open communication with Microchip, and there are sever= al $CUSTOMERs paying to get the driver mainline. 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 | --oJ5sjfRwI4qwiGW3Cg3n4vLkni68u5nof-- --xvI2s64vkRgAtraQkUoVZ8QlXmbOrhg3J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAl90M2cACgkQqclaivrt 76l4kAgAnQ6EJRbrykuaJAF4iwA28tZBhDPhMTx34eiYnBlgaRoCrhHz2gnDS8eT UDK13NtwArXCDvKSiMp1OfWg1HzAMkOIJ9mmH3vG2PQOg3nR0eKy0X+4lZGyQDTi KjYrME7PLj3j2W5Bk8sMpyp75TxiOc6WSvT3neouIp3P4GMuchPIojACCWabGft2 u1PhyN6Hx4Tg+ky6awhe7F3PUxENNBpHUPqPZ30zDtbN3ToMWZXomamit/W8mdti CJ4OBkWy/y/9yLFMK1lOQKsZte1loq2NK08RSFPxfbEGdqZwJL8KF5h2j9S9ff7Z uQCJFXFuaZWJVzPg0q2uKywbfEh+DA== =de5q -----END PGP SIGNATURE----- --xvI2s64vkRgAtraQkUoVZ8QlXmbOrhg3J--