Skip to contentSkip to conversation

spi: dm-convert and cleanups

PATCH New Jagan Teki 3 participants 21 messages May 26, 2020 – Jun 11, 2020

Subsystems (2)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

cover spi: dm-convert and cleanups

We still have few drivers left over,
drivers/spi/fsl_espi.c
drivers/spi/fsl_dspi.c
drivers/spi/kirkwood_spi.c
drivers/spi/mxc_spi.c
drivers/spi/omap3_spi.c
drivers/spi/sh_qspi.c

Yes, most of them have SPL foot-print issues but will figure out the proper solutions and do necessary cleanup in coming days.

Travis-CI:
https://travis-ci.org/github/openedev/u-boot-amarula/builds/691159310

Note:
- fsl_espi.c will completely removed along with SPI config items on their boards, since there is no response on dm-conversion over years even though we made couple of zap patches.
- We are planning to push this soon.

Any inputs?
Jagan.

Jagan Teki (9):
spi Drop spi_init()
spi: Kconfig: Drop redundant CF_SPI definition
spi: Kconfig: Move MSCC_BB_SPI, FSL_QSPI into DM_SPI
ks2_evm: Switch to DM_SPL, SPL_OF_CONTROL
spi: davinci: Drop non-dm code
spi: mxs: Drop nondm code
spi: mxs: Code cleanup
spi: Zap SOFT_SPI (non-dm)
doc: driver-model: Update SPI migration status

 configs/k2e_evm_defconfig            |   2 +
 configs/k2g_evm_defconfig            |   2 +
 configs/k2hk_evm_defconfig           |   2 +
 configs/k2l_evm_defconfig            |   2 +
 doc/driver-model/migration.rst       |   5 -
 drivers/spi/Kconfig                  |  73 ++++++------
 drivers/spi/Makefile                 |   1 -
 drivers/spi/cf_spi.c                 |   4 -
 drivers/spi/davinci_spi.c            | 157 -------------------------
 drivers/spi/kirkwood_spi.c           |   4 -
 drivers/spi/mxs_spi.c                | 158 +++----------------------
 drivers/spi/soft_spi_legacy.c        | 168 ---------------------------
 include/configs/ti_armv7_keystone2.h |  17 ---
 13 files changed, 58 insertions(+), 537 deletions(-)
 delete mode 100644 drivers/spi/soft_spi_legacy.c
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/9 spi Drop spi_init()

spi_init doesn't exist anywhere in the code.

Drop it.

---
 drivers/spi/cf_spi.c       | 4 ----
 drivers/spi/kirkwood_spi.c | 4 ----
 2 files changed, 8 deletions(-)
drivers/spi/cf_spi.c +0 -4
index dd9c77281f..dec92df69b 100644
@@ -383,10 +383,6 @@ static int coldfire_spi_probe(struct udevice *bus)
 	return 0;
 }
 
-void spi_init(void)
-{
-}
-
 #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
 static int coldfire_dspi_ofdata_to_platdata(struct udevice *bus)
 {
drivers/spi/kirkwood_spi.c +0 -4
index 01fcf6bef5..3986b06b25 100644
@@ -183,10 +183,6 @@ int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 }
 #endif
 
-void spi_init(void)
-{
-}
-
 void spi_cs_activate(struct spi_slave *slave)
 {
 	_spi_cs_activate(spireg);
Signature · 1 line
2.25.1
author
#3 lore raw

PATCH 2/9 spi: Kconfig: Drop redundant CF_SPI definition

In reply to Jagan Teki

CF_SPI kconfig option defined twice with DM_SPI
and non DM_SPI.

Drop the non DM_SPI side kconfig definition.

---
 drivers/spi/Kconfig | 6 ------
 1 file changed, 6 deletions(-)
drivers/spi/Kconfig +0 -6
index fc759e71e2..658a48e57a 100644
@@ -384,12 +384,6 @@ config MSCC_BB_SPI
 	  Enable MSCC bitbang SPI driver. This driver can be used on
 	  MSCC SOCs.
 
-config CF_SPI
-	bool "ColdFire SPI driver"
-	help
-	  Enable the ColdFire SPI driver. This driver can be used on
-	  some m68k SoCs.
-
 config FSL_ESPI
 	bool "Freescale eSPI driver"
 	imply SPI_FLASH_BAR
Signature · 1 line
2.25.1
author
#4 lore raw

PATCH 2/9 spi: Kconfig: Drop redundant CF_SPI definition

Quoted 8 lines · Jagan Teki

CF_SPI kconfig option defined twice with DM_SPI
and non DM_SPI.

Drop the non DM_SPI side kconfig definition.

---

Applied to u-boot-spi/master

author
#5 lore raw

PATCH 3/9 spi: Kconfig: Move MSCC_BB_SPI, FSL_QSPI into DM_SPI

In reply to Jagan Teki

- MSCC_BB_SPI
- FSL_QSPI

Both are fully dm-driven, let's move them into DM_SPI side definition.

---
 drivers/spi/Kconfig | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/spi/Kconfig +15 -15
index 658a48e57a..59415209ee 100644
@@ -141,6 +141,14 @@ config FSL_DSPI
 	  this Freescale DSPI IP core. LS102xA and Colibri VF50/VF61 platforms
 	  use this driver.
 
+config FSL_QSPI
+	bool "Freescale QSPI driver"
+	imply SPI_FLASH_BAR
+	help
+	  Enable the Freescale Quad-SPI (QSPI) driver. This driver can be
+	  used to access the SPI NOR flash on platforms embedding this
+	  Freescale IP core.
+
 config ICH_SPI
 	bool "Intel ICH SPI driver"
 	help
@@ -167,6 +175,13 @@ config MPC8XXX_SPI
 	help
 	  Enable support for SPI on the MPC8XXX PowerPC SoCs.
 
+config MSCC_BB_SPI
+	bool "MSCC bitbang SPI driver"
+	depends on SOC_VCOREIII
+	help
+	  Enable MSCC bitbang SPI driver. This driver can be used on
+	  MSCC SOCs.
+
 config MT7621_SPI
 	bool "MediaTek MT7621 SPI driver"
 	depends on SOC_MT7628
@@ -377,13 +392,6 @@ config SOFT_SPI
 	 Enable Soft SPI driver. This driver is to use GPIO simulate
 	 the SPI protocol.
 
-config MSCC_BB_SPI
-	bool "MSCC bitbang SPI driver"
-	depends on SOC_VCOREIII
-	help
-	  Enable MSCC bitbang SPI driver. This driver can be used on
-	  MSCC SOCs.
-
 config FSL_ESPI
 	bool "Freescale eSPI driver"
 	imply SPI_FLASH_BAR
@@ -392,14 +400,6 @@ config FSL_ESPI
 	  access the SPI interface and SPI NOR flash on platforms embedding
 	  this Freescale eSPI IP core.
 
-config FSL_QSPI
-	bool "Freescale QSPI driver"
-	imply SPI_FLASH_BAR
-	help
-	  Enable the Freescale Quad-SPI (QSPI) driver. This driver can be
-	  used to access the SPI NOR flash on platforms embedding this
-	  Freescale IP core.
-
 config DAVINCI_SPI
 	bool "Davinci & Keystone SPI driver"
 	depends on ARCH_DAVINCI || ARCH_KEYSTONE
Signature · 1 line
2.25.1
author
#6 lore raw

PATCH 3/9 spi: Kconfig: Move MSCC_BB_SPI, FSL_QSPI into DM_SPI

Quoted 9 lines · Jagan Teki

- MSCC_BB_SPI
- FSL_QSPI

Both are fully dm-driven, let's move them into DM_SPI side definition.

---

Applied to u-boot-spi/master

author
#7 lore raw

PATCH 4/9 ks2_evm: Switch to DM_SPL, SPL_OF_CONTROL

In reply to Jagan Teki

This would make SPL build to DM_SPL, SPL_OF_CONTROL.

Build fine with but not tested.

Cc Vitaly Andrianov <[email protected]>
---
 configs/k2e_evm_defconfig            | 2 ++
 configs/k2g_evm_defconfig            | 2 ++
 configs/k2hk_evm_defconfig           | 2 ++
 configs/k2l_evm_defconfig            | 2 ++
 include/configs/ti_armv7_keystone2.h | 8 --------
 5 files changed, 8 insertions(+), 8 deletions(-)
configs/k2e_evm_defconfig +2 -0
index 644b6e5464..9f91fb9598 100644
@@ -36,11 +36,13 @@ CONFIG_MTDIDS_DEFAULT="nand0=davinci_nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,-(ubifs)"
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2e-evm"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SPL_DM=y
 CONFIG_SYS_I2C_DAVINCI=y
 CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
configs/k2g_evm_defconfig +2 -0
index 5bc7f7f865..fb8fb250da 100644
@@ -34,6 +34,7 @@ CONFIG_MTDIDS_DEFAULT="nand0=davinci_nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,-(ubifs)"
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2g-evm"
 CONFIG_OF_LIST="keystone-k2g-generic keystone-k2g-evm keystone-k2g-ice"
 CONFIG_DTB_RESELECT=y
@@ -41,6 +42,7 @@ CONFIG_MULTI_DTB_FIT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
+CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_SYS_I2C_DAVINCI=y
 CONFIG_MISC=y
configs/k2hk_evm_defconfig +2 -0
index eb5916c2c6..1cd7331653 100644
@@ -36,11 +36,13 @@ CONFIG_MTDIDS_DEFAULT="nand0=davinci_nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,-(ubifs)"
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2hk-evm"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SPL_DM=y
 CONFIG_SYS_I2C_DAVINCI=y
 CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
configs/k2l_evm_defconfig +2 -0
index 71a35e3496..ae4b26b7a9 100644
@@ -36,11 +36,13 @@ CONFIG_MTDIDS_DEFAULT="nand0=davinci_nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,-(ubifs)"
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="keystone-k2l-evm"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SPL_DM=y
 CONFIG_SYS_I2C_DAVINCI=y
 CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
include/configs/ti_armv7_keystone2.h +0 -8
index 1b014c1022..37210b2605 100644
@@ -53,10 +53,6 @@
 
 /* UART Configuration */
 #define CONFIG_SYS_NS16550_MEM32
-#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_SERIAL)
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE	-4
-#endif
 #define CONFIG_SYS_NS16550_COM1		KS2_UART0_BASE
 #define CONFIG_SYS_NS16550_COM2		KS2_UART1_BASE
 
@@ -77,10 +73,6 @@
 #define CONFIG_SYS_SPI2
 #define CONFIG_SYS_SPI2_BASE		KS2_SPI2_BASE
 #define CONFIG_SYS_SPI2_NUM_CS		4
-#ifdef CONFIG_SPL_BUILD
-#undef CONFIG_DM_SPI
-#undef CONFIG_DM_SPI_FLASH
-#endif
 
 /* Network Configuration */
 #define CONFIG_BOOTP_DEFAULT
Signature · 1 line
2.25.1
author
#9 lore raw

PATCH 5/9 spi: davinci: Drop non-dm code

In reply to Jagan Teki

Now all boards which are using davinci SPI driver have moved to SPL_DM so drop the unneeded non-dm code.

---
 drivers/spi/Kconfig                  |  12 +-
 drivers/spi/davinci_spi.c            | 157 ---------------------------
 include/configs/ti_armv7_keystone2.h |   9 --
 3 files changed, 6 insertions(+), 172 deletions(-)
drivers/spi/Kconfig +6 -6
index 59415209ee..1a1f195232 100644
@@ -119,6 +119,12 @@ config CF_SPI
           Enable the ColdFire SPI driver. This driver can be used on
           some m68k SoCs.
 
+config DAVINCI_SPI
+	bool "Davinci & Keystone SPI driver"
+	depends on ARCH_DAVINCI || ARCH_KEYSTONE
+	help
+	  Enable the Davinci SPI driver
+
 config DESIGNWARE_SPI
 	bool "Designware SPI driver"
 	help
@@ -400,12 +406,6 @@ config FSL_ESPI
 	  access the SPI interface and SPI NOR flash on platforms embedding
 	  this Freescale eSPI IP core.
 
-config DAVINCI_SPI
-	bool "Davinci & Keystone SPI driver"
-	depends on ARCH_DAVINCI || ARCH_KEYSTONE
-	help
-	  Enable the Davinci SPI driver
-
 config SH_QSPI
 	bool "Renesas Quad SPI driver"
 	help
drivers/spi/davinci_spi.c +0 -157

178 lines not on this page · raw message

include/configs/ti_armv7_keystone2.h +0 -9
index 37210b2605..b632ae010d 100644
@@ -64,15 +64,6 @@
 
 /* SPI Configuration */
 #define CONFIG_SYS_SPI_CLK		ks_clk_get_rate(KS2_CLK1_6)
-#define CONFIG_SYS_SPI0
-#define CONFIG_SYS_SPI_BASE		KS2_SPI0_BASE
-#define CONFIG_SYS_SPI0_NUM_CS		4
-#define CONFIG_SYS_SPI1
-#define CONFIG_SYS_SPI1_BASE		KS2_SPI1_BASE
-#define CONFIG_SYS_SPI1_NUM_CS		4
-#define CONFIG_SYS_SPI2
-#define CONFIG_SYS_SPI2_BASE		KS2_SPI2_BASE
-#define CONFIG_SYS_SPI2_NUM_CS		4
 
 /* Network Configuration */
 #define CONFIG_BOOTP_DEFAULT
Signature · 1 line
2.25.1
#10 lore raw

PATCH 5/9 spi: davinci: Drop non-dm code

Quoted 3 lines · Jagan Teki

Now all boards which are using davinci SPI driver have moved to SPL_DM so drop the unneeded non-dm code.

Thanks for doing that.

Quoted 2 lines
Cc Adam Ford <[email protected]>
Quoted 246 lines
---
 drivers/spi/Kconfig                  |  12 +-
 drivers/spi/davinci_spi.c            | 157 ---------------------------
 include/configs/ti_armv7_keystone2.h |   9 --
 3 files changed, 6 insertions(+), 172 deletions(-)
drivers/spi/Kconfig +6 -6
index 59415209ee..1a1f195232 100644
@@ -119,6 +119,12 @@ config CF_SPI
           Enable the ColdFire SPI driver. This driver can be used on
           some m68k SoCs.
 
+config DAVINCI_SPI
+       bool "Davinci & Keystone SPI driver"
+       depends on ARCH_DAVINCI || ARCH_KEYSTONE
+       help
+         Enable the Davinci SPI driver
+
 config DESIGNWARE_SPI
        bool "Designware SPI driver"
        help
@@ -400,12 +406,6 @@ config FSL_ESPI
          access the SPI interface and SPI NOR flash on platforms embedding
          this Freescale eSPI IP core.
 
-config DAVINCI_SPI
-       bool "Davinci & Keystone SPI driver"
-       depends on ARCH_DAVINCI || ARCH_KEYSTONE
-       help
-         Enable the Davinci SPI driver
-
 config SH_QSPI
        bool "Renesas Quad SPI driver"
        help
drivers/spi/davinci_spi.c +0 -157
index 97ac97b1a5..e1e9b45cc9 100644
@@ -55,41 +55,6 @@
 /* SPIDEF */
 #define SPIDEF_CSDEF0_MASK     BIT(0)
 
-#ifndef CONFIG_DM_SPI
-#define SPI0_BUS               0
-#define SPI0_BASE              CONFIG_SYS_SPI_BASE
-/*
- * Define default SPI0_NUM_CS as 1 for existing platforms that uses this
- * driver. Platform can configure number of CS using CONFIG_SYS_SPI0_NUM_CS
- * if more than one CS is supported and by defining CONFIG_SYS_SPI0.
- */
-#ifndef CONFIG_SYS_SPI0
-#define SPI0_NUM_CS            1
-#else
-#define SPI0_NUM_CS            CONFIG_SYS_SPI0_NUM_CS
-#endif
-
-/*
- * define CONFIG_SYS_SPI1 when platform has spi-1 device (bus #1) and
- * CONFIG_SYS_SPI1_NUM_CS defines number of CS on this bus
- */
-#ifdef CONFIG_SYS_SPI1
-#define SPI1_BUS               1
-#define SPI1_NUM_CS            CONFIG_SYS_SPI1_NUM_CS
-#define SPI1_BASE              CONFIG_SYS_SPI1_BASE
-#endif
-
-/*
- * define CONFIG_SYS_SPI2 when platform has spi-2 device (bus #2) and
- * CONFIG_SYS_SPI2_NUM_CS defines number of CS on this bus
- */
-#ifdef CONFIG_SYS_SPI2
-#define SPI2_BUS               2
-#define SPI2_NUM_CS            CONFIG_SYS_SPI2_NUM_CS
-#define SPI2_BASE              CONFIG_SYS_SPI2_BASE
-#endif
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /* davinci spi register set */
@@ -122,9 +87,6 @@ struct davinci_spi_regs {
 
 /* davinci spi slave */
 struct davinci_spi_slave {
-#ifndef CONFIG_DM_SPI
-       struct spi_slave slave;
-#endif
        struct davinci_spi_regs *regs;
        unsigned int freq; /* current SPI bus frequency */
        unsigned int mode; /* current SPI mode used */
@@ -346,124 +308,6 @@ out:
        return 0;
 }
 
-#ifndef CONFIG_DM_SPI
-
-static inline struct davinci_spi_slave *to_davinci_spi(struct spi_slave *slave)
-{
-       return container_of(slave, struct davinci_spi_slave, slave);
-}
-
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-       int ret = 0;
-
-       switch (bus) {
-       case SPI0_BUS:
-               if (cs < SPI0_NUM_CS)
-                       ret = 1;
-               break;
-#ifdef CONFIG_SYS_SPI1
-       case SPI1_BUS:
-               if (cs < SPI1_NUM_CS)
-                       ret = 1;
-               break;
-#endif
-#ifdef CONFIG_SYS_SPI2
-       case SPI2_BUS:
-               if (cs < SPI2_NUM_CS)
-                       ret = 1;
-               break;
-#endif
-       default:
-               /* Invalid bus number. Do nothing */
-               break;
-       }
-       return ret;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-       /* do nothing */
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-       /* do nothing */
-}
-
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
-                       unsigned int max_hz, unsigned int mode)
-{
-       struct davinci_spi_slave        *ds;
-
-       if (!spi_cs_is_valid(bus, cs))
-               return NULL;
-
-       ds = spi_alloc_slave(struct davinci_spi_slave, bus, cs);
-       if (!ds)
-               return NULL;
-
-       switch (bus) {
-       case SPI0_BUS:
-               ds->regs = (struct davinci_spi_regs *)SPI0_BASE;
-               break;
-#ifdef CONFIG_SYS_SPI1
-       case SPI1_BUS:
-               ds->regs = (struct davinci_spi_regs *)SPI1_BASE;
-               break;
-#endif
-#ifdef CONFIG_SYS_SPI2
-       case SPI2_BUS:
-               ds->regs = (struct davinci_spi_regs *)SPI2_BASE;
-               break;
-#endif
-       default: /* Invalid bus number */
-               return NULL;
-       }
-
-       ds->freq = max_hz;
-       ds->mode = mode;
-
-       return &ds->slave;
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
-       struct davinci_spi_slave *ds = to_davinci_spi(slave);
-
-       free(ds);
-}
-
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
-            const void *dout, void *din, unsigned long flags)
-{
-       struct davinci_spi_slave *ds = to_davinci_spi(slave);
-
-       ds->cur_cs = slave->cs;
-
-       return __davinci_spi_xfer(ds, bitlen, dout, din, flags);
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
-       struct davinci_spi_slave *ds = to_davinci_spi(slave);
-
-#ifdef CONFIG_SPI_HALF_DUPLEX
-       ds->half_duplex = true;
-#else
-       ds->half_duplex = false;
-#endif
-       return __davinci_spi_claim_bus(ds, ds->slave.cs);
-}
-
-void spi_release_bus(struct spi_slave *slave)
-{
-       struct davinci_spi_slave *ds = to_davinci_spi(slave);
-
-       __davinci_spi_release_bus(ds);
-}
-
-#else
 static int davinci_spi_set_speed(struct udevice *bus, uint max_hz)
 {
        struct davinci_spi_slave *ds = dev_get_priv(bus);
@@ -582,4 +426,3 @@ U_BOOT_DRIVER(davinci_spi) = {
        .ops = &davinci_spi_ops,
        .priv_auto_alloc_size = sizeof(struct davinci_spi_slave),
 };
-#endif
include/configs/ti_armv7_keystone2.h +0 -10
index 37210b2605..b632ae010d 100644
@@ -64,15 +64,6 @@
 
 /* SPI Configuration */
 #define CONFIG_SYS_SPI_CLK             ks_clk_get_rate(KS2_CLK1_6)
-#define CONFIG_SYS_SPI0
-#define CONFIG_SYS_SPI_BASE            KS2_SPI0_BASE
-#define CONFIG_SYS_SPI0_NUM_CS         4
-#define CONFIG_SYS_SPI1
-#define CONFIG_SYS_SPI1_BASE           KS2_SPI1_BASE
-#define CONFIG_SYS_SPI1_NUM_CS         4
-#define CONFIG_SYS_SPI2
-#define CONFIG_SYS_SPI2_BASE           KS2_SPI2_BASE
-#define CONFIG_SYS_SPI2_NUM_CS         4
 
 /* Network Configuration */
 #define CONFIG_BOOTP_DEFAULT
--

2.25.1

author
#12 lore raw

PATCH 6/9 spi: mxs: Drop nondm code

In reply to Jagan Teki

Deadline for DM migration already passed by months and no response on full dm conversation hence removed the nondm code.

Note: Look like there is no user for nondm code
for this driver.

---
 drivers/spi/Kconfig   |  12 ++---
 drivers/spi/mxs_spi.c | 123 ------------------------------------------
 2 files changed, 6 insertions(+), 129 deletions(-)
drivers/spi/Kconfig +6 -6
index 1a1f195232..46a7b9e9d3 100644
@@ -213,6 +213,12 @@ config MVEBU_A3700_SPI
 	  used to access the SPI NOR flash on platforms embedding this
 	  Marvell IP core.
 
+config MXS_SPI
+	bool "MXS SPI Driver"
+	help
+	  Enable the MXS SPI controller driver. This driver can be used
+	  on the i.MX23 and i.MX28 SoCs.
+
 config NXP_FSPI
 	bool "NXP FlexSPI driver"
 	depends on SPI_MEM
@@ -424,12 +430,6 @@ config MXC_SPI
 	  Enable the MXC SPI controller driver. This driver can be used
 	  on various i.MX SoCs such as i.MX31/35/51/6/7.
 
-config MXS_SPI
-	bool "MXS SPI Driver"
-	help
-	  Enable the MXS SPI controller driver. This driver can be used
-	  on the i.MX23 and i.MX28 SoCs.
-
 config OMAP3_SPI
 	bool "McSPI driver for OMAP"
 	help
drivers/spi/mxs_spi.c +0 -123

186 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#13 lore raw

PATCH 6/9 spi: mxs: Drop nondm code

Quoted 10 lines · Jagan Teki

Deadline for DM migration already passed by months and no response on full dm conversation hence removed the nondm code.

Note: Look like there is no user for nondm code
for this driver.

---

Applied to u-boot-spi/master

author
#14 lore raw

PATCH 7/9 spi: mxs: Code cleanup

In reply to Jagan Teki

Order the macros, private structures and simple functions in a proper way to have more code readability.

No functionality changed.

---
 drivers/spi/mxs_spi.c | 37 ++++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 19 deletions(-)
drivers/spi/mxs_spi.c +18 -19
index a21419a15a..e231e96e58 100644
@@ -13,7 +13,10 @@
  */
 
 #include <common.h>
+#include <dm.h>
+#include <dt-structs.h>
 #include <cpu_func.h>
+#include <errno.h>
 #include <log.h>
 #include <malloc.h>
 #include <memalign.h>
@@ -34,21 +37,9 @@
 
 #define MXSSSP_SMALL_TRANSFER	512
 
-static void mxs_spi_start_xfer(struct mxs_ssp_regs *ssp_regs)
-{
-	writel(SSP_CTRL0_LOCK_CS, &ssp_regs->hw_ssp_ctrl0_set);
-	writel(SSP_CTRL0_IGNORE_CRC, &ssp_regs->hw_ssp_ctrl0_clr);
-}
-
-static void mxs_spi_end_xfer(struct mxs_ssp_regs *ssp_regs)
-{
-	writel(SSP_CTRL0_LOCK_CS, &ssp_regs->hw_ssp_ctrl0_clr);
-	writel(SSP_CTRL0_IGNORE_CRC, &ssp_regs->hw_ssp_ctrl0_set);
-}
-
-#include <dm.h>
-#include <errno.h>
-#include <dt-structs.h>
+/* Base numbers of i.MX2[38] clk for ssp0 IP block */
+#define MXS_SSP_IMX23_CLKID_SSP0 33
+#define MXS_SSP_IMX28_CLKID_SSP0 46
 
 #ifdef CONFIG_MX28
 #define dtd_fsl_imx_spi dtd_fsl_imx28_spi
@@ -75,6 +66,18 @@ struct mxs_spi_priv {
 	unsigned int mode;
 };
 
+static void mxs_spi_start_xfer(struct mxs_ssp_regs *ssp_regs)
+{
+	writel(SSP_CTRL0_LOCK_CS, &ssp_regs->hw_ssp_ctrl0_set);
+	writel(SSP_CTRL0_IGNORE_CRC, &ssp_regs->hw_ssp_ctrl0_clr);
+}
+
+static void mxs_spi_end_xfer(struct mxs_ssp_regs *ssp_regs)
+{
+	writel(SSP_CTRL0_LOCK_CS, &ssp_regs->hw_ssp_ctrl0_clr);
+	writel(SSP_CTRL0_IGNORE_CRC, &ssp_regs->hw_ssp_ctrl0_set);
+}
+
 static int mxs_spi_xfer_pio(struct mxs_spi_priv *priv,
 			    char *data, int length, int write,
 			    unsigned long flags)
@@ -312,10 +315,6 @@ int mxs_spi_xfer(struct udevice *dev, unsigned int bitlen,
 	}
 }
 
-/* Base numbers of i.MX2[38] clk for ssp0 IP block */
-#define MXS_SSP_IMX23_CLKID_SSP0 33
-#define MXS_SSP_IMX28_CLKID_SSP0 46
-
 static int mxs_spi_probe(struct udevice *bus)
 {
 	struct mxs_spi_platdata *plat = dev_get_platdata(bus);
Signature · 1 line
2.25.1
author
#15 lore raw

PATCH 7/9 spi: mxs: Code cleanup

Quoted 8 lines · Jagan Teki

Order the macros, private structures and simple functions in a proper way to have more code readability.

No functionality changed.

---

Applied to u-boot-spi/master

author
#16 lore raw

PATCH 8/9 spi: Zap SOFT_SPI (non-dm)

In reply to Jagan Teki

- Deadline for DM migration already passed by months.
- Sent couple of zap patches and
- No response on dm conversation
hence removed the driver.

---
 drivers/spi/Kconfig           |  13 ++-
 drivers/spi/Makefile          |   1 -
 drivers/spi/soft_spi_legacy.c | 168 ----------------------------------
 3 files changed, 6 insertions(+), 176 deletions(-)
 delete mode 100644 drivers/spi/soft_spi_legacy.c
drivers/spi/Kconfig +6 -7
index 46a7b9e9d3..09b9cb17d8 100644
@@ -292,6 +292,12 @@ config SPI_SIFIVE
 
 	  The SiFive SPI controller driver is found on various SiFive SoCs.
 
+config SOFT_SPI
+	bool "Soft SPI driver"
+	help
+	 Enable Soft SPI driver. This driver is to use GPIO simulate
+	 the SPI protocol.
+
 config SPI_SUNXI
 	bool "Allwinner SoC SPI controllers"
 	default ARCH_SUNXI
@@ -397,13 +403,6 @@ config ZYNQMP_GQSPI
 
 endif # if DM_SPI
 
-config SOFT_SPI
-	bool "Soft SPI driver"
-	depends on DM_SPI || (DEPRECATED && !DM_SPI)
-	help
-	 Enable Soft SPI driver. This driver is to use GPIO simulate
-	 the SPI protocol.
-
 config FSL_ESPI
 	bool "Freescale eSPI driver"
 	imply SPI_FLASH_BAR
drivers/spi/Makefile +0 -1
index 342776404a..54881a7412 100644
@@ -13,7 +13,6 @@ obj-$(CONFIG_TI_QSPI) += ti_qspi.o
 else
 obj-y += spi.o
 obj-$(CONFIG_SPI_MEM) += spi-mem-nodm.o
-obj-$(CONFIG_SOFT_SPI) += soft_spi_legacy.o
 endif
 
 obj-$(CONFIG_ALTERA_SPI) += altera_spi.o
drivers/spi/soft_spi_legacy.c deleted +0 -168

168 lines not on this page · raw message

Signature · 1 line
2.25.1
#17 lore raw

PATCH 8/9 spi: Zap SOFT_SPI (non-dm)

Quoted 6 lines · Jagan Teki

- Deadline for DM migration already passed by months.
- Sent couple of zap patches and
- No response on dm conversation
hence removed the driver.

Quoted 8 lines
---
 drivers/spi/Kconfig           |  13 ++-
 drivers/spi/Makefile          |   1 -
 drivers/spi/soft_spi_legacy.c | 168 ----------------------------------
 3 files changed, 6 insertions(+), 176 deletions(-)
 delete mode 100644 drivers/spi/soft_spi_legacy.c
author
#19 lore raw

PATCH 9/9 doc: driver-model: Update SPI migration status

In reply to Jagan Teki

Update SPI drivers, driver model conversion status as per latest conversion and dropping nondm code.

---
 doc/driver-model/migration.rst | 5 -----
 1 file changed, 5 deletions(-)
doc/driver-model/migration.rst +0 -5
index d1fc0e6a78..2c0e2c7f06 100644
@@ -69,20 +69,15 @@ to move the migration with in the deadline.
 No dm conversion yet::
 
 	drivers/spi/fsl_espi.c
-	drivers/spi/lpc32xx_ssp.c
-	drivers/spi/sh_spi.c
-	drivers/spi/soft_spi_legacy.c
 
 * Status: In progress
 * Deadline: 2019.04
 
 Partially converted::
 
-	drivers/spi/davinci_spi.c
 	drivers/spi/fsl_dspi.c
 	drivers/spi/kirkwood_spi.c
 	drivers/spi/mxc_spi.c
-	drivers/spi/mxs_spi.c
 	drivers/spi/omap3_spi.c
 	drivers/spi/sh_qspi.c
 
Signature · 1 line
2.25.1