diff options
author | Jayachandran C <jchandra@broadcom.com> | 2013-06-10 02:30:02 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-06-13 11:46:41 -0400 |
commit | 1c146cd46fccfaa5525152f086da2752fe0ed4dd (patch) | |
tree | aa1980df5d4a1ec42abb0665086daf8464074647 /arch/mips/include/asm/netlogic | |
parent | 83bee792d7cb20d250be57e99d97f8cc83d9b4d5 (diff) |
MIPS: Netlogic: Fix nlm_read_c2_status() definition
The sel argument os nlm_read_c2_status() was not used and the macro
returned the sel 0 in all cases. Fix this by defining two macros:
nlm_read_c2_status0() and nlm_read_c2_status1() to return the two
status registers.
Add functions to write to the status registers as well.
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Cc: ddaney.cavm@gmail.com
Patchwork: https://patchwork.linux-mips.org/patch/5414/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/netlogic')
-rw-r--r-- | arch/mips/include/asm/netlogic/xlr/fmn.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/mips/include/asm/netlogic/xlr/fmn.h b/arch/mips/include/asm/netlogic/xlr/fmn.h index 2a78929cef73..56c7b85ea7dd 100644 --- a/arch/mips/include/asm/netlogic/xlr/fmn.h +++ b/arch/mips/include/asm/netlogic/xlr/fmn.h | |||
@@ -175,6 +175,10 @@ | |||
175 | #define nlm_write_c2_cc14(s, v) __write_32bit_c2_register($30, s, v) | 175 | #define nlm_write_c2_cc14(s, v) __write_32bit_c2_register($30, s, v) |
176 | #define nlm_write_c2_cc15(s, v) __write_32bit_c2_register($31, s, v) | 176 | #define nlm_write_c2_cc15(s, v) __write_32bit_c2_register($31, s, v) |
177 | 177 | ||
178 | #define nlm_read_c2_status0() __read_32bit_c2_register($2, 0) | ||
179 | #define nlm_write_c2_status0(v) __write_32bit_c2_register($2, 0, v) | ||
180 | #define nlm_read_c2_status1() __read_32bit_c2_register($2, 1) | ||
181 | #define nlm_write_c2_status1(v) __write_32bit_c2_register($2, 1, v) | ||
178 | #define nlm_read_c2_status(sel) __read_32bit_c2_register($2, 0) | 182 | #define nlm_read_c2_status(sel) __read_32bit_c2_register($2, 0) |
179 | #define nlm_read_c2_config() __read_32bit_c2_register($3, 0) | 183 | #define nlm_read_c2_config() __read_32bit_c2_register($3, 0) |
180 | #define nlm_write_c2_config(v) __write_32bit_c2_register($3, 0, v) | 184 | #define nlm_write_c2_config(v) __write_32bit_c2_register($3, 0, v) |
@@ -296,7 +300,7 @@ static inline int nlm_fmn_send(unsigned int size, unsigned int code, | |||
296 | */ | 300 | */ |
297 | for (i = 0; i < 8; i++) { | 301 | for (i = 0; i < 8; i++) { |
298 | nlm_msgsnd(dest); | 302 | nlm_msgsnd(dest); |
299 | status = nlm_read_c2_status(0); | 303 | status = nlm_read_c2_status0(); |
300 | if ((status & 0x2) == 1) | 304 | if ((status & 0x2) == 1) |
301 | pr_info("Send pending fail!\n"); | 305 | pr_info("Send pending fail!\n"); |
302 | if ((status & 0x4) == 0) | 306 | if ((status & 0x4) == 0) |
@@ -316,7 +320,7 @@ static inline int nlm_fmn_receive(int bucket, int *size, int *code, int *stid, | |||
316 | 320 | ||
317 | /* wait for load pending to clear */ | 321 | /* wait for load pending to clear */ |
318 | do { | 322 | do { |
319 | status = nlm_read_c2_status(1); | 323 | status = nlm_read_c2_status0(); |
320 | } while ((status & 0x08) != 0); | 324 | } while ((status & 0x08) != 0); |
321 | 325 | ||
322 | /* receive error bits */ | 326 | /* receive error bits */ |