From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJPzj-0005QU-SJ for barebox@lists.infradead.org; Thu, 17 May 2018 20:59:50 +0000 Received: by mail-pf0-x22a.google.com with SMTP id o76-v6so2665728pfi.5 for ; Thu, 17 May 2018 13:59:17 -0700 (PDT) From: Andrey Smirnov Date: Thu, 17 May 2018 13:58:21 -0700 Message-Id: <20180517205837.32421-13-andrew.smirnov@gmail.com> In-Reply-To: <20180517205837.32421-1-andrew.smirnov@gmail.com> References: <20180517205837.32421-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v3 12/28] ARM: mmu: Drop needless shifting in map_io_sections() To: barebox@lists.infradead.org Cc: Andrey Smirnov 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 --- arch/arm/cpu/mmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index f0f279ffa..06c9045b7 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(); -- 2.17.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox