kconfig: Make FLASH_LOAD_OFFSET/SIZE non-configurable when DT is used

Having FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE always configurable froze
their values at 0 when BOOTLOADER_MCUBOOT was enabled in menuconfig,
when instead the values from /chosen/zephyr,code-partition in devicetree
should be used. BOOTLOADER_MCUBOOT selects USE_CODE_PARTITION, which is
a flag to use the devicetree information.

To fix it, only make FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE configurable
when USE_CODE_PARTITION is disabled. It looks like no configuration
files set them at the moment.

See the added documentation in
https://github.com/zephyrproject-rtos/zephyr/pull/20722 for an
explanation of why this happens. This bit novalisek in
https://github.com/zephyrproject-rtos/zephyr/issues/20673.

Fixes: #20673

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-11-16 01:03:25 +01:00 committed by Anas Nashif
parent 7c8421c2fd
commit 9cdb6f4033

View file

@ -95,7 +95,8 @@ config USE_CODE_PARTITION
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
config FLASH_LOAD_OFFSET
hex "Kernel load offset"
# Only user-configurable when USE_CODE_PARTITION is disabled
hex "Kernel load offset" if !USE_CODE_PARTITION
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_CODE_PARTITION
default 0
depends on HAS_FLASH_LOAD_OFFSET
@ -108,7 +109,8 @@ config FLASH_LOAD_OFFSET
If unsure, leave at the default value 0.
config FLASH_LOAD_SIZE
hex "Kernel load size"
# Only user-configurable when USE_CODE_PARTITION is disabled
hex "Kernel load size" if !USE_CODE_PARTITION
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_CODE_PARTITION
default 0
depends on HAS_FLASH_LOAD_OFFSET