From: Takahiro Kuwano <tkuw584924@gmail.com>
To: Tudor Ambarus <tudor.ambarus@linaro.org>, u-boot@lists.denx.de
Cc: trini@konsulko.com, jagan@amarulasolutions.com, vigneshr@ti.com,
venkatesh.abbarapu@amd.com, Shinsuke.Okada@infineon.com,
Bacem.Daassi@infineon.com,
Takahiro Kuwano <Takahiro.Kuwano@infineon.com>,
Hiroyuki Saito <Hiroyuki.Saito2@infineon.com>
Subject: Re: [PATCH] mtd: spi-nor: Set address mode in SEMPER flash when SFDP is skipped
Date: Tue, 21 Oct 2025 16:41:39 +0900 [thread overview]
Message-ID: <020c68a0-b5ad-4fec-91bb-a75effa15143@gmail.com> (raw)
In-Reply-To: <7f46828a-94b5-4e63-a18c-ec139484275e@linaro.org>
Hi Tudor,
On 10/21/2025 3:36 AM, Tudor Ambarus wrote:
> Hi, Takahiro,
>
> On 10/20/25 8:25 AM, tkuw584924@gmail.com wrote:
>> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>>
>> nor->addr_mode_nbytes is set during SFDP parse. Infineon SEMPER flash
>> family relies on that parameter to read and write registers. To support
>> use cases of skipping SFDP, set address mode in device specific setup()
>> function.
>>
>> Tested-by: Hiroyuki Saito <Hiroyuki.Saito2@infineon.com>
>> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>> ---
>> drivers/mtd/spi/spi-nor-core.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
>> index 6f352c5c0e2..e382a518a34 100644
>> --- a/drivers/mtd/spi/spi-nor-core.c
>> +++ b/drivers/mtd/spi/spi-nor-core.c
>> @@ -3794,6 +3794,16 @@ static int s25_s28_setup(struct spi_nor *nor, const struct flash_info *info,
>> #ifdef CONFIG_SPI_FLASH_BAR
>> return -ENOTSUPP; /* Bank Address Register is not supported */
>> #endif
>> +
>> + /* Setup address mode here, in case SFDP is skipped. */
>
> Under which conditions is the SFDP skipped?
>
In u-boot, SFDP is config option and some defconfig do not use it.
>> + if (!nor->addr_mode_nbytes) {
>> + ret = set_4byte(nor, nor->info, 1);
>
> why do you need this call? Isn't enough the one done in spi_nor_init()?
>
The addr_mode_nbytes is refereed in spansion_read_any_reg() during
setup().
> Cheers,
> ta> + if (ret)
>> + return ret;
>> +
>> + nor->addr_mode_nbytes = 4;
>> + }
>> +
>> /*
>> * S25FS256T has multiple sector architecture options, with selection of
>> * count and location of 128KB and 64KB sectors. This driver supports
next prev parent reply other threads:[~2025-10-21 7:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 7:25 [PATCH] mtd: spi-nor: Set address mode in SEMPER flash when SFDP is skipped tkuw584924
2025-10-20 18:36 ` Tudor Ambarus
2025-10-21 7:41 ` Takahiro Kuwano [this message]
2025-10-23 8:21 ` Tudor Ambarus
2025-10-27 6:40 ` Takahiro Kuwano
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=020c68a0-b5ad-4fec-91bb-a75effa15143@gmail.com \
--to=tkuw584924@gmail.com \
--cc=Bacem.Daassi@infineon.com \
--cc=Hiroyuki.Saito2@infineon.com \
--cc=Shinsuke.Okada@infineon.com \
--cc=Takahiro.Kuwano@infineon.com \
--cc=jagan@amarulasolutions.com \
--cc=trini@konsulko.com \
--cc=tudor.ambarus@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=venkatesh.abbarapu@amd.com \
--cc=vigneshr@ti.com \
/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