Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42521 )
Change subject: mb/pcengines/apu2: Switch to proper GPIO API ......................................................................
Patch Set 7:
(3 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)
I agree, but boundary checking should be enforced by SOC code.
Ack
https://review.coreboot.org/c/coreboot/+/42521/1/src/mainboard/pcengines/apu... PS1, Line 16: return gpio0_read32(gpio & 0x3ff);
Yes, sorry. As before in my other comments it was about maintaining proper API and abstractions. […]
Ack
https://review.coreboot.org/c/coreboot/+/42521/7/src/mainboard/pcengines/apu... File src/mainboard/pcengines/apu2/romstage.c:
https://review.coreboot.org/c/coreboot/+/42521/7/src/mainboard/pcengines/apu... PS7, Line 36: gpio_output(gpio, setting & GPIO_OUTPUT_VALUE); To avoid glitches ?
gpio_output(gpio, gpio_input(gpio)); gpio_output(gpio, setting & GPIO_OUTPUT_VALUE);
Below, iomux_write() below might have to move too.
Or maybe remove this configure_gpio() altogether and call program_gpios().