Hi,
the naming may need to change but otherwise, this is intended.
The main deciding factor for this change is always board's linker script
- it has a final say for data placement and if it places .rodata into
appropriate location in flash and makes sure pointers are adjusted to
point into corresponding memory-mapped area of data address space,
everything should work - even if this patch isn't merged.
The purpose of the configuration options is to allow the linker script
to be customizable, ie. to allow configuring the size of .rodata section
and optionally the size of its offset from flash end. If the board
selects AVR_BOARD_HAS_FLMAP, it declares that its linker script will
respond to sizes set in the .config and act accordingly.
Additional configuration option - AVR_CHIP_HAS_FLMAP - denotes chips
that actually support this memory mapping. Only if both
AVR_BOARD_HAS_FLMAP and AVR_CHIP_HAS_FLMAP are selected, the Kconfig
unlocks the "Use memory-mapped access to flash" choice and allows the
sizes to be set. Strictly speaking, this option could be removed and
make everything depend solely on AVR_BOARD_HAS_FLMAP - it is meant to be
a safeguard for the most part. It can be renamed to ARCH_HAVE_FLMAP too,
if that is preferable.
Best regards
On 2025-07-07 13:53, Alan C. Assis wrote:
Nice work KR and great Documentation! Kudos
BTW, I added a comment about using AVR_BOARD_HAS_FLMAP vs
ARCH_HAVE_FLMAP.
BR,
Alan