[-- 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 --]
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
[-- 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 --]