In my experiment,
adding a chip reset logic as described in Micron's TN (https://www.google.co.kr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAA&url=h...
seems to solve the problem.
I just added the following chip reset code to spi_nor.c before JEDEC probing and haven't seen any probing failure for a day.
#define SPINOR_OP_RSTEN 0x66 /* Reset enable command */
#define SPINOR_OP_RSTMEM 0x99 /* Reset device, follows reset enable */
static void
spi_nor_soft_reset(struct spi_nor* nor)
{
dev_err(nor->dev, "XXX hkim back: performing reset\n");
// 8 clock cycle, DQ0 high, DQ3 is already high through VCC.
nor->write_reg(nor, 0xff, NULL, 0, 0);
// soft-reset command
nor->write_reg(nor, SPINOR_OP_RSTEN, NULL, 0, 0);
nor->write_reg(nor, SPINOR_OP_RSTMEM, NULL, 0, 0);
// XXX FSR or just SR???
//(void)wait_till_ready(nor);
spi_nor_wait_till_fsr_ready(nor);
}
int spi_nor_scan(struct spi_nor *nor, const struct spi_device_id *id,
enum read_mode mode)
{
struct flash_info *info;
struct flash_platform_data *data;
struct device *dev = nor->dev;
struct mtd_info *mtd = nor->mtd;
struct device_node *np = dev->of_node;
int ret;
int i;
ret = spi_nor_check(nor);
if (ret)
return ret;
spi_nor_soft_reset(nor);
...
...
...
I know this is just an experiment and not a clean solution.
Thanks