Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1256839ybl; Fri, 23 Aug 2019 16:19:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZy3LoqQLa/l3wYVgyWFvOrlq+rKlkbb6pUM73hbajVwySux3/vXLjb/lAqpLgZlofnRFz X-Received: by 2002:a17:90a:3be5:: with SMTP id e92mr6040530pjc.86.1566602383089; Fri, 23 Aug 2019 16:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566602383; cv=none; d=google.com; s=arc-20160816; b=baZfBS7v+bUOeSNKdmzRDczlsuTqIJHxGfV5olY+JCErYZZl2ZxvmFhKgwz92EXJkD wVQkCR7n9B6DDGA51kPR5Gj8xySNvqnLT3W1ZU2W+y9tFFAzyw6nXiAESlWmUJ/XuVcS ZSErdmvl0ExqzekBRfNMV3kSnJT8t9VbTe9rd3/B8XeXPfRD0WvCcv6RGVqZaygdPWbn DJSkRxA4/recsoOhuYOw/KZPSHE76uZFHPxOZU8C4+iE1vnkmCGEDlrKn8/z1/i8IuKf yh0Xe9QPHjsYXTluxWVUWXV56FLtWN4SbnLiRxbajpPwGPsQrtUauvxJqf/6YfXP9rd2 AXMw== 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=4cukybuxYzyKh4osdIe5zLMQPeJ6BNChd4Ex1TqwbvQ=; b=kUdofCPXl34uC72WvkeGzVP47mOFmXnXb6UdzER1rKBzl3MApwG4yZpVgO2MhCR9YA DFld/3sr9V4RDZs6gYbx90DYoZSErnNVKsYLbORrcAx6qNojyi131QpzsIk9KfcFxZ+I 0N6GEx+8Wy+/JdxQcE0iSlsfycIJYQt9aawm43i9f8LDIqJ0kvXr052JNc6pTx4PILt7 duxPO1JWjJDb0a0gLNvc0bEbPW5KexzWcjDSwVq/G0j28cykNoSSBQAKx6WXdhTIy8hl RBorLsNKQQYMRR9/o62SfDafHHPvJb0UUWNr1Zwii+x4oT4p8NnK96HHMrUAkU/lsmVx 4Dgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=LAoNsyoT; 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 l8si2952091pgi.347.2019.08.23.16.19.27; Fri, 23 Aug 2019 16:19:43 -0700 (PDT) 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=LAoNsyoT; 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 S2394468AbfHWMuV (ORCPT + 99 others); Fri, 23 Aug 2019 08:50:21 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:19363 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391624AbfHWMuU (ORCPT ); Fri, 23 Aug 2019 08:50:20 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 46FLpd4cyxz9txM0; Fri, 23 Aug 2019 14:50:17 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=LAoNsyoT; 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 SfhwT4Mbyq1G; Fri, 23 Aug 2019 14:50:17 +0200 (CEST) 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 46FLpd3bh2z9txLw; Fri, 23 Aug 2019 14:50:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1566564617; bh=4cukybuxYzyKh4osdIe5zLMQPeJ6BNChd4Ex1TqwbvQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=LAoNsyoTy/Uy/TxiLZs39kyssTYThEDlkklrbs8dyKpjOEBfYoGCIa57RhK1nAicq 0t7DH2XkOxAmEsWyrGNJdU7vfSM/HHBbVZdn7ffytF2jdWJ7K6QohNrWzAjJn+q7Mq 9ym0Zv7t3Jsn72G5EuwnnBwy8U5Zeqd64JdjrKx8= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E53A38B87B; Fri, 23 Aug 2019 14:50:18 +0200 (CEST) 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 7gNk9FgxzWR6; Fri, 23 Aug 2019 14:50:18 +0200 (CEST) Received: from pc16032vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.103]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C8D298B866; Fri, 23 Aug 2019 14:50:18 +0200 (CEST) Received: by pc16032vm.idsi0.si.c-s.fr (Postfix, from userid 0) id B688B639BC; Fri, 23 Aug 2019 12:50:18 +0000 (UTC) Message-Id: <331759c1bcba5797d30f8eace74afb16ac5f3c36.1566564560.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 2/2] powerpc/83xx: map IMMR with a BAT. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , oss@buserror.net, galak@kernel.crashing.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 23 Aug 2019 12:50:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On mpc83xx with a QE, IMMR is 2Mbytes. On mpc83xx without a QE, IMMR is 1Mbytes. Each driver will map a part of it to access the registers it needs. Some driver will map the same part of IMMR as other drivers. In order to reduce TLB misses, map the full IMMR with a BAT. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/83xx/misc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c index f46d7bf3b140..1e395b01c535 100644 --- a/arch/powerpc/platforms/83xx/misc.c +++ b/arch/powerpc/platforms/83xx/misc.c @@ -18,6 +18,8 @@ #include #include +#include + #include "mpc83xx.h" static __be32 __iomem *restart_reg_base; @@ -145,6 +147,14 @@ void __init mpc83xx_setup_arch(void) if (ppc_md.progress) ppc_md.progress("mpc83xx_setup_arch()", 0); + if (!__map_without_bats) { + int immrsize = IS_ENABLED(CONFIG_QUICC_ENGINE) ? SZ_2M : SZ_1M; + + ioremap_bot = ALIGN_DOWN(ioremap_bot - immrsize, immrsize); + setbat(-1, ioremap_bot, get_immrbase(), immrsize, PAGE_KERNEL_NCG); + update_bats(); + } + mpc83xx_setup_pci(); } -- 2.13.3