Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp816712imp; Wed, 20 Feb 2019 09:29:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IYTVhCX/DrCTeqRzyJivwop4SK0erkW7nMNEPRBU4Pq2V5ysSKUETA9X94NoToNUvG50QNT X-Received: by 2002:a65:5844:: with SMTP id s4mr29764337pgr.77.1550683794762; Wed, 20 Feb 2019 09:29:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550683794; cv=none; d=google.com; s=arc-20160816; b=YdfE1jQbeCQShZAOwWRgwRZJ/qZiWykgtJW1j4s16GXTqNTWmhE0YtJXi/qNo/S4FA udqafSqwBFDE5zUt9Db+6slW/IRZenjJdv+E5CG7U0MyMvFxAF9p2oXKikaqpvHF/dix kt1Uqla07suxbXC2kmiBj7CSCxmsgpgo9Lf25rP6Wgb5gUkWNJnwplLQhjCNchLX09IL 2Uu6UrgeeQ86FcfeC9HidoyrBiCYawVZu44bzo3SV5EFSf7xJlYFmACEPr+HYte/f3Gf puUU/wPjoe6JZ14ajajetbtbYioP09t1Nr/xHmt7/bA1uUBxUl+DL6ncUzRnzW2TyF8T EIiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=ZHUKudDrrrsVvvpp99Q9yOTfS6jJuUqw8dzPq7U71mU=; b=OBuLxyImOJrKBcZZf/2epUik8bjHKt2a1BZ9KVNNeXefFwV/QsrGwo1SrI05E+EvXL 3+p76+iygB+FzG/A5gCD9c1DrMNZSx1juy+Q0qQ4R1PKeXfoYZhFPk0ASPveRqNSTh5K 4a+/AhzpxxffLFldMpquCYCS9TB+hTyIN7lqnFT2skB/G1lWq//81ia/Blu3LRQ8tbB6 zmRgnViWZ+ZNY6/aUusTqKW+kekqEqj7ULjo2+WMXIhJ+i+kUzZB+9nbK9kSNZ6BX155 2g8s7wojPtc/PcuZdrf96swGV4PEldLolKtiipnzkpQZNQcuXNOYTc6uSoE8kKxe8dcT dt1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=BagKyvbl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j39si19904039plb.272.2019.02.20.09.29.38; Wed, 20 Feb 2019 09:29:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=BagKyvbl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726581AbfBTR3O (ORCPT + 99 others); Wed, 20 Feb 2019 12:29:14 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:19652 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbfBTR3M (ORCPT ); Wed, 20 Feb 2019 12:29:12 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444PjK47Sxz9v0g7; Wed, 20 Feb 2019 18:29:09 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=BagKyvbl; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 90F8ix-U7-tD; Wed, 20 Feb 2019 18:29:09 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 444PjK31G3z9v0g0; Wed, 20 Feb 2019 18:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550683749; bh=ZHUKudDrrrsVvvpp99Q9yOTfS6jJuUqw8dzPq7U71mU=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=BagKyvblA5Hn24SdcEtEnT43Nbqi9xVKjLMaTB1mjkjUVUA+A3IGRTlx621FK3y4v qVWXHnEEwJxyvgsRFmk9YDZY/4n5lFpmNairbt56eoIvJ7v/P3cF4gbegSWc3JVqY5 oa0jTv90N3tNxWYUEaENfdQnmWsnurSmvpbqOTfg= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1634D8B84F; Wed, 20 Feb 2019 18:29:11 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id qwb08ZiMB0IW; Wed, 20 Feb 2019 18:29:11 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E851C8B84A; Wed, 20 Feb 2019 18:29:10 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id E14D46E85E; Wed, 20 Feb 2019 17:29:10 +0000 (UTC) Message-Id: <4c6d31d6b73122b52403c3f92bd0aca342990f2a.1550648295.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v3 04/16] powerpc/mm/32s: use generic mmu_mapin_ram() for all blocks. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Feb 2019 17:29:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that mmu_mapin_ram() is able to handle other blocks than the one starting at 0, the WII can use it for all its blocks. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable_32.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index b4858818523f..fd665c32a1f7 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c @@ -254,26 +254,15 @@ static void __init __mapin_ram_chunk(unsigned long offset, unsigned long top) void __init mapin_ram(void) { - unsigned long s, top; - -#ifndef CONFIG_WII - top = total_lowmem; - s = mmu_mapin_ram(0, top); - __mapin_ram_chunk(s, top); -#else - if (!wii_hole_size) { - s = mmu_mapin_ram(0, total_lowmem); - __mapin_ram_chunk(s, total_lowmem); - } else { - top = wii_hole_start; - s = mmu_mapin_ram(0, top); - __mapin_ram_chunk(s, top); + struct memblock_region *reg; + + for_each_memblock(memory, reg) { + unsigned long base = reg->base; + unsigned long top = base + reg->size; - top = memblock_end_of_DRAM(); - s = wii_mmu_mapin_mem2(top); - __mapin_ram_chunk(s, top); + base = mmu_mapin_ram(base, top); + __mapin_ram_chunk(base, top); } -#endif } /* Scan the real Linux page tables and return a PTE pointer for -- 2.13.3