From: Michael Walle <michael@walle.cc>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
linux-renesas-soc@vger.kernel.org,
Vignesh Raghavendra <vigneshr@ti.com>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
Mark Brown <broonie@kernel.org>,
MTD Maling List <linux-mtd@lists.infradead.org>,
linux-spi <linux-spi@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH] memory: renesas-rpc-if: Fix IO state based on flash type
Date: Thu, 14 Sep 2023 15:17:20 +0200 [thread overview]
Message-ID: <9bf6cf6f104145080d38c8658000c24b@walle.cc> (raw)
In-Reply-To: <OS0PR01MB5922AED5B1490E251669F45186F7A@OS0PR01MB5922.jpnprd01.prod.outlook.com>
>> >> >> > I'm not sure we can do that, as this code is part of the
>> >> >> > hardware initialization during probing.
>> >> >> > Biju: is this needed that early, or can it be done later, after
>> >> >> > the connected device has been identified?
>> >> >>
>> >> >> I need to check that.
>> >> >>
>> >> >> You mean patch drivers/spi/spi-rpc-if.c to identify the flash type
>> >> >> from sfdp info and pass as a parameter to rpcif_hw_init??
>> >> >
>> >> > Something like that.
>> >> >
>> >> > That configuration should be saved somewhere, as rpcif_hw_init() is
>> >> > also called from rpcif_resume(), and when recovering from an error
>> >> > in rpcif_manual_xfer().
>> >>
>> >> I'm not sure I follow everything here, but apparently you want to set
>> >> the mode of the I/O pins of the controller, right? Shouldn't that
>> >> depend on the spi-mem mode, i.e. the buswidth? Certainly not on the
>> >> type of flash which is connected to the spi controller.
>> >
>> >
>> > How do you handle the IO states sections mentioned in the HW manual[1]
>> > and [2]?
>>
>> What do you mean by "IO states" you don't configure anything on the
>> SPI
>> flash, do you?
>>
>> I guess you should have to configure your SoC SPI pins in your
>> .exec_op()
>> callback according to the buswidth property.
>
> Here, same 4-bit tx_mode IO pin (QSPIn_IO0 Fixed Value for 1-bit Size)
> to be configured based on flash type and bus width right?
Just bus width. There should be no dependency on the flash type.
> For eg: here Adesto flash requires HI-Z for IO3 pin and Micron flash
> requires setting "1" for IO3 pin for 4-bit mode to work.
That is odd. You'd need to ask Micron, but I assume it is because
IO3 is shared with hold# and reset#. And there is a note "For pin
configurations that share the DQ3 pin with RESET#, the RESET#
functionality is disabled in QIO-SPI mode". So I guess the reason
why they asking for a '1' is because they don't want to reset the
flash. I'm pretty sure, we don't really support this in linux, so
you'd probably want to disable that feature, i.e. see Table 7,
bit 4. You could also come around this by enabling a pull-up on
that line (assuming the SPI controller 'drives' HiZ during command
phase).
>
> Have a look at the other spi
>> drivers. I'm not that familiar with the spi controller drivers.
>>
>> > Without this setting flash detection/ read/write failing with tx in
>> > 4-bit mode.
>> >
>> > [1] Figure 20: QUAD INPUT/OUTPUT FAST READ - EBh/ECh
>> >
>> > [2] section 8.14
>> >
>> > https://www.renesas.com/eu/en/document/dst/at25ql128a-datasheet?r=1608
>> > 586
>>
>> Section 8.14 shows a Read with Quad I/O and the flash will tri-state
>> the
>> I/O lines during the command and dummy phase and drive them during
>> data
>> phase (and expect an address from the SoC on all I/Os during address
>> and
>> mode phase).
>
> I agree, What about micron flash??
>
> Cheers,
> Biju
next prev parent reply other threads:[~2023-09-14 13:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230830145835.296690-1-biju.das.jz@bp.renesas.com>
2023-08-30 15:08 ` [PATCH] memory: renesas-rpc-if: Fix IO state based on flash type Geert Uytterhoeven
2023-08-30 15:18 ` Biju Das
2023-09-14 8:08 ` Krzysztof Kozlowski
2023-09-14 8:34 ` Geert Uytterhoeven
2023-09-14 8:59 ` Miquel Raynal
2023-09-14 9:04 ` Geert Uytterhoeven
2023-09-14 9:12 ` Miquel Raynal
2023-09-14 9:23 ` Geert Uytterhoeven
2023-09-14 9:37 ` Biju Das
2023-09-14 9:55 ` Geert Uytterhoeven
2023-09-14 11:27 ` Michael Walle
2023-09-14 12:17 ` Biju Das
2023-09-14 12:31 ` Michael Walle
2023-09-14 12:59 ` Biju Das
2023-09-14 13:17 ` Michael Walle [this message]
2023-09-14 13:32 ` Michael Walle
2023-11-08 10:57 ` Biju Das
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=9bf6cf6f104145080d38c8658000c24b@walle.cc \
--to=michael@walle.cc \
--cc=biju.das.jz@bp.renesas.com \
--cc=broonie@kernel.org \
--cc=geert@linux-m68k.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh+dt@kernel.org \
--cc=tudor.ambarus@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).