[PATCH 3/3] mtd: spinand: winbond: Clarify when to enable the HS bit
Michael Nazzareno Trimarchi
michael at amarulasolutions.com
Sun Apr 5 11:13:59 CEST 2026
Hi
On Fri, Apr 3, 2026 at 6:17 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>
> Above 104MHz when in fast dual or quad I/O reads, the delay between
> address and data cycles is too short. It is possible to reach higher
> frequencies, up to 166MHz, by adding a few more dummy cycles through the
> setting of the HS bit. Improve the condition for enabling this bit, and
> also make sure we set it at soon as we go over 104MHz.
>
> Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
> ---
> This is a port from Linux.
> ---
> drivers/mtd/nand/spi/winbond.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
> index 79c3354efb65..accb46dfeb03 100644
> --- a/drivers/mtd/nand/spi/winbond.c
> +++ b/drivers/mtd/nand/spi/winbond.c
> @@ -261,16 +261,19 @@ static int w25n0xjw_hs_cfg(struct spinand_device *spinand)
> u8 sr4;
> int ret;
>
> + /*
> + * SDR dual and quad I/O operations over 104MHz require the HS bit to
> + * enable a few more dummy cycles.
> + */
> op = spinand->op_templates.read_cache;
> if (op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr)
> hs = false;
> - else if (op->cmd.buswidth == 1 && op->addr.buswidth == 1 &&
> - op->dummy.buswidth == 1 && op->data.buswidth == 1)
> + else if (op->cmd.buswidth != 1 || op->addr.buswidth != 1)
> + hs = false;
> + else if (op->max_freq && op->max_freq <= 104 * HZ_PER_MHZ)
> hs = false;
> - else if (!op->max_freq)
> - hs = true;
> else
> - hs = false;
> + hs = true;
>
Reviewed-by: Michael Trimarchi <michael at amarulasolutions.com>
> ret = spinand_read_reg_op(spinand, W25N0XJW_SR4, &sr4);
> if (ret)
>
> --
> 2.53.0
>
--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________
Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com
More information about the U-Boot
mailing list