aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/serial/uart8250.c
diff options
context:
space:
mode:
authorYu Chien Peter Lin <peterlin@andestech.com>2023-09-25 20:24:26 +0800
committerAnup Patel <anup@brainfault.org>2023-10-06 16:53:25 +0530
commita12542316c98bbc8731dd6048d0a7ba3ab67fa6c (patch)
treea387771ed46a668c2af8b0966a2462e8bf3300eb /lib/utils/serial/uart8250.c
parente21901d3175c7f96961b576ee06a1185ed051ec3 (diff)
downloadopensbi-a12542316c98bbc8731dd6048d0a7ba3ab67fa6c.zip
opensbi-a12542316c98bbc8731dd6048d0a7ba3ab67fa6c.tar.gz
opensbi-a12542316c98bbc8731dd6048d0a7ba3ab67fa6c.tar.bz2
lib: utils/serial: Ensure proper allocation of PMP entries for uart8250
The added memory region should start from the base address. Otherwise, the range will be shifted by reg_offset and not able to merge consecutive NAPOT regions in the root domain, resulting in wasted PMP entries. Fixes: e8bc1621 ("lib: utils/serial: Add shared regions for serial drivers") Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/serial/uart8250.c')
-rw-r--r--lib/utils/serial/uart8250.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/utils/serial/uart8250.c b/lib/utils/serial/uart8250.c
index 4d158d3..1fe053f 100644
--- a/lib/utils/serial/uart8250.c
+++ b/lib/utils/serial/uart8250.c
@@ -135,8 +135,7 @@ int uart8250_init(unsigned long base, u32 in_freq, u32 baudrate, u32 reg_shift,
sbi_console_set_device(&uart8250_console);
- return sbi_domain_root_add_memrange(base + reg_offset, PAGE_SIZE,
- PAGE_SIZE,
+ return sbi_domain_root_add_memrange(base, PAGE_SIZE, PAGE_SIZE,
(SBI_DOMAIN_MEMREGION_MMIO |
SBI_DOMAIN_MEMREGION_SHARED_SURW_MRW));
}