aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/delay.h36
-rw-r--r--arch/powerpc/include/asm/fsl_lbc.h4
-rw-r--r--arch/powerpc/include/asm/reg.h3
-rw-r--r--arch/powerpc/include/asm/reg_booke.h2
4 files changed, 42 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/delay.h b/arch/powerpc/include/asm/delay.h
index f9200a65c632..1e2eb41fa057 100644
--- a/arch/powerpc/include/asm/delay.h
+++ b/arch/powerpc/include/asm/delay.h
@@ -2,8 +2,11 @@
2#define _ASM_POWERPC_DELAY_H 2#define _ASM_POWERPC_DELAY_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <asm/time.h>
6
5/* 7/*
6 * Copyright 1996, Paul Mackerras. 8 * Copyright 1996, Paul Mackerras.
9 * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved.
7 * 10 *
8 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
@@ -30,5 +33,38 @@ extern void udelay(unsigned long usecs);
30#define mdelay(n) udelay((n) * 1000) 33#define mdelay(n) udelay((n) * 1000)
31#endif 34#endif
32 35
36/**
37 * spin_event_timeout - spin until a condition gets true or a timeout elapses
38 * @condition: a C expression to evalate
39 * @timeout: timeout, in microseconds
40 * @delay: the number of microseconds to delay between each evaluation of
41 * @condition
42 *
43 * The process spins until the condition evaluates to true (non-zero) or the
44 * timeout elapses. The return value of this macro is the value of
45 * @condition when the loop terminates. This allows you to determine the cause
46 * of the loop terminates. If the return value is zero, then you know a
47 * timeout has occurred.
48 *
49 * This primary purpose of this macro is to poll on a hardware register
50 * until a status bit changes. The timeout ensures that the loop still
51 * terminates even if the bit never changes. The delay is for devices that
52 * need a delay in between successive reads.
53 *
54 * gcc will optimize out the if-statement if @delay is a constant.
55 */
56#define spin_event_timeout(condition, timeout, delay) \
57({ \
58 typeof(condition) __ret; \
59 unsigned long __loops = tb_ticks_per_usec * timeout; \
60 unsigned long __start = get_tbl(); \
61 while (!(__ret = (condition)) && (tb_ticks_since(__start) <= __loops)) \
62 if (delay) \
63 udelay(delay); \
64 else \
65 cpu_relax(); \
66 __ret; \
67})
68
33#endif /* __KERNEL__ */ 69#endif /* __KERNEL__ */
34#endif /* _ASM_POWERPC_DELAY_H */ 70#endif /* _ASM_POWERPC_DELAY_H */
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index 63a4f779f531..1b5a21041f9b 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -95,8 +95,8 @@ struct fsl_lbc_bank {
95}; 95};
96 96
97struct fsl_lbc_regs { 97struct fsl_lbc_regs {
98 struct fsl_lbc_bank bank[8]; 98 struct fsl_lbc_bank bank[12];
99 u8 res0[0x28]; 99 u8 res0[0x8];
100 __be32 mar; /**< UPM Address Register */ 100 __be32 mar; /**< UPM Address Register */
101 u8 res1[0x4]; 101 u8 res1[0x4];
102 __be32 mamr; /**< UPMA Mode Register */ 102 __be32 mamr; /**< UPMA Mode Register */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index a3c28e46947c..1170267736d3 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -755,7 +755,8 @@
755#define mfspr(rn) ({unsigned long rval; \ 755#define mfspr(rn) ({unsigned long rval; \
756 asm volatile("mfspr %0," __stringify(rn) \ 756 asm volatile("mfspr %0," __stringify(rn) \
757 : "=r" (rval)); rval;}) 757 : "=r" (rval)); rval;})
758#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) 758#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)\
759 : "memory")
759 760
760#ifdef __powerpc64__ 761#ifdef __powerpc64__
761#ifdef CONFIG_PPC_CELL 762#ifdef CONFIG_PPC_CELL
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 601ddbc46002..6bcf364cbb2f 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -389,12 +389,14 @@
389#define ICCR_CACHE 1 /* Cacheable */ 389#define ICCR_CACHE 1 /* Cacheable */
390 390
391/* Bit definitions for L1CSR0. */ 391/* Bit definitions for L1CSR0. */
392#define L1CSR0_CPE 0x00010000 /* Data Cache Parity Enable */
392#define L1CSR0_CLFC 0x00000100 /* Cache Lock Bits Flash Clear */ 393#define L1CSR0_CLFC 0x00000100 /* Cache Lock Bits Flash Clear */
393#define L1CSR0_DCFI 0x00000002 /* Data Cache Flash Invalidate */ 394#define L1CSR0_DCFI 0x00000002 /* Data Cache Flash Invalidate */
394#define L1CSR0_CFI 0x00000002 /* Cache Flash Invalidate */ 395#define L1CSR0_CFI 0x00000002 /* Cache Flash Invalidate */
395#define L1CSR0_DCE 0x00000001 /* Data Cache Enable */ 396#define L1CSR0_DCE 0x00000001 /* Data Cache Enable */
396 397
397/* Bit definitions for L1CSR1. */ 398/* Bit definitions for L1CSR1. */
399#define L1CSR1_CPE 0x00010000 /* Instruction Cache Parity Enable */
398#define L1CSR1_ICLFR 0x00000100 /* Instr Cache Lock Bits Flash Reset */ 400#define L1CSR1_ICLFR 0x00000100 /* Instr Cache Lock Bits Flash Reset */
399#define L1CSR1_ICFI 0x00000002 /* Instr Cache Flash Invalidate */ 401#define L1CSR1_ICFI 0x00000002 /* Instr Cache Flash Invalidate */
400#define L1CSR1_ICE 0x00000001 /* Instr Cache Enable */ 402#define L1CSR1_ICE 0x00000001 /* Instr Cache Enable */