|
From: | Cédric Le Goater |
Subject: | Re: [PATCH v3 4/8] m25p80: Add the mx25l25635f SFPD table |
Date: | Mon, 10 Oct 2022 17:00:18 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 |
On 10/10/22 11:58, Michael Walle wrote:
Am 2022-10-10 08:23, schrieb Cédric Le Goater:On 10/7/22 16:44, Francisco Iglesias wrote:--- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -234,6 +234,8 @@ static const FlashPartInfo known_devices[] = { { INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) }, { INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512, 0), .sfdp_read = m25p80_sfdp_mx25l25635e }, + { INFO6("mx25l25635f", 0xc22019, 0xc22019, 64 << 10, 512, 0),I think I'm not seeing the extended id part in the datasheet I've found so might be that you can switch to just INFO and _ext_id 0 aboveThis was added by commit 6bbe036f32dc ("m25p80: Return the JEDEC ID twice for mx25l25635e") to fix a real breakage on HW.From my experience, the ID has a particular length, at least three bytes and if you read past that length for some (all?) devices the id bytes just get repeated. I.e. the counter in the device will just wrap to offset 0again.
At the time, I did some specific tests on these mx25l25635e chips and this how they behaved. I can not check anymore as I don't have access to these systems.
If you want to emulate the hardware correctly, you would have to take that into consideration.
But this is not the case for all chips, most return 0 and don't wrap around. I just did on w25q512jvq and w25q256 chips with a 6.0.
But I don't think it's worth it, OTOH there seems to be some broken software which rely on that (undefined?) behavior.
I can't really tell :/ The driver (kernel based Linux 2.6.28) reads 4 bytes and expect the last to be the Manufacturer id: 0xC2. That's valid for this chip. Setting an extended ID in the flash info is an alternative : { INFO("mx25l25635e", 0xc22019, 0xc200, ... which does not seem to break other machines using mx25l25635e, with recent kernels at least. To reproduce, grab : http://smbserver.frankfurt.de.velia.net/ipmi/SMT_X11_158.bin Run : qemu-system-arm -M supermicrox11-bmc -nic user -drive file=./SMT_X11_158.bin,format=raw,if=mtd -nographic -serial mon:stdio ... BMC flash ID:0xc21920c2 platform_flash: MX25L25635E (32768 Kbytes) Creating 7 MTD partitions on "spi0.0": ... C.
[Prev in Thread] | Current Thread | [Next in Thread] |