Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
soc/amd/common: Refactor ACPIMMIO posted writes
Change-Id: Ic1a5c17c789dd79fea8f348d1a9d32d4301ced88 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/amd/common/block/include/amdblocks/acpimmio.h M src/soc/amd/picasso/i2c.c M src/soc/amd/stoneyridge/i2c.c 3 files changed, 8 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/42825/1
diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio.h b/src/soc/amd/common/block/include/amdblocks/acpimmio.h index 2775b52..8546da9 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpimmio.h +++ b/src/soc/amd/common/block/include/amdblocks/acpimmio.h @@ -369,12 +369,6 @@ write32(gpio_ctrl_ptr(gpio_num), value); }
-static inline void gpio_write32_rb(uint8_t gpio_num, uint32_t value) -{ - write32(gpio_ctrl_ptr(gpio_num), value); - read32(gpio_ctrl_ptr(gpio_num)); -} - /* GPIO bank 0 */ static inline uint8_t gpio0_read8(uint8_t reg) { diff --git a/src/soc/amd/picasso/i2c.c b/src/soc/amd/picasso/i2c.c index 881278f..61a4f8a 100644 --- a/src/soc/amd/picasso/i2c.c +++ b/src/soc/amd/picasso/i2c.c @@ -161,9 +161,11 @@ static void restore_i2c_pin_registers(uint8_t gpio, struct soc_amd_i2c_save *save_table) { + /* Write and flush posted writes. */ iomux_write8(gpio, save_table->mux_value); - iomux_read8(gpio); - gpio_write32_rb(gpio, save_table->control_value); + iomux_read8(0); + gpio_write32(gpio, save_table->control_value); + gpio_read32(0); }
/* Slaves to be reset are controlled by devicetree register i2c_scl_reset */ diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c index 0327028..cd42cda 100644 --- a/src/soc/amd/stoneyridge/i2c.c +++ b/src/soc/amd/stoneyridge/i2c.c @@ -144,9 +144,11 @@ static void restore_i2c_pin_registers(uint8_t gpio, struct soc_amd_i2c_save *save_table) { + /* Write and flush posted writes. */ iomux_write8(gpio, save_table->mux_value); - iomux_read8(gpio); - gpio_write32_rb(gpio, save_table->control_value); + iomux_read8(0); + gpio_write32(gpio, save_table->control_value); + gpio_read32(0); }
/* Slaves to be reset are controlled by devicetree register i2c_scl_reset */
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Patch Set 4: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/42825/4/src/soc/amd/picasso/i2c.c File src/soc/amd/picasso/i2c.c:
https://review.coreboot.org/c/coreboot/+/42825/4/src/soc/amd/picasso/i2c.c@1... PS4, Line 166: 0 I would leave this as gpio just for clarity.
Hello build bot (Jenkins), Raul Rangel, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42825
to look at the new patch set (#5).
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
soc/amd/common: Refactor ACPIMMIO posted writes
Change-Id: Ic1a5c17c789dd79fea8f348d1a9d32d4301ced88 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/amd/common/block/include/amdblocks/acpimmio.h M src/soc/amd/picasso/i2c.c M src/soc/amd/stoneyridge/i2c.c 3 files changed, 7 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/42825/5
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42825/4/src/soc/amd/picasso/i2c.c File src/soc/amd/picasso/i2c.c:
https://review.coreboot.org/c/coreboot/+/42825/4/src/soc/amd/picasso/i2c.c@1... PS4, Line 166: 0
I would leave this as gpio just for clarity.
Done
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Patch Set 5: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/42825/5/src/soc/amd/stoneyridge/i2c... File src/soc/amd/stoneyridge/i2c.c:
https://review.coreboot.org/c/coreboot/+/42825/5/src/soc/amd/stoneyridge/i2c... PS5, Line 151: 0 This one too.
Hello build bot (Jenkins), Raul Rangel, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42825
to look at the new patch set (#6).
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
soc/amd/common: Refactor ACPIMMIO posted writes
Change-Id: Ic1a5c17c789dd79fea8f348d1a9d32d4301ced88 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/amd/common/block/include/amdblocks/acpimmio.h M src/soc/amd/picasso/i2c.c M src/soc/amd/stoneyridge/i2c.c 3 files changed, 6 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/42825/6
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Patch Set 6: Code-Review+2
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42825/5/src/soc/amd/stoneyridge/i2c... File src/soc/amd/stoneyridge/i2c.c:
https://review.coreboot.org/c/coreboot/+/42825/5/src/soc/amd/stoneyridge/i2c... PS5, Line 151: 0
This one too.
Done
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Patch Set 6: Code-Review+2
Kyösti Mälkki has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Abandoned
Kyösti Mälkki has restored this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Restored
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
Patch Set 9: Code-Review+2
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42825 )
Change subject: soc/amd/common: Refactor ACPIMMIO posted writes ......................................................................
soc/amd/common: Refactor ACPIMMIO posted writes
Change-Id: Ic1a5c17c789dd79fea8f348d1a9d32d4301ced88 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/42825 Reviewed-by: Felix Held felix-coreboot@felixheld.de Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Raul Rangel rrangel@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/common/block/include/amdblocks/acpimmio.h M src/soc/amd/picasso/i2c.c M src/soc/amd/stoneyridge/i2c.c 3 files changed, 6 insertions(+), 8 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved Raul Rangel: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio.h b/src/soc/amd/common/block/include/amdblocks/acpimmio.h index 4fcaa92..15445ba 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpimmio.h +++ b/src/soc/amd/common/block/include/amdblocks/acpimmio.h @@ -387,12 +387,6 @@ write32(gpio_ctrl_ptr(gpio_num), value); }
-static inline void gpio_write32_rb(uint8_t gpio_num, uint32_t value) -{ - write32(gpio_ctrl_ptr(gpio_num), value); - read32(gpio_ctrl_ptr(gpio_num)); -} - /* GPIO bank 0 */ static inline uint8_t gpio0_read8(uint8_t reg) { diff --git a/src/soc/amd/picasso/i2c.c b/src/soc/amd/picasso/i2c.c index 1eb0720..af4c41f 100644 --- a/src/soc/amd/picasso/i2c.c +++ b/src/soc/amd/picasso/i2c.c @@ -169,9 +169,11 @@ static void restore_i2c_pin_registers(uint8_t gpio, struct soc_amd_i2c_save *save_table) { + /* Write and flush posted writes. */ iomux_write8(gpio, save_table->mux_value); iomux_read8(gpio); - gpio_write32_rb(gpio, save_table->control_value); + gpio_write32(gpio, save_table->control_value); + gpio_read32(gpio); }
/* Slaves to be reset are controlled by devicetree register i2c_scl_reset */ diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c index 0327028..295a833 100644 --- a/src/soc/amd/stoneyridge/i2c.c +++ b/src/soc/amd/stoneyridge/i2c.c @@ -144,9 +144,11 @@ static void restore_i2c_pin_registers(uint8_t gpio, struct soc_amd_i2c_save *save_table) { + /* Write and flush posted writes. */ iomux_write8(gpio, save_table->mux_value); iomux_read8(gpio); - gpio_write32_rb(gpio, save_table->control_value); + gpio_write32(gpio, save_table->control_value); + gpio_read32(gpio); }
/* Slaves to be reset are controlled by devicetree register i2c_scl_reset */