From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 22/23] spi: omap3: Drop nondm code
Date: Wed, 27 May 2020 18:26:36 +0530 [thread overview]
Message-ID: <20200527125637.149189-23-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20200527125637.149189-1-jagan@amarulasolutions.com>
Now all boards are using this omap3 spi driver in
dm model, so drop the nondm code.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v2:
- none
drivers/spi/Kconfig | 14 ++---
drivers/spi/omap3_spi.c | 136 ----------------------------------------
2 files changed, 7 insertions(+), 143 deletions(-)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 09b9cb17d8..8fccfbf20d 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -226,6 +226,13 @@ config NXP_FSPI
Enable the NXP FlexSPI (FSPI) driver. This driver can be used to
access the SPI NOR flash on platforms embedding this NXP IP core.
+config OMAP3_SPI
+ bool "McSPI driver for OMAP"
+ help
+ SPI master controller for OMAP24XX and later Multichannel SPI
+ (McSPI). This driver be used to access SPI chips on platforms
+ embedding this OMAP3 McSPI IP core.
+
config PIC32_SPI
bool "Microchip PIC32 SPI driver"
depends on MACH_PIC32
@@ -429,11 +436,4 @@ 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 OMAP3_SPI
- bool "McSPI driver for OMAP"
- help
- SPI master controller for OMAP24XX and later Multichannel SPI
- (McSPI). This driver be used to access SPI chips on platforms
- embedding this OMAP3 McSPI IP core.
-
endif # menu "SPI Support"
diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 6a615d1498..39e6813469 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -25,16 +25,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_AM33XX) || defined(CONFIG_AM43XX)
-#define OMAP3_MCSPI1_BASE 0x48030100
-#define OMAP3_MCSPI2_BASE 0x481A0100
-#else
-#define OMAP3_MCSPI1_BASE 0x48098000
-#define OMAP3_MCSPI2_BASE 0x4809A000
-#define OMAP3_MCSPI3_BASE 0x480B8000
-#define OMAP3_MCSPI4_BASE 0x480BA000
-#endif
-
#define OMAP4_MCSPI_REG_OFFSET 0x100
struct omap2_mcspi_platform_config {
@@ -109,9 +99,6 @@ struct mcspi {
};
struct omap3_spi_priv {
-#ifndef CONFIG_DM_SPI
- struct spi_slave slave;
-#endif
struct mcspi *regs;
unsigned int cs;
unsigned int freq;
@@ -455,128 +442,6 @@ static void _omap3_spi_claim_bus(struct omap3_spi_priv *priv)
writel(conf, &priv->regs->modulctrl);
}
-#ifndef CONFIG_DM_SPI
-
-static inline struct omap3_spi_priv *to_omap3_spi(struct spi_slave *slave)
-{
- return container_of(slave, struct omap3_spi_priv, slave);
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
- struct omap3_spi_priv *priv = to_omap3_spi(slave);
-
- free(priv);
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
- struct omap3_spi_priv *priv = to_omap3_spi(slave);
-
- spi_reset(priv->regs);
-
- _omap3_spi_claim_bus(priv);
- _omap3_spi_set_wordlen(priv);
- _omap3_spi_set_mode(priv);
- _omap3_spi_set_speed(priv);
-
- return 0;
-}
-
-void spi_release_bus(struct spi_slave *slave)
-{
- struct omap3_spi_priv *priv = to_omap3_spi(slave);
-
- writel(OMAP3_MCSPI_MODULCTRL_MS, &priv->regs->modulctrl);
-}
-
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
- unsigned int max_hz, unsigned int mode)
-{
- struct omap3_spi_priv *priv;
- struct mcspi *regs;
-
- /*
- * OMAP3 McSPI (MultiChannel SPI) has 4 busses (modules)
- * with different number of chip selects (CS, channels):
- * McSPI1 has 4 CS (bus 0, cs 0 - 3)
- * McSPI2 has 2 CS (bus 1, cs 0 - 1)
- * McSPI3 has 2 CS (bus 2, cs 0 - 1)
- * McSPI4 has 1 CS (bus 3, cs 0)
- */
-
- switch (bus) {
- case 0:
- regs = (struct mcspi *)OMAP3_MCSPI1_BASE;
- break;
-#ifdef OMAP3_MCSPI2_BASE
- case 1:
- regs = (struct mcspi *)OMAP3_MCSPI2_BASE;
- break;
-#endif
-#ifdef OMAP3_MCSPI3_BASE
- case 2:
- regs = (struct mcspi *)OMAP3_MCSPI3_BASE;
- break;
-#endif
-#ifdef OMAP3_MCSPI4_BASE
- case 3:
- regs = (struct mcspi *)OMAP3_MCSPI4_BASE;
- break;
-#endif
- default:
- printf("SPI error: unsupported bus %i. Supported busses 0 - 3\n", bus);
- return NULL;
- }
-
- if (((bus == 0) && (cs > 3)) ||
- ((bus == 1) && (cs > 1)) ||
- ((bus == 2) && (cs > 1)) ||
- ((bus == 3) && (cs > 0))) {
- printf("SPI error: unsupported chip select %i on bus %i\n", cs, bus);
- return NULL;
- }
-
- if (max_hz > OMAP3_MCSPI_MAX_FREQ) {
- printf("SPI error: unsupported frequency %i Hz. Max frequency is 48 MHz\n",
- max_hz);
- return NULL;
- }
-
- if (mode > SPI_MODE_3) {
- printf("SPI error: unsupported SPI mode %i\n", mode);
- return NULL;
- }
-
- priv = spi_alloc_slave(struct omap3_spi_priv, bus, cs);
- if (!priv) {
- printf("SPI error: malloc of SPI structure failed\n");
- return NULL;
- }
-
- priv->regs = regs;
- priv->cs = cs;
- priv->freq = max_hz;
- priv->mode = mode;
- priv->wordlen = priv->slave.wordlen;
-#if 0
- /* Please migrate to DM_SPI support for this feature. */
- priv->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN;
-#endif
-
- return &priv->slave;
-}
-
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
- const void *dout, void *din, unsigned long flags)
-{
- struct omap3_spi_priv *priv = to_omap3_spi(slave);
-
- return _spi_xfer(priv, bitlen, dout, din, flags);
-}
-
-#else
-
static int omap3_spi_claim_bus(struct udevice *dev)
{
struct udevice *bus = dev->parent;
@@ -701,4 +566,3 @@ U_BOOT_DRIVER(omap3_spi) = {
.ops = &omap3_spi_ops,
.priv_auto_alloc_size = sizeof(struct omap3_spi_priv),
};
-#endif
--
2.25.1
next prev parent reply other threads:[~2020-05-27 12:56 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 12:56 [PATCH v2 00/23] spi: dm-conversion (part1) Jagan Teki
2020-05-27 12:56 ` [PATCH v2 01/23] configs: igep00x0: Enable DM_SPI Jagan Teki
2020-06-03 16:14 ` Enric Balletbo i Serra
2020-06-11 9:26 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 02/23] am335x: sl50: " Jagan Teki
2020-06-03 16:14 ` Enric Balletbo i Serra
2020-06-11 9:28 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 03/23] am335x: baltos: " Jagan Teki
2020-06-13 18:01 ` Jagan Teki
2020-06-14 18:37 ` Yegor Yefremov
2020-06-18 16:23 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 04/23] am335x: igep003x: " Jagan Teki
2020-06-13 18:02 ` Jagan Teki
2020-07-07 15:27 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 05/23] siemens: draco: Enable DM_SPI, DM_SPI_FLASH Jagan Teki
2020-06-13 18:03 ` Jagan Teki
2020-07-07 15:28 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 06/23] siemens: pxm2: " Jagan Teki
2020-06-13 18:05 ` Jagan Teki
2020-07-07 15:29 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 07/23] siemens: rut: " Jagan Teki
2020-06-13 18:06 ` Jagan Teki
2020-07-07 15:29 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 08/23] compulab: Drop cm_t54 Jagan Teki
2020-06-13 18:07 ` Jagan Teki
2020-07-07 15:34 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 09/23] compulab: Drop cm_t35 Jagan Teki
2020-06-13 18:11 ` Jagan Teki
2020-07-07 15:36 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 10/23] overo: Drop omap3 overo Jagan Teki
2020-06-13 18:13 ` Jagan Teki
2020-07-07 15:40 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 11/23] pandora: Drop omap3 pandora Jagan Teki
2020-05-28 9:41 ` Gražvydas Ignotas
2020-05-29 12:39 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 12/23] logicpd: Drop omap3 zoom1 Jagan Teki
2020-06-13 18:15 ` Jagan Teki
2020-06-16 12:59 ` Nishanth Menon
2020-07-07 15:43 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 13/23] quipos: Drop omap3 cairo Jagan Teki
2020-06-13 18:17 ` Jagan Teki
2020-07-07 15:45 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 14/23] gumstix: Drop duovero Jagan Teki
2020-06-13 18:19 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 15/23] ti: Drop panda board Jagan Teki
2020-06-05 4:31 ` Lokesh Vutla
2020-06-13 18:23 ` Jagan Teki
2020-06-13 19:32 ` Peter Robinson
2020-06-13 19:35 ` Jagan Teki
2020-06-13 19:39 ` Tom Rini
2020-06-13 19:43 ` Jagan Teki
2020-06-13 23:15 ` Peter Robinson
2020-06-13 23:23 ` Tom Rini
2020-05-27 12:56 ` [PATCH v2 16/23] ti: Drop sdp4430 board Jagan Teki
2020-06-13 18:21 ` Jagan Teki
2020-07-07 15:48 ` Jagan Teki
2020-07-07 16:00 ` Tom Rini
2020-07-08 6:42 ` Jagan Teki
2020-07-08 17:55 ` Tom Rini
2020-05-27 12:56 ` [PATCH v2 17/23] ti: Drop omap5 uevm Jagan Teki
2020-06-05 4:32 ` Lokesh Vutla
2020-06-13 18:24 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 18/23] birdland: Drop bav335x Jagan Teki
2020-06-13 18:26 ` Jagan Teki
2020-07-07 15:51 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 19/23] gumstix: Drop pepper Jagan Teki
2020-06-13 18:27 ` Jagan Teki
2020-07-07 15:53 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 20/23] phytec: Drop pcm051 Jagan Teki
2020-05-27 14:10 ` Lars Poeschel
2020-05-29 12:40 ` Jagan Teki
2020-05-27 12:56 ` [PATCH v2 21/23] silica: Drop pengwyn Jagan Teki
2020-06-13 18:28 ` Jagan Teki
2020-07-07 15:55 ` Jagan Teki
2020-05-27 12:56 ` Jagan Teki [this message]
2020-05-27 12:56 ` [PATCH v2 23/23] doc: driver-model: Update SPI migration status Jagan Teki
2020-05-27 13:27 ` [PATCH v2 00/23] spi: dm-conversion (part1) Simon Glass
2020-05-27 15:55 ` Jagan Teki
2020-05-28 3:08 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200527125637.149189-23-jagan@amarulasolutions.com \
--to=jagan@amarulasolutions.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox