3mdeb / meta-rte

Yocto meta layer for the RTE https://3mdeb.com/products/open-source-hardware/rte/ board
MIT License
7 stars 3 forks source link

Flash support for chip GD25Q256D #33

Open wessel-novacustom opened 1 year ago

wessel-novacustom commented 1 year ago

The problem you're addressing (if any)

The chip GD25Q256D - found on some NovaCustom NV4-ADL devices - doesn't work on RTE, while it does work with the CH341A programmer.

Describe the solution you'd like

The chip GD25Q256D to be supported by RTE, so that our devices with this chip can be flashed with RTE.

Where is the value to a user, and who might that user be?

Especially for internal use, but it might also be useful for other RTE users.

Describe alternatives you've considered

CH341A programming, which works, but is about 4 times slower than RTE.

Additional context

The read command was successful, while the write command was not. Log after the write command:

set SPI Vcc to 3.3V SPI lines ON SPI Vcc ON Writing ... flashrom v1.2 on Linux 5.4.69 (armv7l) flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Found GigaDevice flash chip "GD25Q256D" (32768 kB, SPI) on linux_spi.

This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE The test status of this chip may have been updated in the latest development version of flashrom. If you are running the latest development version, please email a report to flashrom@flashrom.org if any of the above operations work correctly for you with this flash chip. Please include the flashrom log file for all operations you tested (see the man page for details), and mention which mainboard or programmer you tested in the subject line. Thanks for your help! Reading old flash chip contents... done. Erasing and writing flash chip... Reading current flash chip contents... done. Looking for another erase function. Reading current flash chip contents... done. Looking for another erase function. Reading current flash chip contents... done. Looking for another erase function. Reading current flash chip contents... done. Looking for another erase function. Reading current flash chip contents... done. Looking for another erase function. Reading current flash chip contents... done. Looking for another erase function. Reading current flash chip contents... done. Looking for another erase function. Reading current flash chip contents... done. No usable erase functions left. Reading current flash chip contents... done. SPI Vcc OFF SPI lines OFF

PLangowski commented 11 months ago

@wessel-novacustom Hi, it has been a while since you raised this issue. Is it still relevant? If so, we can look into the problem.

wessel-novacustom commented 11 months ago

Yes it is.

macpijan commented 11 months ago

We can list which chips are supported for given flashrom revision using: flashrom --list-supported.

If it is in fact not there, we may check in the upstream flashrom if such chip has been added, and update our recipe. If it is not there either, we must add it to the upstream flashrom first.

wessel-novacustom commented 11 months ago

@macpijan

Please make sure that the following chips are supported by the RTE:

We can do the testing, no problem.

Thanks.

PLangowski commented 11 months ago

@macpijan Currently RTE has flashrom version 1.2.1.

# flashrom -L
flashrom v1.2 on Linux 5.4.69 (armv7l)
flashrom is free software, get the source code at https://flashrom.org

Supported flash chips (total: 538):

Vendor        Device                 Test  Known   Size   Type      
                                     OK    Broken  [kB]             

(P = PROBE, R = READ, E = ERASE, W = WRITE, - = N/A)
(...)
GigaDevice    GD25Q256D                            32768  SPI       =
Macronix      MX25L25635F/           PREW          32768  SPI       
              MX25L25645G
Winbond       W25Q256.V              PREW          32768  SPI       

Which means that GD25Q256D has not been tested. I checked the support on v1.3.0:

GigaDevice                   GD25Q256D/                           PREW          32768  SPI   
Macronix                     MX25L25635F/                         PREW          32768  SPI       
                             MX25L25645G
Winbond                      W25Q256FV                            PREW          32768  SPI       
Winbond                      W25Q256JV_Q                                        32768  SPI       
Winbond                      W25Q256JV_M                          PREW          32768  SPI       
Winbond                      W25Q256JW                            PREW          32768  SPI       
Winbond                      W25Q256JW_DTR                        PREW          32768  SPI       

It seems that updating our layer to include flashrom v1.3.0 will solve our problem regarding GD25Q256D. I'm not sure about W25Q256.V though.

wessel-novacustom commented 11 months ago

Would be great if it can be updated. If it has been done, please let me know.

PLangowski commented 11 months ago

@wessel-novacustom Hi, we just published a pre-release, which tackles this issue by updating flashrom to v1.3.0. Could you test if it works properly?

wessel-novacustom commented 11 months ago

I will do so soon and let you know, thank you.

PLangowski commented 10 months ago

@wessel-novacustom Did you manage to test the update yet?

wessel-novacustom commented 10 months ago

Not yet, I'm sorry for that. Thank you for the reminder, I will do so now immediately.

wessel-novacustom commented 10 months ago

@PLangowski for the GD25Q256D chip, I'm still trying to find a chassis in our stock that has this chip so I can test it. I will do so now and come back to you ASAP. As you may know, we are also testing the MX25L25635F/MX25L25645G chip. This is what I get with the test version:

root@rte:~# ./flash.sh probe set SPI Vcc to 3.3V SPI lines ON SPI Vcc ON Probing ... flashrom v1.3.0 on Linux 5.4.69 (armv7l) flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Found Generic flash chip "unknown SPI chip (RDID)" (0 kB, SPI) on linux_spi.

This flash part has status NOT WORKING for operations: PROBE READ ERASE WRITE This flash part has status UNTESTED for operations: WP The test status of this chip may have been updated in the latest development version of flashrom. If you are running the latest development version, please email a report to flashrom@flashrom.org if any of the above operations work correctly for you with this flash chip. Please include the flashrom log file for all operations you tested (see the man page for details), and mention which mainboard or programmer you tested in the subject line. Thanks for your help! No operations were specified. SPI Vcc OFF SPI lines OFF

This is what I get with the CH341A programmer modified to 3.3V on my PC running Linux Mint 21.2:

ceo@Z370N-WIFI:~$ flashrom -p ch341a_spi flashrom v1.2 on Linux 5.15.0-88-generic (x86_64) flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Found Macronix flash chip "MX25L25635F/MX25L25645G" (32768 kB, SPI) on ch341a_spi. No operations were specified.

wessel-novacustom commented 10 months ago

@PLangowski. About chip GD25Q256D, this looks good now. It says:

root@rte:~# ./flash.sh probe set SPI Vcc to 3.3V SPI lines ON SPI Vcc ON Probing ... flashrom v1.3.0 on Linux 5.4.69 (armv7l) flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Found GigaDevice flash chip "GD25Q256D/GD25Q256E" (32768 kB, SPI) on linux_spi. No operations were specified. SPI Vcc OFF SPI lines OFF root@rte:~#

Should I close this issue and make a separate issue for the MX25L25635F/MX25L25645G chip?

wessel-novacustom commented 10 months ago

By the way, for the GD25Q256D chip, writing works as well:

root@rte:~# ./flash.sh write ROM.BIN set SPI Vcc to 3.3V SPI lines ON SPI Vcc ON Writing ... flashrom v1.3.0 on Linux 5.4.69 (armv7l) flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Found GigaDevice flash chip "GD25Q256D/GD25Q256E" (32768 kB, SPI) on linux_spi. Reading old flash chip contents... done. Erasing and writing flash chip... Erase/write done. Verifying flash... VERIFIED. SPI Vcc OFF SPI lines OFF

wessel-novacustom commented 10 months ago

Ok, I found something weird now.

The chip "MX25L25635F/MX25L25645G" is recognised for the NS7x-ADL, but not for the NV4x-ADL.

Maybe the actual chip version is different, I will look at this and let you know.

PLangowski commented 10 months ago

@wessel-novacustom We can keep posting under this issue. In the meantime, could you provide the content of your flash.sh script?

wessel-novacustom commented 10 months ago

@PLangowski Sure! Here it is: flash.sh-output.txt

wessel-novacustom commented 10 months ago

The chip "MX25L25635F/MX25L25645G" is recognised for the NS7x-ADL, but not for the NV4x-ADL.

root@rte:~# ./flash.sh write ROM.BIN set SPI Vcc to 3.3V SPI lines ON SPI Vcc ON Writing ... flashrom v1.3.0 on Linux 5.4.69 (armv7l) flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Found Macronix flash chip "MX25L25635F/MX25L25645G" (32768 kB, SPI) on linux_spi.

This flash part has status UNTESTED for operations: WP The test status of this chip may have been updated in the latest development version of flashrom. If you are running the latest development version, please email a report to flashrom@flashrom.org if any of the above operations work correctly for you with this flash chip. Please include the flashrom log file for all operations you tested (see the man page for details), and mention which mainboard or programmer you tested in the subject line. Thanks for your help! Reading old flash chip contents... done. Erasing and writing flash chip... FAILED at 0x01d13ffb! Expected=0xff, Found=0x00, failed byte count from 0x01d13000-0x01d13fff: 0x5 ERASE FAILED! Reading current flash chip contents... done. Looking for another erase function. Erase/write done. Verifying flash... FAILED at 0x01dac200! Expected=0xc7, Found=0xff, failed byte count from 0x00000000-0x01ffffff: 0xf4 Your flash chip is in an unknown state. Please report this to the mailing list at flashrom@flashrom.org or on IRC (see https://www.flashrom.org/Contact for details), thanks! SPI Vcc OFF SPI lines OFF

PLangowski commented 10 months ago

@wessel-novacustom

This flash part has status UNTESTED for operations: WP

That's strange. flashrom 1.3.0 lists MX25L25635F/MX25L25645G as tested for all PREW operations.

Do you use the -c flag in when you flash using your script? I see it is commented out and it may help flashrom recognize the chip.

PLangowski commented 9 months ago

@wessel-novacustom According to our instructions, only 6 out of 8 pins shoukd be connected to RTE. However, from what I've gathered after talking to my colleagues is that there is an issue with flashing that may be solved by connecting the remaining 2 pins.

wessel-novacustom commented 9 months ago

Do you use the -c flag in when you flash using your script? I see it is commented out and it may help flashrom recognize the chip.

@wessel-novacustom According to our instructions, only 6 out of 8 pins should be connected to RTE. However, from what I've gathered after talking to my colleagues is that there is an issue with flashing that may be solved by connecting the remaining 2 pins.

wessel-novacustom commented 1 month ago

Extending this ticket for the chips of the MTL platforms.

cc @macpijan @miczyg1