drivers: mipi_dbi: stm32: fmc: add bank address property #93361
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The driver gets the FMC bank address using the
FMC_BANK1_<parent_register_value>
macro.This approach has some flaws:
STM32_FMC_NORSRAM_BANK3
maps toFMC_BANK1_5
, instead ofFMC_BANK1_3
,STM32_FMC_NORSRAM_BANK4
toFMC_BANK1_7
. It works for existing boards only because they define the bank asSTM32_FMC_NORSRAM_BANK1
, which has a value of0
, and we get the desiredFMC_BANK1_1
in the driver.FMC_BANK1_x
macros.To address this, an optional
bank-address
property is added, providing a direct way to define the FMC bank address for the driver. If the property is undefined, then the original behavior is used.Another approach could be to define missing
FMC_BANK1_x
base address macros; however, it seems like the majority of recent families don't have them. Also, we would need to move away from using the bank'sreg
for the macro construction, and account for possible bank remaps (some families).However, this PR doesn't fix the 1st issue. It is more like a workaround for both problems.
Does someone have a better idea how to handle that?