diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-05-17 13:58:21 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-05-18 08:13:19 +0200 |
commit | f550b750bb45853cacdcb014bc76e312b86f7c26 (patch) | |
tree | dc2fb03cd2617644f87545f9acccbfaaf11b537d /arch/arm/cpu/mmu.c | |
parent | 34e85f20c27fb2199d0fbc0bb6960388df033cea (diff) | |
download | barebox-f550b750bb45853cacdcb014bc76e312b86f7c26.tar.gz barebox-f550b750bb45853cacdcb014bc76e312b86f7c26.tar.xz |
ARM: mmu: Drop needless shifting in map_io_sections()
Instead of shifting phys right by 20 and then again left by the same
amount, just convert the code to expect it to be in unit of bytes all
the time.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu/mmu.c')
-rw-r--r-- | arch/arm/cpu/mmu.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index f0f279ffac..06c9045b70 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -196,9 +196,8 @@ void *map_io_sections(unsigned long phys, void *_start, size_t size) { unsigned long start = (unsigned long)_start, sec; - phys >>= 20; - for (sec = start; sec < start + size; sec += (1 << 20)) - ttb[sec >> 20] = (phys++ << 20) | PMD_SECT_DEF_UNCACHED; + for (sec = start; sec < start + size; sec += (1 << 20), phys += SZ_1M) + ttb[sec >> 20] = phys | PMD_SECT_DEF_UNCACHED; dma_flush_range((unsigned long)ttb, (unsigned long)ttb + 0x4000); tlb_invalidate(); |