From 84dbace1ea49131d1647a8be994ed8d6776f03c5 Mon Sep 17 00:00:00 2001 From: Mario Scheithauer Date: Fri, 7 Oct 2022 11:27:56 +0200 Subject: [PATCH] soc/intel/ehl: Fix incorrect access to MAC_MDIO_DATA register Function 'setbits16' performs an 'OR' operation with the new data and the origin register entry. This can lead to an incorrect value in the register which can then lead to issues. Change-Id: I0212420be770e2ffdabebbfaf5dfbf8d99d25915 Signed-off-by: Mario Scheithauer Reviewed-on: https://review.coreboot.org/c/coreboot/+/68214 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh Reviewed-by: Lean Sheng Tan Reviewed-by: Angel Pons Reviewed-by: Felix Singer --- src/soc/intel/elkhartlake/tsn_gbe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/intel/elkhartlake/tsn_gbe.c b/src/soc/intel/elkhartlake/tsn_gbe.c index 49ce4da95b..3e08897c5c 100644 --- a/src/soc/intel/elkhartlake/tsn_gbe.c +++ b/src/soc/intel/elkhartlake/tsn_gbe.c @@ -72,7 +72,7 @@ void tsn_mdio_write(void *base, uint8_t phy_adr, uint8_t reg_adr, uint16_t data) { enum cb_err status; - setbits16(base + TSN_MAC_MDIO_DATA, data); + write16(base + TSN_MAC_MDIO_DATA, data); clrsetbits32(base + TSN_MAC_MDIO_ADR, TSN_MAC_MDIO_ADR_MASK, TSN_MAC_PHYAD(phy_adr) | TSN_MAC_REGAD(reg_adr) | TSN_MAC_CLK_TRAIL_4 | TSN_MAC_CSR_CLK_DIV_62