Received: by 10.223.164.202 with SMTP id h10csp470960wrb; Wed, 15 Nov 2017 02:56:47 -0800 (PST) X-Google-Smtp-Source: AGs4zMZd2LgioqdOzHXZQnWD6W7+xbaO6sUXgt86LoWbMMAH31XIii57s1PKsUwvIob5LU5wKqnC X-Received: by 10.99.122.3 with SMTP id v3mr14697909pgc.394.1510743407547; Wed, 15 Nov 2017 02:56:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510743407; cv=none; d=google.com; s=arc-20160816; b=kepg0FPmMsmCRPFgH/22/emxr2yNxpT/EHRIbyXdZ3OOnsaPmRzIUHLcxFlo7kI4cJ zBmG8s5v6xFq8X0DC4lLj8J3yfAFpPsgOK27ffAMP+NaUTzS9mR7Hlsawj7WMhhlNKzn F4LW8KBkzsba5Ji/AaDplczd60QMJ8bx0F6Sf6ok97uKwuFh7r803IkzTHg2d6nqhOnk NMFgeeYE69qcKnvnvImXBUrPXfSZfKJWGgtidDWKL3tGCXsAc7op7SMqFqdfWtwU7e3L wVs5PpS4d1yL9C0s7SuFd4jDk2WSyAQntpJc94vSezZCFE6qnsfxjslD4l85ktj1iPL+ jWWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=rYDmdYvTXhcfLHbTAiVcgqA3ybsVr89Nou0MIvvU4QE=; b=WaoxllpUY1EZGzeOmgNi1kCAJtDss1PTvBGX3xfZYPCh0uBuwig60A7LPqrBVUtM0D cKyP7Dxmz4Z1rqGIYP+AroPpDKPyJLGxYzyqiPJ/8SywGhlzV/a6mqWo1EvkgVbtslqA I7Pr9OEbS17tK0l2VnE2v6x3v1x+StlrsnuYWn7KyJsf9hl1zgd/2B4tD2tw+z1Yv4/p +N3DtdqFryavBaC6D8zVzicEkOTWye66yMuw9Lel7uE7u04EqhFGhyqU5vqfglLfi+fu 1LALUw5rQ2VPY2B0ueHjGn+ub2xMbVPy1ArimpplAlbxI9zxdlDhLYucM+GVI6isUo4o GrlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si8263187plt.597.2017.11.15.02.56.35; Wed, 15 Nov 2017 02:56:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757612AbdKOKyh (ORCPT + 88 others); Wed, 15 Nov 2017 05:54:37 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:40679 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752311AbdKOKye (ORCPT ); Wed, 15 Nov 2017 05:54:34 -0500 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eEvKv-000070-0p; Wed, 15 Nov 2017 11:54:29 +0100 Received: from [IPv6:2001:470:7eea:1122:6933:f3e:cb0f:ccfd] (unknown [IPv6:2001:470:7eea:1122:6933:f3e:cb0f:ccfd]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (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 130E628BE5E; Wed, 15 Nov 2017 10:54:27 +0000 (UTC) Subject: Re: MCP251x SPI CAN controller on Cavium ThunderX To: Mark Brown , Tim Harvey Cc: Jan Glauber , linux-spi@vger.kernel.org, "linux-kernel@vger.kernel.org" , Wolfgang Grandegger , linux-can References: <20171114120207.xbee2cgsai4qka46@sirena.org.uk> From: Marc Kleine-Budde Message-ID: Date: Wed, 15 Nov 2017 11:54:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171114120207.xbee2cgsai4qka46@sirena.org.uk> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="o7qiMC3WpGcCdQpHm6f4ksauBgA6wOgoT" 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --o7qiMC3WpGcCdQpHm6f4ksauBgA6wOgoT Content-Type: multipart/mixed; boundary="OJPt4AltXt13rjA1heHo76g3IsQab1BIt"; protected-headers="v1" From: Marc Kleine-Budde To: Mark Brown , Tim Harvey Cc: Jan Glauber , linux-spi@vger.kernel.org, "linux-kernel@vger.kernel.org" , Wolfgang Grandegger , linux-can Message-ID: Subject: Re: MCP251x SPI CAN controller on Cavium ThunderX References: <20171114120207.xbee2cgsai4qka46@sirena.org.uk> In-Reply-To: <20171114120207.xbee2cgsai4qka46@sirena.org.uk> --OJPt4AltXt13rjA1heHo76g3IsQab1BIt Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 11/14/2017 01:02 PM, Mark Brown wrote: > On Mon, Nov 13, 2017 at 01:17:42PM -0800, Tim Harvey wrote: >=20 >> When a register is read from the mcp251x driver the >> octeon_spi_do_transfer() gets a spi_message with a single spi_xfer of >> len=3D3, a tx_buf, and an rx_buf which I believe is supposed to shift >> out 3 bytes out MOSI and shift in 3 bytes from MISO where the last >> byte shifted in would be the response. >=20 > No, that will simultaneously transmit and recieve three bytes. That's what the driver supposed to do. > If you want to transmit two bytes and then recieve one byte you need > two xfers, one with a len of 2 and a tx_buf, the other with a len of > 1 and a rx_buf. To read a register (mcp251x_read_reg()) the mcp251x does a 3 byte full duplex transfer. The first byte send is the command (read register) the second byte the register number the third byte is a dummy. The first 2 bytes received are ignored the 3rd byte is the register contents. Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | --OJPt4AltXt13rjA1heHo76g3IsQab1BIt-- --o7qiMC3WpGcCdQpHm6f4ksauBgA6wOgoT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEE4bay/IylYqM/npjQHv7KIOw4HPYFAloMHN4ACgkQHv7KIOw4 HPZdSgf+MpniHvwZ4ctg9TfDsS4s4t2z30+8SzARxjln7DVPz9SrLCT1ZLSpTEKy eBjRvjuEwlnzFTXDbnGmYPgT1440okdX8F1tjQ19NR3myevdGHMZTOAcaT5xg8SD tBMRWDMDpp5qPA7EYF/huqO9w6rgyP7UT+FZ0IK3blXs7/EZMiJ/Pk+U3FOoss62 7ywP2DZjTjMDKk9riBRBCCX+tf+3BXCfOinXqVI33l1jGyG1f0Y5bYpMC7af//wo /v9X88EhbNiy3LYD8RiknA936KGMtCJZDQVlPJMgyO6JJUNkTEJzbDXXgPItGcdU fLQISEaaVIm8RjCaTAixAPywiwqDBg== =NpGN -----END PGP SIGNATURE----- --o7qiMC3WpGcCdQpHm6f4ksauBgA6wOgoT-- From 1584044982260420001@xxx Tue Nov 14 12:36:55 +0000 2017 X-GM-THRID: 1583987213767022680 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread