From patchwork Sun Oct 5 21:59:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beniamino Galvani X-Patchwork-Id: 5034731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82994C11AC for ; Sun, 5 Oct 2014 22:06:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5530201D3 for ; Sun, 5 Oct 2014 22:06:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B62AE201C8 for ; Sun, 5 Oct 2014 22:06:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XatsZ-0005Ns-27; Sun, 05 Oct 2014 22:02:11 +0000 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xats4-00055i-Vv for linux-arm-kernel@lists.infradead.org; Sun, 05 Oct 2014 22:01:41 +0000 Received: by mail-wi0-f177.google.com with SMTP id fb4so2964273wid.10 for ; Sun, 05 Oct 2014 15:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fJMHRguWNboivqb2i32Nime9JhEHABbS7ZrWzrMNbsM=; b=hHX3T23UHMSvnRL/C2p7n0UzLFeEBB+L0ZQdmCd8uKAC+wCKWgTZVXvj1c+l+sSwRa eY2eVNiTB4cG9Pjk7Fo3xynP4+fZroQIuDLUoS3Ghevo5W3wDLslbcCVFnGyI2lrrvl4 W3Z/V4apK1+JD0EEkjKdTuTPDUDrZaMeQwZ0ItfYX3mbm2udSNn+BwyVubbBuVlDwspQ +XPaG2OvQYj1Pq5BiyYbPYt+G4I+yBS4XJ6hMXqefNtBglHD0nuAZMfu/o6jLEGd8Mcm ixe5NeKBhf2OxHmMOMgAo/v8lexqJJ285JrQwUjqz85/ZKU2gKC4e9Nqv2duhgqy5Rcp XXNg== X-Received: by 10.180.102.41 with SMTP id fl9mr7987203wib.52.1412546483329; Sun, 05 Oct 2014 15:01:23 -0700 (PDT) Received: from sark.local (host207-98-dynamic.16-79-r.retail.telecomitalia.it. [79.16.98.207]) by mx.google.com with ESMTPSA id fo6sm9266168wic.3.2014.10.05.15.01.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Oct 2014 15:01:22 -0700 (PDT) From: Beniamino Galvani To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 7/7] ARM: meson: enable L2 cache Date: Sun, 5 Oct 2014 23:59:19 +0200 Message-Id: <1412546359-15062-8-git-send-email-b.galvani@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412546359-15062-1-git-send-email-b.galvani@gmail.com> References: <1412546359-15062-1-git-send-email-b.galvani@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141005_150141_172934_D132A55A X-CRM114-Status: GOOD ( 11.07 ) X-Spam-Score: -0.8 (/) Cc: Mark Rutland , devicetree@vger.kernel.org, Victor Wan , Russell King , Pawel Moll , Arnd Bergmann , Ian Campbell , linux-kernel@vger.kernel.org, Beniamino Galvani , Rob Herring , Kumar Gala , Carlo Caione , Jerry Cao X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This enables the L2 cache controller available in Amlogic SoCs. Signed-off-by: Beniamino Galvani --- arch/arm/boot/dts/meson.dtsi | 7 +++++++ arch/arm/boot/dts/meson6.dtsi | 2 ++ arch/arm/boot/dts/meson8.dtsi | 4 ++++ arch/arm/mach-meson/Kconfig | 1 + arch/arm/mach-meson/meson.c | 2 ++ 5 files changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi index 55feb14..7d27f12 100644 --- a/arch/arm/boot/dts/meson.dtsi +++ b/arch/arm/boot/dts/meson.dtsi @@ -50,6 +50,13 @@ / { interrupt-parent = <&gic>; + L2: l2-cache-controller@c4200000 { + compatible = "arm,pl310-cache"; + reg = <0xc4200000 0x1000>; + cache-unified; + cache-level = <2>; + }; + gic: interrupt-controller@c4301000 { compatible = "arm,cortex-a9-gic"; reg = <0xc4301000 0x1000>, diff --git a/arch/arm/boot/dts/meson6.dtsi b/arch/arm/boot/dts/meson6.dtsi index 4ba4912..8b33be1 100644 --- a/arch/arm/boot/dts/meson6.dtsi +++ b/arch/arm/boot/dts/meson6.dtsi @@ -60,12 +60,14 @@ cpu@200 { device_type = "cpu"; compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; reg = <0x200>; }; cpu@201 { device_type = "cpu"; compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; reg = <0x201>; }; }; diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi index 42e4026..1f442a7 100644 --- a/arch/arm/boot/dts/meson8.dtsi +++ b/arch/arm/boot/dts/meson8.dtsi @@ -58,24 +58,28 @@ cpu@200 { device_type = "cpu"; compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; reg = <0x200>; }; cpu@201 { device_type = "cpu"; compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; reg = <0x201>; }; cpu@202 { device_type = "cpu"; compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; reg = <0x202>; }; cpu@203 { device_type = "cpu"; compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; reg = <0x203>; }; }; diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig index b289e8e..18301dc 100644 --- a/arch/arm/mach-meson/Kconfig +++ b/arch/arm/mach-meson/Kconfig @@ -2,6 +2,7 @@ menuconfig ARCH_MESON bool "Amlogic Meson SoCs" if ARCH_MULTI_V7 select GENERIC_IRQ_CHIP select ARM_GIC + select CACHE_L2X0 if ARCH_MESON diff --git a/arch/arm/mach-meson/meson.c b/arch/arm/mach-meson/meson.c index 8f42d8f..5d6affe 100644 --- a/arch/arm/mach-meson/meson.c +++ b/arch/arm/mach-meson/meson.c @@ -24,4 +24,6 @@ static const char * const meson_common_board_compat[] = { DT_MACHINE_START(MESON, "Amlogic Meson platform") .dt_compat = meson_common_board_compat, + .l2c_aux_val = 0, + .l2c_aux_mask = ~0, MACHINE_END