[coreboot-gerrit] Change in coreboot[master]: drivers/spi: Add flash probe callbacks to spi_ctrlr structure

Julius Werner (Code Review) gerrit at coreboot.org
Wed May 17 01:57:02 CEST 2017


Julius Werner has posted comments on this change. ( https://review.coreboot.org/19708 )

Change subject: drivers/spi: Add flash probe callbacks to spi_ctrlr structure
......................................................................


Patch Set 6:

(4 comments)

https://review.coreboot.org/#/c/19708/6/src/drivers/spi/spi_flash.c
File src/drivers/spi/spi_flash.c:

PS6, Line 338: (try_generic_probe_first != true)
Why not '!try_generic_probe_first'? (This is circumventing the C assumption that all non-zero values represent true.)


https://review.coreboot.org/#/c/19708/6/src/include/spi-generic.h
File src/include/spi-generic.h:

Line 132: 	bool (*try_generic_probe_first)(void);
Does this really need to be a function? (A variable could still be dynamically decided at runtime by spi_setup_slave().)


https://review.coreboot.org/#/c/19708/6/src/soc/mediatek/mt8173/flash_controller.c
File src/soc/mediatek/mt8173/flash_controller.c:

Line 237: 		return 0;
I think this part is no longer necessary today. It used to be that several drivers (e.g. elog) call spi_flash_probe() themselves, but nowadays it all goes through the boot_device API which already makes sure to probe no more than once (per stage).


https://review.coreboot.org/#/c/19708/6/src/soc/mediatek/mt8173/include/soc/spi.h
File src/soc/mediatek/mt8173/include/soc/spi.h:

Line 110: int mtk_spi_flash_probe(const struct spi_slave *spi, struct spi_flash *flash);
nit: better in flash_controller.h?


-- 
To view, visit https://review.coreboot.org/19708
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I35f3bd8ddc5e71515df3ef0c1c4b1a68ee56bf4b
Gerrit-PatchSet: 6
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie at chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Julius Werner <jwerner at chromium.org>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-HasComments: Yes



More information about the coreboot-gerrit mailing list