Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42521 )
Change subject: mb/pcengines/apu2: Remove gpio1_ and gpio2_ references ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42521/1/src/mainboard/pcengines/apu... File src/mainboard/pcengines/apu2/gpio_ftns.c:
https://review.coreboot.org/c/coreboot/+/42521/1/src/mainboard/pcengines/apu... PS1, Line 13: if (gpio >= 0x300)
What is w/ this 0x300 check and how does it correspond 0x300? Seems we shouldn't be open coding any […]
There are 3 GPIO banks, each occupies the 0x100 bytes in the APCI MMIO space. This bounds check was intended to not read higher memory than the GPIO2 bank.
https://review.coreboot.org/c/coreboot/+/42521/1/src/mainboard/pcengines/apu... PS1, Line 16: return gpio0_read32(gpio & 0x3ff);
if a single namespace for gpios is intended to be used then gpioX_read() should be dropped entirely […]
It is all about assuming that the GPIO reading functions will be used sanely by the developer.