From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1176223AbdDYH4f (ORCPT ); Tue, 25 Apr 2017 03:56:35 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:60244 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S943248AbdDYH42 (ORCPT ); Tue, 25 Apr 2017 03:56:28 -0400 Message-ID: <58FF0127.7070703@mentor.com> Date: Tue, 25 Apr 2017 00:56:23 -0700 From: Jiada Wang User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120411 Thunderbird/11.0.1 MIME-Version: 1.0 To: Geert Uytterhoeven CC: Mark Brown , 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" Subject: Re: [PATCH RFC 0/5] *** SPI Slave mode support *** References: <1492085644-4195-1-git-send-email-jiada_wang@mentor.com> <20170413125929.dygodgj6c35ydh5p@sirena.org.uk> <58F06092.9080409@mentor.com> <58FDF430.5090306@mentor.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert On 04/24/2017 06:10 AM, Geert Uytterhoeven wrote: > Hi Jiada, > > On Mon, Apr 24, 2017 at 2:48 PM, Jiada Wang wrote: >> On 04/24/2017 03:55 AM, Geert Uytterhoeven wrote: >>> On Fri, Apr 14, 2017 at 7:39 AM, Jiada Wang wrote: >>>> On 04/13/2017 12:47 PM, Geert Uytterhoeven wrote: >>>>> On Thu, Apr 13, 2017 at 2:59 PM, Mark Brown wrote: >>>>>> On Thu, Apr 13, 2017 at 05:13:59AM -0700, jiada_wang@mentor.com wrote: >>>>>>> From: Jiada Wang >>>>>>> >>>>>>> v1: >>>>>>> add Slave mode support in SPI core >>>>>>> spidev create slave device when SPI controller work in slave mode >>>>>>> spi-imx support to work in slave mode >>>>>> Adding Geert who also had a series doing this in progress that was >>>>>> getting very near to being merged. >>>>> Thank you! >>>>> >>>>> Actually my plan is to fix the last remaining issues and resubmit for >>>>> v4.13. >>>> I noticed your patch set for SPI slave support, >>>> (I am sure you can find out some of the change >>>> in this patch set is based on your work). >>>> we have similar requirement to add slave mode support to ecspi IP on imx6 >>>> Soc. >>>> >>>> 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. >> It doesn't need to be a multi-master bus, >> for example A is master device for slave device B. >> while B has its own slave device C >> for each SPI connection A<=> B, and B<=> C, there is only one master >> device. >> >> and I think from use case point of view, it's very normal, >> one CPU upon receives command from external SPI master device, >> it writes data to its own slave device (EEPROM) connected to it. > So "A<=> B" and "B<=> C" are two distinct SPI buses? > Or do they share some signals? > > Your comment seems to suggest otherwise: the use case of "A (master) <=> B (slave)", "B (master) <=> C(slave)", do share MISO and MOSI lines, but there is no SS line between A and C. so for each SPI slave device, there is only one master device. so I think the question becomes whether the above mentioned hardware setup is valid or not. Thanks, Jiada >>>> 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 they are distinct, it should work. Then B has two SPI controllers: one slave > controller controlled by A, and one master controller to control C. > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiada Wang Subject: Re: [PATCH RFC 0/5] *** SPI Slave mode support *** Date: Tue, 25 Apr 2017 00:56:23 -0700 Message-ID: <58FF0127.7070703@mentor.com> References: <1492085644-4195-1-git-send-email-jiada_wang@mentor.com> <20170413125929.dygodgj6c35ydh5p@sirena.org.uk> <58F06092.9080409@mentor.com> <58FDF430.5090306@mentor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Geert Uytterhoeven Cc: Mark Brown , 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 Hi Geert On 04/24/2017 06:10 AM, Geert Uytterhoeven wrote: > Hi Jiada, > > On Mon, Apr 24, 2017 at 2:48 PM, Jiada Wang wrote: >> On 04/24/2017 03:55 AM, Geert Uytterhoeven wrote: >>> On Fri, Apr 14, 2017 at 7:39 AM, Jiada Wang wrote: >>>> On 04/13/2017 12:47 PM, Geert Uytterhoeven wrote: >>>>> On Thu, Apr 13, 2017 at 2:59 PM, Mark Brown wrote: >>>>>> On Thu, Apr 13, 2017 at 05:13:59AM -0700, jiada_wang-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org wrote: >>>>>>> From: Jiada Wang >>>>>>> >>>>>>> v1: >>>>>>> add Slave mode support in SPI core >>>>>>> spidev create slave device when SPI controller work in slave mode >>>>>>> spi-imx support to work in slave mode >>>>>> Adding Geert who also had a series doing this in progress that was >>>>>> getting very near to being merged. >>>>> Thank you! >>>>> >>>>> Actually my plan is to fix the last remaining issues and resubmit for >>>>> v4.13. >>>> I noticed your patch set for SPI slave support, >>>> (I am sure you can find out some of the change >>>> in this patch set is based on your work). >>>> we have similar requirement to add slave mode support to ecspi IP on imx6 >>>> Soc. >>>> >>>> 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. >> It doesn't need to be a multi-master bus, >> for example A is master device for slave device B. >> while B has its own slave device C >> for each SPI connection A<=> B, and B<=> C, there is only one master >> device. >> >> and I think from use case point of view, it's very normal, >> one CPU upon receives command from external SPI master device, >> it writes data to its own slave device (EEPROM) connected to it. > So "A<=> B" and "B<=> C" are two distinct SPI buses? > Or do they share some signals? > > Your comment seems to suggest otherwise: the use case of "A (master) <=> B (slave)", "B (master) <=> C(slave)", do share MISO and MOSI lines, but there is no SS line between A and C. so for each SPI slave device, there is only one master device. so I think the question becomes whether the above mentioned hardware setup is valid or not. Thanks, Jiada >>>> 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 they are distinct, it should work. Then B has two SPI controllers: one slave > controller controlled by A, and one master controller to control C. > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds -- 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: jiada_wang@mentor.com (Jiada Wang) Date: Tue, 25 Apr 2017 00:56:23 -0700 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> <58FDF430.5090306@mentor.com> Message-ID: <58FF0127.7070703@mentor.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Geert On 04/24/2017 06:10 AM, Geert Uytterhoeven wrote: > Hi Jiada, > > On Mon, Apr 24, 2017 at 2:48 PM, Jiada Wang wrote: >> On 04/24/2017 03:55 AM, Geert Uytterhoeven wrote: >>> On Fri, Apr 14, 2017 at 7:39 AM, Jiada Wang wrote: >>>> On 04/13/2017 12:47 PM, Geert Uytterhoeven wrote: >>>>> On Thu, Apr 13, 2017 at 2:59 PM, Mark Brown wrote: >>>>>> On Thu, Apr 13, 2017 at 05:13:59AM -0700, jiada_wang at mentor.com wrote: >>>>>>> From: Jiada Wang >>>>>>> >>>>>>> v1: >>>>>>> add Slave mode support in SPI core >>>>>>> spidev create slave device when SPI controller work in slave mode >>>>>>> spi-imx support to work in slave mode >>>>>> Adding Geert who also had a series doing this in progress that was >>>>>> getting very near to being merged. >>>>> Thank you! >>>>> >>>>> Actually my plan is to fix the last remaining issues and resubmit for >>>>> v4.13. >>>> I noticed your patch set for SPI slave support, >>>> (I am sure you can find out some of the change >>>> in this patch set is based on your work). >>>> we have similar requirement to add slave mode support to ecspi IP on imx6 >>>> Soc. >>>> >>>> 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. >> It doesn't need to be a multi-master bus, >> for example A is master device for slave device B. >> while B has its own slave device C >> for each SPI connection A<=> B, and B<=> C, there is only one master >> device. >> >> and I think from use case point of view, it's very normal, >> one CPU upon receives command from external SPI master device, >> it writes data to its own slave device (EEPROM) connected to it. > So "A<=> B" and "B<=> C" are two distinct SPI buses? > Or do they share some signals? > > Your comment seems to suggest otherwise: the use case of "A (master) <=> B (slave)", "B (master) <=> C(slave)", do share MISO and MOSI lines, but there is no SS line between A and C. so for each SPI slave device, there is only one master device. so I think the question becomes whether the above mentioned hardware setup is valid or not. Thanks, Jiada >>>> 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 they are distinct, it should work. Then B has two SPI controllers: one slave > controller controlled by A, and one master controller to control C. > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds