spi: dm-convert and cleanups
Subsystems (2)
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
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
@@ -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
@@ -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
PATCH 1/9 spi Drop spi_init()
Quoted 7 lines · Jagan Teki
spi_initdoesn't exist anywhere in the code.Drop it.
Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
PATCH 2/9 spi: Kconfig: Drop redundant CF_SPI definition
In reply to Jagan TekiCF_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
@@ -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
PATCH 2/9 spi: Kconfig: Drop redundant CF_SPI definition
Quoted 8 lines · Jagan Teki
CF_SPIkconfig option defined twice withDM_SPI
and nonDM_SPI.Drop the non
DM_SPIside kconfig definition.Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
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
@@ -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
PATCH 3/9 spi: Kconfig: Move MSCC_BB_SPI, FSL_QSPI into DM_SPI
Quoted 9 lines · Jagan Teki
-
MSCC_BB_SPI
-FSL_QSPIBoth are fully dm-driven, let's move them into
DM_SPIside definition.Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
PATCH 4/9 ks2_evm: Switch to DM_SPL, SPL_OF_CONTROL
In reply to Jagan TekiThis would make SPL build to DM_SPL, SPL_OF_CONTROL.
Build fine with but not tested.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 4/9 ks2_evm: Switch to DM_SPL, SPL_OF_CONTROL
Quoted 8 lines · Jagan Teki
This would make SPL build to
DM_SPL,SPL_OF_CONTROL.Build fine with but not tested.
Cc Vitaly Andrianov <[email protected]>Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
PATCH 5/9 spi: davinci: Drop non-dm code
In reply to Jagan TekiNow 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
@@ -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
@@ -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
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_DMso drop the unneeded non-dm code.
Thanks for doing that.
Quoted 2 lines
Cc Adam Ford <[email protected]>
Quoted 246 lines
Signed-off-by Jagan Teki <[email protected]>--- 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@@ -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" helpdrivers/spi/davinci_spi.c +0
-157@@ -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@@ -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
PATCH 5/9 spi: davinci: Drop non-dm code
In reply to Jagan TekiQuoted 7 lines · Jagan Teki
Now all boards which are using davinci SPI driver have moved to
SPL_DMso drop the unneeded non-dm code.Cc Adam Ford <[email protected]>Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
PATCH 6/9 spi: mxs: Drop nondm code
In reply to Jagan TekiDeadline 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
@@ -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
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.Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
PATCH 7/9 spi: mxs: Code cleanup
In reply to Jagan TekiOrder 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
@@ -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
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.
Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
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
@@ -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
@@ -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
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
Signed-off-by Jagan Teki <[email protected]>--- 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
PATCH 8/9 spi: Zap SOFT_SPI (non-dm)
In reply to Jagan TekiQuoted 8 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.Signed-off-by Jagan Teki <[email protected]>---
Applied to u-boot-spi/master
PATCH 9/9 doc: driver-model: Update SPI migration status
In reply to Jagan TekiUpdate 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
@@ -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
PATCH 9/9 doc: driver-model: Update SPI migration status
Quoted 9 lines · Jagan Teki
Update SPI drivers, driver model conversion status as per latest conversion and dropping nondm code.
Signed-off-by Jagan Teki <[email protected]>--- doc/driver-model/migration.rst | 5 ----- 1 file changed, 5 deletions(-)