From patchwork Fri Jun 23 17:52:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 9807211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 949BE6086C for ; Fri, 23 Jun 2017 17:53:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85AF62865B for ; Fri, 23 Jun 2017 17:53:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A3AE28760; Fri, 23 Jun 2017 17:53:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 131B52865B for ; Fri, 23 Jun 2017 17:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GmkcVErNXzqkNyjRXCX5D8kzfpusy0t11jwj3jZye38=; b=PdhPusKmX76sB7kfbD+YQ/qYix M08kvJffnPq1ABWhxFSZZ3z3Ix2z9RMreFeC9gweXw0BQJS36jOdVf775Fj9aotVsIm08liHIgGJ9 f6nV39KNUMEvMuaF11BSFS7NjtzKEeuO2awTd/jSVO90DznABT6gzcwq19Qtef730eO2tr7/GI1vs oZ00m9DHLIFECb3HkyZKm/NDVe4ap8vewcYf8reNPRg3BWbvxxBTonGJ15+nEv5o3XQ/N2zRfBArq Us2V2ExD99H4d+IGreCAokmGoHcMB6/Q2ASYbtzU1oXeSRWLmyAHP/qC63IeMOGVjlgHzIAQbFDMU Ot+1adHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dOSmK-0001eF-VI; Fri, 23 Jun 2017 17:53:56 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dOSm0-0000yB-NI for linux-arm-kernel@lists.infradead.org; Fri, 23 Jun 2017 17:53:39 +0000 Received: by mail-wr0-x243.google.com with SMTP id 77so14192231wrb.3 for ; Fri, 23 Jun 2017 10:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HqO1YjJt8hcB5+EiGHYxuW5wiqoluzwueNUzsCiywRI=; b=jNce+wT74xNI2wG11XluRc7Yc4iVsPRkNZvP3MT38q2NbX/yHYE2mI5vxX3CQXM2m5 M9eveJ6s1oBlWaDyroEnhF9DnmFJWZapv3mZs+9d+1OB9qA3QSbseshCMN04EE1j+kxN tFxRQf+c2q6ysB3WumUFI//HmOJsHUg5AO/mQnMnGFuFoZ/JKqVra/iUUTCLf+CK5OWd z7mwd+YXbjO+C0ACOJkmv4FmdJiysN7eH4rBxSlDv9oK0xnYmYXuGQ3vQLB292ahXadN 8SG0a5QMCbtdMHJpZoUBG40aIu4VHneLpBYro3ShVIw8BgQmNCLadPV0rAguwWj3K0yd KMXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HqO1YjJt8hcB5+EiGHYxuW5wiqoluzwueNUzsCiywRI=; b=LPfGHX7S4x8GE9zzoDRTpkH1pZpBWEYiYW29PPpGTjooLt/nsYuOoq0eCWVF5BEiSw JXLtckM095GZ9rCUqUMklg4nirKhkXFUta96Z9kakePm6PalbAnWfAwp0xyeLlwnij+T 3wq984yNT2fOkKkJDVB58282pKRLiHAC8r1bGr2vDoP0kiRazfgHtm0U36+X/3dLMJir 6wdvDWn5v+WyEO7411I2M+8ae/wa2AdswnAeOSGssx2Y3grwgUIRHbun9+3WWK2fEBVa UqXSCwu+wKTMyWX6HThSKtLJrDdV/Ec7VI2zlTZDmh0j01BEw5Mhg0bdOVhe3kDZP9qm sOiw== X-Gm-Message-State: AKS2vOzCPJ+qafXcPumOPUfbrAquYKtsHI+lptmQdL59ERN2AZa2YGO8 9nqDv96uQmtwv92NCQNasA== X-Received: by 10.223.161.219 with SMTP id v27mr6787827wrv.135.1498240394674; Fri, 23 Jun 2017 10:53:14 -0700 (PDT) Received: from fainelli-desktop.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id v2sm6201909wrb.68.2017.06.23.10.53.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 10:53:14 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/7] ARM: Hook B15 readahead cache functions based on processor Date: Fri, 23 Jun 2017 10:52:23 -0700 Message-Id: <20170623175227.19743-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170623175227.19743-1-f.fainelli@gmail.com> References: <20170623175227.19743-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170623_105336_968923_8500A50C X-CRM114-Status: GOOD ( 14.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , Sebastian Andrzej Siewior , open list , Masahiro Yamada , Ingo Molnar , Christoffer Dall , Florian Fainelli , Russell King , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Laura Abbott , Vladimir Murzin , Kees Cook , Pawel Moll , Marc Zyngier , opendmb@gmail.com, Gregory Fong , Doug Anderson , Thomas Gleixner , Mauro Carvalho Chehab , Anna-Maria Gleixner , Richard Cochran , Jonathan Austin , "Martin K. Petersen" , Greg Kroah-Hartman , Douglas Anderson , Andrew Morton , Brian Norris , "David S. Miller" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If we detect that we are running on a Broadcom Brahma-B15 CPU, and CONFIG_CACHE_B15_RAC is enabled, make sure that we pick-up the b15_cache_fns function operations. If CONFIG_CACHE_B15_RAC is enabled, but we are not running on a Broadcom Brahma-B15 CPU, we will fallback to calling into the regular v7_cache_fns with no cost. If CONFIG_CACHE_B15_RAC is disabled, there is no cost and we just use the regular v7_cache_fns. Signed-off-by: Florian Fainelli --- arch/arm/mm/cache-v7.S | 21 +++++++++++++++++++++ arch/arm/mm/proc-v7.S | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index de78109d002d..215df435bfb9 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -15,6 +15,7 @@ #include #include #include +#include #include "proc-macros.S" @@ -446,3 +447,23 @@ ENDPROC(v7_dma_unmap_area) @ define struct cpu_cache_fns (see and proc-macros.S) define_cache_functions v7 + + /* The Broadcom Brahma-B15 read-ahead cache requires some modifications + * to the v7_cache_fns, we only override the ones we need + */ +#ifndef CONFIG_CACHE_B15_RAC + globl_equ b15_flush_kern_cache_all, v7_flush_kern_cache_all +#endif + globl_equ b15_flush_icache_all, v7_flush_icache_all + globl_equ b15_flush_kern_cache_louis, v7_flush_kern_cache_louis + globl_equ b15_flush_user_cache_all, v7_flush_user_cache_all + globl_equ b15_flush_user_cache_range, v7_flush_user_cache_range + globl_equ b15_coherent_kern_range, v7_coherent_kern_range + globl_equ b15_coherent_user_range, v7_coherent_user_range + globl_equ b15_flush_kern_dcache_area, v7_flush_kern_dcache_area + + globl_equ b15_dma_map_area, v7_dma_map_area + globl_equ b15_dma_unmap_area, v7_dma_unmap_area + globl_equ b15_dma_flush_range, v7_dma_flush_range + + define_cache_functions b15 diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 812ac861cd23..d55d493f9a1e 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -678,7 +678,7 @@ __v7_ca15mp_proc_info: __v7_b15mp_proc_info: .long 0x420f00f0 .long 0xff0ffff0 - __v7_proc __v7_b15mp_proc_info, __v7_b15mp_setup + __v7_proc __v7_b15mp_proc_info, __v7_b15mp_setup, cache_fns = b15_cache_fns .size __v7_b15mp_proc_info, . - __v7_b15mp_proc_info /*