Hello TI's supporter,
After our custom board work well with S28HS01GT OSPI Flash device.
At the moment, we changed to higher volumes with S28HS02GT OSPI Flash device, but it can't work.
Detailed inform:
- SoC: AM6442
- Bootmode: xSPI and SD card.
- Bootloader: tiboot3.bin is created from R5 SPL boot loader.
OSPI driver failed at function spi_nor_cypress_octal_dtr_enable():
log:[ 1.540643] spi_nor_cypress_octal_dtr_enable:nor->info->id_len:3
[ 1.546659] spi_nor_cypress_octal_dtr_enable:nor->info->id:34
[ 1.552397] spi_nor_cypress_octal_dtr_enable:nor->info->id:5b
[ 1.558140] spi_nor_cypress_octal_dtr_enable:nor->info->id:1c
[ 1.563877] spi_nor_cypress_octal_dtr_enable:buf:0
[ 1.568659] spi_nor_cypress_octal_dtr_enable:buf:0
[ 1.573441] spi_nor_cypress_octal_dtr_enable:buf:0
[ 1.578223] spi_nor_cypress_octal_dtr_enable:OSPI error is here
[ 1.591209] spi-nor: probe of spi0.0 failed with error -22
I added log at the spi_nor_cypress_octal_dtr_enable() function of spansion.c
static int spi_nor_cypress_octal_dtr_enable(struct spi_nor *nor, bool enable)
{
struct spi_mem_op op;
u8 *buf = nor->bouncebuf;
int ret;
if (enable) {
/* Use 24 dummy cycles for memory array reads. */
ret = spi_nor_write_enable(nor);
if (ret)
return ret;
*buf = SPINOR_REG_CYPRESS_CFR2V_MEMLAT_11_24;
op = (struct spi_mem_op)
SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WR_ANY_REG, 1),
SPI_MEM_OP_ADDR(3, SPINOR_REG_CYPRESS_CFR2V, 1),
SPI_MEM_OP_NO_DUMMY SPI_MEM_OP_DATA_OUT(1, buf, 1));
ret = spi_mem_exec_op(nor->spimem, &op);
if (ret)
return ret;
ret = spi_nor_wait_till_ready(nor);
if (ret)
return ret;
nor->read_dummy = 24;
}
/* Set/unset the octal and DTR enable bits. */
ret = spi_nor_write_enable(nor);
if (ret)
return ret;
if (enable)
*buf = SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_EN;
else
*buf = SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_DS;
op = (struct spi_mem_op)
SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WR_ANY_REG, 1),
SPI_MEM_OP_ADDR(enable ? 3 : 4,
SPINOR_REG_CYPRESS_CFR5V,
1),
SPI_MEM_OP_NO_DUMMY,
SPI_MEM_OP_DATA_OUT(1, buf, 1));
if (!enable)
spi_nor_spimem_setup_op(nor, &op, SNOR_PROTO_8_8_8_DTR);
ret = spi_mem_exec_op(nor->spimem, &op);
if (ret)
return ret;
/* Read flash ID to make sure the switch was successful. */
op = (struct spi_mem_op)
SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_RDID, 1),
SPI_MEM_OP_ADDR(enable ? 4 : 0, 0, 1),
SPI_MEM_OP_DUMMY(enable ? 3 : 0, 1),
SPI_MEM_OP_DATA_IN(round_up(nor->info->id_len, 2),
buf, 1));
if (enable)
spi_nor_spimem_setup_op(nor, &op, SNOR_PROTO_8_8_8_DTR);
ret = spi_mem_exec_op(nor->spimem, &op);
if (ret)
return ret;
printk ("%s:nor->info->id_len:%d\n", __func__, nor->info->id_len);
printk ("%s:nor->info->id:%x\n", __func__, nor->info->id[0]);
printk ("%s:nor->info->id:%x\n", __func__, nor->info->id[1]);
printk ("%s:nor->info->id:%x\n", __func__, nor->info->id[2]);
printk ("%s:buf:%x\n", __func__, buf[0]);
printk ("%s:buf:%x\n", __func__, buf[1]);
printk ("%s:buf:%x\n", __func__, buf[2]);
if (memcmp(buf, nor->info->id, nor->info->id_len)) {
printk ("%s:OSPI error is here\n", __func__); //????? FAIL HERE
return -EINVAL;
}
return 0;
}
I mean switching to DTR mode the driver couldn't read ID of device.
Can you give your suggestion?
Many thank you for your effort and your investigation
Thinh