hw/block:m25p80: Support write status register 2 command (0x31) for w25q01jvq
authorJamin Lin <jamin_lin@aspeedtech.com>
Tue, 22 Oct 2024 09:40:55 +0000 (17:40 +0800)
committerCédric Le Goater <clg@redhat.com>
Thu, 24 Oct 2024 05:57:47 +0000 (07:57 +0200)
commit9785731ec4f7f314d583e65114da5afd90980420
treef10442d2254e1b8e446295ceea28c997a7887790
parentc0400e3ac6c2d5751ce2bff314f3cc7a01e7c50d
hw/block:m25p80: Support write status register 2 command (0x31) for w25q01jvq

According to the w25q01jv datasheet at page 16, it is required to set QE bit
in "Status Register 2" to enable quad mode.

Currently, m25p80 support users utilize "Write Status Register 1(0x01)" command
to set QE bit in "Status Register 2" and utilize "Read Status Register 2(0x35)"
command to get the QE bit status.

However, some firmware directly utilize "Status Register 2(0x31)" command to
set QE bit. To fully support quad mode for w25q01jvq, adds WRSR2 command.

Update collecting data needed 1 byte for WRSR2 command in decode_new_cmd
function and verify QE bit at the first byte of collecting data bit 2 in
complete_collecting_data.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
hw/block/m25p80.c