Skip to content

Commit

Permalink
pcie_check.c: remove MMIO base address detection by dmesg way
Browse files Browse the repository at this point in the history
Remove MMIO base address detection by dmesg way, because in CXL QEMU
environment, dmesg shows incorrect MMIO base address "0xffc00000":
"
[    0.000000] efi: Remove mem128: MMIO range=[0xffc00000-0xffffffff] (4MB) from e820 map
"
And use MCFG way directly and it could detect correct MMIO base address
"0xe0000000" for CXL QEMU environment.

Signed-off-by: Pengfei Xu <[email protected]>
  • Loading branch information
xupengfe authored and ysun committed Sep 13, 2024
1 parent f404368 commit 54ecaf1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions BM/tools/pcie/pcie_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,19 @@ int find_bar(void)
}
fclose(maps);

/*
* In CXL QEMU environment, MMIO base address is incorrect,
* so will not use dmesg check way to detect the MMIO base
* address, will use mcfg way instead.
* if (BASE_ADDR == 0) {
* BASE_ADDR = find_base_from_dmesg();
* }
*/
if (BASE_ADDR == 0) {
//printf("Check kconfig CONFIG_IO_STRICT_DEVMEM or v6.9 or newer kernel!\n");
BASE_ADDR = find_base_from_dmesg();
BASE_ADDR = find_base_from_mcfg();
if (BASE_ADDR == 0) {
BASE_ADDR = find_base_from_mcfg();
if (BASE_ADDR == 0) {
printf("No MMIO in dmesg, /proc/iomem and mcfg, check acpidump.\n");
exit(2);
}
printf("No MMIO in dmesg, /proc/iomem and mcfg, check acpidump.\n");
exit(2);
}
}
#endif
Expand Down

0 comments on commit 54ecaf1

Please sign in to comment.