diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2006-12-11 00:16:08 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2006-12-11 00:16:08 -0500 |
commit | c86c676cca5be7366570ecf3d2e4f8e28cf2b920 (patch) | |
tree | d97757920f4f84085151f71d158dce2891f8223a /include/asm-powerpc | |
parent | a147c5857c0b591b05d787e59b691c3a4f245f83 (diff) | |
parent | 45d8e7aaf47668550fdb6c2d3abbe42f48a76df2 (diff) |
Merge branch '85xx' into for_paulus
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/dcr-native.h | 37 | ||||
-rw-r--r-- | include/asm-powerpc/dcr.h | 2 |
2 files changed, 37 insertions, 2 deletions
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h index fd4a5f5e33d1..d7a1bc1551c6 100644 --- a/include/asm-powerpc/dcr-native.h +++ b/include/asm-powerpc/dcr-native.h | |||
@@ -20,8 +20,7 @@ | |||
20 | #ifndef _ASM_POWERPC_DCR_NATIVE_H | 20 | #ifndef _ASM_POWERPC_DCR_NATIVE_H |
21 | #define _ASM_POWERPC_DCR_NATIVE_H | 21 | #define _ASM_POWERPC_DCR_NATIVE_H |
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | 23 | #ifndef __ASSEMBLY__ | |
24 | #include <asm/reg.h> | ||
25 | 24 | ||
26 | typedef struct {} dcr_host_t; | 25 | typedef struct {} dcr_host_t; |
27 | 26 | ||
@@ -32,7 +31,41 @@ typedef struct {} dcr_host_t; | |||
32 | #define dcr_read(host, dcr_n) mfdcr(dcr_n) | 31 | #define dcr_read(host, dcr_n) mfdcr(dcr_n) |
33 | #define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) | 32 | #define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) |
34 | 33 | ||
34 | /* Device Control Registers */ | ||
35 | void __mtdcr(int reg, unsigned int val); | ||
36 | unsigned int __mfdcr(int reg); | ||
37 | #define mfdcr(rn) \ | ||
38 | ({unsigned int rval; \ | ||
39 | if (__builtin_constant_p(rn)) \ | ||
40 | asm volatile("mfdcr %0," __stringify(rn) \ | ||
41 | : "=r" (rval)); \ | ||
42 | else \ | ||
43 | rval = __mfdcr(rn); \ | ||
44 | rval;}) | ||
45 | |||
46 | #define mtdcr(rn, v) \ | ||
47 | do { \ | ||
48 | if (__builtin_constant_p(rn)) \ | ||
49 | asm volatile("mtdcr " __stringify(rn) ",%0" \ | ||
50 | : : "r" (v)); \ | ||
51 | else \ | ||
52 | __mtdcr(rn, v); \ | ||
53 | } while (0) | ||
54 | |||
55 | /* R/W of indirect DCRs make use of standard naming conventions for DCRs */ | ||
56 | #define mfdcri(base, reg) \ | ||
57 | ({ \ | ||
58 | mtdcr(base ## _CFGADDR, base ## _ ## reg); \ | ||
59 | mfdcr(base ## _CFGDATA); \ | ||
60 | }) | ||
61 | |||
62 | #define mtdcri(base, reg, data) \ | ||
63 | do { \ | ||
64 | mtdcr(base ## _CFGADDR, base ## _ ## reg); \ | ||
65 | mtdcr(base ## _CFGDATA, data); \ | ||
66 | } while (0) | ||
35 | 67 | ||
68 | #endif /* __ASSEMBLY__ */ | ||
36 | #endif /* __KERNEL__ */ | 69 | #endif /* __KERNEL__ */ |
37 | #endif /* _ASM_POWERPC_DCR_NATIVE_H */ | 70 | #endif /* _ASM_POWERPC_DCR_NATIVE_H */ |
38 | 71 | ||
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h index 473f2c7fd892..b66c5e6941f0 100644 --- a/include/asm-powerpc/dcr.h +++ b/include/asm-powerpc/dcr.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #ifndef _ASM_POWERPC_DCR_H | 20 | #ifndef _ASM_POWERPC_DCR_H |
21 | #define _ASM_POWERPC_DCR_H | 21 | #define _ASM_POWERPC_DCR_H |
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | #ifdef CONFIG_PPC_DCR | ||
23 | 24 | ||
24 | #ifdef CONFIG_PPC_DCR_NATIVE | 25 | #ifdef CONFIG_PPC_DCR_NATIVE |
25 | #include <asm/dcr-native.h> | 26 | #include <asm/dcr-native.h> |
@@ -38,5 +39,6 @@ extern unsigned int dcr_resource_len(struct device_node *np, | |||
38 | unsigned int index); | 39 | unsigned int index); |
39 | #endif /* CONFIG_PPC_MERGE */ | 40 | #endif /* CONFIG_PPC_MERGE */ |
40 | 41 | ||
42 | #endif /* CONFIG_PPC_DCR */ | ||
41 | #endif /* __KERNEL__ */ | 43 | #endif /* __KERNEL__ */ |
42 | #endif /* _ASM_POWERPC_DCR_H */ | 44 | #endif /* _ASM_POWERPC_DCR_H */ |