Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32336 )
Change subject: google/kukui: Get write protection status from WP GPIO ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/32336/1/src/mainboard/google/kukui/chromeos.... File src/mainboard/google/kukui/chromeos.c:
https://review.coreboot.org/#/c/32336/1/src/mainboard/google/kukui/chromeos.... PS1, Line 36: !
You're negating here and also at line 47. […]
The GPIO_WP is active low.
get_write_protect_state always returns 1 = enabled, so we have to add ! for it.
lb_gpio provides a way for payloads to read GPIO dynamically using GPIO_WP, so we have to specify ACTIVE_LOW here. As a result, the initial value must be reversed again from get_write_protect_state results, because the value will be evaluated as active_low then.
I think this is very common across all boards - see cheza, butterfly, veyron, storm, even gru for example. So there should be no need to document explicitly?