-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support for STM32 FMC NOR/PSRAM #44448
Initial support for STM32 FMC NOR/PSRAM #44448
Conversation
a710a75
to
1d16083
Compare
Thank you for your contribution ! At some point I wanted to start on the same task and bumped into the same questions. FMC in the first PR where it was introduced used linker sections to point to the correct adresses and allow the app to use data in a specific sdram. If we come to the use case of driving a display: Display drivers implementations use different interfaces, SPI, bitbang, FMC, LTDC... Some of them are shareable between architectures like SPI and bitbang, and others are device or familly specific (i.e. STM32). For all 8080 display drivers that we have today, we have to access some kind of databus between the LCD and the MCU. Who do we want to give the responsability of managing this databus ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of devicetree requests, otherwise no objections.
1d16083
to
e0cf2a1
Compare
e0cf2a1
to
a531426
Compare
@GeorgeCGV thank you! I've dropped my -1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, one minor nitpick
d70ff3d
to
c7925d6
Compare
Add defines to configure STM32 FMC NOR/PSRAM controller. Signed-off-by: Georgij Cernysiov <[email protected]>
Adds STM32 FMC NOR/PSRAM controller bindings. Signed-off-by: Georgij Cernysiov <[email protected]>
Adds STM32 FMC NOR/PSRAM controller driver. The implementation follows FMC SDRAM driver approach and uses HAL API. Tested on H7 series. Signed-off-by: Georgij Cernysiov <[email protected]>
c7925d6
to
1b14115
Compare
Dear @GeorgeCGV, I'm using FMC-BANK1 as the LCD memory bus address like ST did in stm32l562e_discovery's BSP. I'll therefore be able to provide support for FMC norsram for the stm32l5x when this is merged ! 😄 FMC definition for L5 series: -> dts/arm/st/l5/stm32l5.dtsi
FMC config for the L562E_DK: -> boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi
Enabling FMC: ->boards/arm/stm32l562e_dk/Kconfig.defconfig
And other ports on my st7789h2 driver to remove the init of the bitbang GPIO and replace the writing to GPIOs by writing at the FMC bank 1 address:
Writing to LCD pixel data ram is therefore just: ->drivers/display/display_st7789h2.c --> st7789h2_write(... , buffer)
Writing a register is also simplified to: -> drivers/display/display_st7789h2.c --> st7789h2_transmit(..., uint8_t cmd, uint8_t *tx_data, size_t tx_count)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, implementation performs correct init of the FMC in NOR/SRAM mode.
Though, drivers accessing the configured FMC-banks should define their address space because it's not provided by this implementation.
It is not possible to use this driver with STM32F103 SoCs. Apparently, the HAL code for these SoCs uses the old FSMC driver. Any suggestion on how to adapt the driver? |
@luispimo depending on how different it is. There is always a possibility to create f1 specific driver with a different compatibility label |
This PR extends existing #29686 and adds NOR/PSRAM controller.
The goal is to use an external display over the 8080 parallel interface.
The driver was tested using a custom H7 board with a modified #39335 driver.
The adapted display driver uses direct memory writes (for example,
*FMC_BANK2_REG = Reg; __DSB();
), whereFMC_BANK2_REG
is a definition of the SRAM bank address.Everything works but there are some questions:
dt-bindings
of FMC under one header as it is done in LL?