Skip to content

Conversation

@FRASTM
Copy link
Contributor

@FRASTM FRASTM commented Sep 28, 2021

This changes introduces a new property to the DTS of the stm32 spi to configure the Frame Format.
Some STM32 devices, have a SPI interface which is compatible with the TI protocol. The FRF bit of the SPIx_CR2 register can be used to configure the SPI to be compliant with this protocol.
By default the frame format is motorola Mode.

To configure the TI mode, the dts should include the property as follows:

&spi1 {
	frame-format;
};

Fixes #38683

Signed-off-by: Francois Ramu [email protected]

If supported by the SPI instance and soc, this property will
configure the frame-format to be compliant with the TI mode.
By default, if supported, the frame-format is Motorola mode.

Signed-off-by: Francois Ramu <[email protected]>
Depending of the soc and SPI peripheral, the Frame-Format of the
SPI can be configured to support TI or Motorola protocol.
This is configured through a new DTS property.

Signed-off-by: Francois Ramu <[email protected]>
@github-actions github-actions bot added area: Devicetree area: Devicetree Binding PR modifies or adds a Device Tree binding area: SPI SPI bus platform: STM32 ST Micro STM32 labels Sep 28, 2021
@erwango erwango added this to the v3.0.0 milestone Sep 28, 2021
Copy link
Contributor

@avisconti avisconti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
(I assume the answer to my question is "yes")

false: SPI Motorola mode (default)
true: SPI TI mode
pinctrl-0:
Copy link
Contributor

@avisconti avisconti Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default is "false" for booleans, right?

Copy link
Contributor

@simonguinot simonguinot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that adding the DT frame-format property to a SPI node fixes the MOSI signal issue for my test case.

In addition the patches are looking good to me.

Thanks @FRASTM.

@cfriedt cfriedt merged commit d563313 into zephyrproject-rtos:main Sep 29, 2021
@erwango
Copy link
Member

erwango commented Sep 30, 2021

@cfriedt, I think we've been too fast on this. It wasn't approved (nor reviewed) by any of the maintainers.

Would you mind to revert ?
Since we're introducing a new SPI configuration bit, it might be worse discussing with @tbursztyka if this should be expanded to other devices.
Also, I think that frame-format property name should be reviewed, as it's not meaningful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree area: SPI SPI bus platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stm32g0b1: spi: MOSI signal goes high before and after transmitting data

5 participants