[U-Boot] [PATCH 1/3] spi: Kconfig: Mark CONFIG_SPI as Legacy spi support

CONFIG_SPI is mandatory for SPI support even if the given board has dm or non-dm versions, so mark CONFIG_SPI as non-dm config option and move the respective non-dm drivers below to that.
This eventually reduce the explicit CONFIG_SPI enablement for dm version spi drivers.
Cc: Vignesh R vigneshr@ti.com Signed-off-by: Jagan Teki jagan@amarulasolutions.com --- drivers/spi/Kconfig | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 2fb4862c4a..bed279cbc4 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -1,7 +1,4 @@ -menuconfig SPI - bool "SPI Support" - -if SPI +menu "SPI Support"
config DM_SPI bool "Enable Driver Model for SPI drivers" @@ -294,6 +291,14 @@ config ZYNQMP_GQSPI
endif # if DM_SPI
+config SPI + bool "Legacy SPI support" + help + Enable the legacy SPI support. This will include legacy SPI + interface code for non-dm SPI drivers. + +if SPI + config SOFT_SPI bool "Soft SPI driver" help @@ -387,4 +392,6 @@ config OMAP3_SPI (McSPI). This driver be used to access SPI chips on platforms embedding this OMAP3 McSPI IP core.
-endif # menu "SPI Support" +endif # if SPI + +endmenu # menu "SPI Support"

1) CONFIG_SPI_FLASH is not just a legacy code, but it has common core code which handle both dm and non-dm spi flash code. So fix the info text to make it clear globally.
2) Since it's flash core it shouldn't depends on legacy SPI, so remove the 'depends on SPI'
Cc: Vignesh R vigneshr@ti.com Signed-off-by: Jagan Teki jagan@amarulasolutions.com --- drivers/mtd/spi/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index e3b40fc157..605f60c713 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -26,11 +26,10 @@ config SPI_FLASH_SANDBOX stored in a file on the host filesystem.
config SPI_FLASH - bool "Legacy SPI Flash Interface support" - depends on SPI + bool "SPI Flash Core Interface support" select SPI_MEM help - Enable the legacy SPI flash support. This will include basic + Enable the SPI flash Core support. This will include basic standard support for things like probing, read / write, and erasing through cmd_sf interface.

Hi,
On 09/02/19 5:45 PM, Jagan Teki wrote:
CONFIG_SPI_FLASH is not just a legacy code, but it has common core code which handle both dm and non-dm spi flash code. So fix the info text to make it clear globally.
Since it's flash core it shouldn't depends on legacy SPI, so remove the 'depends on SPI'
Cc: Vignesh R vigneshr@ti.com Signed-off-by: Jagan Teki jagan@amarulasolutions.com
drivers/mtd/spi/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index e3b40fc157..605f60c713 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -26,11 +26,10 @@ config SPI_FLASH_SANDBOX stored in a file on the host filesystem.
config SPI_FLASH
- bool "Legacy SPI Flash Interface support"
- depends on SPI
- bool "SPI Flash Core Interface support"
Nit, since we have SPI NAND flash as well, should description be updated to say SPI NOR Flash instead of SPI Flash?
select SPI_MEM help
Enable the legacy SPI flash support. This will include basic
standard support for things like probing, read / write, and erasing through cmd_sf interface.Enable the SPI flash Core support. This will include basic

On Tue, Feb 12, 2019 at 1:31 PM Vignesh R vigneshr@ti.com wrote:
Hi,
On 09/02/19 5:45 PM, Jagan Teki wrote:
CONFIG_SPI_FLASH is not just a legacy code, but it has common core code which handle both dm and non-dm spi flash code. So fix the info text to make it clear globally.
Since it's flash core it shouldn't depends on legacy SPI, so remove the 'depends on SPI'
Cc: Vignesh R vigneshr@ti.com Signed-off-by: Jagan Teki jagan@amarulasolutions.com
drivers/mtd/spi/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index e3b40fc157..605f60c713 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -26,11 +26,10 @@ config SPI_FLASH_SANDBOX stored in a file on the host filesystem.
config SPI_FLASH
bool "Legacy SPI Flash Interface support"
depends on SPI
bool "SPI Flash Core Interface support"
Nit, since we have SPI NAND flash as well, should description be updated to say SPI NOR Flash instead of SPI Flash?
True, I have bundle of changes even for configs to rename till those are in lets go with as we are.

DM_SPI_FLASH should require spi flash interface code for dm version, so select SPI_FLASH core by default if any board enabled DM_SPI_FLASH.
This overcome the explicit enablement of CONFIG_SPI_FLASH on respective boards when DM_SPI_FLASH being used.
Cc: Vignesh R vigneshr@ti.com Signed-off-by: Jagan Teki jagan@amarulasolutions.com --- drivers/mtd/spi/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index 605f60c713..43f597ec29 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -3,6 +3,7 @@ menu "SPI Flash Support" config DM_SPI_FLASH bool "Enable Driver Model for SPI flash" depends on DM && DM_SPI + select SPI_FLASH help Enable driver model for SPI flash. This SPI flash interface (spi_flash_probe(), spi_flash_write(), etc.) is then

On 09/02/19 5:45 PM, Jagan Teki wrote:
DM_SPI_FLASH should require spi flash interface code for dm version, so select SPI_FLASH core by default if any board enabled DM_SPI_FLASH.
This overcome the explicit enablement of CONFIG_SPI_FLASH on respective boards when DM_SPI_FLASH being used.
Cc: Vignesh R vigneshr@ti.com
Signed-off-by: Jagan Teki jagan@amarulasolutions.com
drivers/mtd/spi/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index 605f60c713..43f597ec29 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -3,6 +3,7 @@ menu "SPI Flash Support" config DM_SPI_FLASH bool "Enable Driver Model for SPI flash" depends on DM && DM_SPI
- select SPI_FLASH
How about imply instead of select since there is no compile time dependency?
help Enable driver model for SPI flash. This SPI flash interface (spi_flash_probe(), spi_flash_write(), etc.) is then

On Tue, Feb 12, 2019 at 1:27 PM Vignesh R vigneshr@ti.com wrote:
On 09/02/19 5:45 PM, Jagan Teki wrote:
DM_SPI_FLASH should require spi flash interface code for dm version, so select SPI_FLASH core by default if any board enabled DM_SPI_FLASH.
This overcome the explicit enablement of CONFIG_SPI_FLASH on respective boards when DM_SPI_FLASH being used.
Cc: Vignesh R vigneshr@ti.com
Signed-off-by: Jagan Teki jagan@amarulasolutions.com
drivers/mtd/spi/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index 605f60c713..43f597ec29 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -3,6 +3,7 @@ menu "SPI Flash Support" config DM_SPI_FLASH bool "Enable Driver Model for SPI flash" depends on DM && DM_SPI
select SPI_FLASH
How about imply instead of select since there is no compile time dependency?
Yes we can, since DM_SPI_FLASH by default require SPI_FLASH I have used select.

On 09/02/19 5:45 PM, Jagan Teki wrote:
CONFIG_SPI is mandatory for SPI support even if the given board has dm or non-dm versions, so mark CONFIG_SPI as non-dm config option and move the respective non-dm drivers below to that.
This eventually reduce the explicit CONFIG_SPI enablement for dm version spi drivers.
Cc: Vignesh R vigneshr@ti.com Signed-off-by: Jagan Teki jagan@amarulasolutions.com
Acked-by: Vignesh R vigneshr@ti.com
drivers/spi/Kconfig | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 2fb4862c4a..bed279cbc4 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -1,7 +1,4 @@ -menuconfig SPI
- bool "SPI Support"
-if SPI +menu "SPI Support"
config DM_SPI bool "Enable Driver Model for SPI drivers" @@ -294,6 +291,14 @@ config ZYNQMP_GQSPI
endif # if DM_SPI
+config SPI
- bool "Legacy SPI support"
- help
Enable the legacy SPI support. This will include legacy SPI
interface code for non-dm SPI drivers.
+if SPI
config SOFT_SPI bool "Soft SPI driver" help @@ -387,4 +392,6 @@ config OMAP3_SPI (McSPI). This driver be used to access SPI chips on platforms embedding this OMAP3 McSPI IP core.
-endif # menu "SPI Support" +endif # if SPI
+endmenu # menu "SPI Support"
participants (2)
-
Jagan Teki
-
Vignesh R