Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com>
---
 arch/arm/cpu/mmu-early.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c
index 70cb5fe31..fc14d5cac 100644
--- a/arch/arm/cpu/mmu-early.c
+++ b/arch/arm/cpu/mmu-early.c
@@ -23,8 +23,8 @@ static void create_sections(unsigned long addr, int size_m, 
unsigned int flags)
 
 static void map_cachable(unsigned long start, unsigned long size)
 {
-       start &= ~(SZ_1M - 1);
-       size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1);
+       start = ALIGN_DOWN(start, SZ_1M);
+       size  = ALIGN(size, SZ_1M);
 
        create_sections(start, size >> 20, PMD_SECT_AP_WRITE |
                        PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB);
-- 
2.17.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to