aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/fs_pd.h
diff options
context:
space:
mode:
authorVitaly Bordug <vbordug@ru.mvista.com>2007-01-24 14:41:24 -0500
committerPaul Mackerras <paulus@samba.org>2007-02-06 22:03:17 -0500
commitf2a0bd3753dad7ea4605ebd5435716b39e9f92bb (patch)
treef14b6a7b9e3588a388be0f2b6602284c49c026e4 /include/asm-powerpc/fs_pd.h
parent88bdc6f061cfb4579d2327fd457d4b7807525a0e (diff)
[POWERPC] 8xx: powerpc port of core CPM PIC
This covers common CPM access functions, CPM interrupt controller code, micropatch and a few compatibility things to kee the same driver base working with arch/ppc. This version is refined with all the comments (mostly PIC-related) addressed. Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/fs_pd.h')
-rw-r--r--include/asm-powerpc/fs_pd.h45
1 files changed, 35 insertions, 10 deletions
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
index 3d0e819d37f1..1e2962fc4fa8 100644
--- a/include/asm-powerpc/fs_pd.h
+++ b/include/asm-powerpc/fs_pd.h
@@ -11,19 +11,11 @@
11 11
12#ifndef FS_PD_H 12#ifndef FS_PD_H
13#define FS_PD_H 13#define FS_PD_H
14#include <asm/cpm2.h>
15#include <sysdev/fsl_soc.h> 14#include <sysdev/fsl_soc.h>
16#include <asm/time.h> 15#include <asm/time.h>
17 16
18static inline int uart_baudrate(void) 17#ifdef CONFIG_CPM2
19{ 18#include <asm/cpm2.h>
20 return get_baudrate();
21}
22
23static inline int uart_clock(void)
24{
25 return ppc_proc_freq;
26}
27 19
28#define cpm2_map(member) \ 20#define cpm2_map(member) \
29({ \ 21({ \
@@ -41,5 +33,38 @@ static inline int uart_clock(void)
41}) 33})
42 34
43#define cpm2_unmap(addr) iounmap(addr) 35#define cpm2_unmap(addr) iounmap(addr)
36#endif
37
38#ifdef CONFIG_8xx
39#include <asm/8xx_immap.h>
40#include <asm/mpc8xx.h>
41
42#define immr_map(member) \
43({ \
44 u32 offset = offsetof(immap_t, member); \
45 void *addr = ioremap (IMAP_ADDR + offset, \
46 sizeof( ((immap_t*)0)->member)); \
47 addr; \
48})
49
50#define immr_map_size(member, size) \
51({ \
52 u32 offset = offsetof(immap_t, member); \
53 void *addr = ioremap (IMAP_ADDR + offset, size); \
54 addr; \
55})
56
57#define immr_unmap(addr) iounmap(addr)
58#endif
59
60static inline int uart_baudrate(void)
61{
62 return get_baudrate();
63}
64
65static inline int uart_clock(void)
66{
67 return ppc_proc_freq;
68}
44 69
45#endif 70#endif