Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42224 )
Change subject: soc/amd/common/blocks/gpio: Introduce gpio_get_bar ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42224/4/src/soc/amd/common/block/gp... File src/soc/amd/common/block/gpio_banks/gpio.c:
https://review.coreboot.org/c/coreboot/+/42224/4/src/soc/amd/common/block/gp... PS4, Line 86: uint16_t block_offset = GPIO_BLOCK_SIZE * (gpio_num / GPIO_PINS_PER_BLOCK);
I'd be very surprised if the compiler doesn't turn those into shifts. […]
Agreed.
https://review.coreboot.org/c/coreboot/+/42224/4/src/soc/amd/common/block/gp... PS4, Line 87: uint16_t pin_offset = (gpio_num % GPIO_PINS_PER_BLOCK) * sizeof(uint32_t);
mask/shift instead of module division and multiplication? Unless PSP is fast here? Maybe not worth o […]
Since this is common code, I'd prefer not to explicitly change them to shifts on the off chance a future platform is different.