diff options
author | Mario Scheithauer <mario.scheithauer@siemens.com> | 2024-11-26 13:28:13 +0100 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2024-11-29 08:52:01 +0000 |
commit | 932b5079074d752b121067dc3698e7838cdb4b1b (patch) | |
tree | 5ee1d50b5397184f3087707f7e27dd92b37673dc /src/mainboard | |
parent | 7906bc65768b9543d262586797274f5f93b15996 (diff) |
mb/siemens/mc_ehl5: Use clrsetbits macro for register access
The code is simplified by using the mmio.h macros clrsetbits.
Change-Id: Iab71ab4d6e8b6c38e07641dae3b38093690543e8
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85325
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/siemens/mc_ehl/variants/mc_ehl5/mainboard.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/mainboard.c b/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/mainboard.c index 2c37c69698..ac3ab14eef 100644 --- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/mainboard.c +++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl5/mainboard.c @@ -20,12 +20,10 @@ /* Disable SDR104 and SDR50 mode while keeping DDR50 mode enabled. */ static void disable_sdr_modes(struct resource *res) { - uint32_t reg; write32(res2mmio(res, MMC_CAP_BYP, 0), MMC_CAP_BYP_EN); - reg = read32(res2mmio(res, MMC_CAP_BYP_REG1, 0)); - reg &= ~(MMC_CAP_BYP_SDR104 | MMC_CAP_BYP_SDR50); - reg |= MMC_CAP_BYP_DDR50; - write32(res2mmio(res, MMC_CAP_BYP_REG1, 0), reg); + clrsetbits32(res2mmio(res, MMC_CAP_BYP_REG1, 0), + MMC_CAP_BYP_SDR104 | MMC_CAP_BYP_SDR50, + MMC_CAP_BYP_DDR50); } void variant_mainboard_final(void) @@ -43,7 +41,6 @@ void variant_mainboard_final(void) dev = pcidev_path_on_root(PCH_DEVFN_SDCARD); if (dev) { - uint16_t reg16; struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0); if (!res) return; @@ -51,9 +48,7 @@ void variant_mainboard_final(void) disable_sdr_modes(res); /* Use preset driver strength from preset value registers. */ - reg16 = read16(res2mmio(res, HOSTCTRL2, 0)); - reg16 |= HOSTCTRL2_PRESET; - write16(res2mmio(res, HOSTCTRL2, 0), reg16); + clrsetbits16(res2mmio(res, HOSTCTRL2, 0), 0, HOSTCTRL2_PRESET); } dev = pcidev_path_on_root(PCH_DEVFN_EMMC); |