From patchwork Tue Nov 4 03:07:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5222921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AF40D9F39B for ; Tue, 4 Nov 2014 03:12:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1F6A2012F for ; Tue, 4 Nov 2014 03:12:19 +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 EAF802012E for ; Tue, 4 Nov 2014 03:12:18 +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 1XlUV3-0007s8-Hz; Tue, 04 Nov 2014 03:09:41 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XlUV1-0007rX-3x for linux-arm-kernel@lists.infradead.org; Tue, 04 Nov 2014 03:09:39 +0000 Received: by mail-pa0-f43.google.com with SMTP id eu11so13529765pac.30 for ; Mon, 03 Nov 2014 19:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=dBzW3b9NvgaUHJxJ/QjAN2p8tWhsJBtfNPcVXQ/7xXA=; b=pCanGxdTorff4zDTqJ+RO+xA+qalQ/oLqlIF0VjKQuHLPCwGCf/RU+c9xeZB+zjKBg roIaZ9vFoXJNjsDvfh7rSKNvGlWtDjOO26A8ZwQzQXZTcWhtPvSmbt3EJ6EUTvQ5Ies6 PGgCcBj+ei00IFgwyxK43Qbz03coHlEdYrYM0Ksb1EVuutZOOrU6mJmV24ZNsJfFAYtA I2yZCB2+UwiBa2JH8KguONg8CjzA8uSHckj0M1DpZoobU0qSr3BecoPn20ebKvURMh8h B5tHot/sII9kBHALz9IkHBA8euBihG0JmDta5fnLYmlVzBfFI/OrksmrP2hSf9hjAoM2 IsQQ== X-Received: by 10.68.228.102 with SMTP id sh6mr47495089pbc.12.1415070557487; Mon, 03 Nov 2014 19:09:17 -0800 (PST) Received: from ld-irv-0074.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id hb6sm1684419pbc.31.2014.11.03.19.09.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Nov 2014 19:09:16 -0800 (PST) From: Brian Norris To: Russell King Subject: [PATCH] ARM: v7: replace magic numbers with CP15 macros Date: Mon, 3 Nov 2014 19:07:48 -0800 Message-Id: <1415070468-4667-1-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141103_190939_299427_CF144106 X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Brian Norris , linux-arm-kernel@lists.infradead.org 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=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 These CP15 register bit-masks are slightly more readable when using the CP15 macro definitions from . They also assist in grepping for sites which mess with SCTLR bits. Tested on a B15 SMP x4 system, and checked the disassembly before/after to confirm equivalence. Signed-off-by: Brian Norris Cc: Russell King --- arch/arm/mm/proc-v7.S | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index b3a947863ac7..3f9dbe91168b 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -31,8 +32,8 @@ ENDPROC(cpu_v7_proc_init) ENTRY(cpu_v7_proc_fin) mrc p15, 0, r0, c1, c0, 0 @ ctrl register - bic r0, r0, #0x1000 @ ...i............ - bic r0, r0, #0x0006 @ .............ca. + bic r0, r0, #CR_I @ ...i............ + bic r0, r0, #(CR_C | CR_A) @ .............ca. mcr p15, 0, r0, c1, c0, 0 @ disable caches ret lr ENDPROC(cpu_v7_proc_fin) @@ -53,8 +54,8 @@ ENDPROC(cpu_v7_proc_fin) .pushsection .idmap.text, "ax" ENTRY(cpu_v7_reset) mrc p15, 0, r1, c1, c0, 0 @ ctrl register - bic r1, r1, #0x1 @ ...............m - THUMB( bic r1, r1, #1 << 30 ) @ SCTLR.TE (Thumb exceptions) + bic r1, r1, #CR_M @ ...............m + THUMB( bic r1, r1, #CR_TE ) @ SCTLR.TE (Thumb exceptions) mcr p15, 0, r1, c1, c0, 0 @ disable MMU isb bx r0