mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
mtd: spi-nor-core: Add octal mode support
Add support for Octal flash devices. Octal flash devices use 8 IO lines for data transfer. Currently only 1-1-8 Octal Read mode is supported. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
This commit is contained in:
committed by
Jagan Teki
parent
ffab212123
commit
658df8bd94
@@ -251,6 +251,8 @@ static u8 spi_nor_convert_3to4_read(u8 opcode)
|
||||
{ SPINOR_OP_READ_1_2_2, SPINOR_OP_READ_1_2_2_4B },
|
||||
{ SPINOR_OP_READ_1_1_4, SPINOR_OP_READ_1_1_4_4B },
|
||||
{ SPINOR_OP_READ_1_4_4, SPINOR_OP_READ_1_4_4_4B },
|
||||
{ SPINOR_OP_READ_1_1_8, SPINOR_OP_READ_1_1_8_4B },
|
||||
{ SPINOR_OP_READ_1_8_8, SPINOR_OP_READ_1_8_8_4B },
|
||||
|
||||
{ SPINOR_OP_READ_1_1_1_DTR, SPINOR_OP_READ_1_1_1_DTR_4B },
|
||||
{ SPINOR_OP_READ_1_2_2_DTR, SPINOR_OP_READ_1_2_2_DTR_4B },
|
||||
@@ -267,6 +269,8 @@ static u8 spi_nor_convert_3to4_program(u8 opcode)
|
||||
{ SPINOR_OP_PP, SPINOR_OP_PP_4B },
|
||||
{ SPINOR_OP_PP_1_1_4, SPINOR_OP_PP_1_1_4_4B },
|
||||
{ SPINOR_OP_PP_1_4_4, SPINOR_OP_PP_1_4_4_4B },
|
||||
{ SPINOR_OP_PP_1_1_8, SPINOR_OP_PP_1_1_8_4B },
|
||||
{ SPINOR_OP_PP_1_8_8, SPINOR_OP_PP_1_8_8_4B },
|
||||
};
|
||||
|
||||
return spi_nor_convert_opcode(opcode, spi_nor_3to4_program,
|
||||
@@ -2169,6 +2173,13 @@ static int spi_nor_init_params(struct spi_nor *nor,
|
||||
SNOR_PROTO_1_1_4);
|
||||
}
|
||||
|
||||
if (info->flags & SPI_NOR_OCTAL_READ) {
|
||||
params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8;
|
||||
spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8],
|
||||
0, 8, SPINOR_OP_READ_1_1_8,
|
||||
SNOR_PROTO_1_1_8);
|
||||
}
|
||||
|
||||
/* Page Program settings. */
|
||||
params->hwcaps.mask |= SNOR_HWCAPS_PP;
|
||||
spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP],
|
||||
@@ -2476,7 +2487,14 @@ int spi_nor_scan(struct spi_nor *nor)
|
||||
nor->read_reg = spi_nor_read_reg;
|
||||
nor->write_reg = spi_nor_write_reg;
|
||||
|
||||
if (spi->mode & SPI_RX_QUAD) {
|
||||
if (spi->mode & SPI_RX_OCTAL) {
|
||||
hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8;
|
||||
|
||||
if (spi->mode & SPI_TX_OCTAL)
|
||||
hwcaps.mask |= (SNOR_HWCAPS_READ_1_8_8 |
|
||||
SNOR_HWCAPS_PP_1_1_8 |
|
||||
SNOR_HWCAPS_PP_1_8_8);
|
||||
} else if (spi->mode & SPI_RX_QUAD) {
|
||||
hwcaps.mask |= SNOR_HWCAPS_READ_1_1_4;
|
||||
|
||||
if (spi->mode & SPI_TX_QUAD)
|
||||
|
Reference in New Issue
Block a user