From patchwork Sun Dec 9 23:58:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "boojin.kim" X-Patchwork-Id: 1854841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 5AB1E3FCF2 for ; Mon, 10 Dec 2012 00:01:44 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Thqln-0005kC-Bo; Sun, 09 Dec 2012 23:58:51 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Thqli-0005iw-Da for linux-arm-kernel@lists.infradead.org; Sun, 09 Dec 2012 23:58:48 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MES000MQFWPLY90@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2012 08:58:35 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.47]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B7.CA.01231.BA525C05; Mon, 10 Dec 2012 08:58:35 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-2d-50c525ab7f2a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 57.CA.01231.BA525C05; Mon, 10 Dec 2012 08:58:35 +0900 (KST) Received: from DOBOOJINKIM03 ([12.23.119.77]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MES00GUTFXM5PB0@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2012 08:58:35 +0900 (KST) From: Boojin Kim To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: In-reply-to: Subject: [PATCH 1/3] ARM: MM: Add the workaround of Errata 774769 Date: Mon, 10 Dec 2012 08:58:35 +0900 Message-id: <001701cdd669$19e8cdd0$4dba6970$%kim@samsung.com> X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac3WZaq4ai+zcSB3TK2VBDX2Gj8fbAAABBCwAADNLPA= Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t8zfd3VqkcDDC7s57XY9PgaqwOjx+Yl 9QGMUVw2Kak5mWWpRfp2CVwZPz6tZS74IFLxd+1mxgbGfQJdjJwcEgImEkcur2CDsMUkLtxb D2RzcQgJLGOUuNE/gbmLkQOs6Od1MYj4IkaJbROOskAVMUnceraeEaSbTUBTYsb36ewgtoiA m8SNxg4mkCJmgZWMEpM+TWAEmSQkwC2xujkIpIZTgEdi3Z9OZhBbWMBR4uyCv2DLWARUJfqm CoGEeQVsJVb8m8UGcYO6xKO/uhDTrSTWXtnLCmIzC4hI7HvxDuwCFgEBiW+TD7FAlMtKbDrA DHKAhMB3NoktH34yQ/woKXFwxQ2WCYyis5C0L2BkXMUomlqQXFCclJ5rqFecmFtcmpeul5yf u4kREsZSOxhXNlgcYhTgYFTi4Q1QPBogxJpYVlyZe4hRgoNZSYSX69iRACHelMTKqtSi/Pii 0pzU4kOMPkBXTWSWEk3OB8ZYXkm8obGxiZmJqYm5pam5KQ5hJXHeZo+UACGB9MSS1OzU1ILU IphxTBycUg2MBjEbo+Uc5zkxTVOUUyz8lOU7V1Rxse7T3HlrU/jdstwDdqjy9V2dqnNqf5VH 0Iw6oYXGps1HvtxokPkiZMzI+cJ44uXZy3XFvxQtvaqolZH2Zp/48Zcp+odbN9rrPv7iuJgv UvFmffuH3NuXjpefKH6/qV1xz95jtvkGD2tLRBR/qQVvifqrxFKckWioxVxUnAgAIV2Qg5AC AAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDIsWRmVeSWpSXmKPExsVy+t9jAd3VqkcDDLa3clhsenyN1YHRY/OS +gDGqAZGm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zByg qUoKZYk5pUChgMTiYiV9O0wTQkPcdC1gGiN0fUOC4HqMDNBAwjrGjB+f1jIXfBCp+Lt2M2MD 4z6BLkYODgkBE4mf18W6GDmBTDGJC/fWs3UxcnEICSxilNg24SgLhLOMSeLWs/WMIFVsApoS M75PZwexRQTcJG40djCBFDELrGSUmPRpAiPIVCEBbonVzUEgNZwCPBLr/nQyg9jCAo4SZxf8 ZQYpYRFQleibKgQS5hWwlVjxbxYbxD3qEo/+6kJMt5JYe2UvK4jNLCAise/FO8YJjPyzkLgL GBlXMYqmFiQXFCel5xrqFSfmFpfmpesl5+duYgRHyTOpHYwrGywOMQpwMCrx8AYoHg0QYk0s K67MPcQowcGsJMLLdexIgBBvSmJlVWpRfnxRaU5q8SFGH6D7JjJLiSbnAyM4ryTe0NjEzMjS yMzCyMTcHIewkjhvs0dKgJBAemJJanZqakFqEcw4Jg5OqQZGmTubqi49PN20K7+y7Y1n6Eub iKfXD4kwblw67f8dhueBf85HSE7Nkj0dOzNGlC93u1XIlFmW3fMP35q5cAKn+D4G5zmxy4ya nF64Xd6htvLSVfEF9k9nf7K/UOd/s6kl4YD8peSVyc9NMk4sXmhr8KOwl3f9xYTfc5LXLeBm kji/P4aPp35fgBJLcUaioRZzUXEiADpJ9+y/AgAA X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121209_185846_767580_FB98E158 X-CRM114-Status: GOOD ( 10.98 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: 'Will Deacon' , 'Kukjin Kim' , 'Russell King' , 'Catalin Marinas' X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds the workaround of Errata 774769 that configures write streaming on versions of A15 affected by this erratum such that no streaming-write ever allocates into the L2 cache. Signed-off-by: Boojin Kim --- arch/arm/Kconfig | 11 +++++++++++ arch/arm/mach-exynos/Kconfig | 1 + arch/arm/mm/proc-v7.S | 16 ++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) -- 1.7.5.4 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9759fec..11a57e2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1417,6 +1417,17 @@ config ARM_ERRATA_775420 to deadlock. This workaround puts DSB before executing ISB if an abort may occur on cache maintenance. +config ARM_ERRATA_774769 + bool "ARM errata: data corruption may occur with store streaming in a system" + depends on CPU_V7 + help + This option enables the workaround for the erratum 774769 affecting + Cortex-A15 (r0p4). + External memory may be corrupted on erratum 774769. + The workaround is to configure write streaming on versions of A15 + affected by this erratum such that no streaming-write ever allocates + into the L2 cache. + endmenu source "arch/arm/common/Kconfig" diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index da55107..e1168fb 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -22,6 +22,7 @@ config ARCH_EXYNOS4 config ARCH_EXYNOS5 bool "SAMSUNG EXYNOS5" select HAVE_SMP + select ARM_ERRATA_774769 help Samsung EXYNOS5 (Cortex-A15) SoC based systems diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 846d279..06cbdfa 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -208,7 +208,7 @@ __v7_setup: orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register #endif - b 3f + b 4f /* Cortex-A9 Errata */ 2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number @@ -243,8 +243,20 @@ __v7_setup: mcrlt p15, 0, r10, c15, c0, 1 @ write diagnostic register 1: #endif + b 4f -3: mov r10, #0 + /* Cortex-A15 Errata */ +3: ldr r10, =0x00000c0f @ Cortex-A15 primary part number + teq r0, r10 + bne 4f +#ifdef CONFIG_ARM_ERRATA_774769 + teq r6, #0x4 @ present in r0p4 + mrceq p15, 0, r10, c1, c0, 1 @ read aux control register + orreq r10, r10, #1 << 25 @ set bit #25 + mcreq p15, 0, r10, c1, c0, 1 @ write aux control register +#endif + +4: mov r10, #0 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate dsb #ifdef CONFIG_MMU