What is the expected meaning of CONFIG_SYS_NO_FLASH
Hi,
There is a bit of confusion at $dayjob about when CONFIG_SYS_NO_FLASH is used. Initially we thought that this meant I have no parallel NOR flash. So a board with only SPI flash would have CONFIG_SYS_NO_FLASH=1 and CONFIG_SPI_FLASH=1.
Is this understanding correct? I'd like to be able to add a blurb to README about how CONFIG_SYS_NO_FLASH should be used. Based on what I can tell from the code there seems to be a requirement that if !defined(CONFIG_SYS_NO_FLASH) something must implement flash_init(), flash_write(), etc as defined in include/flash.h. This could be a driver like cfi_flash.c or a board specific implementation.
Thanks,
Chris
Hi Chris,
Quoted 6 lines · Chris Packham
There is a bit of confusion at $dayjob about when
CONFIG_SYS_NO_FLASHis used. Initially we thought that this meant I have no parallel NOR flash. So a board with only SPI flash would haveCONFIG_SYS_NO_FLASH=1andCONFIG_SPI_FLASH=1.Is this understanding correct?
Yes. CONFIG_SYS_NO_FLASH dates back to a time when only parallel NOR flash (like CFI NOR) was available. And it definitely is now confusing at least. Perhaps it would be good to rename it to CONFIG_SYS_NO_PARALLEL_FLASH now.
Quoted 2 lines
I'd like to be able to add a blurb to
README about howCONFIG_SYS_NO_FLASHshould be used.
Thanks, that would be helpful.
Quoted 5 lines
Based on what I
can tell from the code there seems to be a requirement that if !defined(CONFIG_SYS_NO_FLASH) something must implementflash_init(),flash_write(), etc as defined ininclude/flash.h. This could be a driver likecfi_flash.cor a board specific implementation.
Yes, this seems to be a correct assumption.
Thanks,
Stefan
RFC PATCH 1/1 README: Describe CONFIG_SYS_NO_FLASH
Unlike most configuration options defining this actually disables support for a feature (parallel flash). Eventually the logic behind this should probably be flipped so that '#ifndef CONFIG_SYS_NO_FLASH' becomes '#ifdef CONFIG_HAS_PARALLEL_FLASH' but for now lets document the existing behaviour.
---
So this is my attempt to describe (my understanding of) how this option should be used. Any suggestions for improvement are most welcome.
README | 13 +++++++++++++ 1 file changed, 13 insertions(+)
README +13 -0
@@ -3037,6 +3037,19 @@ CBFS (Coreboot Filesystem) support this is instead controlled by the value of /config/load-environment. +- Parallel Flash support: + CONFIG_SYS_NO_FLASH + + Traditionally U-boot was run on systems with parallel NOR + flash. This option is used to disable support for parallel NOR + flash. This option should be defined if the board does not have + parallel flash. + + If this option is not defined one of the generic flash drivers + (e.g. CONFIG_FLASH_CFI_DRIVER or CONFIG_ST_SMI) must be + selected or the board must provide an implementation of the + flash API (see include/flash.h). + - DataFlash Support: CONFIG_HAS_DATAFLASH
Signature · 1 line
2.3.5
RFC PATCH 1/1 README: Describe CONFIG_SYS_NO_FLASH
Quoted 4 lines · Chris Packham
Unlike most configuration options defining this actually disables support for a feature (parallel flash). Eventually the logic behind this should probably be flipped so that '#ifndef
CONFIG_SYS_NO_FLASH' becomes '#ifdefCONFIG_HAS_PARALLEL_FLASH'
Yes, this should be the ultimate goal. But definitely a quite complex task.
Quoted 2 lines
but for now lets document the
existing behaviour.
Ack.
Quoted 1 line
Signed-off-by Chris Packham <[email protected]>
Thanks,
Stefan