All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 5/9] spi: davinci: Drop non-dm code
Date: Wed, 27 May 2020 19:30:24 -0500	[thread overview]
Message-ID: <CAHCN7xJGPMDXLhz=UwnbQ9Srz4LpQfe_okDiDcN0jXeoy8782A@mail.gmail.com> (raw)
In-Reply-To: <20200526080430.118262-6-jagan@amarulasolutions.com>

On Tue, May 26, 2020 at 3:04 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> 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.

>
> Cc: Adam Ford <aford173@gmail.com>

Tested-by: Adam Ford <aford173@gmail.com> #da850-evm

> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  drivers/spi/Kconfig                  |  12 +-
>  drivers/spi/davinci_spi.c            | 157 ---------------------------
>  include/configs/ti_armv7_keystone2.h |   9 --
>  3 files changed, 6 insertions(+), 172 deletions(-)
>
> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> index 59415209ee..1a1f195232 100644
> --- a/drivers/spi/Kconfig
> +++ b/drivers/spi/Kconfig
> @@ -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
> diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
> index 97ac97b1a5..e1e9b45cc9 100644
> --- a/drivers/spi/davinci_spi.c
> +++ b/drivers/spi/davinci_spi.c
> @@ -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
> diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
> index 37210b2605..b632ae010d 100644
> --- a/include/configs/ti_armv7_keystone2.h
> +++ b/include/configs/ti_armv7_keystone2.h
> @@ -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
>

  reply	other threads:[~2020-05-28  0:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  8:04 [PATCH 0/9] spi: dm-convert and cleanups Jagan Teki
2020-05-26  8:04 ` [PATCH 1/9] spi Drop spi_init() Jagan Teki
2020-05-27 18:21   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 2/9] spi: Kconfig: Drop redundant CF_SPI definition Jagan Teki
2020-05-27 18:22   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 3/9] spi: Kconfig: Move MSCC_BB_SPI, FSL_QSPI into DM_SPI Jagan Teki
2020-05-27 18:22   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 4/9] ks2_evm: Switch to DM_SPL, SPL_OF_CONTROL Jagan Teki
2020-06-11  8:46   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 5/9] spi: davinci: Drop non-dm code Jagan Teki
2020-05-28  0:30   ` Adam Ford [this message]
2020-06-11  8:47   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 6/9] spi: mxs: Drop nondm code Jagan Teki
2020-06-11  8:38   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 7/9] spi: mxs: Code cleanup Jagan Teki
2020-06-11  8:39   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 8/9] spi: Zap SOFT_SPI (non-dm) Jagan Teki
2020-05-31 14:07   ` Simon Glass
2020-06-11  8:40   ` Jagan Teki
2020-05-26  8:04 ` [PATCH 9/9] doc: driver-model: Update SPI migration status Jagan Teki
2020-05-31 14:07   ` 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='CAHCN7xJGPMDXLhz=UwnbQ9Srz4LpQfe_okDiDcN0jXeoy8782A@mail.gmail.com' \
    --to=aford173@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.