This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VH-Q1: norflash write protection problem

Part Number: TDA4VH-Q1

Tool/software:

Hi,

SDK:8.6

At present, our project needs to implement flash write protection function, and the implementation method is as follows:

When the system is powered on,configure flash write protection for the entire flash on MCU1_0, and then when A72 is running,load the spi-cadence-quadspi.ko driver,

and disabled write protection,so we can use the mtd dev to erase flash.

However, after flash write protection is enabled for Mcu1_0, the flash driver fails to be loaded on A72, and the kernel reports the following error:

[root@]# insmod spi-nor.ko
[root@]# insmod spi-cadence-quadspi.ko
[  191.005523] nor->info->id:44  buf:0
[  191.005534] spi-nor spi7.0: octal mode not supported
[  191.014006] spi-nor: probe of spi7.0 failed with error -22

I looked at the source code and found that the problem was in /kernel/driver/mtd/spi-nor/micron-st.c,enabled octal dtr failed:

/* 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_NO_ADDR,
			   SPI_MEM_OP_DUMMY(enable ? 8 : 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;

	if (memcmp(buf, nor->info->id, nor->info->id_len)){
		printk("nor->info->id:%u  buf:%u",nor->info->id[0],buf[0]);
		return -EINVAL;
	}

mcu1_0 only changes the write status register (01h), and A72 cannot be loaded after configuration, but without rewriting the status register, the driver is normal.

Is there any way to determine which registers are affecting driver loading?