* Ask for help on SPI slave side driver support @ 2013-09-29 16:23 YouShenghui 2013-09-29 23:20 ` Tomasz Figa 0 siblings, 1 reply; 8+ messages in thread From: YouShenghui @ 2013-09-29 16:23 UTC (permalink / raw) To: linux-samsung-soc; +Cc: linux-spi, youshenghui0322 Hi Samsung expert, I am working a project that need spi slave side driver support in smdk6410 in linux. I am connecting two 6410 board with spi bus, one side as master, the other as slave. Data is passed from one side to the other. I looked over spi related code in kernel and only find spi master support. I see http://www.spinics.net/lists/arm-kernel/msg73403.html that said there was already spi slave support in Samsungs current code. Could you give me a suggestion where I could find that code? I would like to port slave side support code to my code though it's not upstream yet. thanks ysh ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ask for help on SPI slave side driver support 2013-09-29 16:23 Ask for help on SPI slave side driver support YouShenghui @ 2013-09-29 23:20 ` Tomasz Figa 2013-09-30 5:38 ` YouShenghui 2013-09-30 9:33 ` Mark Brown 0 siblings, 2 replies; 8+ messages in thread From: Tomasz Figa @ 2013-09-29 23:20 UTC (permalink / raw) To: YouShenghui; +Cc: linux-samsung-soc, linux-spi, broonie Hi, [Ccing Mark Brown, maintainer of Linux SPI subsystem] On Monday 30 of September 2013 00:23:32 YouShenghui wrote: > Hi Samsung expert, > I am working a project that need spi slave side driver support in > smdk6410 in linux. I am connecting two 6410 board with spi bus, one > side as master, the other as slave. Data is passed from one side to the > other. I looked over spi related code in kernel and only find spi > master support. I see > http://www.spinics.net/lists/arm-kernel/msg73403.html that said there > was already spi slave support in Samsungs current code. Could you give > me a suggestion where I could find that code? I would like to port > slave side support code to my code though it's not upstream yet. Mark will probably know better, but AFAIK there is no API for slave mode SPI available in Linux kernel. Please correct me if I'm wrong. The code mentioned in the post from your link was some internal vendor code, which is unlikely to be available publicly. However support for slave mode from hardware side seems more or less similar to master mode, which means that assuming you can add some kernel API for it, the modification to the spi-s3c64xx wouldn't be too big. Best regards, Tomasz ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re:Re: Ask for help on SPI slave side driver support 2013-09-29 23:20 ` Tomasz Figa @ 2013-09-30 5:38 ` YouShenghui 2013-09-30 9:33 ` Mark Brown 1 sibling, 0 replies; 8+ messages in thread From: YouShenghui @ 2013-09-30 5:38 UTC (permalink / raw) To: Tomasz Figa; +Cc: linux-samsung-soc, linux-spi, broonie At 2013-09-30 07:20:42,"Tomasz Figa" <tomasz.figa@gmail.com> wrote: >Hi, > >[Ccing Mark Brown, maintainer of Linux SPI subsystem] > >On Monday 30 of September 2013 00:23:32 YouShenghui wrote: >> Hi Samsung expert, >> I am working a project that need spi slave side driver support in >> smdk6410 in linux. I am connecting two 6410 board with spi bus, one >> side as master, the other as slave. Data is passed from one side to the >> other. I looked over spi related code in kernel and only find spi >> master support. I see >> http://www.spinics.net/lists/arm-kernel/msg73403.html that said there >> was already spi slave support in Samsungs current code. Could you give >> me a suggestion where I could find that code? I would like to port >> slave side support code to my code though it's not upstre am yet. > >Mark will probably know better, but AFAIK there is no API for slave mode >SPI available in Linux kernel. Please correct me if I'm wrong. > >The code mentioned in the post from your link was some internal vendor >code, which is unlikely to be available publicly. However support for >slave mode from hardware side seems more or less similar to master mode, >which means that assuming you can add some kernel API for it, the >modification to the spi-s3c64xx wouldn't be too big. > >Best regards, >Tomasz > Thanks for your answer. Yes, It will not be a big patch. But I feel hard to add the support as a application developer so I want if they could send me a small patch to make it work. ysh ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ask for help on SPI slave side driver support 2013-09-29 23:20 ` Tomasz Figa 2013-09-30 5:38 ` YouShenghui @ 2013-09-30 9:33 ` Mark Brown [not found] ` <4cd52b0c.af8e.14184497bb9.Coremail.youshenghui0322@163.com> 1 sibling, 1 reply; 8+ messages in thread From: Mark Brown @ 2013-09-30 9:33 UTC (permalink / raw) To: Tomasz Figa; +Cc: YouShenghui, linux-samsung-soc, linux-spi [-- Attachment #1: Type: text/plain, Size: 928 bytes --] On Mon, Sep 30, 2013 at 01:20:42AM +0200, Tomasz Figa wrote: > Mark will probably know better, but AFAIK there is no API for slave mode > SPI available in Linux kernel. Please correct me if I'm wrong. That's correct. > The code mentioned in the post from your link was some internal vendor > code, which is unlikely to be available publicly. However support for > slave mode from hardware side seems more or less similar to master mode, > which means that assuming you can add some kernel API for it, the > modification to the spi-s3c64xx wouldn't be too big. There were some people working on slave mode (or at least talking about it) but I don't think they ever sent it. It'd probably just be the same as master mode but with transfers triggered from /CS instead of from driver action. The biggest trick would be making sure the transfer is running before the master actually starts sending data. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <4cd52b0c.af8e.14184497bb9.Coremail.youshenghui0322@163.com>]
* Re: Re: Ask for help on SPI slave side driver support [not found] ` <4cd52b0c.af8e.14184497bb9.Coremail.youshenghui0322@163.com> @ 2013-10-07 11:33 ` Mark Brown [not found] ` <4e8f3999.9132.141b335ef13.Coremail.youshenghui0322@163.com> 0 siblings, 1 reply; 8+ messages in thread From: Mark Brown @ 2013-10-07 11:33 UTC (permalink / raw) To: YouShenghui; +Cc: Tomasz Figa, linux-samsung-soc, linux-spi, jassi.brar [-- Attachment #1: Type: text/plain, Size: 1450 bytes --] On Sat, Oct 05, 2013 at 12:25:10AM +0800, YouShenghui wrote: > At 2013-09-30 17:33:17,"Mark Brown" <broonie@kernel.org> wrote: >On Mon, Sep 30, 2013 at 01:20:42AM +0200, Tomasz Figa wrote: > >> Mark will probably know better, but AFAIK there is no API for slave mode >> SPI available in Linux kernel. Please correct me if I'm wrong. > >That's correct. > >> The code mentioned in the post from your link was some internal vendor >> code, which is unlikely to be available publicly. However support for >> slave mode from hardware side seems more or less similar to master mode, >> which means that assuming you can add some kernel API for it, the >> modification to the spi-s3c64xx wouldn't be too big. > >There were some people working on slave mode (or at least talking about >it) but I don't think they ever sent it. It'd probably just be the same >as master mode but with transfers triggered from /CS instead of from >driver action. The biggest trick would be making sure the transfer is >running before the master actually starts sending data The formatting of your mail is really bad, I can barely read it. Please check the configuration of your mail program, there are some suggstions for common clients in Documentation/email-clients.txt. > Thanks for Mark for your answer. > But how could I trigger from /CS? Could I enable transfer in open syscall? I'd expect this to be done in-kernel, at least in the first instance. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <4e8f3999.9132.141b335ef13.Coremail.youshenghui0322@163.com>]
* Re: Re: Re: Ask for help on SPI slave side driver support [not found] ` <4e8f3999.9132.141b335ef13.Coremail.youshenghui0322@163.com> @ 2013-10-14 11:25 ` Mark Brown 2013-10-14 14:51 ` ysh 0 siblings, 1 reply; 8+ messages in thread From: Mark Brown @ 2013-10-14 11:25 UTC (permalink / raw) To: YouShenghui; +Cc: Tomasz Figa, linux-samsung-soc, linux-spi, jassi.brar [-- Attachment #1: Type: text/plain, Size: 913 bytes --] On Mon, Oct 14, 2013 at 03:05:58AM +0800, YouShenghui wrote: Please fix your mailer to word wrap within paragraphs, your messages are very hard to read. > Ok, I have one question when reading drivers/spi/spi-s3c64xx.c > In s3c64xx_spi_setup, cs->line(S3C64XX_GPC(3)) is set to GPIOF_OUT_INIT_HIGH, that means an general output pin. > But the other three(clk, mosi, miso) was set to 2 by s3c64xx_spi0_cfg_gpio. This is just what is needed by SPI. > My question is why wasn't cs->line also set to 2 to use SPI CS0? In common with many drivers this driver controls the chp select as a GPIO. Generally the hardware is less flexible than Linux can be if it implements automatic chip select handling at all. > When I want to use spi as slave side, should I set S3C64XX_GPC(3)'s cfg of to 0(input) or 2? I don't think the controller has any slave support natively so you'd probably need to put it into GPIO mode. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ask for help on SPI slave side driver support 2013-10-14 11:25 ` Mark Brown @ 2013-10-14 14:51 ` ysh 2013-10-14 16:24 ` Mark Brown 0 siblings, 1 reply; 8+ messages in thread From: ysh @ 2013-10-14 14:51 UTC (permalink / raw) To: Mark Brown; +Cc: Tomasz Figa, linux-samsung-soc, linux-spi, jassi.brar On 2013-10-14 19:25, Mark Brown wrote: > On Mon, Oct 14, 2013 at 03:05:58AM +0800, YouShenghui wrote: > > Please fix your mailer to word wrap within paragraphs, your messages are > very hard to read. > >> Ok, I have one question when reading drivers/spi/spi-s3c64xx.c >> In s3c64xx_spi_setup, cs->line(S3C64XX_GPC(3)) is set to GPIOF_OUT_INIT_HIGH, that means an general output pin. >> But the other three(clk, mosi, miso) was set to 2 by s3c64xx_spi0_cfg_gpio. This is just what is needed by SPI. >> My question is why wasn't cs->line also set to 2 to use SPI CS0? > > In common with many drivers this driver controls the chp select as a > GPIO. Generally the hardware is less flexible than Linux can be if it > implements automatic chip select handling at all. > >> When I want to use spi as slave side, should I set S3C64XX_GPC(3)'s cfg of to 0(input) or 2? > > I don't think the controller has any slave support natively so you'd > probably need to put it into GPIO mode. Got it, then what about the setting of clk, mosi, miso pin in slave mode? Do you mean I need to simulate spi slave side using four gpios? thanks zduan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ask for help on SPI slave side driver support 2013-10-14 14:51 ` ysh @ 2013-10-14 16:24 ` Mark Brown 0 siblings, 0 replies; 8+ messages in thread From: Mark Brown @ 2013-10-14 16:24 UTC (permalink / raw) To: ysh; +Cc: Tomasz Figa, linux-samsung-soc, linux-spi, jassi.brar [-- Attachment #1: Type: text/plain, Size: 359 bytes --] On Mon, Oct 14, 2013 at 10:51:06PM +0800, ysh wrote: > Got it, then what about the setting of clk, mosi, miso pin in slave mode? > Do you mean I need to simulate spi slave side using four gpios? Hrm, now I think about it clock is going to be a problem... you're probably stuck with bitbanging unless there's some controller support which won't be awesome. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-10-14 16:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-29 16:23 Ask for help on SPI slave side driver support YouShenghui
2013-09-29 23:20 ` Tomasz Figa
2013-09-30 5:38 ` YouShenghui
2013-09-30 9:33 ` Mark Brown
[not found] ` <4cd52b0c.af8e.14184497bb9.Coremail.youshenghui0322@163.com>
2013-10-07 11:33 ` Mark Brown
[not found] ` <4e8f3999.9132.141b335ef13.Coremail.youshenghui0322@163.com>
2013-10-14 11:25 ` Mark Brown
2013-10-14 14:51 ` ysh
2013-10-14 16:24 ` Mark Brown
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.