Skip to content

Commit f1f1976

Browse files
committed
mtd: spi-nor: core: Update name and description of spansion_set_4byte_addr_mode
Rename method to spi_nor_set_4byte_addr_mode_brwr and extend its description. This method is described in JESD216 BFPT[SFDP_DWORD(16)], BIT(28) and BIT(20). Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20230331074606.3559258-4-tudor.ambarus@linaro.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
1 parent 288df43 commit f1f1976

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/mtd/spi-nor/core.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,15 +564,20 @@ int spi_nor_set_4byte_addr_mode_wren_en4b_ex4b(struct spi_nor *nor, bool enable)
564564
}
565565

566566
/**
567-
* spansion_set_4byte_addr_mode() - Set 4-byte address mode for Spansion
568-
* flashes.
567+
* spi_nor_set_4byte_addr_mode_brwr() - Set 4-byte address mode using
568+
* SPINOR_OP_BRWR. Typically used by Spansion flashes.
569569
* @nor: pointer to 'struct spi_nor'.
570570
* @enable: true to enter the 4-byte address mode, false to exit the 4-byte
571571
* address mode.
572572
*
573+
* 8-bit volatile bank register used to define A[30:A24] bits. MSB (bit[7]) is
574+
* used to enable/disable 4-byte address mode. When MSB is set to ‘1’, 4-byte
575+
* address mode is active and A[30:24] bits are don’t care. Write instruction is
576+
* SPINOR_OP_BRWR(17h) with 1 byte of data.
577+
*
573578
* Return: 0 on success, -errno otherwise.
574579
*/
575-
static int spansion_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
580+
static int spi_nor_set_4byte_addr_mode_brwr(struct spi_nor *nor, bool enable)
576581
{
577582
int ret;
578583

@@ -2966,7 +2971,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
29662971
struct device_node *np = spi_nor_get_flash_node(nor);
29672972

29682973
params->quad_enable = spi_nor_sr2_bit1_quad_enable;
2969-
params->set_4byte_addr_mode = spansion_set_4byte_addr_mode;
2974+
params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode_brwr;
29702975
params->otp.org = &info->otp_org;
29712976

29722977
/* Default to 16-bit Write Status (01h) Command */

0 commit comments

Comments
 (0)