openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* AST2600: Linux driver support for SPI controller
@ 2021-07-19 13:02 VINOTHKUMAR RK
  2021-07-19 16:32 ` Milton Miller II
  2021-07-19 18:38 ` Patrick Williams
  0 siblings, 2 replies; 3+ messages in thread
From: VINOTHKUMAR RK @ 2021-07-19 13:02 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

Hello all,

This is regarding SPI controller driver support in OpenBMC.
Here is the scenario: Three devices connected *over same SPI controller* as
mentioned below:

Firmware SPI Memory Controller (BSPI): (0x1E620000):
    - Flash 0 (CS0)
    - Flash 1 (CS1)
    - MCU/CPLD (CS2)

When I look at the OpenBMC Linux repository, I could find 'aspeed-smc.c'
driver under the MTD subsystem, so this seems to work only for flash
devices.

Do we've any other driver support or a solution to handle all the three
devices? Any help/suggestions would be appreciated.


Regards,
Vinoth Kumar RK

[-- Attachment #2: Type: text/html, Size: 880 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:  AST2600: Linux driver support for SPI controller
  2021-07-19 13:02 AST2600: Linux driver support for SPI controller VINOTHKUMAR RK
@ 2021-07-19 16:32 ` Milton Miller II
  2021-07-19 18:38 ` Patrick Williams
  1 sibling, 0 replies; 3+ messages in thread
From: Milton Miller II @ 2021-07-19 16:32 UTC (permalink / raw)
  To: VINOTHKUMAR RK; +Cc: openbmc

On July 19, 2021,  VINOTHKUMAR RK wrote:
>Hello all,
>
>This is regarding SPI controller driver support in OpenBMC.
>Here is the scenario: Three devices connected over same SPI
>controller as mentioned below:
>
>Firmware SPI Memory Controller (BSPI): (0x1E620000):
>    - Flash 0 (CS0)
>    - Flash 1 (CS1)
>    - MCU/CPLD (CS2)
>
>When I look at the OpenBMC Linux repository, I could find
>'aspeed-smc.c' driver under the MTD subsystem, so this seems to work
>only for flash devices.
>
>Do we've any other driver support or a solution to handle all the
>three devices? Any help/suggestions would be appreciated.

I was involved with the driver you found before Cedric took it 
over.

I am not aware of anyone writing a generic SPI acccess driver.   
The hardwaredoes have a user mode that does not auto-sequence, but 
as I remember its limited in that it can not read and write data 
at the same time and is limited to transfers that are multiples of 
a byte.

If your MCU/CPLD can live with these limitations then you or 
someone can integrate a spi layer driver into the current 
driver.

Note on the 2600 the hardware for the host is the same as the 
hardware for the BMC.  It may be easier to develop spi mode on 
that port because it could be developed while running with the 
BMC from existing driver.  Alternatively it could be developed 
on a system that runs on eMMC.

Milton


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AST2600: Linux driver support for SPI controller
  2021-07-19 13:02 AST2600: Linux driver support for SPI controller VINOTHKUMAR RK
  2021-07-19 16:32 ` Milton Miller II
@ 2021-07-19 18:38 ` Patrick Williams
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick Williams @ 2021-07-19 18:38 UTC (permalink / raw)
  To: VINOTHKUMAR RK; +Cc: openbmc

[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]

On Mon, Jul 19, 2021 at 06:32:34PM +0530, VINOTHKUMAR RK wrote:
> This is regarding SPI controller driver support in OpenBMC.
> Here is the scenario: Three devices connected *over same SPI controller* as
> mentioned below:
> 
> Firmware SPI Memory Controller (BSPI): (0x1E620000):
>     - Flash 0 (CS0)
>     - Flash 1 (CS1)
>     - MCU/CPLD (CS2)

I would strongly recommend splitting your hardware design so that the MCU/CPLD
is on another SPI bus.  The aspeed-smc driver doesn't currently support using it
for other devices and I think it would be fairly difficult to do so.  There are
patches available for using the other two SPI engines if they are not already
upstream though and those patches use the more generic SPI subsystem.

The AST2xxx hardware is fairly limited in SPI traffic though, so you will need
to analyze your MCU/CPLD protocol and determine if the hardware can even deal
with your protocol.  There is a single byte FIFO and the hardware only allows a
read *or* write byte per 8 clock cycle.  Thus, even though SPI is a
bi-directional bus, the hardware available in the AST2xxx doesn't allow it.

> Do we've any other driver support or a solution to handle all the three
> devices? Any help/suggestions would be appreciated.

We have had a few devices where this was not sufficient for the protocol that
those devices exposed and we had to revert to using the spi-gpio driver.  This
is another reason why it is much easier if you split that hardware off from your
BMC's flash device.

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-19 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19 13:02 AST2600: Linux driver support for SPI controller VINOTHKUMAR RK
2021-07-19 16:32 ` Milton Miller II
2021-07-19 18:38 ` Patrick Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).