diff options
author | Scott Wood <scottwood@freescale.com> | 2007-09-14 16:30:44 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-10-04 12:02:04 -0400 |
commit | 449012daa92a60e42f0d55478641cfa796d51528 (patch) | |
tree | 0d79f3259147e7fda762ab1e07586697c22641a2 /include | |
parent | 544cdabe642e5508e784de709530a74d0775d070 (diff) |
[POWERPC] cpm2: Infrastructure code cleanup.
Mostly sparse fixes (__iomem annotations, etc); also, cpm2_immr
is used rather than creating many temporary mappings.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/cpm2.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/fs_pd.h | 19 | ||||
-rw-r--r-- | include/asm-powerpc/immap_cpm2.h | 4 |
3 files changed, 7 insertions, 18 deletions
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h index 12a2860f9a9c..c03650609792 100644 --- a/include/asm-powerpc/cpm2.h +++ b/include/asm-powerpc/cpm2.h | |||
@@ -107,7 +107,7 @@ | |||
107 | /* Export the base address of the communication processor registers | 107 | /* Export the base address of the communication processor registers |
108 | * and dual port ram. | 108 | * and dual port ram. |
109 | */ | 109 | */ |
110 | extern cpm_cpm2_t *cpmp; /* Pointer to comm processor */ | 110 | extern cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor */ |
111 | 111 | ||
112 | extern unsigned long cpm_dpalloc(uint size, uint align); | 112 | extern unsigned long cpm_dpalloc(uint size, uint align); |
113 | extern int cpm_dpfree(unsigned long offset); | 113 | extern int cpm_dpfree(unsigned long offset); |
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h index 77e04d01749c..64706a0532d3 100644 --- a/include/asm-powerpc/fs_pd.h +++ b/include/asm-powerpc/fs_pd.h | |||
@@ -23,22 +23,9 @@ | |||
23 | #include <asm/mpc85xx.h> | 23 | #include <asm/mpc85xx.h> |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #define cpm2_map(member) \ | 26 | #define cpm2_map(member) (&cpm2_immr->member) |
27 | ({ \ | 27 | #define cpm2_map_size(member, size) (&cpm2_immr->member) |
28 | u32 offset = offsetof(cpm2_map_t, member); \ | 28 | #define cpm2_unmap(addr) do {} while(0) |
29 | void *addr = ioremap (CPM_MAP_ADDR + offset, \ | ||
30 | sizeof( ((cpm2_map_t*)0)->member)); \ | ||
31 | addr; \ | ||
32 | }) | ||
33 | |||
34 | #define cpm2_map_size(member, size) \ | ||
35 | ({ \ | ||
36 | u32 offset = offsetof(cpm2_map_t, member); \ | ||
37 | void *addr = ioremap (CPM_MAP_ADDR + offset, size); \ | ||
38 | addr; \ | ||
39 | }) | ||
40 | |||
41 | #define cpm2_unmap(addr) iounmap(addr) | ||
42 | #endif | 29 | #endif |
43 | 30 | ||
44 | #ifdef CONFIG_8xx | 31 | #ifdef CONFIG_8xx |
diff --git a/include/asm-powerpc/immap_cpm2.h b/include/asm-powerpc/immap_cpm2.h index f316a91c628a..4080bab0468c 100644 --- a/include/asm-powerpc/immap_cpm2.h +++ b/include/asm-powerpc/immap_cpm2.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #ifndef __IMMAP_CPM2__ | 10 | #ifndef __IMMAP_CPM2__ |
11 | #define __IMMAP_CPM2__ | 11 | #define __IMMAP_CPM2__ |
12 | 12 | ||
13 | #include <linux/types.h> | ||
14 | |||
13 | /* System configuration registers. | 15 | /* System configuration registers. |
14 | */ | 16 | */ |
15 | typedef struct sys_82xx_conf { | 17 | typedef struct sys_82xx_conf { |
@@ -642,7 +644,7 @@ typedef struct immap { | |||
642 | u8 res11[4096]; | 644 | u8 res11[4096]; |
643 | } cpm2_map_t; | 645 | } cpm2_map_t; |
644 | 646 | ||
645 | extern cpm2_map_t *cpm2_immr; | 647 | extern cpm2_map_t __iomem *cpm2_immr; |
646 | 648 | ||
647 | #endif /* __IMMAP_CPM2__ */ | 649 | #endif /* __IMMAP_CPM2__ */ |
648 | #endif /* __KERNEL__ */ | 650 | #endif /* __KERNEL__ */ |