Skip to content

Conversation

@FRASTM
Copy link
Contributor

@FRASTM FRASTM commented May 17, 2022

This PR adds the support of the octoSPI bus for the stm32H7 devices
It updates the ospi flash controller driver
It also adds the OSPI instances to the stm32H7 mcus and boards

Not that DMA transfer is not yet in. There is no DMAMUX request for the octospi, only MDMA req 0x16, but the periph is not yet in.

requires the #45487

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

@FRASTM
Copy link
Contributor Author

FRASTM commented Jun 20, 2022

rebase and fix merge conflicts

@FRASTM FRASTM force-pushed the ospi_h7 branch 2 times, most recently from d66ce54 to 31ff107 Compare June 20, 2022 15:25
@FRASTM FRASTM requested a review from carlescufi as a code owner June 20, 2022 15:25
@FRASTM
Copy link
Contributor Author

FRASTM commented Jun 22, 2022

tested on the stm32h735g_disco with west build -p auto -b stm32h735g_disco samples/drivers/spi_flash


*** Booting Zephyr OS build zephyr-v3.1.0-589-ge9bd6e5b4bee  ***
JEDEC OSPI-NOR SPI flash testing                                            
==========================  
Test 1: Flash erase       
Flash erase succeeded! 

Test 2: Flash write
Attempting to write 4 bytes
Data read matches data written. Good!! 

@FRASTM FRASTM added the DNM This PR should not be merged (Do Not Merge) label Jun 24, 2022
@FRASTM
Copy link
Contributor Author

FRASTM commented Jun 28, 2022

rebase after merge of #46842
Align on the #46703 to define the alternate clock source in the DTS of the soc for each octospi peripheral to be pll1_q
The default clock source (0) for the octospi is not the PCLK1 (but rcc_hclk3) so it must be defined explicitly.

@FRASTM FRASTM removed the DNM This PR should not be merged (Do Not Merge) label Jun 28, 2022
@FRASTM FRASTM force-pushed the ospi_h7 branch 2 times, most recently from f695b2b to 23a955d Compare June 28, 2022 13:12
@carlescufi carlescufi requested review from GeorgeCGV and erwango July 1, 2022 14:21
@carlescufi
Copy link
Member

@manoj153 please revisit

GeorgeCGV
GeorgeCGV previously approved these changes Jul 7, 2022
Copy link
Contributor

@GeorgeCGV GeorgeCGV left a comment

Choose a reason for hiding this comment

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

LGTM

FRASTM added 7 commits July 19, 2022 17:46
With the introduction of the OSPI NOR flash controller
the stm32H7 serie requires the HAL MDMA in anycase.

Signed-off-by: Francois Ramu <[email protected]>
For the stm32h7x3 and stm32h7x5 there is a octospi
clock configuration in the D1CCIPR register

Signed-off-by: Francois Ramu <[email protected]>
Add the octospi nodes to the stm32h723/h725
and h730/h733/h735 devices.
Note that RM0468 gives a size of 1kB.
The definition of the octospi clock source for both intances
is given by the DTS node. The selected value for
the alternate clock control is the PLL1_Q.

Signed-off-by: Francois Ramu <[email protected]>
This commit enables the octo SPI peripheral to the flash-nor
on the target board stm32h735g_disco from STMicroelectronics.
The octospi1 is connected to the NOR- octo-flash through
the OSPI IO Manager.
Note that JESD16 requires 9 dwords for the sdfp table.
The NOR octoflash is MX25LM51245 or compatible.

Signed-off-by: Francois Ramu <[email protected]>
Add the octospi nodes to the stm32h7A3 and
and h7B0/h7B3 devices.
Note that RM0455 gives a size of 1kB.
The definition of the octospi clock source for both intances
is given by the DTS node. The selected value for
the alternate clock control is the PLL1_Q.

Signed-off-by: Francois Ramu <[email protected]>
This commit enables the octo SPI peripheral to the flash-nor
on the target board stm32h7b3i_dk from STMicroelectronics.
The octospi1 is connected to the NOR- octo-flash through
the OSPI IO Manager.
Note that JESD16 requires 9 dwords for the sdfp table.
The NOR octoflash is MX25LM51245 or compatible.

Signed-off-by: Francois Ramu <[email protected]>
This add a removes the SPI config
for the stm32H735 and stm32H7b3 disco boards
when testing the octoSPI.

Signed-off-by: Francois Ramu <[email protected]>
@FRASTM
Copy link
Contributor Author

FRASTM commented Jul 19, 2022

rebase on 6027152
remove unused OSPI_CLK_SRC definition

Copy link
Contributor

@GeorgeCGV GeorgeCGV left a comment

Choose a reason for hiding this comment

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

LGTM

@FRASTM FRASTM requested a review from erwango July 22, 2022 07:15

mx25lm51245: ospi-nor-flash@0 {
compatible = "st,stm32-ospi-nor";
label = "MX25LM51245";
Copy link
Member

@fabiobaltieri fabiobaltieri Jul 25, 2022

Choose a reason for hiding this comment

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

Label properties are being wiped out all over from the repository, #47881 wiped them from this binding. Can you drop them from here as well? (and I'd say from the st,stm32-ospi nodes as well)

@carlescufi carlescufi merged commit 8aa3960 into zephyrproject-rtos:main Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants