system/loongarch: Fix a bug about the memory boundary. (#447)

In LoongArch, the addresses from 0x30000000 to 0x80000000 are 32-bit PCI
memory space, If the BAR happens start at 0x30000000, a mapping error
will occur according to the old logic, and 0x30000000 should also be
mapped, so fix it.

Signed-off-by: Chao Li <lichao@loongson.cn>
This commit is contained in:
Chao Li 2024-10-17 20:43:27 +08:00 committed by GitHub
parent f34a85ce07
commit a52ad6aa61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,7 +29,7 @@ extern uint8_t highest_map_bit;
uintptr_t map_region(uintptr_t base_addr, size_t size __attribute__((unused)), bool only_for_startup __attribute__((unused)))
{
if (((base_addr < 0x80000000) && (base_addr > 0x30000000)) || ((base_addr & PCI_IO_PERFIX) != 0x0)) {
if (((base_addr < 0x80000000) && (base_addr >= 0x30000000)) || ((base_addr & PCI_IO_PERFIX) != 0x0)) {
return MMIO_BASE | base_addr;
} else if ((base_addr < 0x20000000) && (base_addr > 0x10000000)) {
return DMW0_BASE | base_addr;