summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorShuo Liu <shuo.liu@intel.com>2024-11-12 18:30:15 +0800
committerLean Sheng Tan <sheng.tan@9elements.com>2024-11-14 14:29:18 +0000
commit97412d1929e88a929f73a229e40ca85a38168d7e (patch)
tree13549d8e57b4ae7b0d73157ef81e1727aeffe843 /src/soc
parent02cbfaa201209e4145aae8e475e923ed68052f3c (diff)
cpu/x86/mtrr: Use fls/ffs from lib.h
Definitions of __fls/__ffs from lib.h and fms/fls from cpu/x86/mtrr.h are duplicated. Use definition from lib.h which is more generic. Change-Id: Ic9c6f1027447b04627d7f21d777cbea142588093 Signed-off-by: Shuo Liu <shuo.liu@intel.com> Suggested-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/85104 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/common/block/pci/amd_pci_mmconf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/pci/amd_pci_mmconf.c b/src/soc/amd/common/block/pci/amd_pci_mmconf.c
index fb4db39ac5..e02bcde248 100644
--- a/src/soc/amd/common/block/pci/amd_pci_mmconf.c
+++ b/src/soc/amd/common/block/pci/amd_pci_mmconf.c
@@ -4,6 +4,7 @@
#include <cpu/amd/msr.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
+#include <lib.h>
void enable_pci_mmconf(void)
{
@@ -11,6 +12,6 @@ void enable_pci_mmconf(void)
mmconf.hi = 0;
mmconf.lo = CONFIG_ECAM_MMCONF_BASE_ADDRESS | MMIO_RANGE_EN
- | fms(CONFIG_ECAM_MMCONF_BUS_NUMBER) << MMIO_BUS_RANGE_SHIFT;
+ | __fls(CONFIG_ECAM_MMCONF_BUS_NUMBER) << MMIO_BUS_RANGE_SHIFT;
wrmsr(MMIO_CONF_BASE, mmconf);
}