From f2a0bd3753dad7ea4605ebd5435716b39e9f92bb Mon Sep 17 00:00:00 2001 From: Vitaly Bordug Date: Wed, 24 Jan 2007 22:41:24 +0300 Subject: [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 Signed-off-by: Paul Mackerras --- include/asm-powerpc/fs_pd.h | 45 ++++++++++++++++++++++++++++++++++---------- include/asm-powerpc/mpc8xx.h | 24 +++++++++++++++++++++++ include/asm-powerpc/time.h | 2 ++ 3 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 include/asm-powerpc/mpc8xx.h (limited to 'include/asm-powerpc') 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 @@ #ifndef FS_PD_H #define FS_PD_H -#include #include #include -static inline int uart_baudrate(void) -{ - return get_baudrate(); -} - -static inline int uart_clock(void) -{ - return ppc_proc_freq; -} +#ifdef CONFIG_CPM2 +#include #define cpm2_map(member) \ ({ \ @@ -41,5 +33,38 @@ static inline int uart_clock(void) }) #define cpm2_unmap(addr) iounmap(addr) +#endif + +#ifdef CONFIG_8xx +#include +#include + +#define immr_map(member) \ +({ \ + u32 offset = offsetof(immap_t, member); \ + void *addr = ioremap (IMAP_ADDR + offset, \ + sizeof( ((immap_t*)0)->member)); \ + addr; \ +}) + +#define immr_map_size(member, size) \ +({ \ + u32 offset = offsetof(immap_t, member); \ + void *addr = ioremap (IMAP_ADDR + offset, size); \ + addr; \ +}) + +#define immr_unmap(addr) iounmap(addr) +#endif + +static inline int uart_baudrate(void) +{ + return get_baudrate(); +} + +static inline int uart_clock(void) +{ + return ppc_proc_freq; +} #endif diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h new file mode 100644 index 000000000000..e05ba6b1b000 --- /dev/null +++ b/include/asm-powerpc/mpc8xx.h @@ -0,0 +1,24 @@ +/* This is the single file included by all MPC8xx build options. + * Since there are many different boards and no standard configuration, + * we have a unique include file for each. Rather than change every + * file that has to include MPC8xx configuration, they all include + * this one and the configuration switching is done here. + */ +#ifdef __KERNEL__ +#ifndef __CONFIG_8xx_DEFS +#define __CONFIG_8xx_DEFS + + +#ifdef CONFIG_8xx + +#ifdef CONFIG_FADS +#include +#endif + +#if defined(CONFIG_MPC885ADS) +#include +#endif + +#endif /* CONFIG_8xx */ +#endif /* __CONFIG_8xx_DEFS */ +#endif /* __KERNEL__ */ diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index 4cff977ad526..3fd57c048f59 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h @@ -39,6 +39,8 @@ extern void generic_calibrate_decr(void); extern void wakeup_decrementer(void); extern void snapshot_timebase(void); +extern void set_dec_cpu6(unsigned int val); + /* Some sane defaults: 125 MHz timebase, 1GHz processor */ extern unsigned long ppc_proc_freq; #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) -- cgit v1.2.3