From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] mtd: spi: Drop sf.c
Date: Fri, 2 Aug 2019 12:54:52 +0200 [thread overview]
Message-ID: <20190802125452.678de963@jawa> (raw)
In-Reply-To: <20190722115258.8044-3-jagan@amarulasolutions.com>
Hi Jagan,
> spi_write_then_read, will manage to do the respective
> spi_xfer based on the tx_buf, rx_buf so drop the
> legacy spi_flash_read/write/cm code.
I guess that the 'sf' command will stay with us a bit longer to avoid
compatibility issues on some legacy boards?
And I also assume that we now advice to switch to 'mtd' command instead
of (now deprecated?) 'sf' ?
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
> drivers/mtd/spi/Makefile | 2 +-
> drivers/mtd/spi/sf.c | 53
> ----------------------------------- drivers/mtd/spi/sf_internal.h |
> 18 ------------ 3 files changed, 1 insertion(+), 72 deletions(-)
> delete mode 100644 drivers/mtd/spi/sf.c
>
> diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
> index f99f6cb16e..20db1015d9 100644
> --- a/drivers/mtd/spi/Makefile
> +++ b/drivers/mtd/spi/Makefile
> @@ -18,6 +18,6 @@ spi-nor-y += spi-nor-core.o
> endif
>
> obj-$(CONFIG_SPI_FLASH) += spi-nor.o
> -obj-$(CONFIG_SPI_FLASH_DATAFLASH) += sf_dataflash.o sf.o
> +obj-$(CONFIG_SPI_FLASH_DATAFLASH) += sf_dataflash.o
> obj-$(CONFIG_SPI_FLASH_MTD) += sf_mtd.o
> obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
> diff --git a/drivers/mtd/spi/sf.c b/drivers/mtd/spi/sf.c
> deleted file mode 100644
> index ee3cf8b759..0000000000
> --- a/drivers/mtd/spi/sf.c
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0+
> -/*
> - * SPI flash interface
> - *
> - * Copyright (C) 2008 Atmel Corporation
> - * Copyright (C) 2010 Reinhard Meyer, EMK Elektronik
> - */
> -
> -#include <common.h>
> -#include <spi.h>
> -
> -static int spi_flash_read_write(struct spi_slave *spi,
> - const u8 *cmd, size_t cmd_len,
> - const u8 *data_out, u8 *data_in,
> - size_t data_len)
> -{
> - unsigned long flags = SPI_XFER_BEGIN;
> - int ret;
> -
> - if (data_len == 0)
> - flags |= SPI_XFER_END;
> -
> - ret = spi_xfer(spi, cmd_len * 8, cmd, NULL, flags);
> - if (ret) {
> - debug("SF: Failed to send command (%zu bytes): %d\n",
> - cmd_len, ret);
> - } else if (data_len != 0) {
> - ret = spi_xfer(spi, data_len * 8, data_out, data_in,
> - SPI_XFER_END);
> - if (ret)
> - debug("SF: Failed to transfer %zu bytes of
> data: %d\n",
> - data_len, ret);
> - }
> -
> - return ret;
> -}
> -
> -int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
> - size_t cmd_len, void *data, size_t data_len)
> -{
> - return spi_flash_read_write(spi, cmd, cmd_len, NULL, data,
> data_len); -}
> -
> -int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response,
> size_t len) -{
> - return spi_flash_cmd_read(spi, &cmd, 1, response, len);
> -}
> -
> -int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t
> cmd_len,
> - const void *data, size_t data_len)
> -{
> - return spi_flash_read_write(spi, cmd, cmd_len, data, NULL,
> data_len); -}
> diff --git a/drivers/mtd/spi/sf_internal.h
> b/drivers/mtd/spi/sf_internal.h index a6bf734830..ece6fbc258 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -72,24 +72,6 @@ extern const struct flash_info spi_nor_ids[];
> #define JEDEC_MFR(info) ((info)->id[0])
> #define JEDEC_ID(info) (((info)->id[1]) << 8 |
> ((info)->id[2]))
> -/* Send a single-byte command to the device and read the response */
> -int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response,
> size_t len); -
> -/*
> - * Send a multi-byte command to the device and read the response.
> Used
> - * for flash array reads, etc.
> - */
> -int spi_flash_cmd_read(struct spi_slave *spi, const u8 *cmd,
> - size_t cmd_len, void *data, size_t data_len);
> -
> -/*
> - * Send a multi-byte command to the device followed by (optional)
> - * data. Used for programming the flash array, etc.
> - */
> -int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t
> cmd_len,
> - const void *data, size_t data_len);
> -
> -
> /* Get software write-protect value (BP bits) */
> int spi_flash_cmd_get_sw_write_prot(struct spi_flash *flash);
>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190802/c34d2cb9/attachment.sig>
next prev parent reply other threads:[~2019-08-02 10:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 11:52 [U-Boot] [PATCH 1/3] spi: Add spi_write_then_read Jagan Teki
2019-07-22 11:52 ` [U-Boot] [PATCH 2/3] mtd: spi_dataflash: Use spi read then write Jagan Teki
2019-07-22 11:52 ` [U-Boot] [PATCH 3/3] mtd: spi: Drop sf.c Jagan Teki
2019-08-02 10:54 ` Lukasz Majewski [this message]
2019-08-02 11:58 ` Jagan Teki
2019-07-23 14:27 ` [U-Boot] [PATCH 1/3] spi: Add spi_write_then_read Adam Ford
2019-09-07 4:01 ` Jagan Teki
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=20190802125452.678de963@jawa \
--to=lukma@denx.de \
--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