All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: JaimeLiao <jaimeliao.tw@gmail.com>
Cc: u-boot@lists.denx.de, vigneshr@ti.com, p.yadav@ti.com,
	 zhengxunli@mxic.com.tw, jaimeliao@mxic.com.tw
Subject: Re: [PATCH v4 2/4] mtd: spi-nor-core: Adding different type of command extension in Soft Reset
Date: Mon, 25 Oct 2021 12:30:57 +0530	[thread overview]
Message-ID: <CAMty3ZAD0kxpZ-ZHQMaamLYnmbtPHDD3e6UPNya4VH+3Pjzf9g@mail.gmail.com> (raw)
In-Reply-To: <20211018062428.4201-3-jaimeliao.tw@gmail.com>

On Mon, Oct 18, 2021 at 11:54 AM JaimeLiao <jaimeliao.tw@gmail.com> wrote:
>
> Power-on-Reset is a method to restore flash back to 1S-1S-1S mode from 8D-8D-8D
> in the begging of probe.
>
> Command extension type is not standardized across flash vendors in DTR mode.
>
> For suiting different vendor flash devices, adding a flag to seperate types for
> soft reset on boot.
>
> Signed-off-by: JaimeLiao <jaimeliao.tw@gmail.com>
> ---
>  drivers/mtd/spi/Kconfig        | 7 +++++++
>  drivers/mtd/spi/spi-nor-core.c | 7 ++++++-
>  2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig
> index 67599b32c9..8304d6c973 100644
> --- a/drivers/mtd/spi/Kconfig
> +++ b/drivers/mtd/spi/Kconfig
> @@ -97,6 +97,13 @@ config SPI_FLASH_SMART_HWCAPS
>          can support a type of operation in a much more refined way compared
>          to using flags like SPI_RX_DUAL, SPI_TX_QUAD, etc.
>
> +config SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT
> +       bool "Command extension type is INVERT for Software Reset on boot"
> +       default n
> +       help
> +        Because of SFDP information can not be get before boot.
> +        So define command extension type is INVERT when Software Reset on boot only.
> +
>  config SPI_FLASH_SOFT_RESET
>         bool "Software Reset support for SPI NOR flashes"
>         default n
> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
> index fdaca0a0d3..87a7de7d60 100644
> --- a/drivers/mtd/spi/spi-nor-core.c
> +++ b/drivers/mtd/spi/spi-nor-core.c
> @@ -3661,7 +3661,12 @@ static int spi_nor_soft_reset(struct spi_nor *nor)
>         enum spi_nor_cmd_ext ext;
>
>         ext = nor->cmd_ext_type;
> -       nor->cmd_ext_type = SPI_NOR_EXT_REPEAT;
> +       if (nor->cmd_ext_type == SPI_NOR_EXT_NONE) {
> +               nor->cmd_ext_type = SPI_NOR_EXT_REPEAT;
> +#if CONFIG_IS_ENABLED(SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT)
> +               nor->cmd_ext_type = SPI_NOR_EXT_INVERT;
> +#endif /* SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT */

I think we can get the SPI_NOR_EXT_INVERT by parsing bfpt, can you try
it that way instead of new macro?

Jagan.

  reply	other threads:[~2021-10-25  7:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  6:24 [PATCH v4 0/4] Add octal DTR support for Macronix flash JaimeLiao
2021-10-18  6:24 ` [PATCH v4 1/4] mtd: spi-nor: macronix: add support for Macronix Octal JaimeLiao
2021-10-25  6:56   ` Jagan Teki
2021-11-03 10:41     ` liao jaime
2021-11-13 13:44       ` Jagan Teki
2021-10-18  6:24 ` [PATCH v4 2/4] mtd: spi-nor-core: Adding different type of command extension in Soft Reset JaimeLiao
2021-10-25  7:00   ` Jagan Teki [this message]
2021-10-25 19:42     ` Pratyush Yadav
2021-10-26  6:42       ` liao jaime
2021-10-26  7:03       ` liao jaime
2021-10-18  6:24 ` [PATCH v4 3/4] mtd: spi-nor-core: set 4byte opcode when possible JaimeLiao
2021-10-25 19:44   ` Pratyush Yadav
2021-10-26  7:00     ` liao jaime
2021-10-18  6:24 ` [PATCH v4 4/4] mtd: spi-nor-core: Add support for Macronix Octal flash JaimeLiao
2021-10-25 19:45   ` Pratyush Yadav
2021-10-26  6:47     ` liao jaime
2021-10-26  7:02     ` liao jaime

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=CAMty3ZAD0kxpZ-ZHQMaamLYnmbtPHDD3e6UPNya4VH+3Pjzf9g@mail.gmail.com \
    --to=jagan@amarulasolutions.com \
    --cc=jaimeliao.tw@gmail.com \
    --cc=jaimeliao@mxic.com.tw \
    --cc=p.yadav@ti.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    --cc=zhengxunli@mxic.com.tw \
    /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.