From patchwork Wed Oct 9 14:29:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3009171 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 829AA9F1E1 for ; Wed, 9 Oct 2013 14:32:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE5622010E for ; Wed, 9 Oct 2013 14:32:17 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3DC2F200F7 for ; Wed, 9 Oct 2013 14:32:13 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTun6-0005QB-KQ; Wed, 09 Oct 2013 14:31:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTump-0004uk-PU; Wed, 09 Oct 2013 14:30:51 +0000 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VTumN-0004qN-Gb for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2013 14:30:25 +0000 Received: from e103592.cambridge.arm.com (e103592.cambridge.arm.com [10.1.203.33]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id r99ETrZp001453; Wed, 9 Oct 2013 15:29:54 +0100 From: Dave Martin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 4/4] drivers/bus: arm-cci: Fix CCI enable code for BE32 Date: Wed, 9 Oct 2013 15:29:53 +0100 Message-Id: <1381328993-12724-5-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381328993-12724-1-git-send-email-Dave.Martin@arm.com> References: <1381328993-12724-1-git-send-email-Dave.Martin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131009_103023_827641_6A230E6A X-CRM114-Status: GOOD ( 10.25 ) X-Spam-Score: -2.8 (--) Cc: Nicolas Pitre , Lorenzo Pieralisi , Ben Dooks , Victor Kamensky X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The CCI control registers are always little-endian. This patch ensures that data is transferred to/from those registers using the correct byte order in the low-level asm code of cci_enable_port_for_self(). This is required for CCI to work correctly with BE8 kernels. Signed-off-by: Dave Martin --- drivers/bus/arm-cci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index 2009266..b205a97 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -20,11 +20,13 @@ #include #include +#include #include #include #define CCI_PORT_CTRL 0x0 #define CCI_CTRL_STATUS 0xc +#define CCI_CHANGE_PENDING (1 << 0) /* change pending in CCI_CTRL_STATUS */ #define CCI_ENABLE_SNOOP_REQ 0x1 #define CCI_ENABLE_DVM_REQ 0x2 @@ -280,7 +282,7 @@ asmlinkage void __naked cci_enable_port_for_self(void) /* Enable the CCI port */ " ldr r0, [r0, %[offsetof_port_phys]] \n" -" mov r3, #"__stringify(CCI_ENABLE_REQ)" \n" +" mov r3, #"__asm_cpu_to_le32(__stringify(CCI_ENABLE_REQ))" \n" " str r3, [r0, #"__stringify(CCI_PORT_CTRL)"] \n" /* poll the status reg for completion */ @@ -288,7 +290,7 @@ asmlinkage void __naked cci_enable_port_for_self(void) " ldr r0, [r1] \n" " ldr r0, [r0, r1] @ cci_ctrl_base \n" "4: ldr r1, [r0, #"__stringify(CCI_CTRL_STATUS)"] \n" -" tst r1, #1 \n" +" tst r1, #"__asm_cpu_to_le32(__stringify(CCI_CHANGE_PENDING))" \n" " bne 4b \n" " mov r0, #0 \n"