diff options
| author | Vitaly Bordug <vbordug@ru.mvista.com> | 2007-01-24 14:41:24 -0500 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2007-02-06 22:03:17 -0500 |
| commit | f2a0bd3753dad7ea4605ebd5435716b39e9f92bb (patch) | |
| tree | f14b6a7b9e3588a388be0f2b6602284c49c026e4 /include | |
| parent | 88bdc6f061cfb4579d2327fd457d4b7807525a0e (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')
| -rw-r--r-- | include/asm-powerpc/fs_pd.h | 45 | ||||
| -rw-r--r-- | include/asm-powerpc/mpc8xx.h | 24 | ||||
| -rw-r--r-- | include/asm-powerpc/time.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc/commproc.h | 1 |
4 files changed, 62 insertions, 10 deletions
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h index 3d0e819d37..1e2962fc4f 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 | ||
| 18 | static inline int uart_baudrate(void) | 17 | #ifdef CONFIG_CPM2 |
| 19 | { | 18 | #include <asm/cpm2.h> |
| 20 | return get_baudrate(); | ||
| 21 | } | ||
| 22 | |||
| 23 | static 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 | |||
| 60 | static inline int uart_baudrate(void) | ||
| 61 | { | ||
| 62 | return get_baudrate(); | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline int uart_clock(void) | ||
| 66 | { | ||
| 67 | return ppc_proc_freq; | ||
| 68 | } | ||
| 44 | 69 | ||
| 45 | #endif | 70 | #endif |
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h new file mode 100644 index 0000000000..e05ba6b1b0 --- /dev/null +++ b/include/asm-powerpc/mpc8xx.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* This is the single file included by all MPC8xx build options. | ||
| 2 | * Since there are many different boards and no standard configuration, | ||
| 3 | * we have a unique include file for each. Rather than change every | ||
| 4 | * file that has to include MPC8xx configuration, they all include | ||
| 5 | * this one and the configuration switching is done here. | ||
| 6 | */ | ||
| 7 | #ifdef __KERNEL__ | ||
| 8 | #ifndef __CONFIG_8xx_DEFS | ||
| 9 | #define __CONFIG_8xx_DEFS | ||
| 10 | |||
| 11 | |||
| 12 | #ifdef CONFIG_8xx | ||
| 13 | |||
| 14 | #ifdef CONFIG_FADS | ||
| 15 | #include <platforms/fads.h> | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #if defined(CONFIG_MPC885ADS) | ||
| 19 | #include <platforms/8xx/mpc885ads.h> | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #endif /* CONFIG_8xx */ | ||
| 23 | #endif /* __CONFIG_8xx_DEFS */ | ||
| 24 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index 4cff977ad5..3fd57c048f 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
| @@ -39,6 +39,8 @@ extern void generic_calibrate_decr(void); | |||
| 39 | extern void wakeup_decrementer(void); | 39 | extern void wakeup_decrementer(void); |
| 40 | extern void snapshot_timebase(void); | 40 | extern void snapshot_timebase(void); |
| 41 | 41 | ||
| 42 | extern void set_dec_cpu6(unsigned int val); | ||
| 43 | |||
| 42 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ | 44 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ |
| 43 | extern unsigned long ppc_proc_freq; | 45 | extern unsigned long ppc_proc_freq; |
| 44 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) | 46 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) |
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h index 7b06b4e6bf..4f99df1baf 100644 --- a/include/asm-ppc/commproc.h +++ b/include/asm-ppc/commproc.h | |||
| @@ -77,6 +77,7 @@ extern int cpm_dpfree(uint offset); | |||
| 77 | extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align); | 77 | extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align); |
| 78 | extern void cpm_dpdump(void); | 78 | extern void cpm_dpdump(void); |
| 79 | extern void *cpm_dpram_addr(uint offset); | 79 | extern void *cpm_dpram_addr(uint offset); |
| 80 | extern uint cpm_dpram_phys(u8* addr); | ||
| 80 | extern void cpm_setbrg(uint brg, uint rate); | 81 | extern void cpm_setbrg(uint brg, uint rate); |
| 81 | 82 | ||
| 82 | extern uint m8xx_cpm_hostalloc(uint size); | 83 | extern uint m8xx_cpm_hostalloc(uint size); |
