mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
[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>
This commit is contained in:
parent
88bdc6f061
commit
f2a0bd3753
9 changed files with 1414 additions and 10 deletions
|
|
@ -11,19 +11,11 @@
|
|||
|
||||
#ifndef FS_PD_H
|
||||
#define FS_PD_H
|
||||
#include <asm/cpm2.h>
|
||||
#include <sysdev/fsl_soc.h>
|
||||
#include <asm/time.h>
|
||||
|
||||
static inline int uart_baudrate(void)
|
||||
{
|
||||
return get_baudrate();
|
||||
}
|
||||
|
||||
static inline int uart_clock(void)
|
||||
{
|
||||
return ppc_proc_freq;
|
||||
}
|
||||
#ifdef CONFIG_CPM2
|
||||
#include <asm/cpm2.h>
|
||||
|
||||
#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 <asm/8xx_immap.h>
|
||||
#include <asm/mpc8xx.h>
|
||||
|
||||
#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
|
||||
|
|
|
|||
24
include/asm-powerpc/mpc8xx.h
Normal file
24
include/asm-powerpc/mpc8xx.h
Normal file
|
|
@ -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 <platforms/fads.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MPC885ADS)
|
||||
#include <platforms/8xx/mpc885ads.h>
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_8xx */
|
||||
#endif /* __CONFIG_8xx_DEFS */
|
||||
#endif /* __KERNEL__ */
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ extern int cpm_dpfree(uint offset);
|
|||
extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
|
||||
extern void cpm_dpdump(void);
|
||||
extern void *cpm_dpram_addr(uint offset);
|
||||
extern uint cpm_dpram_phys(u8* addr);
|
||||
extern void cpm_setbrg(uint brg, uint rate);
|
||||
|
||||
extern uint m8xx_cpm_hostalloc(uint size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue