Skip to contentSkip to conversation

spi: Kconfig: Mark CONFIG_SPI as Legacy spi support

PATCH New Jagan Teki 2 participants 8 messages Feb 9, 2019 – Feb 12, 2019

Subsystems (2)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

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.

---
 drivers/spi/Kconfig | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/spi/Kconfig +12 -5
index 2fb4862c4a..bed279cbc4 100644
@@ -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"
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#1 lore raw

PATCH 2/3 mtd: spi: Kconfig: Update CONFIG_SPI_FLASH

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'

---
 drivers/mtd/spi/Kconfig | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mtd/spi/Kconfig +2 -3
index e3b40fc157..605f60c713 100644
@@ -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.
 
Signature · 1 line
2.18.0.321.gffc6fa0e3
maintainer
#2 lore raw

PATCH 2/3 mtd: spi: Kconfig: Update CONFIG_SPI_FLASH

Hi,

Quoted 18 lines · Jagan Teki

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'

---
 drivers/mtd/spi/Kconfig | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mtd/spi/Kconfig +0 -0
index e3b40fc157..605f60c713 100644

drivers/mtd/spi/Kconfig config SPI_FLASH_SANDBOX · line 29

Quoted 6 lines
drivers/mtd/spi/Kconfig +1 -2
@@ -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?

Quoted 8 lines
drivers/mtd/spi/Kconfig +1 -1
 	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.
 
Signature · 2 lines
Regards
Vignesh
author
#3 lore raw

PATCH 2/3 mtd: spi: Kconfig: Update CONFIG_SPI_FLASH

Quoted 24 lines · Vignesh R

Hi,

Quoted 20 lines · Jagan Teki

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'

---
 drivers/mtd/spi/Kconfig | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mtd/spi/Kconfig +0 -0
index e3b40fc157..605f60c713 100644
@@ -26,11 +26,10 @@ config SPI_FLASH_SANDBOX
        stored in a file on the host filesystem.
 
Quoted 7 lines

drivers/mtd/spi/Kconfig config SPI_FLASH_SANDBOX · line 29

Quoted 4 lines
drivers/mtd/spi/Kconfig +1 -2
 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.

author
#4 lore raw

PATCH 3/3 mtd: spi: Kconfig: Select SPI_FLASH if DM_SPI_FLASH

In reply to Jagan Teki

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.

---
 drivers/mtd/spi/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/spi/Kconfig +1 -0
index 605f60c713..43f597ec29 100644
@@ -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
Signature · 1 line
2.18.0.321.gffc6fa0e3
maintainer
#5 lore raw

PATCH 3/3 mtd: spi: Kconfig: Select SPI_FLASH if DM_SPI_FLASH

Quoted 17 lines · Jagan Teki

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.

Quoted 1 line
Cc Vignesh R <[email protected]>
---
 drivers/mtd/spi/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/spi/Kconfig +0 -0
index 605f60c713..43f597ec29 100644

drivers/mtd/spi/Kconfig menu "SPI Flash Support" · line 6

Quoted 4 lines
drivers/mtd/spi/Kconfig +1 -0
@@ -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?

Quoted 4 lines
drivers/mtd/spi/Kconfig +0 -0
 	help
 	  Enable driver model for SPI flash. This SPI flash interface
 	  (spi_flash_probe(), spi_flash_write(), etc.) is then
Signature · 2 lines
Regards
Vignesh
author
#6 lore raw

PATCH 3/3 mtd: spi: Kconfig: Select SPI_FLASH if DM_SPI_FLASH

Quoted 16 lines · Vignesh R
Quoted 12 lines · Jagan Teki

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.

Quoted 1 line
Cc Vignesh R <[email protected]>
---
 drivers/mtd/spi/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

drivers/mtd/spi/Kconfig menu "SPI Flash Support" · line 6

Quoted 9 lines
drivers/mtd/spi/Kconfig +1 -0
index 605f60c713..43f597ec29 100644
@@ -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.

maintainer
#7 lore raw

PATCH 1/3 spi: Kconfig: Mark CONFIG_SPI as Legacy spi support

In reply to Jagan Teki
Quoted 9 lines · Jagan Teki

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.

Quoted 41 lines
---
 drivers/spi/Kconfig | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/spi/Kconfig +12 -5
index 2fb4862c4a..bed279cbc4 100644
@@ -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"
Signature · 2 lines
Regards
Vignesh