From: Dave.Martin@arm.com (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 [thread overview]
Message-ID: <1381328993-12724-5-git-send-email-Dave.Martin@arm.com> (raw)
In-Reply-To: <1381328993-12724-1-git-send-email-Dave.Martin@arm.com>
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 <Dave.Martin@arm.com>
---
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 <linux/of_address.h>
#include <linux/slab.h>
+#include <asm/assembler.h>
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
#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"
--
1.7.9.5
prev parent reply other threads:[~2013-10-09 14:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 14:29 [RFC PATCH 0/4] ARM: Unify const-swabbing and conditional asm Dave Martin
2013-10-09 14:29 ` [RFC PATCH 1/4] ARM: Allow assembler.h to be used with inline asm Dave Martin
2013-10-09 14:42 ` Russell King - ARM Linux
2013-10-09 15:00 ` Dave Martin
2013-10-09 15:32 ` Nicolas Pitre
2013-10-09 14:29 ` [RFC PATCH 2/4] ARM: Add common compile-time swab32 for asm code Dave Martin
2013-10-09 14:29 ` [RFC PATCH 3/4] ARM: Add const cpu_to_le32 for asm Dave Martin
2013-10-09 14:29 ` Dave Martin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381328993-12724-5-git-send-email-Dave.Martin@arm.com \
--to=dave.martin@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).