From patchwork Wed Oct 16 04:50:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3050191 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 46DEB9F2B6 for ; Wed, 16 Oct 2013 04:52:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C4B020444 for ; Wed, 16 Oct 2013 04:52:10 +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 2BE85201CE for ; Wed, 16 Oct 2013 04:52:09 +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 1VWJ58-0007yB-QZ; Wed, 16 Oct 2013 04:51:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWJ4y-00064Z-T7; Wed, 16 Oct 2013 04:51:28 +0000 Received: from mail-pd0-f178.google.com ([209.85.192.178]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VWJ4o-00063T-Bc for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2013 04:51:19 +0000 Received: by mail-pd0-f178.google.com with SMTP id w10so308172pde.37 for ; Tue, 15 Oct 2013 21:50:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IQK5NfC9nIy8JBq9XcDIWF7E+T+0BYjPZTy64mu0hd4=; b=BZbkpUGScDC8NyzQ8r01bEvIhsOBil/0gs413W3PK72m7WcxuxNKvLblv4r10KV5to jEbeSdVFuuTfHRGax6RaHEZ4mHZ1T8j+Oddy9xQYHcUh/tUzSUaOBUhkOrpnXB3bcH+s NrUUUD19O1HKEE9ko4rksDh3uyhPRmktrfNnEut7I8iBCHNsq8UHHYuZ6CULg0LHSYaD r0Z6LjC5a5i8u3rNxohnsXmoansKN4nGoh25j0Hch78VY+1giii6h4mNL0BitEiY12Un QnzhXbrgN0TcNY8Gc5GmYLroF7TwCfmW3SnbIWwMXKkfrrVOpim3HKMa6tBRUWP6yjfe cc9Q== X-Gm-Message-State: ALoCoQk6Rb446W3laQPZmG6+EG8qZk+gDcueCJZt9T0cAkSsxB8lJn+la57n5698JsM54bEPGSWs X-Received: by 10.66.147.230 with SMTP id tn6mr1433557pab.135.1381899056950; Tue, 15 Oct 2013 21:50:56 -0700 (PDT) Received: from kamensky-w530.cisco.com.net (c-24-6-79-41.hsd1.ca.comcast.net. [24.6.79.41]) by mx.google.com with ESMTPSA id bp4sm85731419pbb.42.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Oct 2013 21:50:56 -0700 (PDT) From: Victor Kamensky To: ben.dooks@codethink.co.uk, linux-arm-kernel@lists.infradead.org, nicolas.pitre@linaro.org, Dave.Martin@arm.com Subject: [PATCH v2] ARM: cci driver need big endian fixes in asm code Date: Tue, 15 Oct 2013 21:50:34 -0700 Message-Id: <1381899034-420-2-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1381899034-420-1-git-send-email-victor.kamensky@linaro.org> References: <1381899034-420-1-git-send-email-victor.kamensky@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131016_005118_546390_0E3E50C4 X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.1 (+) Cc: thomas.petazzoni@free-electrons.com, lorenzo.pieralisi@arm.com, patches@linaro.org, Victor Kamensky , will.deacon@arm.com, linaro-kernel@lists.linaro.org, rmk@arm.linux.org.uk 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=-1.7 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, 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 cci_enable_port_for_self written in asm and it works with h/w registers that are in little endian format. When run in big endian mode it needs byteswaped constants before/after it writes/reads to/from such registers Signed-off-by: Victor Kamensky Signed-off-by: Ben Dooks Acked-by: Nicolas Pitre --- 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 57b0bc6..4328c25 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -872,7 +872,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, %[cci_enable_req]\n" " str r3, [r0, #"__stringify(CCI_PORT_CTRL)"] \n" /* poll the status reg for completion */ @@ -880,7 +880,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, %[cci_control_status_bits] \n" " bne 4b \n" " mov r0, #0 \n" @@ -893,6 +893,8 @@ asmlinkage void __naked cci_enable_port_for_self(void) "7: .word cci_ctrl_phys - . \n" : : [sizeof_cpu_port] "i" (sizeof(cpu_port)), + [cci_enable_req] "i" cpu_to_le32(CCI_ENABLE_REQ), + [cci_control_status_bits] "i" cpu_to_le32(1), #ifndef __ARMEB__ [offsetof_cpu_port_mpidr_lsb] "i" (offsetof(struct cpu_port, mpidr)), #else