On Wed, 27 Jan 2016 03:12:11 +0200 Urja Rannikko urjaman@gmail.com wrote:
Hi,
Review-ish... with some only-commentary included too.
On Mon, Jan 18, 2016 at 1:28 AM, Stefan Tauner stefan.tauner@alumni.tuwien.ac.at wrote:
Signed-off-by: Urja Rannikko urjaman@gmail.com Signed-off-by: Stefan Tauner stefan.tauner@alumni.tuwien.ac.at
Makefile | 23 ++- ch341a_spi.c | 531 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ flashrom.8.tmpl | 12 +- flashrom.c | 12 ++ programmer.h | 13 ++ 5 files changed, 588 insertions(+), 3 deletions(-) create mode 100644 ch341a_spi.c
free_idx = (free_idx + 1) % USB_IN_TRANSFERS; /* Increment (and wrap around). */
Yeah this obvious construct is something I didnt use because I'm such an embedded guy that I'd never ever use % in performance related code... (i think i had some if idx>=USB_IN_TRANSFERS) idx = 0 thing)... thanks for making it saner.
:)
I had a fancier delay implementation done (all the way upto ms scale using the I2C commands), but since i didnt get that fully tested, this one will do, i'll post it as an improvement later.
Please do. I don't deem it that important but since you have investigated the whole issue in such detail it would be a waste to not exploit this knowledge.
unsigned int i;
for (i = 0; i < readcnt; i++) {
/* FIXME: does working on words instead of bytes improve speed? */
... drop the comment? i dont really care, but i think our consensus on IRC was that a words-wide implementation would have more issues (alignment and such) than performance. Or make a comment with that info.
It's gone.
*readarr++ = swap_byte(rbuf[writecnt + i]);
}
return 0;
+}
+static const struct spi_master spi_master_ch341a_spi = {
.type = SPI_CONTROLLER_CH341A_SPI,
/* TODO: flashrom's current maximum is 256 B. Device was tested on Linux to accept atleast 16 kB. */
.max_data_read = 16 * 1024,
.max_data_write = 16 * 1024,
On linux. Not on windows usb "stack" i think... set these back to 1k? Or test for the limit (maybe something like 4k?) and change the 1000ms timeout, since i think the big packet would timeout on windows if nothing else failed...
As discussed, I have tested up to 128 kB on Windows (in VM) and on Linux with a bigger timeout and it works fine. We have agreed upon 4 kB chunks now and using VLAs (I had an intermediate version that used bigger chunks and relied on mallocs for them).
With atleast the limits dropped (or tested), this is: Acked-by: Urja Rannikko urjaman@gmail.com
Thanks, r1921.
Hi,
I am writing to you because you were interested in CH341A support in flashrom in the past. I am happy to announce that we have merged the respective patch in r1921 and it should work fine on any operating system that supports libusb1. It will be included in the upcoming 0.9.9 release of flashrom as well.
Hello Stefan,
Thank you very much for the notification! I am really glad for that.
I do not have currently that programmer, but I will give it a try when I could borrow one.
Regards, Miklós Márton
2016-01-31 23:23 keltezéssel, Stefan Tauner írta:
Hi,
I am writing to you because you were interested in CH341A support in flashrom in the past. I am happy to announce that we have merged the respective patch in r1921 and it should work fine on any operating system that supports libusb1. It will be included in the upcoming 0.9.9 release of flashrom as well.
Hi.
Good news. I'll wait for new release. Thank you.
2016-02-01 1:23 GMT+03:00 Stefan Tauner stefan.tauner@alumni.tuwien.ac.at:
Hi,
I am writing to you because you were interested in CH341A support in flashrom in the past. I am happy to announce that we have merged the respective patch in r1921 and it should work fine on any operating system that supports libusb1. It will be included in the upcoming 0.9.9 release of flashrom as well.
-- Kind regards/Mit freundlichen Grüßen, Stefan Tauner
Здравствуйте, Stefan.
Вы писали 1 февраля 2016 г., 3:23:13:
Hi!
i have ch341a china programmer and tested this feature on W25Q32 chip
./flashrom -p ch341a_spi -r 1 flashrom v0.9.8-r1925 on Linux 3.2.75-imq (i686) flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK. Found Winbond flash chip "W25Q32.V" (4096 kB, SPI) on ch341a_spi. Reading flash... done.
--
./flashrom -p ch341a_spi -E flashrom v0.9.8-r1925 on Linux 3.2.75-imq (i686) flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK. Found Winbond flash chip "W25Q32.V" (4096 kB, SPI) on ch341a_spi. Erasing and writing flash chip... Erase/write done.
---
./flashrom -p ch341a_spi -r 1erase flashrom v0.9.8-r1925 on Linux 3.2.75-imq (i686) flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK. Found Winbond flash chip "W25Q32.V" (4096 kB, SPI) on ch341a_spi. Reading flash... done.
---
./flashrom -p ch341a_spi -w 1 flashrom v0.9.8-r1925 on Linux 3.2.75-imq (i686) flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK. Found Winbond flash chip "W25Q32.V" (4096 kB, SPI) on ch341a_spi. Reading old flash chip contents... done. Erasing and writing flash chip... Erase/write done. Verifying flash... VERIFIED.
--
./flashrom -p ch341a_spi -r 1r flashrom v0.9.8-r1925 on Linux 3.2.75-imq (i686) flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK. Found Winbond flash chip "W25Q32.V" (4096 kB, SPI) on ch341a_spi. Reading flash... done.
---
diff 1 1r
- no diff!
if you want, i may tested other chips?
CH341A programmer support 24C1024 chips and other 24XX chips, but flashrom not support it.
CH341A programmer have other 8 pin in 16 pin panel to support 24CXX chips.
how i can help to support 24CXX chips ?
---
Thank to you for support CH341A programmer in open source!
Hi,
I am writing to you because you were interested in CH341A support in flashrom in the past. I am happy to announce that we have merged the respective patch in r1921 and it should work fine on any operating system that supports libusb1. It will be included in the upcoming 0.9.9 release of flashrom as well.
On Sun, 14 Feb 2016 21:17:48 +0500 novoagansk@gmail.com wrote:
Здравствуйте, Stefan.
Вы писали 1 февраля 2016 г., 3:23:13:
[…]
if you want, i may tested other chips?
Hi Novoagansk,
thank you for testing. There is no need to test other chips (unless the chips themselves are not marked as tested on https://www.flashrom.org/Supported_hardware#Supported_flash_chips
CH341A programmer support 24C1024 chips and other 24XX chips, but flashrom not support it.
CH341A programmer have other 8 pin in 16 pin panel to support 24CXX chips.
how i can help to support 24CXX chips ?
Currently flashrom is only targeting NOR flash chips and hence 24 series EEPROMs are out of scope. There might be support for them in the distant future but there is way too much important stuff to do for flash chips at the moment, sorry.