From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1429776AbdDYKcY (ORCPT ); Tue, 25 Apr 2017 06:32:24 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:59070 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1429733AbdDYKbv (ORCPT ); Tue, 25 Apr 2017 06:31:51 -0400 Date: Tue, 25 Apr 2017 11:31:13 +0100 From: Mark Brown To: Geert Uytterhoeven Cc: Jiada Wang , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Fabio Estevam , linux-spi , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Message-ID: <20170425103113.lxpwoq6sbxvg3ihl@sirena.org.uk> References: <1492085644-4195-1-git-send-email-jiada_wang@mentor.com> <20170413125929.dygodgj6c35ydh5p@sirena.org.uk> <58F06092.9080409@mentor.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lyxm4mylxjgwr253" Content-Disposition: inline In-Reply-To: X-Cookie: To err is human, to moo bovine. User-Agent: NeoMutt/20170306 (1.8.0) X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH RFC 0/5] *** SPI Slave mode support *** X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lyxm4mylxjgwr253 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 24, 2017 at 12:55:21PM +0200, Geert Uytterhoeven wrote: > On Fri, Apr 14, 2017 at 7:39 AM, Jiada Wang wrote: > > Our use case is to use spidev as an interface to communicate with external > > SPI master devices. > > meanwhile the SPI bus controller can also act as master device to send data > > to other > > SPI slave devices on the board. > That sounds a bit hackish to me. SPI was never meant to be a multi-master bus. > While it can be done, you will need external synchronization (signals) to > avoid conflicts between the SPI masters. > > I found in your implementation, SPI bus controller is limited to either work > > in master mode or > > slave mode, is there any reasoning to not configure SPI mode based on SPI > > devices use case? > If you really need both master and slave support, you can use 2 subnodes > in DT, the first representing the master, the second the slave. > Mark, what's your opinion about this? That sounds like a mess... we *could* put the slave flag on the device rather than the controller I guess but there's also going to need to be something representing whatever avoids collisions on the bus somewhere. --lyxm4mylxjgwr253 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlj/JXEACgkQJNaLcl1U h9D3xAf/atRUjYimqLCfoOcqGSAoGXE4qnLqiwKNjC1y70Yed/AsQYlmgSVHaFzR 7vDGhyqODzLdoc90Aypu9cfzVk1wc2sNRdNcN8xbGIc0inn/FoI5yIA5ZO559EdK A1IjZRgH8OtJjnAE/qKL2u90WdTXtHPApOek7fDcCEycc7Reebvu/+DuzKamypBz 00wB22HLjkQCwcwVAn7xtlAwK4Nl/lUU38hkx4cK+aV965qNMpuu+hUGzS398Q6m Owm5iCmr9wTz29+mEBMH65juTZ8ItFr/u3jqf1zTso84Xr8j4HvTEqAsBCHwJJDH lkCJ3mMbyXDt7lDhyVUMvy6ybXtHwQ== =mJ/U -----END PGP SIGNATURE----- --lyxm4mylxjgwr253-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH RFC 0/5] *** SPI Slave mode support *** Date: Tue, 25 Apr 2017 11:31:13 +0100 Message-ID: <20170425103113.lxpwoq6sbxvg3ihl@sirena.org.uk> References: <1492085644-4195-1-git-send-email-jiada_wang@mentor.com> <20170413125929.dygodgj6c35ydh5p@sirena.org.uk> <58F06092.9080409@mentor.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lyxm4mylxjgwr253" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Geert Uytterhoeven Cc: Jiada Wang , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Fabio Estevam , linux-spi , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: devicetree@vger.kernel.org --lyxm4mylxjgwr253 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 24, 2017 at 12:55:21PM +0200, Geert Uytterhoeven wrote: > On Fri, Apr 14, 2017 at 7:39 AM, Jiada Wang wrote: > > Our use case is to use spidev as an interface to communicate with external > > SPI master devices. > > meanwhile the SPI bus controller can also act as master device to send data > > to other > > SPI slave devices on the board. > That sounds a bit hackish to me. SPI was never meant to be a multi-master bus. > While it can be done, you will need external synchronization (signals) to > avoid conflicts between the SPI masters. > > I found in your implementation, SPI bus controller is limited to either work > > in master mode or > > slave mode, is there any reasoning to not configure SPI mode based on SPI > > devices use case? > If you really need both master and slave support, you can use 2 subnodes > in DT, the first representing the master, the second the slave. > Mark, what's your opinion about this? That sounds like a mess... we *could* put the slave flag on the device rather than the controller I guess but there's also going to need to be something representing whatever avoids collisions on the bus somewhere. --lyxm4mylxjgwr253 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlj/JXEACgkQJNaLcl1U h9D3xAf/atRUjYimqLCfoOcqGSAoGXE4qnLqiwKNjC1y70Yed/AsQYlmgSVHaFzR 7vDGhyqODzLdoc90Aypu9cfzVk1wc2sNRdNcN8xbGIc0inn/FoI5yIA5ZO559EdK A1IjZRgH8OtJjnAE/qKL2u90WdTXtHPApOek7fDcCEycc7Reebvu/+DuzKamypBz 00wB22HLjkQCwcwVAn7xtlAwK4Nl/lUU38hkx4cK+aV965qNMpuu+hUGzS398Q6m Owm5iCmr9wTz29+mEBMH65juTZ8ItFr/u3jqf1zTso84Xr8j4HvTEqAsBCHwJJDH lkCJ3mMbyXDt7lDhyVUMvy6ybXtHwQ== =mJ/U -----END PGP SIGNATURE----- --lyxm4mylxjgwr253-- -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: broonie@kernel.org (Mark Brown) Date: Tue, 25 Apr 2017 11:31:13 +0100 Subject: [PATCH RFC 0/5] *** SPI Slave mode support *** In-Reply-To: References: <1492085644-4195-1-git-send-email-jiada_wang@mentor.com> <20170413125929.dygodgj6c35ydh5p@sirena.org.uk> <58F06092.9080409@mentor.com> Message-ID: <20170425103113.lxpwoq6sbxvg3ihl@sirena.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, Apr 24, 2017 at 12:55:21PM +0200, Geert Uytterhoeven wrote: > On Fri, Apr 14, 2017 at 7:39 AM, Jiada Wang wrote: > > Our use case is to use spidev as an interface to communicate with external > > SPI master devices. > > meanwhile the SPI bus controller can also act as master device to send data > > to other > > SPI slave devices on the board. > That sounds a bit hackish to me. SPI was never meant to be a multi-master bus. > While it can be done, you will need external synchronization (signals) to > avoid conflicts between the SPI masters. > > I found in your implementation, SPI bus controller is limited to either work > > in master mode or > > slave mode, is there any reasoning to not configure SPI mode based on SPI > > devices use case? > If you really need both master and slave support, you can use 2 subnodes > in DT, the first representing the master, the second the slave. > Mark, what's your opinion about this? That sounds like a mess... we *could* put the slave flag on the device rather than the controller I guess but there's also going to need to be something representing whatever avoids collisions on the bus somewhere. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: