Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp787991imp; Thu, 21 Feb 2019 11:10:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IYx23zm22FK5tpWrC+b73+RRXbQ5BrLIS6DpZWslFKSGDIsPUkX1pR2KYYZyV4Gb1x1Wkw2 X-Received: by 2002:a62:ed15:: with SMTP id u21mr107945pfh.38.1550776259265; Thu, 21 Feb 2019 11:10:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550776259; cv=none; d=google.com; s=arc-20160816; b=1Ke5J6zoXEZsz1xcKK2kUdIMj20kMoUhHflBLmEgNFyTiK/2j0ZiERKKNRcdmBgni2 xG/JcDk0Gof7qKIRom2jgPFfWmDLdPVzWpuq0FwoO8ItH8JWq2YpqVbxScS6s3mYqPjp 9lUCnw5ilWDkaks6qAowae6npdSDZjzc0D2KnnllLU4SCgTcPa+tKg5RtH5pPiKrBti8 YsGT3YQaML4ki9OKbutdtgGdUgKDzfYZ54BZk1qQdIpyMMfCwAcAgjGrAja9gb/9hvX/ djVd0qSDtsfCSTjpZXPocDaZYRMod+TF+M5V0RQYG+6Pnt7YiNcVKBtnF999p+stDaNO OyCA== 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=h833MPxWaqIdIiBCZbSEEo7piRFdFUsngs+n+GtqrgI=; b=igRYPdgtCUC4vRHOFHTU8L+P0Y4PmqMppebsQDK8mSExR6sLNUGYzpVJKroC0BH5sk mNcMnIvDjat5+eVBjTkvAEx/71YVEynjcOXQp9ye3tBBqnm0gcfTFbHEXmp9yMt4m18P 4M0YY598AplotPL8XnCtnsJiamRRiqr+DHIh8InKn9SWKzIsEcWVsvEhfgPSssDxsge9 r5ErZ1o8ATxs7B49e7fPj9FYHyj02cmqDdnUAonGdiKoykGPKz4UJhvJolw0Wu2VEwai y8Gl6UA0gzad+xBGaadM+TAlbsd+9fPiic2fbuF3hNMXJml5CauABCk2kVB8X1mNQgSs TO+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=lsfmAE7N; 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 o9si20686579pll.303.2019.02.21.11.10.44; Thu, 21 Feb 2019 11:10:59 -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=lsfmAE7N; 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 S1726425AbfBUTIo (ORCPT + 99 others); Thu, 21 Feb 2019 14:08:44 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:57068 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbfBUTIl (ORCPT ); Thu, 21 Feb 2019 14:08:41 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4453sh60MNz9v6l2; Thu, 21 Feb 2019 20:08:40 +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=lsfmAE7N; 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 8v0A2gZf7ulN; Thu, 21 Feb 2019 20:08:40 +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 4453sh4xRyz9v6jt; Thu, 21 Feb 2019 20:08:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550776120; bh=h833MPxWaqIdIiBCZbSEEo7piRFdFUsngs+n+GtqrgI=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=lsfmAE7N4NUHnhwAJP51kdXEkg34iNBsFf6KESPBa8DVoNaeakJxDeGLyNA8Ar+Z+ BsJZX0GPBBjdEZL2aeTfW3AQ7rAPZRNdOnPPrT9FUTBiGbf9lNY4LI8OcVctXyUCBF Mt1TJ0jntN17xTJETEu+h9yMFUNb3UiwJ+wPDzWk= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id AD6B68B86A; Thu, 21 Feb 2019 20:08:40 +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 W5dgpq0nWPks; Thu, 21 Feb 2019 20:08:40 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 829428B852; Thu, 21 Feb 2019 20:08:40 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 61FFC6EF61; Thu, 21 Feb 2019 19:08:40 +0000 (UTC) Message-Id: <3964416ff59a9197b5f182e2e741e20aedbd4b9e.1550775950.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 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: Thu, 21 Feb 2019 19:08:40 +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 | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index b4858818523f..c4b0eb51f6d8 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c @@ -254,26 +254,17 @@ 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) { + phys_addr_t base = reg->base; + phys_addr_t top = min(base + reg->size, total_lowmem); - top = memblock_end_of_DRAM(); - s = wii_mmu_mapin_mem2(top); - __mapin_ram_chunk(s, top); + if (base >= top) + continue; + 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