From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B704EC49ED7 for ; Mon, 16 Sep 2019 20:36:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A7C92067B for ; Mon, 16 Sep 2019 20:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403823AbfIPUgf (ORCPT ); Mon, 16 Sep 2019 16:36:35 -0400 Received: from baldur.buserror.net ([165.227.176.147]:35306 "EHLO baldur.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387499AbfIPUgf (ORCPT ); Mon, 16 Sep 2019 16:36:35 -0400 Received: from [2601:449:8480:af0:12bf:48ff:fe84:c9a0] by baldur.buserror.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i9xjV-0001Rl-Ai; Mon, 16 Sep 2019 15:36:25 -0500 Message-ID: From: Scott Wood To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , galak@kernel.crashing.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 16 Sep 2019 15:36:23 -0500 In-Reply-To: <269a00951328fb6fa1be2fa3cbc76c19745019b7.1568665466.git.christophe.leroy@c-s.fr> References: <269a00951328fb6fa1be2fa3cbc76c19745019b7.1568665466.git.christophe.leroy@c-s.fr> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2601:449:8480:af0:12bf:48ff:fe84:c9a0 X-SA-Exim-Rcpt-To: christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, galak@kernel.crashing.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org X-SA-Exim-Mail-From: oss@buserror.net Subject: Re: [PATCH v3 2/2] powerpc/83xx: map IMMR with a BAT. X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on baldur.buserror.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-09-16 at 20:25 +0000, Christophe Leroy wrote: > On mpc83xx with a QE, IMMR is 2Mbytes and aligned on 2Mbytes boundarie. > On mpc83xx without a QE, IMMR is 1Mbyte and 1Mbyte aligned. > > Each driver will map a part of it to access the registers it needs. > Some drivers will map the same part of IMMR as other drivers. > > In order to reduce TLB misses, map the full IMMR with a BAT. If it is > 2Mbytes aligned, map 2Mbytes. If there is no QE, the upper part will > remain unused, but it doesn't harm as it is mapped as guarded memory. > > When the IMMR is not aligned on a 2Mbytes boundarie, only map 1Mbyte. > > Signed-off-by: Christophe Leroy > > --- > v2: > - use a fixmap area instead of playing with ioremap_bot > - always map 2M unless IMMRBAR is only 1M aligned > > v3: > - replaced __fix_to_virt() by fix_to_virt() > --- > arch/powerpc/include/asm/fixmap.h | 8 ++++++++ > arch/powerpc/platforms/83xx/misc.c | 11 +++++++++++ > 2 files changed, 19 insertions(+) Acked-by: Scott Wood -Scott