Attention is currently required from: Stefan Reinauer, Edward O'Callaghan, Angel Pons. Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/49255 )
Change subject: bitbang-spi.c: support clock polarity and phase ......................................................................
Patch Set 7:
(9 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/49255/comment/4bcc8490_9031c6be PS1, Line 8:
Hi Xiang, So I think what Angel and I are saying here is that the rational should be explained in mo […]
Sorry I misunderstood.
File bitbang_spi.c:
https://review.coreboot.org/c/flashrom/+/49255/comment/b3eba98a_c24212aa PS6, Line 52: } : : master->set_sck(sck); : master->set_mosi(mosi); : }
spurious changes?
This is the spi timing requirement, the mosi change should be before the sck change when sending data
https://review.coreboot.org/c/flashrom/+/49255/comment/cd6f1a5e_6c580f5d PS6, Line 62:
ditto
Done
https://review.coreboot.org/c/flashrom/+/49255/comment/679cf963_1ffa11b2 PS6, Line 89: for (int i = 0; i < 8; i++) {
Leave style changes to another commit and out of the meat of this one, it gets in the way of reviewi […]
Done
https://review.coreboot.org/c/flashrom/+/49255/comment/e4f09580_9aea642e PS6, Line 90: ret = ret << 1;
same here, just leave as `ret <<= 1;` in this commit
Done
https://review.coreboot.org/c/flashrom/+/49255/comment/5e82946b_2f1959f2 PS6, Line 107: for (int i = 0; i < 8; i++) {
ditto
Done
https://review.coreboot.org/c/flashrom/+/49255/comment/b25fe90f_74e596fd PS6, Line 119: val = val << 1;
ditto
Done
https://review.coreboot.org/c/flashrom/+/49255/comment/d19d7b79_d46dc670 PS6, Line 136: programmer_delay(master->half_period); : bitbang_spi_set_cs(master, 0); : programmer_delay(master->half_period); :
this feels like its own little patch.
move to https://review.coreboot.org/c/flashrom/+/49262
https://review.coreboot.org/c/flashrom/+/49255/comment/b6c1dbdb_314857fb PS6, Line 186: char *mode = extract_programmer_param("mode"); : if (mode) { : if (strlen(mode)) { : char *endptr; : int v = strtol(mode, &endptr, 0); : if (mode == endptr || v > 3 || v < 0) { : msg_perr("bitbang spi only work with mode 0-3\n"); : free(mode); : return ERROR_FLASHROM_BUG; : } : cpol = (v >> 1) & 1; : cpha = (v >> 0) & 1; : } : free(mode); : }
static parse_mode function that takes `(&int, &int)` as a type ?
Done