From 3c5df36ddac3b5137bc8c770fbe1228b8b6f509e Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Fri, 9 Aug 2024 15:33:18 -0500 Subject: [PATCH] soc: nxp: Move flexspi log level change to driver Single point of control over this kconfig's effect. Signed-off-by: Declan Snyder --- drivers/flash/Kconfig.mcux | 5 +++++ drivers/memc/Kconfig.mcux | 5 +++++ soc/nxp/imxrt/Kconfig.defconfig | 13 ------------ soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig | 13 ------------ soc/nxp/mcx/Kconfig | 25 ------------------------ soc/nxp/mcx/Kconfig.defconfig | 13 ++---------- soc/nxp/rw/Kconfig.defconfig | 9 --------- 7 files changed, 12 insertions(+), 71 deletions(-) diff --git a/drivers/flash/Kconfig.mcux b/drivers/flash/Kconfig.mcux index 7b3df836107..22695bece12 100644 --- a/drivers/flash/Kconfig.mcux +++ b/drivers/flash/Kconfig.mcux @@ -106,4 +106,9 @@ config FLASH_MCUX_FLEXSPI_HYPERFLASH_WRITE_BUFFER This prevents faults when the data to write would be located on the flash itself. +# Avoid RWW hazards by defaulting logging to disabled +choice FLASH_LOG_LEVEL_CHOICE + default FLASH_LOG_LEVEL_OFF if FLASH_MCUX_FLEXSPI_XIP +endchoice + endif # HAS_MCUX_FLEXSPI diff --git a/drivers/memc/Kconfig.mcux b/drivers/memc/Kconfig.mcux index dd6c2da48f4..7d231808ea3 100644 --- a/drivers/memc/Kconfig.mcux +++ b/drivers/memc/Kconfig.mcux @@ -54,6 +54,11 @@ config MEMC_MCUX_FLEXSPI bool select PINCTRL +# Avoid RWW hazards by defaulting logging to disabled +choice MEMC_LOG_LEVEL_CHOICE + default MEMC_LOG_LEVEL_OFF if FLASH_MCUX_FLEXSPI_XIP +endchoice + endif # DT_HAS_NXP_IMX_FLEXSPI_ENABLED diff --git a/soc/nxp/imxrt/Kconfig.defconfig b/soc/nxp/imxrt/Kconfig.defconfig index 8e563fdf921..fe919a0eb71 100644 --- a/soc/nxp/imxrt/Kconfig.defconfig +++ b/soc/nxp/imxrt/Kconfig.defconfig @@ -132,17 +132,4 @@ config FLASH_SIZE default $(dt_node_int_prop_int,$(DT_CHOSEN_FLASH_NODE),size,Kb) \ if $(DT_FLASH_HAS_SIZE_PROP) -if FLASH_MCUX_FLEXSPI_XIP - -# Avoid RWW hazards by defaulting logging to disabled -choice FLASH_LOG_LEVEL_CHOICE - default FLASH_LOG_LEVEL_OFF -endchoice - -choice MEMC_LOG_LEVEL_CHOICE - default MEMC_LOG_LEVEL_OFF -endchoice - -endif - endif # SOC_FAMILY_NXP_IMXRT diff --git a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig index 83d9604f2ba..db741bed0a4 100644 --- a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig @@ -62,19 +62,6 @@ config FLASH_SIZE if $(dt_node_has_prop,$(DT_CHOSEN_FLASH_NODE),size) default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K) -if FLASH_MCUX_FLEXSPI_XIP - -# Avoid RWW hazards by defaulting logging to disabled -choice FLASH_LOG_LEVEL_CHOICE - default FLASH_LOG_LEVEL_OFF -endchoice - -choice MEMC_LOG_LEVEL_CHOICE - default MEMC_LOG_LEVEL_OFF -endchoice - -endif - # # MBEDTLS is larger but much faster than TinyCrypt so choose wisely # diff --git a/soc/nxp/mcx/Kconfig b/soc/nxp/mcx/Kconfig index b2a5c5ab8e7..b8ac7a08f17 100644 --- a/soc/nxp/mcx/Kconfig +++ b/soc/nxp/mcx/Kconfig @@ -10,29 +10,4 @@ if SOC_FAMILY_NXP_MCX rsource "*/Kconfig" -if FLASH_MCUX_FLEXSPI_XIP - -# Avoid RWW hazards by defaulting logging to disabled -choice FLASH_LOG_LEVEL_CHOICE - default FLASH_LOG_LEVEL_OFF -endchoice - -choice MEMC_LOG_LEVEL_CHOICE - default MEMC_LOG_LEVEL_OFF -endchoice - -endif - -if FLASH_MCUX_FLEXSPI_XIP - -# Code relocation is needed when FLASH_MCUX_FLEXSPI_XIP is enabled -config CODE_DATA_RELOCATION_SRAM - default y - -config FLASH_MCUX_FLEXSPI_XIP_MEM - string - default "RAM" - -endif # FLASH_MCUX_FLEXSPI_XIP - endif # SOC_FAMILY_NXP_MCX diff --git a/soc/nxp/mcx/Kconfig.defconfig b/soc/nxp/mcx/Kconfig.defconfig index 89196947cd8..d4ef8eebce5 100644 --- a/soc/nxp/mcx/Kconfig.defconfig +++ b/soc/nxp/mcx/Kconfig.defconfig @@ -3,19 +3,8 @@ if SOC_FAMILY_NXP_MCX -rsource "*/Kconfig.defconfig" - if FLASH_MCUX_FLEXSPI_XIP -# Avoid RWW hazards by defaulting logging to disabled -choice FLASH_LOG_LEVEL_CHOICE - default FLASH_LOG_LEVEL_OFF -endchoice - -choice MEMC_LOG_LEVEL_CHOICE - default MEMC_LOG_LEVEL_OFF -endchoice - # Code relocation is needed when FLASH_MCUX_FLEXSPI_XIP is enabled config CODE_DATA_RELOCATION_SRAM default y @@ -33,4 +22,6 @@ choice USB_MCUX_CONTROLLER_TYPE default USB_DC_NXP_EHCI endchoice +rsource "*/Kconfig.defconfig" + endif # SOC_FAMILY_NXP_MCX diff --git a/soc/nxp/rw/Kconfig.defconfig b/soc/nxp/rw/Kconfig.defconfig index 6d7a718e13c..eec238cce66 100644 --- a/soc/nxp/rw/Kconfig.defconfig +++ b/soc/nxp/rw/Kconfig.defconfig @@ -61,15 +61,6 @@ endif # NXP_RW_ROM_RAMLOADER if FLASH_MCUX_FLEXSPI_XIP -# Avoid RWW hazards by defaulting logging to disabled -choice FLASH_LOG_LEVEL_CHOICE - default FLASH_LOG_LEVEL_OFF -endchoice - -choice MEMC_LOG_LEVEL_CHOICE - default MEMC_LOG_LEVEL_OFF -endchoice - # Code relocation is needed when MEMC driver is enabled config CODE_DATA_RELOCATION_SRAM default y if MEMC