Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
This commit is contained in:
Linus Torvalds 2005-04-16 15:20:36 -07:00
commit 1da177e4c3
17291 changed files with 6718755 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,152 @@
/* include/asm-m68knommu/MC68332.h: '332 control registers
*
* Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
*
*/
#ifndef _MC68332_H_
#define _MC68332_H_
#define BYTE_REF(addr) (*((volatile unsigned char*)addr))
#define WORD_REF(addr) (*((volatile unsigned short*)addr))
#define PORTE_ADDR 0xfffa11
#define PORTE BYTE_REF(PORTE_ADDR)
#define DDRE_ADDR 0xfffa15
#define DDRE BYTE_REF(DDRE_ADDR)
#define PEPAR_ADDR 0xfffa17
#define PEPAR BYTE_REF(PEPAR_ADDR)
#define PORTF_ADDR 0xfffa19
#define PORTF BYTE_REF(PORTF_ADDR)
#define DDRF_ADDR 0xfffa1d
#define DDRF BYTE_REF(DDRF_ADDR)
#define PFPAR_ADDR 0xfffa1f
#define PFPAR BYTE_REF(PFPAR_ADDR)
#define PORTQS_ADDR 0xfffc15
#define PORTQS BYTE_REF(PORTQS_ADDR)
#define DDRQS_ADDR 0xfffc17
#define DDRQS BYTE_REF(DDRQS_ADDR)
#define PQSPAR_ADDR 0xfffc16
#define PQSPAR BYTE_REF(PQSPAR_ADDR)
#define CSPAR0_ADDR 0xFFFA44
#define CSPAR0 WORD_REF(CSPAR0_ADDR)
#define CSPAR1_ADDR 0xFFFA46
#define CSPAR1 WORD_REF(CSPAR1_ADDR)
#define CSARBT_ADDR 0xFFFA48
#define CSARBT WORD_REF(CSARBT_ADDR)
#define CSOPBT_ADDR 0xFFFA4A
#define CSOPBT WORD_REF(CSOPBT_ADDR)
#define CSBAR0_ADDR 0xFFFA4C
#define CSBAR0 WORD_REF(CSBAR0_ADDR)
#define CSOR0_ADDR 0xFFFA4E
#define CSOR0 WORD_REF(CSOR0_ADDR)
#define CSBAR1_ADDR 0xFFFA50
#define CSBAR1 WORD_REF(CSBAR1_ADDR)
#define CSOR1_ADDR 0xFFFA52
#define CSOR1 WORD_REF(CSOR1_ADDR)
#define CSBAR2_ADDR 0xFFFA54
#define CSBAR2 WORD_REF(CSBAR2_ADDR)
#define CSOR2_ADDR 0xFFFA56
#define CSOR2 WORD_REF(CSOR2_ADDR)
#define CSBAR3_ADDR 0xFFFA58
#define CSBAR3 WORD_REF(CSBAR3_ADDR)
#define CSOR3_ADDR 0xFFFA5A
#define CSOR3 WORD_REF(CSOR3_ADDR)
#define CSBAR4_ADDR 0xFFFA5C
#define CSBAR4 WORD_REF(CSBAR4_ADDR)
#define CSOR4_ADDR 0xFFFA5E
#define CSOR4 WORD_REF(CSOR4_ADDR)
#define CSBAR5_ADDR 0xFFFA60
#define CSBAR5 WORD_REF(CSBAR5_ADDR)
#define CSOR5_ADDR 0xFFFA62
#define CSOR5 WORD_REF(CSOR5_ADDR)
#define CSBAR6_ADDR 0xFFFA64
#define CSBAR6 WORD_REF(CSBAR6_ADDR)
#define CSOR6_ADDR 0xFFFA66
#define CSOR6 WORD_REF(CSOR6_ADDR)
#define CSBAR7_ADDR 0xFFFA68
#define CSBAR7 WORD_REF(CSBAR7_ADDR)
#define CSOR7_ADDR 0xFFFA6A
#define CSOR7 WORD_REF(CSOR7_ADDR)
#define CSBAR8_ADDR 0xFFFA6C
#define CSBAR8 WORD_REF(CSBAR8_ADDR)
#define CSOR8_ADDR 0xFFFA6E
#define CSOR8 WORD_REF(CSOR8_ADDR)
#define CSBAR9_ADDR 0xFFFA70
#define CSBAR9 WORD_REF(CSBAR9_ADDR)
#define CSOR9_ADDR 0xFFFA72
#define CSOR9 WORD_REF(CSOR9_ADDR)
#define CSBAR10_ADDR 0xFFFA74
#define CSBAR10 WORD_REF(CSBAR10_ADDR)
#define CSOR10_ADDR 0xFFFA76
#define CSOR10 WORD_REF(CSOR10_ADDR)
#define CSOR_MODE_ASYNC 0x0000
#define CSOR_MODE_SYNC 0x8000
#define CSOR_MODE_MASK 0x8000
#define CSOR_BYTE_DISABLE 0x0000
#define CSOR_BYTE_UPPER 0x4000
#define CSOR_BYTE_LOWER 0x2000
#define CSOR_BYTE_BOTH 0x6000
#define CSOR_BYTE_MASK 0x6000
#define CSOR_RW_RSVD 0x0000
#define CSOR_RW_READ 0x0800
#define CSOR_RW_WRITE 0x1000
#define CSOR_RW_BOTH 0x1800
#define CSOR_RW_MASK 0x1800
#define CSOR_STROBE_DS 0x0400
#define CSOR_STROBE_AS 0x0000
#define CSOR_STROBE_MASK 0x0400
#define CSOR_DSACK_WAIT(x) (wait << 6)
#define CSOR_DSACK_FTERM (14 << 6)
#define CSOR_DSACK_EXTERNAL (15 << 6)
#define CSOR_DSACK_MASK 0x03c0
#define CSOR_SPACE_CPU 0x0000
#define CSOR_SPACE_USER 0x0010
#define CSOR_SPACE_SU 0x0020
#define CSOR_SPACE_BOTH 0x0030
#define CSOR_SPACE_MASK 0x0030
#define CSOR_IPL_ALL 0x0000
#define CSOR_IPL_PRIORITY(x) (x << 1)
#define CSOR_IPL_MASK 0x000e
#define CSOR_AVEC_ON 0x0001
#define CSOR_AVEC_OFF 0x0000
#define CSOR_AVEC_MASK 0x0001
#define CSBAR_ADDR(x) ((addr >> 11) << 3)
#define CSBAR_ADDR_MASK 0xfff8
#define CSBAR_BLKSIZE_2K 0x0000
#define CSBAR_BLKSIZE_8K 0x0001
#define CSBAR_BLKSIZE_16K 0x0002
#define CSBAR_BLKSIZE_64K 0x0003
#define CSBAR_BLKSIZE_128K 0x0004
#define CSBAR_BLKSIZE_256K 0x0005
#define CSBAR_BLKSIZE_512K 0x0006
#define CSBAR_BLKSIZE_1M 0x0007
#define CSBAR_BLKSIZE_MASK 0x0007
#define CSPAR_DISC 0
#define CSPAR_ALT 1
#define CSPAR_CS8 2
#define CSPAR_CS16 3
#define CSPAR_MASK 3
#define CSPAR0_CSBOOT(x) (x << 0)
#define CSPAR0_CS0(x) (x << 2)
#define CSPAR0_CS1(x) (x << 4)
#define CSPAR0_CS2(x) (x << 6)
#define CSPAR0_CS3(x) (x << 8)
#define CSPAR0_CS4(x) (x << 10)
#define CSPAR0_CS5(x) (x << 12)
#define CSPAR1_CS6(x) (x << 0)
#define CSPAR1_CS7(x) (x << 2)
#define CSPAR1_CS8(x) (x << 4)
#define CSPAR1_CS9(x) (x << 6)
#define CSPAR1_CS10(x) (x << 8)
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
#include <asm-m68k/a.out.h>

View file

@ -0,0 +1,112 @@
/****************************************************************************/
/*
* anchor.h -- Anchor CO-MEM Lite PCI host bridge part.
*
* (C) Copyright 2000, Moreton Bay (www.moreton.com.au)
*/
/****************************************************************************/
#ifndef anchor_h
#define anchor_h
/****************************************************************************/
/*
* Define basic addressing info.
*/
#if defined(CONFIG_MOTOROLA) && defined(CONFIG_M5407)
#define COMEM_BASE 0xFFFF0000 /* Base of CO-MEM address space */
#define COMEM_IRQ 25 /* IRQ of anchor part */
#else
#define COMEM_BASE 0x80000000 /* Base of CO-MEM address space */
#define COMEM_IRQ 25 /* IRQ of anchor part */
#endif
/****************************************************************************/
/*
* 4-byte registers of CO-MEM, so adjust register addresses for
* easy access. Handy macro for word access too.
*/
#define LREG(a) ((a) >> 2)
#define WREG(a) ((a) >> 1)
/*
* Define base addresses within CO-MEM Lite register address space.
*/
#define COMEM_I2O 0x0000 /* I2O registers */
#define COMEM_OPREGS 0x0400 /* Operation registers */
#define COMEM_PCIBUS 0x2000 /* Direct access to PCI bus */
#define COMEM_SHMEM 0x4000 /* Shared memory region */
#define COMEM_SHMEMSIZE 0x4000 /* Size of shared memory */
/*
* Define CO-MEM Registers.
*/
#define COMEM_I2OHISR 0x0030 /* I2O host interrupt status */
#define COMEM_I2OHIMR 0x0034 /* I2O host interrupt mask */
#define COMEM_I2OLISR 0x0038 /* I2O local interrupt status */
#define COMEM_I2OLIMR 0x003c /* I2O local interrupt mask */
#define COMEM_IBFPFIFO 0x0040 /* I2O inbound free/post FIFO */
#define COMEM_OBPFFIFO 0x0044 /* I2O outbound post/free FIFO */
#define COMEM_IBPFFIFO 0x0048 /* I2O inbound post/free FIFO */
#define COMEM_OBFPFIFO 0x004c /* I2O outbound free/post FIFO */
#define COMEM_DAHBASE 0x0460 /* Direct access base address */
#define COMEM_NVCMD 0x04a0 /* I2C serial command */
#define COMEM_NVREAD 0x04a4 /* I2C serial read */
#define COMEM_NVSTAT 0x04a8 /* I2C status */
#define COMEM_DMALBASE 0x04b0 /* DMA local base address */
#define COMEM_DMAHBASE 0x04b4 /* DMA host base address */
#define COMEM_DMASIZE 0x04b8 /* DMA size */
#define COMEM_DMACTL 0x04bc /* DMA control */
#define COMEM_HCTL 0x04e0 /* Host control */
#define COMEM_HINT 0x04e4 /* Host interrupt control/status */
#define COMEM_HLDATA 0x04e8 /* Host to local data mailbox */
#define COMEM_LINT 0x04f4 /* Local interrupt contole status */
#define COMEM_LHDATA 0x04f8 /* Local to host data mailbox */
#define COMEM_LBUSCFG 0x04fc /* Local bus configuration */
/*
* Commands and flags for use with Direct Access Register.
*/
#define COMEM_DA_IACK 0x00000000 /* Interrupt acknowledge (read) */
#define COMEM_DA_SPCL 0x00000010 /* Special cycle (write) */
#define COMEM_DA_MEMRD 0x00000004 /* Memory read cycle */
#define COMEM_DA_MEMWR 0x00000004 /* Memory write cycle */
#define COMEM_DA_IORD 0x00000002 /* I/O read cycle */
#define COMEM_DA_IOWR 0x00000002 /* I/O write cycle */
#define COMEM_DA_CFGRD 0x00000006 /* Configuration read cycle */
#define COMEM_DA_CFGWR 0x00000006 /* Configuration write cycle */
#define COMEM_DA_ADDR(a) ((a) & 0xffffe000)
#define COMEM_DA_OFFSET(a) ((a) & 0x00001fff)
/*
* The PCI bus will be limited in what slots will actually be used.
* Define valid device numbers for different boards.
*/
#if defined(CONFIG_MOTOROLA) && defined(CONFIG_M5407)
#define COMEM_MINDEV 14 /* Minimum valid DEVICE */
#define COMEM_MAXDEV 14 /* Maximum valid DEVICE */
#define COMEM_BRIDGEDEV 15 /* Slot bridge is in */
#else
#define COMEM_MINDEV 0 /* Minimum valid DEVICE */
#define COMEM_MAXDEV 3 /* Maximum valid DEVICE */
#endif
#define COMEM_MAXPCI (COMEM_MAXDEV+1) /* Maximum PCI devices */
/****************************************************************************/
#endif /* anchor_h */

View file

@ -0,0 +1,49 @@
#ifndef __ASM_OFFSETS_H__
#define __ASM_OFFSETS_H__
/*
* DO NOT MODIFY.
*
* This file was generated by arch/m68knommu/Makefile
*
*/
#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
#define TASK_BLOCKED 922 /* offsetof(struct task_struct, blocked) */
#define TASK_THREAD 772 /* offsetof(struct task_struct, thread) */
#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
#define TASK_MM 92 /* offsetof(struct task_struct, mm) */
#define TASK_ACTIVE_MM 96 /* offsetof(struct task_struct, active_mm) */
#define CPUSTAT_SOFTIRQ_PENDING 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
#define THREAD_KSP 0 /* offsetof(struct thread_struct, ksp) */
#define THREAD_USP 4 /* offsetof(struct thread_struct, usp) */
#define THREAD_SR 8 /* offsetof(struct thread_struct, sr) */
#define THREAD_FS 10 /* offsetof(struct thread_struct, fs) */
#define THREAD_CRP 12 /* offsetof(struct thread_struct, crp) */
#define THREAD_ESP0 20 /* offsetof(struct thread_struct, esp0) */
#define THREAD_FPREG 24 /* offsetof(struct thread_struct, fp) */
#define THREAD_FPCNTL 120 /* offsetof(struct thread_struct, fpcntl) */
#define THREAD_FPSTATE 132 /* offsetof(struct thread_struct, fpstate) */
#define PT_D0 32 /* offsetof(struct pt_regs, d0) */
#define PT_ORIG_D0 36 /* offsetof(struct pt_regs, orig_d0) */
#define PT_D1 0 /* offsetof(struct pt_regs, d1) */
#define PT_D2 4 /* offsetof(struct pt_regs, d2) */
#define PT_D3 8 /* offsetof(struct pt_regs, d3) */
#define PT_D4 12 /* offsetof(struct pt_regs, d4) */
#define PT_D5 16 /* offsetof(struct pt_regs, d5) */
#define PT_A0 20 /* offsetof(struct pt_regs, a0) */
#define PT_A1 24 /* offsetof(struct pt_regs, a1) */
#define PT_A2 28 /* offsetof(struct pt_regs, a2) */
#define PT_PC 48 /* offsetof(struct pt_regs, pc) */
#define PT_SR 46 /* offsetof(struct pt_regs, sr) */
#define PT_VECTOR 52 /* offsetof(struct pt_regs, pc) + 4 */
#define STAT_IRQ 5140 /* offsetof(struct kernel_stat, irqs) */
#define SIGSEGV 11 /* SIGSEGV */
#define SEGV_MAPERR 196609 /* SEGV_MAPERR */
#define SIGTRAP 5 /* SIGTRAP */
#define TRAP_TRACE 196610 /* TRAP_TRACE */
#define PT_PTRACED 1 /* PT_PTRACED */
#define PT_DTRACE 2 /* PT_DTRACE */
#endif

View file

@ -0,0 +1,134 @@
#ifndef __ARCH_M68KNOMMU_ATOMIC__
#define __ARCH_M68KNOMMU_ATOMIC__
#include <asm/system.h> /* local_irq_XXX() */
/*
* Atomic operations that C can't guarantee us. Useful for
* resource counting etc..
*/
/*
* We do not have SMP m68k systems, so we don't have to deal with that.
*/
typedef struct { int counter; } atomic_t;
#define ATOMIC_INIT(i) { (i) }
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)
static __inline__ void atomic_add(int i, atomic_t *v)
{
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__("addl %1,%0" : "+m" (*v) : "d" (i));
#else
__asm__ __volatile__("addl %1,%0" : "+m" (*v) : "di" (i));
#endif
}
static __inline__ void atomic_sub(int i, atomic_t *v)
{
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__("subl %1,%0" : "+m" (*v) : "d" (i));
#else
__asm__ __volatile__("subl %1,%0" : "+m" (*v) : "di" (i));
#endif
}
static __inline__ int atomic_sub_and_test(int i, atomic_t * v)
{
char c;
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__("subl %2,%1; seq %0"
: "=d" (c), "+m" (*v)
: "d" (i));
#else
__asm__ __volatile__("subl %2,%1; seq %0"
: "=d" (c), "+m" (*v)
: "di" (i));
#endif
return c != 0;
}
static __inline__ void atomic_inc(volatile atomic_t *v)
{
__asm__ __volatile__("addql #1,%0" : "+m" (*v));
}
/*
* atomic_inc_and_test - increment and test
* @v: pointer of type atomic_t
*
* Atomically increments @v by 1
* and returns true if the result is zero, or false for all
* other cases.
*/
static __inline__ int atomic_inc_and_test(volatile atomic_t *v)
{
char c;
__asm__ __volatile__("addql #1,%1; seq %0" : "=d" (c), "+m" (*v));
return c != 0;
}
static __inline__ void atomic_dec(volatile atomic_t *v)
{
__asm__ __volatile__("subql #1,%0" : "+m" (*v));
}
static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
{
char c;
__asm__ __volatile__("subql #1,%1; seq %0" : "=d" (c), "+m" (*v));
return c != 0;
}
static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *v)
{
__asm__ __volatile__("andl %1,%0" : "+m" (*v) : "id" (~(mask)));
}
static __inline__ void atomic_set_mask(unsigned long mask, unsigned long *v)
{
__asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask));
}
/* Atomic operations are already serializing */
#define smp_mb__before_atomic_dec() barrier()
#define smp_mb__after_atomic_dec() barrier()
#define smp_mb__before_atomic_inc() barrier()
#define smp_mb__after_atomic_inc() barrier()
extern __inline__ int atomic_add_return(int i, atomic_t * v)
{
unsigned long temp, flags;
local_irq_save(flags);
temp = *(long *)v;
temp += i;
*(long *)v = temp;
local_irq_restore(flags);
return temp;
}
#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
extern __inline__ int atomic_sub_return(int i, atomic_t * v)
{
unsigned long temp, flags;
local_irq_save(flags);
temp = *(long *)v;
temp -= i;
*(long *)v = temp;
local_irq_restore(flags);
return temp;
}
#define atomic_dec_return(v) atomic_sub_return(1,(v))
#define atomic_inc_return(v) atomic_add_return(1,(v))
#endif /* __ARCH_M68KNOMMU_ATOMIC __ */

View file

@ -0,0 +1,503 @@
#ifndef _M68KNOMMU_BITOPS_H
#define _M68KNOMMU_BITOPS_H
/*
* Copyright 1992, Linus Torvalds.
*/
#include <linux/config.h>
#include <linux/compiler.h>
#include <asm/byteorder.h> /* swab32 */
#include <asm/system.h> /* save_flags */
#ifdef __KERNEL__
/*
* Generic ffs().
*/
static inline int ffs(int x)
{
int r = 1;
if (!x)
return 0;
if (!(x & 0xffff)) {
x >>= 16;
r += 16;
}
if (!(x & 0xff)) {
x >>= 8;
r += 8;
}
if (!(x & 0xf)) {
x >>= 4;
r += 4;
}
if (!(x & 3)) {
x >>= 2;
r += 2;
}
if (!(x & 1)) {
x >>= 1;
r += 1;
}
return r;
}
/*
* Generic __ffs().
*/
static inline int __ffs(int x)
{
int r = 0;
if (!x)
return 0;
if (!(x & 0xffff)) {
x >>= 16;
r += 16;
}
if (!(x & 0xff)) {
x >>= 8;
r += 8;
}
if (!(x & 0xf)) {
x >>= 4;
r += 4;
}
if (!(x & 3)) {
x >>= 2;
r += 2;
}
if (!(x & 1)) {
x >>= 1;
r += 1;
}
return r;
}
/*
* Every architecture must define this function. It's the fastest
* way of searching a 140-bit bitmap where the first 100 bits are
* unlikely to be set. It's guaranteed that at least one of the 140
* bits is cleared.
*/
static inline int sched_find_first_bit(unsigned long *b)
{
if (unlikely(b[0]))
return __ffs(b[0]);
if (unlikely(b[1]))
return __ffs(b[1]) + 32;
if (unlikely(b[2]))
return __ffs(b[2]) + 64;
if (b[3])
return __ffs(b[3]) + 96;
return __ffs(b[4]) + 128;
}
/*
* ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first..
*/
static __inline__ unsigned long ffz(unsigned long word)
{
unsigned long result = 0;
while(word & 1) {
result++;
word >>= 1;
}
return result;
}
static __inline__ void set_bit(int nr, volatile unsigned long * addr)
{
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %0,%%a0; bset %1,(%%a0)"
: "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "d" (nr)
: "%a0", "cc");
#else
__asm__ __volatile__ ("bset %1,%0"
: "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "di" (nr)
: "cc");
#endif
}
#define __set_bit(nr, addr) set_bit(nr, addr)
/*
* clear_bit() doesn't provide any barrier for the compiler.
*/
#define smp_mb__before_clear_bit() barrier()
#define smp_mb__after_clear_bit() barrier()
static __inline__ void clear_bit(int nr, volatile unsigned long * addr)
{
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %0,%%a0; bclr %1,(%%a0)"
: "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "d" (nr)
: "%a0", "cc");
#else
__asm__ __volatile__ ("bclr %1,%0"
: "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "di" (nr)
: "cc");
#endif
}
#define __clear_bit(nr, addr) clear_bit(nr, addr)
static __inline__ void change_bit(int nr, volatile unsigned long * addr)
{
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %0,%%a0; bchg %1,(%%a0)"
: "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "d" (nr)
: "%a0", "cc");
#else
__asm__ __volatile__ ("bchg %1,%0"
: "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "di" (nr)
: "cc");
#endif
}
#define __change_bit(nr, addr) change_bit(nr, addr)
static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
{
char retval;
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %1,%%a0; bset %2,(%%a0); sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "d" (nr)
: "%a0");
#else
__asm__ __volatile__ ("bset %2,%1; sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "di" (nr)
/* No clobber */);
#endif
return retval;
}
#define __test_and_set_bit(nr, addr) test_and_set_bit(nr, addr)
static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
{
char retval;
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %1,%%a0; bclr %2,(%%a0); sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "d" (nr)
: "%a0");
#else
__asm__ __volatile__ ("bclr %2,%1; sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "di" (nr)
/* No clobber */);
#endif
return retval;
}
#define __test_and_clear_bit(nr, addr) test_and_clear_bit(nr, addr)
static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
{
char retval;
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %1,%%a0\n\tbchg %2,(%%a0)\n\tsne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "d" (nr)
: "%a0");
#else
__asm__ __volatile__ ("bchg %2,%1; sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3])
: "di" (nr)
/* No clobber */);
#endif
return retval;
}
#define __test_and_change_bit(nr, addr) test_and_change_bit(nr, addr)
/*
* This routine doesn't need to be atomic.
*/
static __inline__ int __constant_test_bit(int nr, const volatile unsigned long * addr)
{
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
}
static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
{
int * a = (int *) addr;
int mask;
a += nr >> 5;
mask = 1 << (nr & 0x1f);
return ((mask & *a) != 0);
}
#define test_bit(nr,addr) \
(__builtin_constant_p(nr) ? \
__constant_test_bit((nr),(addr)) : \
__test_bit((nr),(addr)))
#define find_first_zero_bit(addr, size) \
find_next_zero_bit((addr), (size), 0)
#define find_first_bit(addr, size) \
find_next_bit((addr), (size), 0)
static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
unsigned long tmp;
if (offset >= size)
return size;
size -= result;
offset &= 31UL;
if (offset) {
tmp = *(p++);
tmp |= ~0UL >> (32-offset);
if (size < 32)
goto found_first;
if (~tmp)
goto found_middle;
size -= 32;
result += 32;
}
while (size & ~31UL) {
if (~(tmp = *(p++)))
goto found_middle;
result += 32;
size -= 32;
}
if (!size)
return result;
tmp = *p;
found_first:
tmp |= ~0UL >> size;
found_middle:
return result + ffz(tmp);
}
/*
* Find next one bit in a bitmap reasonably efficiently.
*/
static __inline__ unsigned long find_next_bit(const unsigned long *addr,
unsigned long size, unsigned long offset)
{
unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
unsigned int result = offset & ~31UL;
unsigned int tmp;
if (offset >= size)
return size;
size -= result;
offset &= 31UL;
if (offset) {
tmp = *p++;
tmp &= ~0UL << offset;
if (size < 32)
goto found_first;
if (tmp)
goto found_middle;
size -= 32;
result += 32;
}
while (size >= 32) {
if ((tmp = *p++) != 0)
goto found_middle;
result += 32;
size -= 32;
}
if (!size)
return result;
tmp = *p;
found_first:
tmp &= ~0UL >> (32 - size);
if (tmp == 0UL) /* Are any bits set? */
return result + size; /* Nope. */
found_middle:
return result + __ffs(tmp);
}
/*
* hweightN: returns the hamming weight (i.e. the number
* of bits set) of a N-bit word
*/
#define hweight32(x) generic_hweight32(x)
#define hweight16(x) generic_hweight16(x)
#define hweight8(x) generic_hweight8(x)
static __inline__ int ext2_set_bit(int nr, volatile void * addr)
{
char retval;
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %1,%%a0; bset %2,(%%a0); sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
: "d" (nr)
: "%a0");
#else
__asm__ __volatile__ ("bset %2,%1; sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
: "di" (nr)
/* No clobber */);
#endif
return retval;
}
static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
{
char retval;
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %1,%%a0; bclr %2,(%%a0); sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
: "d" (nr)
: "%a0");
#else
__asm__ __volatile__ ("bclr %2,%1; sne %0"
: "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3])
: "di" (nr)
/* No clobber */);
#endif
return retval;
}
#define ext2_set_bit_atomic(lock, nr, addr) \
({ \
int ret; \
spin_lock(lock); \
ret = ext2_set_bit((nr), (addr)); \
spin_unlock(lock); \
ret; \
})
#define ext2_clear_bit_atomic(lock, nr, addr) \
({ \
int ret; \
spin_lock(lock); \
ret = ext2_clear_bit((nr), (addr)); \
spin_unlock(lock); \
ret; \
})
static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
{
char retval;
#ifdef CONFIG_COLDFIRE
__asm__ __volatile__ ("lea %1,%%a0; btst %2,(%%a0); sne %0"
: "=d" (retval)
: "m" (((const volatile char *)addr)[nr >> 3]), "d" (nr)
: "%a0");
#else
__asm__ __volatile__ ("btst %2,%1; sne %0"
: "=d" (retval)
: "m" (((const volatile char *)addr)[nr >> 3]), "di" (nr)
/* No clobber */);
#endif
return retval;
}
#define ext2_find_first_zero_bit(addr, size) \
ext2_find_next_zero_bit((addr), (size), 0)
static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
unsigned long tmp;
if (offset >= size)
return size;
size -= result;
offset &= 31UL;
if(offset) {
/* We hold the little endian value in tmp, but then the
* shift is illegal. So we could keep a big endian value
* in tmp, like this:
*
* tmp = __swab32(*(p++));
* tmp |= ~0UL >> (32-offset);
*
* but this would decrease preformance, so we change the
* shift:
*/
tmp = *(p++);
tmp |= __swab32(~0UL >> (32-offset));
if(size < 32)
goto found_first;
if(~tmp)
goto found_middle;
size -= 32;
result += 32;
}
while(size & ~31UL) {
if(~(tmp = *(p++)))
goto found_middle;
result += 32;
size -= 32;
}
if(!size)
return result;
tmp = *p;
found_first:
/* tmp is little endian, so we would have to swab the shift,
* see above. But then we have to swab tmp below for ffz, so
* we might as well do this here.
*/
return result + ffz(__swab32(tmp) | (~0UL << size));
found_middle:
return result + ffz(__swab32(tmp));
}
/* Bitmap functions for the minix filesystem. */
#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
#define minix_set_bit(nr,addr) set_bit(nr,addr)
#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
#define minix_test_bit(nr,addr) test_bit(nr,addr)
#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
/**
* hweightN - returns the hamming weight of a N-bit word
* @x: the word to weigh
*
* The Hamming Weight of a number is the total number of bits set in it.
*/
#define hweight32(x) generic_hweight32(x)
#define hweight16(x) generic_hweight16(x)
#define hweight8(x) generic_hweight8(x)
#endif /* __KERNEL__ */
/*
* fls: find last bit set.
*/
#define fls(x) generic_fls(x)
#endif /* _M68KNOMMU_BITOPS_H */

View file

@ -0,0 +1,2 @@
/* Nothing for m68knommu */

View file

@ -0,0 +1,132 @@
/* bootstd.h: Bootloader system call interface
*
* (c) 1999, Rt-Control, Inc.
*/
#ifndef __BOOTSTD_H__
#define __BOOTSTD_H__
#define NR_BSC 21 /* last used bootloader system call */
#define __BN_reset 0 /* reset and start the bootloader */
#define __BN_test 1 /* tests the system call interface */
#define __BN_exec 2 /* executes a bootloader image */
#define __BN_exit 3 /* terminates a bootloader image */
#define __BN_program 4 /* program FLASH from a chain */
#define __BN_erase 5 /* erase sector(s) of FLASH */
#define __BN_open 6
#define __BN_write 7
#define __BN_read 8
#define __BN_close 9
#define __BN_mmap 10 /* map a file descriptor into memory */
#define __BN_munmap 11 /* remove a file to memory mapping */
#define __BN_gethwaddr 12 /* get the hardware address of my interfaces */
#define __BN_getserialnum 13 /* get the serial number of this board */
#define __BN_getbenv 14 /* get a bootloader envvar */
#define __BN_setbenv 15 /* get a bootloader envvar */
#define __BN_setpmask 16 /* set the protection mask */
#define __BN_readenv 17 /* read environment variables */
#define __BN_flash_chattr_range 18
#define __BN_flash_erase_range 19
#define __BN_flash_write_range 20
/* Calling conventions compatible to (uC)linux/68k
* We use simmilar macros to call into the bootloader as for uClinux
*/
#define __bsc_return(type, res) \
do { \
if ((unsigned long)(res) >= (unsigned long)(-64)) { \
/* let errno be a function, preserve res in %d0 */ \
int __err = -(res); \
errno = __err; \
res = -1; \
} \
return (type)(res); \
} while (0)
#define _bsc0(type,name) \
type name(void) \
{ \
register long __res __asm__ ("%d0") = __BN_##name; \
__asm__ __volatile__ ("trap #2" \
: "=g" (__res) \
: "0" (__res) \
: "%d0"); \
__bsc_return(type,__res); \
}
#define _bsc1(type,name,atype,a) \
type name(atype a) \
{ \
register long __res __asm__ ("%d0") = __BN_##name; \
register long __a __asm__ ("%d1") = (long)a; \
__asm__ __volatile__ ("trap #2" \
: "=g" (__res) \
: "0" (__res), "d" (__a) \
: "%d0"); \
__bsc_return(type,__res); \
}
#define _bsc2(type,name,atype,a,btype,b) \
type name(atype a, btype b) \
{ \
register long __res __asm__ ("%d0") = __BN_##name; \
register long __a __asm__ ("%d1") = (long)a; \
register long __b __asm__ ("%d2") = (long)b; \
__asm__ __volatile__ ("trap #2" \
: "=g" (__res) \
: "0" (__res), "d" (__a), "d" (__b) \
: "%d0"); \
__bsc_return(type,__res); \
}
#define _bsc3(type,name,atype,a,btype,b,ctype,c) \
type name(atype a, btype b, ctype c) \
{ \
register long __res __asm__ ("%d0") = __BN_##name; \
register long __a __asm__ ("%d1") = (long)a; \
register long __b __asm__ ("%d2") = (long)b; \
register long __c __asm__ ("%d3") = (long)c; \
__asm__ __volatile__ ("trap #2" \
: "=g" (__res) \
: "0" (__res), "d" (__a), "d" (__b), \
"d" (__c) \
: "%d0"); \
__bsc_return(type,__res); \
}
#define _bsc4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
type name(atype a, btype b, ctype c, dtype d) \
{ \
register long __res __asm__ ("%d0") = __BN_##name; \
register long __a __asm__ ("%d1") = (long)a; \
register long __b __asm__ ("%d2") = (long)b; \
register long __c __asm__ ("%d3") = (long)c; \
register long __d __asm__ ("%d4") = (long)d; \
__asm__ __volatile__ ("trap #2" \
: "=g" (__res) \
: "0" (__res), "d" (__a), "d" (__b), \
"d" (__c), "d" (__d) \
: "%d0"); \
__bsc_return(type,__res); \
}
#define _bsc5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
type name(atype a, btype b, ctype c, dtype d, etype e) \
{ \
register long __res __asm__ ("%d0") = __BN_##name; \
register long __a __asm__ ("%d1") = (long)a; \
register long __b __asm__ ("%d2") = (long)b; \
register long __c __asm__ ("%d3") = (long)c; \
register long __d __asm__ ("%d4") = (long)d; \
register long __e __asm__ ("%d5") = (long)e; \
__asm__ __volatile__ ("trap #2" \
: "=g" (__res) \
: "0" (__res), "d" (__a), "d" (__b), \
"d" (__c), "d" (__d), "d" (__e) \
: "%d0"); \
__bsc_return(type,__res); \
}
#endif /* __BOOTSTD_H__ */

View file

@ -0,0 +1,4 @@
#ifndef _M68KNOMMU_BUG_H
#define _M68KNOMMU_BUG_H
#include <asm-generic/bug.h>
#endif

View file

@ -0,0 +1,16 @@
/*
* include/asm-m68k/bugs.h
*
* Copyright (C) 1994 Linus Torvalds
*/
/*
* This is included by init/main.c to check for architecture-dependent bugs.
*
* Needs:
* void check_bugs(void);
*/
static void check_bugs(void)
{
}

View file

@ -0,0 +1,13 @@
#ifndef _M68KNOMMU_BYTEORDER_H
#define _M68KNOMMU_BYTEORDER_H
#include <asm/types.h>
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __BYTEORDER_HAS_U64__
# define __SWAB_64_THRU_32__
#endif
#include <linux/byteorder/big_endian.h>
#endif /* _M68KNOMMU_BYTEORDER_H */

View file

@ -0,0 +1,12 @@
#ifndef __ARCH_M68KNOMMU_CACHE_H
#define __ARCH_M68KNOMMU_CACHE_H
/* bytes per L1 cache line */
#define L1_CACHE_BYTES 16 /* this need to be at least 1 */
/* m68k-elf-gcc 2.95.2 doesn't like these */
#define __cacheline_aligned
#define ____cacheline_aligned
#endif

View file

@ -0,0 +1 @@
#include <asm-m68k/cachectl.h>

View file

@ -0,0 +1,75 @@
#ifndef _M68KNOMMU_CACHEFLUSH_H
#define _M68KNOMMU_CACHEFLUSH_H
/*
* (C) Copyright 2000-2002, Greg Ungerer <gerg@snapgear.com>
*/
#include <linux/mm.h>
#define flush_cache_all() __flush_cache_all()
#define flush_cache_mm(mm) do { } while (0)
#define flush_cache_range(vma, start, end) do { } while (0)
#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
#define flush_dcache_range(start,len) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
#define flush_dcache_mmap_lock(mapping) do { } while (0)
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
#define flush_icache_range(start,len) __flush_cache_all()
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
#define flush_cache_vmap(start, end) flush_cache_all()
#define flush_cache_vunmap(start, end) flush_cache_all()
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
memcpy(dst, src, len)
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
memcpy(dst, src, len)
extern inline void __flush_cache_all(void)
{
#ifdef CONFIG_M5407
/*
* Use cpushl to push and invalidate all cache lines.
* Gas doesn't seem to know how to generate the ColdFire
* cpushl instruction... Oh well, bit stuff it for now.
*/
__asm__ __volatile__ (
"nop\n\t"
"clrl %%d0\n\t"
"1:\n\t"
"movel %%d0,%%a0\n\t"
"2:\n\t"
".word 0xf468\n\t"
"addl #0x10,%%a0\n\t"
"cmpl #0x00000800,%%a0\n\t"
"blt 2b\n\t"
"addql #1,%%d0\n\t"
"cmpil #4,%%d0\n\t"
"bne 1b\n\t"
"movel #0xb6088500,%%d0\n\t"
"movec %%d0,%%CACR\n\t"
: : : "d0", "a0" );
#endif /* CONFIG_M5407 */
#ifdef CONFIG_M5272
__asm__ __volatile__ (
"movel #0x01000000, %%d0\n\t"
"movec %%d0, %%CACR\n\t"
"nop\n\t"
"movel #0x80000100, %%d0\n\t"
"movec %%d0, %%CACR\n\t"
"nop\n\t"
: : : "d0" );
#endif /* CONFIG_M5272 */
#if 0 /* CONFIG_M5249 */
__asm__ __volatile__ (
"movel #0x01000000, %%d0\n\t"
"movec %%d0, %%CACR\n\t"
"nop\n\t"
"movel #0xa0000200, %%d0\n\t"
"movec %%d0, %%CACR\n\t"
"nop\n\t"
: : : "d0" );
#endif /* CONFIG_M5249 */
}
#endif /* _M68KNOMMU_CACHEFLUSH_H */

View file

@ -0,0 +1,133 @@
#ifndef _M68K_CHECKSUM_H
#define _M68K_CHECKSUM_H
#include <linux/in6.h>
/*
* computes the checksum of a memory block at buff, length len,
* and adds in "sum" (32-bit)
*
* returns a 32-bit number suitable for feeding into itself
* or csum_tcpudp_magic
*
* this function must be called with even lengths, except
* for the last fragment, which may be odd
*
* it's best to have buff aligned on a 32-bit boundary
*/
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
/*
* the same as csum_partial, but copies from src while it
* checksums
*
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
/*
* the same as csum_partial_copy, but copies from user space.
*
* here even more important to align src and dst on a 32-bit (or even
* better 64-bit) boundary
*/
extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
int len, int sum, int *csum_err);
#define csum_partial_copy_nocheck(src, dst, len, sum) \
csum_partial_copy((src), (dst), (len), (sum))
unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl);
/*
* Fold a partial checksum
*/
static inline unsigned int csum_fold(unsigned int sum)
{
#ifdef CONFIG_COLDFIRE
sum = (sum & 0xffff) + (sum >> 16);
sum = (sum & 0xffff) + (sum >> 16);
#else
unsigned int tmp = sum;
__asm__("swap %1\n\t"
"addw %1, %0\n\t"
"clrw %1\n\t"
"addxw %1, %0"
: "=&d" (sum), "=&d" (tmp)
: "0" (sum), "1" (sum));
#endif
return ~sum;
}
/*
* computes the checksum of the TCP/UDP pseudo-header
* returns a 16-bit checksum, already complemented
*/
static inline unsigned int
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
unsigned short proto, unsigned int sum)
{
__asm__ ("addl %1,%0\n\t"
"addxl %4,%0\n\t"
"addxl %5,%0\n\t"
"clrl %1\n\t"
"addxl %1,%0"
: "=&d" (sum), "=&d" (saddr)
: "0" (daddr), "1" (saddr), "d" (len + proto),
"d"(sum));
return sum;
}
static inline unsigned short int
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
unsigned short proto, unsigned int sum)
{
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
}
/*
* this routine is used for miscellaneous IP-like checksums, mainly
* in icmp.c
*/
extern unsigned short ip_compute_csum(const unsigned char * buff, int len);
#define _HAVE_ARCH_IPV6_CSUM
static __inline__ unsigned short int
csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
__u32 len, unsigned short proto, unsigned int sum)
{
register unsigned long tmp;
__asm__("addl %2@,%0\n\t"
"movel %2@(4),%1\n\t"
"addxl %1,%0\n\t"
"movel %2@(8),%1\n\t"
"addxl %1,%0\n\t"
"movel %2@(12),%1\n\t"
"addxl %1,%0\n\t"
"movel %3@,%1\n\t"
"addxl %1,%0\n\t"
"movel %3@(4),%1\n\t"
"addxl %1,%0\n\t"
"movel %3@(8),%1\n\t"
"addxl %1,%0\n\t"
"movel %3@(12),%1\n\t"
"addxl %1,%0\n\t"
"addxl %4,%0\n\t"
"clrl %1\n\t"
"addxl %1,%0"
: "=&d" (sum), "=&d" (tmp)
: "a" (saddr), "a" (daddr), "d" (len + proto),
"0" (sum));
return csum_fold(sum);
}
#endif /* _M68K_CHECKSUM_H */

View file

@ -0,0 +1,86 @@
/****************************************************************************/
/*
* coldfire.h -- Motorola ColdFire CPU sepecific defines
*
* (C) Copyright 1999-2002, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo (www.lineo.com)
*/
/****************************************************************************/
#ifndef coldfire_h
#define coldfire_h
/****************************************************************************/
#include <linux/config.h>
/*
* Define the processor support peripherals base address.
* This is generally setup by the boards start up code.
*/
#define MCF_MBAR 0x10000000
#define MCF_MBAR2 0x80000000
#define MCF_IPSBAR 0x40000000
#if defined(CONFIG_M527x) || defined(CONFIG_M528x)
#undef MCF_MBAR
#define MCF_MBAR MCF_IPSBAR
#endif
/*
* Define master clock frequency.
*/
#if defined(CONFIG_CLOCK_11MHz)
#define MCF_CLK 11289600
#elif defined(CONFIG_CLOCK_16MHz)
#define MCF_CLK 16000000
#elif defined(CONFIG_CLOCK_20MHz)
#define MCF_CLK 20000000
#elif defined(CONFIG_CLOCK_24MHz)
#define MCF_CLK 24000000
#elif defined(CONFIG_CLOCK_25MHz)
#define MCF_CLK 25000000
#elif defined(CONFIG_CLOCK_33MHz)
#define MCF_CLK 33000000
#elif defined(CONFIG_CLOCK_40MHz)
#define MCF_CLK 40000000
#elif defined(CONFIG_CLOCK_45MHz)
#define MCF_CLK 45000000
#elif defined(CONFIG_CLOCK_48MHz)
#define MCF_CLK 48000000
#elif defined(CONFIG_CLOCK_50MHz)
#define MCF_CLK 50000000
#elif defined(CONFIG_CLOCK_54MHz)
#define MCF_CLK 54000000
#elif defined(CONFIG_CLOCK_60MHz)
#define MCF_CLK 60000000
#elif defined(CONFIG_CLOCK_64MHz)
#define MCF_CLK 64000000
#elif defined(CONFIG_CLOCK_66MHz)
#define MCF_CLK 66000000
#elif defined(CONFIG_CLOCK_70MHz)
#define MCF_CLK 70000000
#elif defined(CONFIG_CLOCK_100MHz)
#define MCF_CLK 100000000
#elif defined(CONFIG_CLOCK_140MHz)
#define MCF_CLK 140000000
#elif defined(CONFIG_CLOCK_150MHz)
#define MCF_CLK 150000000
#elif defined(CONFIG_CLOCK_166MHz)
#define MCF_CLK 166000000
#else
#error "Don't know what your ColdFire CPU clock frequency is??"
#endif
/*
* One some ColdFire family members the bus clock (used by internal
* peripherals) is not the same as the CPU clock.
*/
#if defined(CONFIG_M5249) || defined(CONFIG_M527x)
#define MCF_BUSCLK (MCF_CLK / 2)
#else
#define MCF_BUSCLK MCF_CLK
#endif
/****************************************************************************/
#endif /* coldfire_h */

View file

@ -0,0 +1,723 @@
/*
* 68360 Communication Processor Module.
* Copyright (c) 2000 Michael Leslie <mleslie@lineo.com> (mc68360) after:
* Copyright (c) 1997 Dan Malek <dmalek@jlc.net> (mpc8xx)
*
* This file contains structures and information for the communication
* processor channels. Some CPM control and status is available
* through the 68360 internal memory map. See include/asm/360_immap.h for details.
* This file is not a complete map of all of the 360 QUICC's capabilities
*
* On the MBX board, EPPC-Bug loads CPM microcode into the first 512
* bytes of the DP RAM and relocates the I2C parameter area to the
* IDMA1 space. The remaining DP RAM is available for buffer descriptors
* or other use.
*/
#ifndef __CPM_360__
#define __CPM_360__
#include <linux/config.h>
/* CPM Command register masks: */
#define CPM_CR_RST ((ushort)0x8000)
#define CPM_CR_OPCODE ((ushort)0x0f00)
#define CPM_CR_CHAN ((ushort)0x00f0)
#define CPM_CR_FLG ((ushort)0x0001)
/* CPM Command set (opcodes): */
#define CPM_CR_INIT_TRX ((ushort)0x0000)
#define CPM_CR_INIT_RX ((ushort)0x0001)
#define CPM_CR_INIT_TX ((ushort)0x0002)
#define CPM_CR_HUNT_MODE ((ushort)0x0003)
#define CPM_CR_STOP_TX ((ushort)0x0004)
#define CPM_CR_GRSTOP_TX ((ushort)0x0005)
#define CPM_CR_RESTART_TX ((ushort)0x0006)
#define CPM_CR_CLOSE_RXBD ((ushort)0x0007)
#define CPM_CR_SET_GADDR ((ushort)0x0008)
#define CPM_CR_GCI_TIMEOUT ((ushort)0x0009)
#define CPM_CR_GCI_ABORT ((ushort)0x000a)
#define CPM_CR_RESET_BCS ((ushort)0x000a)
/* CPM Channel numbers. */
#define CPM_CR_CH_SCC1 ((ushort)0x0000)
#define CPM_CR_CH_SCC2 ((ushort)0x0004)
#define CPM_CR_CH_SPI ((ushort)0x0005) /* SPI / Timers */
#define CPM_CR_CH_TMR ((ushort)0x0005)
#define CPM_CR_CH_SCC3 ((ushort)0x0008)
#define CPM_CR_CH_SMC1 ((ushort)0x0009) /* SMC1 / IDMA1 */
#define CPM_CR_CH_IDMA1 ((ushort)0x0009)
#define CPM_CR_CH_SCC4 ((ushort)0x000c)
#define CPM_CR_CH_SMC2 ((ushort)0x000d) /* SMC2 / IDMA2 */
#define CPM_CR_CH_IDMA2 ((ushort)0x000d)
#define mk_cr_cmd(CH, CMD) ((CMD << 8) | (CH << 4))
#if 1 /* mleslie: I dinna think we have any such restrictions on
* DP RAM aboard the 360 board - see the MC68360UM p.3-3 */
/* The dual ported RAM is multi-functional. Some areas can be (and are
* being) used for microcode. There is an area that can only be used
* as data ram for buffer descriptors, which is all we use right now.
* Currently the first 512 and last 256 bytes are used for microcode.
*/
/* mleslie: The uCquicc board is using no extra microcode in DPRAM */
#define CPM_DATAONLY_BASE ((uint)0x0000)
#define CPM_DATAONLY_SIZE ((uint)0x0800)
#define CPM_DP_NOSPACE ((uint)0x7fffffff)
#endif
/* Export the base address of the communication processor registers
* and dual port ram. */
/* extern cpm360_t *cpmp; */ /* Pointer to comm processor */
extern QUICC *pquicc;
uint m360_cpm_dpalloc(uint size);
/* void *m360_cpm_hostalloc(uint size); */
void m360_cpm_setbrg(uint brg, uint rate);
#if 0 /* use QUICC_BD declared in include/asm/m68360_quicc.h */
/* Buffer descriptors used by many of the CPM protocols. */
typedef struct cpm_buf_desc {
ushort cbd_sc; /* Status and Control */
ushort cbd_datlen; /* Data length in buffer */
uint cbd_bufaddr; /* Buffer address in host memory */
} cbd_t;
#endif
/* rx bd status/control bits */
#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */
#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor in table */
#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame OR control char */
#define BD_SC_FIRST ((ushort)0x0400) /* 1st buffer in an HDLC frame */
#define BD_SC_ADDR ((ushort)0x0400) /* 1st byte is a multidrop address */
#define BD_SC_CM ((ushort)0x0200) /* Continous mode */
#define BD_SC_ID ((ushort)0x0100) /* Received too many idles */
#define BD_SC_AM ((ushort)0x0080) /* Multidrop address match */
#define BD_SC_DE ((ushort)0x0080) /* DPLL Error (HDLC) */
#define BD_SC_BR ((ushort)0x0020) /* Break received */
#define BD_SC_LG ((ushort)0x0020) /* Frame length violation (HDLC) */
#define BD_SC_FR ((ushort)0x0010) /* Framing error */
#define BD_SC_NO ((ushort)0x0010) /* Nonoctet aligned frame (HDLC) */
#define BD_SC_PR ((ushort)0x0008) /* Parity error */
#define BD_SC_AB ((ushort)0x0008) /* Received abort Sequence (HDLC) */
#define BD_SC_OV ((ushort)0x0002) /* Overrun */
#define BD_SC_CD ((ushort)0x0001) /* Carrier Detect lost */
/* tx bd status/control bits (as differ from rx bd) */
#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
#define BD_SC_TC ((ushort)0x0400) /* Transmit CRC */
#define BD_SC_P ((ushort)0x0100) /* xmt preamble */
#define BD_SC_UN ((ushort)0x0002) /* Underrun */
/* Parameter RAM offsets. */
/* In 2.4 ppc, the PROFF_S?C? are used as byte offsets into DPRAM.
* In 2.0, we use a more structured C struct map of DPRAM, and so
* instead, we need only a parameter ram `slot' */
#define PRSLOT_SCC1 0
#define PRSLOT_SCC2 1
#define PRSLOT_SCC3 2
#define PRSLOT_SMC1 2
#define PRSLOT_SCC4 3
#define PRSLOT_SMC2 3
/* #define PROFF_SCC1 ((uint)0x0000) */
/* #define PROFF_SCC2 ((uint)0x0100) */
/* #define PROFF_SCC3 ((uint)0x0200) */
/* #define PROFF_SMC1 ((uint)0x0280) */
/* #define PROFF_SCC4 ((uint)0x0300) */
/* #define PROFF_SMC2 ((uint)0x0380) */
/* Define enough so I can at least use the serial port as a UART.
* The MBX uses SMC1 as the host serial port.
*/
typedef struct smc_uart {
ushort smc_rbase; /* Rx Buffer descriptor base address */
ushort smc_tbase; /* Tx Buffer descriptor base address */
u_char smc_rfcr; /* Rx function code */
u_char smc_tfcr; /* Tx function code */
ushort smc_mrblr; /* Max receive buffer length */
uint smc_rstate; /* Internal */
uint smc_idp; /* Internal */
ushort smc_rbptr; /* Internal */
ushort smc_ibc; /* Internal */
uint smc_rxtmp; /* Internal */
uint smc_tstate; /* Internal */
uint smc_tdp; /* Internal */
ushort smc_tbptr; /* Internal */
ushort smc_tbc; /* Internal */
uint smc_txtmp; /* Internal */
ushort smc_maxidl; /* Maximum idle characters */
ushort smc_tmpidl; /* Temporary idle counter */
ushort smc_brklen; /* Last received break length */
ushort smc_brkec; /* rcv'd break condition counter */
ushort smc_brkcr; /* xmt break count register */
ushort smc_rmask; /* Temporary bit mask */
} smc_uart_t;
/* Function code bits.
*/
#define SMC_EB ((u_char)0x10) /* Set big endian byte order */
/* SMC uart mode register.
*/
#define SMCMR_REN ((ushort)0x0001)
#define SMCMR_TEN ((ushort)0x0002)
#define SMCMR_DM ((ushort)0x000c)
#define SMCMR_SM_GCI ((ushort)0x0000)
#define SMCMR_SM_UART ((ushort)0x0020)
#define SMCMR_SM_TRANS ((ushort)0x0030)
#define SMCMR_SM_MASK ((ushort)0x0030)
#define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
#define SMCMR_REVD SMCMR_PM_EVEN
#define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
#define SMCMR_BS SMCMR_PEN
#define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
#define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
/* SMC2 as Centronics parallel printer. It is half duplex, in that
* it can only receive or transmit. The parameter ram values for
* each direction are either unique or properly overlap, so we can
* include them in one structure.
*/
typedef struct smc_centronics {
ushort scent_rbase;
ushort scent_tbase;
u_char scent_cfcr;
u_char scent_smask;
ushort scent_mrblr;
uint scent_rstate;
uint scent_r_ptr;
ushort scent_rbptr;
ushort scent_r_cnt;
uint scent_rtemp;
uint scent_tstate;
uint scent_t_ptr;
ushort scent_tbptr;
ushort scent_t_cnt;
uint scent_ttemp;
ushort scent_max_sl;
ushort scent_sl_cnt;
ushort scent_character1;
ushort scent_character2;
ushort scent_character3;
ushort scent_character4;
ushort scent_character5;
ushort scent_character6;
ushort scent_character7;
ushort scent_character8;
ushort scent_rccm;
ushort scent_rccr;
} smc_cent_t;
/* Centronics Status Mask Register.
*/
#define SMC_CENT_F ((u_char)0x08)
#define SMC_CENT_PE ((u_char)0x04)
#define SMC_CENT_S ((u_char)0x02)
/* SMC Event and Mask register.
*/
#define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
#define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
#define SMCM_TXE ((unsigned char)0x10) /* When in Transparent Mode */
#define SMCM_BSY ((unsigned char)0x04)
#define SMCM_TX ((unsigned char)0x02)
#define SMCM_RX ((unsigned char)0x01)
/* Baud rate generators.
*/
#define CPM_BRG_RST ((uint)0x00020000)
#define CPM_BRG_EN ((uint)0x00010000)
#define CPM_BRG_EXTC_INT ((uint)0x00000000)
#define CPM_BRG_EXTC_CLK2 ((uint)0x00004000)
#define CPM_BRG_EXTC_CLK6 ((uint)0x00008000)
#define CPM_BRG_ATB ((uint)0x00002000)
#define CPM_BRG_CD_MASK ((uint)0x00001ffe)
#define CPM_BRG_DIV16 ((uint)0x00000001)
/* SCCs.
*/
#define SCC_GSMRH_IRP ((uint)0x00040000)
#define SCC_GSMRH_GDE ((uint)0x00010000)
#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
#define SCC_GSMRH_REVD ((uint)0x00002000)
#define SCC_GSMRH_TRX ((uint)0x00001000)
#define SCC_GSMRH_TTX ((uint)0x00000800)
#define SCC_GSMRH_CDP ((uint)0x00000400)
#define SCC_GSMRH_CTSP ((uint)0x00000200)
#define SCC_GSMRH_CDS ((uint)0x00000100)
#define SCC_GSMRH_CTSS ((uint)0x00000080)
#define SCC_GSMRH_TFL ((uint)0x00000040)
#define SCC_GSMRH_RFW ((uint)0x00000020)
#define SCC_GSMRH_TXSY ((uint)0x00000010)
#define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
#define SCC_GSMRH_SYNL8 ((uint)0x00000008)
#define SCC_GSMRH_SYNL4 ((uint)0x00000004)
#define SCC_GSMRH_RTSM ((uint)0x00000002)
#define SCC_GSMRH_RSYN ((uint)0x00000001)
#define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
#define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
#define SCC_GSMRL_TCI ((uint)0x10000000)
#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
#define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
#define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
#define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
#define SCC_GSMRL_RINV ((uint)0x02000000)
#define SCC_GSMRL_TINV ((uint)0x01000000)
#define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
#define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
#define SCC_GSMRL_TPL_48 ((uint)0x00800000)
#define SCC_GSMRL_TPL_32 ((uint)0x00600000)
#define SCC_GSMRL_TPL_16 ((uint)0x00400000)
#define SCC_GSMRL_TPL_8 ((uint)0x00200000)
#define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
#define SCC_GSMRL_TPP_01 ((uint)0x00100000)
#define SCC_GSMRL_TPP_10 ((uint)0x00080000)
#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
#define SCC_GSMRL_TEND ((uint)0x00040000)
#define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
#define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
#define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
#define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
#define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
#define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
#define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
#define SCC_GSMRL_ENR ((uint)0x00000020)
#define SCC_GSMRL_ENT ((uint)0x00000010)
#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
#define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
#define SCC_GSMRL_MODE_UART ((uint)0x00000004)
#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
#define SCC_TODR_TOD ((ushort)0x8000)
/* SCC Event and Mask register.
*/
#define SCCM_TXE ((unsigned char)0x10)
#define SCCM_BSY ((unsigned char)0x04)
#define SCCM_TX ((unsigned char)0x02)
#define SCCM_RX ((unsigned char)0x01)
typedef struct scc_param {
ushort scc_rbase; /* Rx Buffer descriptor base address */
ushort scc_tbase; /* Tx Buffer descriptor base address */
u_char scc_rfcr; /* Rx function code */
u_char scc_tfcr; /* Tx function code */
ushort scc_mrblr; /* Max receive buffer length */
uint scc_rstate; /* Internal */
uint scc_idp; /* Internal */
ushort scc_rbptr; /* Internal */
ushort scc_ibc; /* Internal */
uint scc_rxtmp; /* Internal */
uint scc_tstate; /* Internal */
uint scc_tdp; /* Internal */
ushort scc_tbptr; /* Internal */
ushort scc_tbc; /* Internal */
uint scc_txtmp; /* Internal */
uint scc_rcrc; /* Internal */
uint scc_tcrc; /* Internal */
} sccp_t;
/* Function code bits.
*/
#define SCC_EB ((u_char)0x10) /* Set big endian byte order */
#define SCC_FC_DMA ((u_char)0x08) /* Set SDMA */
/* CPM Ethernet through SCC1.
*/
typedef struct scc_enet {
sccp_t sen_genscc;
uint sen_cpres; /* Preset CRC */
uint sen_cmask; /* Constant mask for CRC */
uint sen_crcec; /* CRC Error counter */
uint sen_alec; /* alignment error counter */
uint sen_disfc; /* discard frame counter */
ushort sen_pads; /* Tx short frame pad character */
ushort sen_retlim; /* Retry limit threshold */
ushort sen_retcnt; /* Retry limit counter */
ushort sen_maxflr; /* maximum frame length register */
ushort sen_minflr; /* minimum frame length register */
ushort sen_maxd1; /* maximum DMA1 length */
ushort sen_maxd2; /* maximum DMA2 length */
ushort sen_maxd; /* Rx max DMA */
ushort sen_dmacnt; /* Rx DMA counter */
ushort sen_maxb; /* Max BD byte count */
ushort sen_gaddr1; /* Group address filter */
ushort sen_gaddr2;
ushort sen_gaddr3;
ushort sen_gaddr4;
uint sen_tbuf0data0; /* Save area 0 - current frame */
uint sen_tbuf0data1; /* Save area 1 - current frame */
uint sen_tbuf0rba; /* Internal */
uint sen_tbuf0crc; /* Internal */
ushort sen_tbuf0bcnt; /* Internal */
ushort sen_paddrh; /* physical address (MSB) */
ushort sen_paddrm;
ushort sen_paddrl; /* physical address (LSB) */
ushort sen_pper; /* persistence */
ushort sen_rfbdptr; /* Rx first BD pointer */
ushort sen_tfbdptr; /* Tx first BD pointer */
ushort sen_tlbdptr; /* Tx last BD pointer */
uint sen_tbuf1data0; /* Save area 0 - current frame */
uint sen_tbuf1data1; /* Save area 1 - current frame */
uint sen_tbuf1rba; /* Internal */
uint sen_tbuf1crc; /* Internal */
ushort sen_tbuf1bcnt; /* Internal */
ushort sen_txlen; /* Tx Frame length counter */
ushort sen_iaddr1; /* Individual address filter */
ushort sen_iaddr2;
ushort sen_iaddr3;
ushort sen_iaddr4;
ushort sen_boffcnt; /* Backoff counter */
/* NOTE: Some versions of the manual have the following items
* incorrectly documented. Below is the proper order.
*/
ushort sen_taddrh; /* temp address (MSB) */
ushort sen_taddrm;
ushort sen_taddrl; /* temp address (LSB) */
} scc_enet_t;
#if defined (CONFIG_UCQUICC)
/* uCquicc has the following signals connected to Ethernet:
* 68360 - lxt905
* PA0/RXD1 - rxd
* PA1/TXD1 - txd
* PA8/CLK1 - tclk
* PA9/CLK2 - rclk
* PC0/!RTS1 - t_en
* PC1/!CTS1 - col
* PC5/!CD1 - cd
*/
#define PA_ENET_RXD PA_RXD1
#define PA_ENET_TXD PA_TXD1
#define PA_ENET_TCLK PA_CLK1
#define PA_ENET_RCLK PA_CLK2
#define PC_ENET_TENA PC_RTS1
#define PC_ENET_CLSN PC_CTS1
#define PC_ENET_RENA PC_CD1
/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
* SCC1.
*/
#define SICR_ENET_MASK ((uint)0x000000ff)
#define SICR_ENET_CLKRT ((uint)0x0000002c)
#endif /* config_ucquicc */
#ifdef MBX
/* Bits in parallel I/O port registers that have to be set/cleared
* to configure the pins for SCC1 use. The TCLK and RCLK seem unique
* to the MBX860 board. Any two of the four available clocks could be
* used, and the MPC860 cookbook manual has an example using different
* clock pins.
*/
#define PA_ENET_RXD ((ushort)0x0001)
#define PA_ENET_TXD ((ushort)0x0002)
#define PA_ENET_TCLK ((ushort)0x0200)
#define PA_ENET_RCLK ((ushort)0x0800)
#define PC_ENET_TENA ((ushort)0x0001)
#define PC_ENET_CLSN ((ushort)0x0010)
#define PC_ENET_RENA ((ushort)0x0020)
/* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
* SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
*/
#define SICR_ENET_MASK ((uint)0x000000ff)
#define SICR_ENET_CLKRT ((uint)0x0000003d)
#endif
#ifdef CONFIG_RPXLITE
/* This ENET stuff is for the MPC850 with ethernet on SCC2. Some of
* this may be unique to the RPX-Lite configuration.
* Note TENA is on Port B.
*/
#define PA_ENET_RXD ((ushort)0x0004)
#define PA_ENET_TXD ((ushort)0x0008)
#define PA_ENET_TCLK ((ushort)0x0200)
#define PA_ENET_RCLK ((ushort)0x0800)
#define PB_ENET_TENA ((uint)0x00002000)
#define PC_ENET_CLSN ((ushort)0x0040)
#define PC_ENET_RENA ((ushort)0x0080)
#define SICR_ENET_MASK ((uint)0x0000ff00)
#define SICR_ENET_CLKRT ((uint)0x00003d00)
#endif
#ifdef CONFIG_BSEIP
/* This ENET stuff is for the MPC823 with ethernet on SCC2.
* This is unique to the BSE ip-Engine board.
*/
#define PA_ENET_RXD ((ushort)0x0004)
#define PA_ENET_TXD ((ushort)0x0008)
#define PA_ENET_TCLK ((ushort)0x0100)
#define PA_ENET_RCLK ((ushort)0x0200)
#define PB_ENET_TENA ((uint)0x00002000)
#define PC_ENET_CLSN ((ushort)0x0040)
#define PC_ENET_RENA ((ushort)0x0080)
/* BSE uses port B and C bits for PHY control also.
*/
#define PB_BSE_POWERUP ((uint)0x00000004)
#define PB_BSE_FDXDIS ((uint)0x00008000)
#define PC_BSE_LOOPBACK ((ushort)0x0800)
#define SICR_ENET_MASK ((uint)0x0000ff00)
#define SICR_ENET_CLKRT ((uint)0x00002c00)
#endif
#ifdef CONFIG_RPXCLASSIC
/* Bits in parallel I/O port registers that have to be set/cleared
* to configure the pins for SCC1 use.
*/
#define PA_ENET_RXD ((ushort)0x0001)
#define PA_ENET_TXD ((ushort)0x0002)
#define PA_ENET_TCLK ((ushort)0x0200)
#define PA_ENET_RCLK ((ushort)0x0800)
#define PB_ENET_TENA ((uint)0x00001000)
#define PC_ENET_CLSN ((ushort)0x0010)
#define PC_ENET_RENA ((ushort)0x0020)
/* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
* SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
*/
#define SICR_ENET_MASK ((uint)0x000000ff)
#define SICR_ENET_CLKRT ((uint)0x0000003d)
#endif
/* SCC Event register as used by Ethernet.
*/
#define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
#define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
#define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
#define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
/* SCC Mode Register (PMSR) as used by Ethernet.
*/
#define SCC_PMSR_HBC ((ushort)0x8000) /* Enable heartbeat */
#define SCC_PMSR_FC ((ushort)0x4000) /* Force collision */
#define SCC_PMSR_RSH ((ushort)0x2000) /* Receive short frames */
#define SCC_PMSR_IAM ((ushort)0x1000) /* Check individual hash */
#define SCC_PMSR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
#define SCC_PMSR_PRO ((ushort)0x0200) /* Promiscuous mode */
#define SCC_PMSR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
#define SCC_PMSR_SBT ((ushort)0x0080) /* Special backoff timer */
#define SCC_PMSR_LPB ((ushort)0x0040) /* Set Loopback mode */
#define SCC_PMSR_SIP ((ushort)0x0020) /* Sample Input Pins */
#define SCC_PMSR_LCW ((ushort)0x0010) /* Late collision window */
#define SCC_PMSR_NIB22 ((ushort)0x000a) /* Start frame search */
#define SCC_PMSR_FDE ((ushort)0x0001) /* Full duplex enable */
/* Buffer descriptor control/status used by Ethernet receive.
*/
#define BD_ENET_RX_EMPTY ((ushort)0x8000)
#define BD_ENET_RX_WRAP ((ushort)0x2000)
#define BD_ENET_RX_INTR ((ushort)0x1000)
#define BD_ENET_RX_LAST ((ushort)0x0800)
#define BD_ENET_RX_FIRST ((ushort)0x0400)
#define BD_ENET_RX_MISS ((ushort)0x0100)
#define BD_ENET_RX_LG ((ushort)0x0020)
#define BD_ENET_RX_NO ((ushort)0x0010)
#define BD_ENET_RX_SH ((ushort)0x0008)
#define BD_ENET_RX_CR ((ushort)0x0004)
#define BD_ENET_RX_OV ((ushort)0x0002)
#define BD_ENET_RX_CL ((ushort)0x0001)
#define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
/* Buffer descriptor control/status used by Ethernet transmit.
*/
#define BD_ENET_TX_READY ((ushort)0x8000)
#define BD_ENET_TX_PAD ((ushort)0x4000)
#define BD_ENET_TX_WRAP ((ushort)0x2000)
#define BD_ENET_TX_INTR ((ushort)0x1000)
#define BD_ENET_TX_LAST ((ushort)0x0800)
#define BD_ENET_TX_TC ((ushort)0x0400)
#define BD_ENET_TX_DEF ((ushort)0x0200)
#define BD_ENET_TX_HB ((ushort)0x0100)
#define BD_ENET_TX_LC ((ushort)0x0080)
#define BD_ENET_TX_RL ((ushort)0x0040)
#define BD_ENET_TX_RCMASK ((ushort)0x003c)
#define BD_ENET_TX_UN ((ushort)0x0002)
#define BD_ENET_TX_CSL ((ushort)0x0001)
#define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
/* SCC as UART
*/
typedef struct scc_uart {
sccp_t scc_genscc;
uint scc_res1; /* Reserved */
uint scc_res2; /* Reserved */
ushort scc_maxidl; /* Maximum idle chars */
ushort scc_idlc; /* temp idle counter */
ushort scc_brkcr; /* Break count register */
ushort scc_parec; /* receive parity error counter */
ushort scc_frmec; /* receive framing error counter */
ushort scc_nosec; /* receive noise counter */
ushort scc_brkec; /* receive break condition counter */
ushort scc_brkln; /* last received break length */
ushort scc_uaddr1; /* UART address character 1 */
ushort scc_uaddr2; /* UART address character 2 */
ushort scc_rtemp; /* Temp storage */
ushort scc_toseq; /* Transmit out of sequence char */
ushort scc_char1; /* control character 1 */
ushort scc_char2; /* control character 2 */
ushort scc_char3; /* control character 3 */
ushort scc_char4; /* control character 4 */
ushort scc_char5; /* control character 5 */
ushort scc_char6; /* control character 6 */
ushort scc_char7; /* control character 7 */
ushort scc_char8; /* control character 8 */
ushort scc_rccm; /* receive control character mask */
ushort scc_rccr; /* receive control character register */
ushort scc_rlbc; /* receive last break character */
} scc_uart_t;
/* SCC Event and Mask registers when it is used as a UART.
*/
#define UART_SCCM_GLR ((ushort)0x1000)
#define UART_SCCM_GLT ((ushort)0x0800)
#define UART_SCCM_AB ((ushort)0x0200)
#define UART_SCCM_IDL ((ushort)0x0100)
#define UART_SCCM_GRA ((ushort)0x0080)
#define UART_SCCM_BRKE ((ushort)0x0040)
#define UART_SCCM_BRKS ((ushort)0x0020)
#define UART_SCCM_CCR ((ushort)0x0008)
#define UART_SCCM_BSY ((ushort)0x0004)
#define UART_SCCM_TX ((ushort)0x0002)
#define UART_SCCM_RX ((ushort)0x0001)
/* The SCC PMSR when used as a UART.
*/
#define SCU_PMSR_FLC ((ushort)0x8000)
#define SCU_PMSR_SL ((ushort)0x4000)
#define SCU_PMSR_CL ((ushort)0x3000)
#define SCU_PMSR_UM ((ushort)0x0c00)
#define SCU_PMSR_FRZ ((ushort)0x0200)
#define SCU_PMSR_RZS ((ushort)0x0100)
#define SCU_PMSR_SYN ((ushort)0x0080)
#define SCU_PMSR_DRT ((ushort)0x0040)
#define SCU_PMSR_PEN ((ushort)0x0010)
#define SCU_PMSR_RPM ((ushort)0x000c)
#define SCU_PMSR_REVP ((ushort)0x0008)
#define SCU_PMSR_TPM ((ushort)0x0003)
#define SCU_PMSR_TEVP ((ushort)0x0003)
/* CPM Transparent mode SCC.
*/
typedef struct scc_trans {
sccp_t st_genscc;
uint st_cpres; /* Preset CRC */
uint st_cmask; /* Constant mask for CRC */
} scc_trans_t;
#define BD_SCC_TX_LAST ((ushort)0x0800)
/* CPM interrupts. There are nearly 32 interrupts generated by CPM
* channels or devices. All of these are presented to the PPC core
* as a single interrupt. The CPM interrupt handler dispatches its
* own handlers, in a similar fashion to the PPC core handler. We
* use the table as defined in the manuals (i.e. no special high
* priority and SCC1 == SCCa, etc...).
*/
/* #define CPMVEC_NR 32 */
/* #define CPMVEC_PIO_PC15 ((ushort)0x1f) */
/* #define CPMVEC_SCC1 ((ushort)0x1e) */
/* #define CPMVEC_SCC2 ((ushort)0x1d) */
/* #define CPMVEC_SCC3 ((ushort)0x1c) */
/* #define CPMVEC_SCC4 ((ushort)0x1b) */
/* #define CPMVEC_PIO_PC14 ((ushort)0x1a) */
/* #define CPMVEC_TIMER1 ((ushort)0x19) */
/* #define CPMVEC_PIO_PC13 ((ushort)0x18) */
/* #define CPMVEC_PIO_PC12 ((ushort)0x17) */
/* #define CPMVEC_SDMA_CB_ERR ((ushort)0x16) */
/* #define CPMVEC_IDMA1 ((ushort)0x15) */
/* #define CPMVEC_IDMA2 ((ushort)0x14) */
/* #define CPMVEC_TIMER2 ((ushort)0x12) */
/* #define CPMVEC_RISCTIMER ((ushort)0x11) */
/* #define CPMVEC_I2C ((ushort)0x10) */
/* #define CPMVEC_PIO_PC11 ((ushort)0x0f) */
/* #define CPMVEC_PIO_PC10 ((ushort)0x0e) */
/* #define CPMVEC_TIMER3 ((ushort)0x0c) */
/* #define CPMVEC_PIO_PC9 ((ushort)0x0b) */
/* #define CPMVEC_PIO_PC8 ((ushort)0x0a) */
/* #define CPMVEC_PIO_PC7 ((ushort)0x09) */
/* #define CPMVEC_TIMER4 ((ushort)0x07) */
/* #define CPMVEC_PIO_PC6 ((ushort)0x06) */
/* #define CPMVEC_SPI ((ushort)0x05) */
/* #define CPMVEC_SMC1 ((ushort)0x04) */
/* #define CPMVEC_SMC2 ((ushort)0x03) */
/* #define CPMVEC_PIO_PC5 ((ushort)0x02) */
/* #define CPMVEC_PIO_PC4 ((ushort)0x01) */
/* #define CPMVEC_ERROR ((ushort)0x00) */
extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
/* CPM interrupt configuration vector.
*/
#define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
#define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
#define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
#define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
#define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
#define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
#define CICR_IEN ((uint)0x00000080) /* Int. enable */
#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
#endif /* __CPM_360__ */

View file

@ -0,0 +1,6 @@
#ifndef __M68KNOMMU_CPUTIME_H
#define __M68KNOMMU_CPUTIME_H
#include <asm-generic/cputime.h>
#endif /* __M68KNOMMU_CPUTIME_H */

View file

@ -0,0 +1,24 @@
#ifndef _M68KNOMMU_CURRENT_H
#define _M68KNOMMU_CURRENT_H
/*
* current.h
* (C) Copyright 2000, Lineo, David McCullough <davidm@uclinux.org>
* (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
*
* rather than dedicate a register (as the m68k source does), we
* just keep a global, we should probably just change it all to be
* current and lose _current_task.
*/
#include <linux/thread_info.h>
struct task_struct;
static inline struct task_struct *get_current(void)
{
return(current_thread_info()->task);
}
#define current get_current()
#endif /* _M68KNOMMU_CURRENT_H */

View file

@ -0,0 +1,6 @@
#define DEBUG 1
#ifdef CONFIG_COLDFIRE
#define BREAK asm volatile ("halt")
#else
#define BREAK *(volatile unsigned char *)0xdeadbee0 = 0
#endif

View file

@ -0,0 +1,76 @@
#ifndef _M68KNOMMU_DELAY_H
#define _M68KNOMMU_DELAY_H
/*
* Copyright (C) 1994 Hamish Macdonald
* Copyright (C) 2004 Greg Ungerer <gerg@snapgear.com>
*/
#include <asm/param.h>
extern __inline__ void __delay(unsigned long loops)
{
#if defined(CONFIG_COLDFIRE)
/* The coldfire runs this loop at significantly different speeds
* depending upon long word alignment or not. We'll pad it to
* long word alignment which is the faster version.
* The 0x4a8e is of course a 'tstl %fp' instruction. This is better
* than using a NOP (0x4e71) instruction because it executes in one
* cycle not three and doesn't allow for an arbitary delay waiting
* for bus cycles to finish. Also fp/a6 isn't likely to cause a
* stall waiting for the register to become valid if such is added
* to the coldfire at some stage.
*/
__asm__ __volatile__ ( ".balignw 4, 0x4a8e\n\t"
"1: subql #1, %0\n\t"
"jcc 1b"
: "=d" (loops) : "0" (loops));
#else
__asm__ __volatile__ ( "1: subql #1, %0\n\t"
"jcc 1b"
: "=d" (loops) : "0" (loops));
#endif
}
/*
* Ideally we use a 32*32->64 multiply to calculate the number of
* loop iterations, but the older standard 68k and ColdFire do not
* have this instruction. So for them we have a clsoe approximation
* loop using 32*32->32 multiplies only. This calculation based on
* the ARM version of delay.
*
* We want to implement:
*
* loops = (usecs * 0x10c6 * HZ * loops_per_jiffy) / 2^32
*/
#define HZSCALE (268435456 / (1000000/HZ))
extern unsigned long loops_per_jiffy;
extern __inline__ void _udelay(unsigned long usecs)
{
#if defined(CONFIG_M68328) || defined(CONFIG_M68EZ328) || \
defined(CONFIG_M68VZ328) || defined(CONFIG_M68360) || \
defined(CONFIG_COLDFIRE)
__delay((((usecs * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6);
#else
unsigned long tmp;
usecs *= 4295; /* 2**32 / 1000000 */
__asm__ ("mulul %2,%0:%1"
: "=d" (usecs), "=d" (tmp)
: "d" (usecs), "1" (loops_per_jiffy*HZ));
__delay(usecs);
#endif
}
/*
* Moved the udelay() function into library code, no longer inlined.
* I had to change the algorithm because we are overflowing now on
* the faster ColdFire parts. The code is a little biger, so it makes
* sense to library it.
*/
extern void udelay(unsigned long usecs);
#endif /* defined(_M68KNOMMU_DELAY_H) */

View file

@ -0,0 +1 @@
#include <asm-generic/div64.h>

View file

@ -0,0 +1,10 @@
#ifndef _M68KNOMMU_DMA_MAPPING_H
#define _M68KNOMMU_DMA_MAPPING_H
#include <linux/config.h>
#ifdef CONFIG_PCI
#include <asm-generic/dma-mapping.h>
#endif
#endif /* _M68KNOMMU_DMA_MAPPING_H */

492
include/asm-m68knommu/dma.h Normal file
View file

@ -0,0 +1,492 @@
#ifndef _M68K_DMA_H
#define _M68K_DMA_H 1
//#define DMA_DEBUG 1
#include <linux/config.h>
#ifdef CONFIG_COLDFIRE
/*
* ColdFire DMA Model:
* ColdFire DMA supports two forms of DMA: Single and Dual address. Single
* address mode emits a source address, and expects that the device will either
* pick up the data (DMA READ) or source data (DMA WRITE). This implies that
* the device will place data on the correct byte(s) of the data bus, as the
* memory transactions are always 32 bits. This implies that only 32 bit
* devices will find single mode transfers useful. Dual address DMA mode
* performs two cycles: source read and destination write. ColdFire will
* align the data so that the device will always get the correct bytes, thus
* is useful for 8 and 16 bit devices. This is the mode that is supported
* below.
*
* AUG/22/2000 : added support for 32-bit Dual-Address-Mode (K) 2000
* Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
*
* AUG/25/2000 : addad support for 8, 16 and 32-bit Single-Address-Mode (K)2000
* Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
*
* APR/18/2002 : added proper support for MCF5272 DMA controller.
* Arthur Shipkowski (art@videon-central.com)
*/
#include <asm/coldfire.h>
#include <asm/mcfsim.h>
#include <asm/mcfdma.h>
/*
* Set number of channels of DMA on ColdFire for different implementations.
*/
#if defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
#define MAX_M68K_DMA_CHANNELS 4
#elif defined(CONFIG_M5272)
#define MAX_M68K_DMA_CHANNELS 1
#else
#define MAX_M68K_DMA_CHANNELS 2
#endif
extern unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS];
extern unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
#if !defined(CONFIG_M5272)
#define DMA_MODE_WRITE_BIT 0x01 /* Memory/IO to IO/Memory select */
#define DMA_MODE_WORD_BIT 0x02 /* 8 or 16 bit transfers */
#define DMA_MODE_LONG_BIT 0x04 /* or 32 bit transfers */
#define DMA_MODE_SINGLE_BIT 0x08 /* single-address-mode */
/* I/O to memory, 8 bits, mode */
#define DMA_MODE_READ 0
/* memory to I/O, 8 bits, mode */
#define DMA_MODE_WRITE 1
/* I/O to memory, 16 bits, mode */
#define DMA_MODE_READ_WORD 2
/* memory to I/O, 16 bits, mode */
#define DMA_MODE_WRITE_WORD 3
/* I/O to memory, 32 bits, mode */
#define DMA_MODE_READ_LONG 4
/* memory to I/O, 32 bits, mode */
#define DMA_MODE_WRITE_LONG 5
/* I/O to memory, 8 bits, single-address-mode */
#define DMA_MODE_READ_SINGLE 8
/* memory to I/O, 8 bits, single-address-mode */
#define DMA_MODE_WRITE_SINGLE 9
/* I/O to memory, 16 bits, single-address-mode */
#define DMA_MODE_READ_WORD_SINGLE 10
/* memory to I/O, 16 bits, single-address-mode */
#define DMA_MODE_WRITE_WORD_SINGLE 11
/* I/O to memory, 32 bits, single-address-mode */
#define DMA_MODE_READ_LONG_SINGLE 12
/* memory to I/O, 32 bits, single-address-mode */
#define DMA_MODE_WRITE_LONG_SINGLE 13
#else /* CONFIG_M5272 is defined */
/* Source static-address mode */
#define DMA_MODE_SRC_SA_BIT 0x01
/* Two bits to select between all four modes */
#define DMA_MODE_SSIZE_MASK 0x06
/* Offset to shift bits in */
#define DMA_MODE_SSIZE_OFF 0x01
/* Destination static-address mode */
#define DMA_MODE_DES_SA_BIT 0x10
/* Two bits to select between all four modes */
#define DMA_MODE_DSIZE_MASK 0x60
/* Offset to shift bits in */
#define DMA_MODE_DSIZE_OFF 0x05
/* Size modifiers */
#define DMA_MODE_SIZE_LONG 0x00
#define DMA_MODE_SIZE_BYTE 0x01
#define DMA_MODE_SIZE_WORD 0x02
#define DMA_MODE_SIZE_LINE 0x03
/*
* Aliases to help speed quick ports; these may be suboptimal, however. They
* do not include the SINGLE mode modifiers since the MCF5272 does not have a
* mode where the device is in control of its addressing.
*/
/* I/O to memory, 8 bits, mode */
#define DMA_MODE_READ ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
/* memory to I/O, 8 bits, mode */
#define DMA_MODE_WRITE ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
/* I/O to memory, 16 bits, mode */
#define DMA_MODE_READ_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
/* memory to I/O, 16 bits, mode */
#define DMA_MODE_WRITE_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
/* I/O to memory, 32 bits, mode */
#define DMA_MODE_READ_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
/* memory to I/O, 32 bits, mode */
#define DMA_MODE_WRITE_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
#endif /* !defined(CONFIG_M5272) */
#if !defined(CONFIG_M5272)
/* enable/disable a specific DMA channel */
static __inline__ void enable_dma(unsigned int dmanr)
{
volatile unsigned short *dmawp;
#ifdef DMA_DEBUG
printk("enable_dma(dmanr=%d)\n", dmanr);
#endif
dmawp = (unsigned short *) dma_base_addr[dmanr];
dmawp[MCFDMA_DCR] |= MCFDMA_DCR_EEXT;
}
static __inline__ void disable_dma(unsigned int dmanr)
{
volatile unsigned short *dmawp;
volatile unsigned char *dmapb;
#ifdef DMA_DEBUG
printk("disable_dma(dmanr=%d)\n", dmanr);
#endif
dmawp = (unsigned short *) dma_base_addr[dmanr];
dmapb = (unsigned char *) dma_base_addr[dmanr];
/* Turn off external requests, and stop any DMA in progress */
dmawp[MCFDMA_DCR] &= ~MCFDMA_DCR_EEXT;
dmapb[MCFDMA_DSR] = MCFDMA_DSR_DONE;
}
/*
* Clear the 'DMA Pointer Flip Flop'.
* Write 0 for LSB/MSB, 1 for MSB/LSB access.
* Use this once to initialize the FF to a known state.
* After that, keep track of it. :-)
* --- In order to do that, the DMA routines below should ---
* --- only be used while interrupts are disabled! ---
*
* This is a NOP for ColdFire. Provide a stub for compatibility.
*/
static __inline__ void clear_dma_ff(unsigned int dmanr)
{
}
/* set mode (above) for a specific DMA channel */
static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
{
volatile unsigned char *dmabp;
volatile unsigned short *dmawp;
#ifdef DMA_DEBUG
printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
#endif
dmabp = (unsigned char *) dma_base_addr[dmanr];
dmawp = (unsigned short *) dma_base_addr[dmanr];
// Clear config errors
dmabp[MCFDMA_DSR] = MCFDMA_DSR_DONE;
// Set command register
dmawp[MCFDMA_DCR] =
MCFDMA_DCR_INT | // Enable completion irq
MCFDMA_DCR_CS | // Force one xfer per request
MCFDMA_DCR_AA | // Enable auto alignment
// single-address-mode
((mode & DMA_MODE_SINGLE_BIT) ? MCFDMA_DCR_SAA : 0) |
// sets s_rw (-> r/w) high if Memory to I/0
((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_S_RW : 0) |
// Memory to I/O or I/O to Memory
((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_SINC : MCFDMA_DCR_DINC) |
// 32 bit, 16 bit or 8 bit transfers
((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_SSIZE_WORD :
((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_SSIZE_LONG :
MCFDMA_DCR_SSIZE_BYTE)) |
((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_DSIZE_WORD :
((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_DSIZE_LONG :
MCFDMA_DCR_DSIZE_BYTE));
#ifdef DEBUG_DMA
printk("%s(%d): dmanr=%d DSR[%x]=%x DCR[%x]=%x\n", __FILE__, __LINE__,
dmanr, (int) &dmabp[MCFDMA_DSR], dmabp[MCFDMA_DSR],
(int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR]);
#endif
}
/* Set transfer address for specific DMA channel */
static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
{
volatile unsigned short *dmawp;
volatile unsigned int *dmalp;
#ifdef DMA_DEBUG
printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
#endif
dmawp = (unsigned short *) dma_base_addr[dmanr];
dmalp = (unsigned int *) dma_base_addr[dmanr];
// Determine which address registers are used for memory/device accesses
if (dmawp[MCFDMA_DCR] & MCFDMA_DCR_SINC) {
// Source incrementing, must be memory
dmalp[MCFDMA_SAR] = a;
// Set dest address, must be device
dmalp[MCFDMA_DAR] = dma_device_address[dmanr];
} else {
// Destination incrementing, must be memory
dmalp[MCFDMA_DAR] = a;
// Set source address, must be device
dmalp[MCFDMA_SAR] = dma_device_address[dmanr];
}
#ifdef DEBUG_DMA
printk("%s(%d): dmanr=%d DCR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
__FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR],
(int) &dmalp[MCFDMA_SAR], dmalp[MCFDMA_SAR],
(int) &dmalp[MCFDMA_DAR], dmalp[MCFDMA_DAR]);
#endif
}
/*
* Specific for Coldfire - sets device address.
* Should be called after the mode set call, and before set DMA address.
*/
static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
{
#ifdef DMA_DEBUG
printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
#endif
dma_device_address[dmanr] = a;
}
/*
* NOTE 2: "count" represents _bytes_.
*/
static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
{
volatile unsigned short *dmawp;
#ifdef DMA_DEBUG
printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
#endif
dmawp = (unsigned short *) dma_base_addr[dmanr];
dmawp[MCFDMA_BCR] = (unsigned short)count;
}
/*
* Get DMA residue count. After a DMA transfer, this
* should return zero. Reading this while a DMA transfer is
* still in progress will return unpredictable results.
* Otherwise, it returns the number of _bytes_ left to transfer.
*/
static __inline__ int get_dma_residue(unsigned int dmanr)
{
volatile unsigned short *dmawp;
unsigned short count;
#ifdef DMA_DEBUG
printk("get_dma_residue(dmanr=%d)\n", dmanr);
#endif
dmawp = (unsigned short *) dma_base_addr[dmanr];
count = dmawp[MCFDMA_BCR];
return((int) count);
}
#else /* CONFIG_M5272 is defined */
/*
* The MCF5272 DMA controller is very different than the controller defined above
* in terms of register mapping. For instance, with the exception of the 16-bit
* interrupt register (IRQ#85, for reference), all of the registers are 32-bit.
*
* The big difference, however, is the lack of device-requested DMA. All modes
* are dual address transfer, and there is no 'device' setup or direction bit.
* You can DMA between a device and memory, between memory and memory, or even between
* two devices directly, with any combination of incrementing and non-incrementing
* addresses you choose. This puts a crimp in distinguishing between the 'device
* address' set up by set_dma_device_addr.
*
* Therefore, there are two options. One is to use set_dma_addr and set_dma_device_addr,
* which will act exactly as above in -- it will look to see if the source is set to
* autoincrement, and if so it will make the source use the set_dma_addr value and the
* destination the set_dma_device_addr value. Otherwise the source will be set to the
* set_dma_device_addr value and the destination will get the set_dma_addr value.
*
* The other is to use the provided set_dma_src_addr and set_dma_dest_addr functions
* and make it explicit. Depending on what you're doing, one of these two should work
* for you, but don't mix them in the same transfer setup.
*/
/* enable/disable a specific DMA channel */
static __inline__ void enable_dma(unsigned int dmanr)
{
volatile unsigned int *dmalp;
#ifdef DMA_DEBUG
printk("enable_dma(dmanr=%d)\n", dmanr);
#endif
dmalp = (unsigned int *) dma_base_addr[dmanr];
dmalp[MCFDMA_DMR] |= MCFDMA_DMR_EN;
}
static __inline__ void disable_dma(unsigned int dmanr)
{
volatile unsigned int *dmalp;
#ifdef DMA_DEBUG
printk("disable_dma(dmanr=%d)\n", dmanr);
#endif
dmalp = (unsigned int *) dma_base_addr[dmanr];
/* Turn off external requests, and stop any DMA in progress */
dmalp[MCFDMA_DMR] &= ~MCFDMA_DMR_EN;
dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
}
/*
* Clear the 'DMA Pointer Flip Flop'.
* Write 0 for LSB/MSB, 1 for MSB/LSB access.
* Use this once to initialize the FF to a known state.
* After that, keep track of it. :-)
* --- In order to do that, the DMA routines below should ---
* --- only be used while interrupts are disabled! ---
*
* This is a NOP for ColdFire. Provide a stub for compatibility.
*/
static __inline__ void clear_dma_ff(unsigned int dmanr)
{
}
/* set mode (above) for a specific DMA channel */
static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
{
volatile unsigned int *dmalp;
volatile unsigned short *dmawp;
#ifdef DMA_DEBUG
printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
#endif
dmalp = (unsigned int *) dma_base_addr[dmanr];
dmawp = (unsigned short *) dma_base_addr[dmanr];
// Clear config errors
dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
// Set command register
dmalp[MCFDMA_DMR] =
MCFDMA_DMR_RQM_DUAL | // Mandatory Request Mode setting
MCFDMA_DMR_DSTT_SD | // Set up addressing types; set to supervisor-data.
MCFDMA_DMR_SRCT_SD | // Set up addressing types; set to supervisor-data.
// source static-address-mode
((mode & DMA_MODE_SRC_SA_BIT) ? MCFDMA_DMR_SRCM_SA : MCFDMA_DMR_SRCM_IA) |
// dest static-address-mode
((mode & DMA_MODE_DES_SA_BIT) ? MCFDMA_DMR_DSTM_SA : MCFDMA_DMR_DSTM_IA) |
// burst, 32 bit, 16 bit or 8 bit transfers are separately configurable on the MCF5272
(((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_DSTS_OFF) |
(((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_SRCS_OFF);
dmawp[MCFDMA_DIR] |= MCFDMA_DIR_ASCEN; /* Enable completion interrupts */
#ifdef DEBUG_DMA
printk("%s(%d): dmanr=%d DMR[%x]=%x DIR[%x]=%x\n", __FILE__, __LINE__,
dmanr, (int) &dmalp[MCFDMA_DMR], dmabp[MCFDMA_DMR],
(int) &dmawp[MCFDMA_DIR], dmawp[MCFDMA_DIR]);
#endif
}
/* Set transfer address for specific DMA channel */
static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
{
volatile unsigned int *dmalp;
#ifdef DMA_DEBUG
printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
#endif
dmalp = (unsigned int *) dma_base_addr[dmanr];
// Determine which address registers are used for memory/device accesses
if (dmalp[MCFDMA_DMR] & MCFDMA_DMR_SRCM) {
// Source incrementing, must be memory
dmalp[MCFDMA_DSAR] = a;
// Set dest address, must be device
dmalp[MCFDMA_DDAR] = dma_device_address[dmanr];
} else {
// Destination incrementing, must be memory
dmalp[MCFDMA_DDAR] = a;
// Set source address, must be device
dmalp[MCFDMA_DSAR] = dma_device_address[dmanr];
}
#ifdef DEBUG_DMA
printk("%s(%d): dmanr=%d DMR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
__FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DMR], dmawp[MCFDMA_DMR],
(int) &dmalp[MCFDMA_DSAR], dmalp[MCFDMA_DSAR],
(int) &dmalp[MCFDMA_DDAR], dmalp[MCFDMA_DDAR]);
#endif
}
/*
* Specific for Coldfire - sets device address.
* Should be called after the mode set call, and before set DMA address.
*/
static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
{
#ifdef DMA_DEBUG
printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
#endif
dma_device_address[dmanr] = a;
}
/*
* NOTE 2: "count" represents _bytes_.
*
* NOTE 3: While a 32-bit register, "count" is only a maximum 24-bit value.
*/
static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
{
volatile unsigned int *dmalp;
#ifdef DMA_DEBUG
printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
#endif
dmalp = (unsigned int *) dma_base_addr[dmanr];
dmalp[MCFDMA_DBCR] = count;
}
/*
* Get DMA residue count. After a DMA transfer, this
* should return zero. Reading this while a DMA transfer is
* still in progress will return unpredictable results.
* Otherwise, it returns the number of _bytes_ left to transfer.
*/
static __inline__ int get_dma_residue(unsigned int dmanr)
{
volatile unsigned int *dmalp;
unsigned int count;
#ifdef DMA_DEBUG
printk("get_dma_residue(dmanr=%d)\n", dmanr);
#endif
dmalp = (unsigned int *) dma_base_addr[dmanr];
count = dmalp[MCFDMA_DBCR];
return(count);
}
#endif /* !defined(CONFIG_M5272) */
#endif /* CONFIG_COLDFIRE */
#define MAX_DMA_CHANNELS 8
/* Don't define MAX_DMA_ADDRESS; it's useless on the m68k/coldfire and any
occurrence should be flagged as an error. */
/* under 2.4 it is actually needed by the new bootmem allocator */
#define MAX_DMA_ADDRESS PAGE_OFFSET
/* These are in kernel/dma.c: */
extern int request_dma(unsigned int dmanr, const char *device_id); /* reserve a DMA channel */
extern void free_dma(unsigned int dmanr); /* release it again */
#endif /* _M68K_DMA_H */

113
include/asm-m68knommu/elf.h Normal file
View file

@ -0,0 +1,113 @@
#ifndef __ASMm68k_ELF_H
#define __ASMm68k_ELF_H
/*
* ELF register definitions..
*/
#include <linux/config.h>
#include <asm/ptrace.h>
#include <asm/user.h>
/*
* 68k ELF relocation types
*/
#define R_68K_NONE 0
#define R_68K_32 1
#define R_68K_16 2
#define R_68K_8 3
#define R_68K_PC32 4
#define R_68K_PC16 5
#define R_68K_PC8 6
#define R_68K_GOT32 7
#define R_68K_GOT16 8
#define R_68K_GOT8 9
#define R_68K_GOT32O 10
#define R_68K_GOT16O 11
#define R_68K_GOT8O 12
#define R_68K_PLT32 13
#define R_68K_PLT16 14
#define R_68K_PLT8 15
#define R_68K_PLT32O 16
#define R_68K_PLT16O 17
#define R_68K_PLT8O 18
#define R_68K_COPY 19
#define R_68K_GLOB_DAT 20
#define R_68K_JMP_SLOT 21
#define R_68K_RELATIVE 22
typedef unsigned long elf_greg_t;
#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
typedef struct user_m68kfp_struct elf_fpregset_t;
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#define elf_check_arch(x) ((x)->e_machine == EM_68K)
/*
* These are used to set parameters in the core dumps.
*/
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_68K
/* For SVR4/m68k the function pointer to be registered with `atexit' is
passed in %a1. Although my copy of the ABI has no such statement, it
is actually used on ASV. */
#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
#define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE 4096
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
use of this is to invoke "./ld.so someprog" to test out a new version of
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
#define ELF_ET_DYN_BASE 0xD0000000UL
#define ELF_CORE_COPY_REGS(pr_reg, regs) \
/* Bleech. */ \
pr_reg[0] = regs->d1; \
pr_reg[1] = regs->d2; \
pr_reg[2] = regs->d3; \
pr_reg[3] = regs->d4; \
pr_reg[4] = regs->d5; \
pr_reg[7] = regs->a0; \
pr_reg[8] = regs->a1; \
pr_reg[14] = regs->d0; \
pr_reg[15] = rdusp(); \
pr_reg[16] = 0 /* regs->orig_d0 */; \
pr_reg[17] = regs->sr; \
pr_reg[18] = regs->pc; \
/* pr_reg[19] = (regs->format << 12) | regs->vector; */ \
{ \
struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \
pr_reg[5] = sw->d6; \
pr_reg[6] = sw->d7; \
pr_reg[10] = sw->a3; \
pr_reg[11] = sw->a4; \
pr_reg[12] = sw->a5; \
pr_reg[13] = sw->a6; \
}
/* This yields a mask that user programs can use to figure out what
instruction set this cpu supports. */
#define ELF_HWCAP (0)
/* This yields a string that ld.so will use to load implementation
specific libraries for optimization. This is more specific in
intent than poking at uname or /proc/cpuinfo. */
#define ELF_PLATFORM (NULL)
#ifdef __KERNEL__
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
#endif
#endif

View file

@ -0,0 +1,42 @@
/****************************************************************************/
/*
* elia.h -- Lineo (formerly Moreton Bay) eLIA platform support.
*
* (C) Copyright 1999-2000, Moreton Bay (www.moreton.com.au)
* (C) Copyright 1999-2000, Lineo (www.lineo.com)
*/
/****************************************************************************/
#ifndef elia_h
#define elia_h
/****************************************************************************/
#include <linux/config.h>
#include <asm/coldfire.h>
#ifdef CONFIG_eLIA
/*
* The serial port DTR and DCD lines are also on the Parallel I/O
* as well, so define those too.
*/
#define eLIA_DCD1 0x0001
#define eLIA_DCD0 0x0002
#define eLIA_DTR1 0x0004
#define eLIA_DTR0 0x0008
#define eLIA_PCIRESET 0x0020
/*
* Kernel macros to set and unset the LEDs.
*/
#ifndef __ASSEMBLY__
extern unsigned short ppdata;
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_eLIA */
/****************************************************************************/
#endif /* elia_h */

View file

@ -0,0 +1,183 @@
#ifndef __M68KNOMMU_ENTRY_H
#define __M68KNOMMU_ENTRY_H
#include <linux/config.h>
#include <asm/setup.h>
#include <asm/page.h>
/*
* Stack layout in 'ret_from_exception':
*
* This allows access to the syscall arguments in registers d1-d5
*
* 0(sp) - d1
* 4(sp) - d2
* 8(sp) - d3
* C(sp) - d4
* 10(sp) - d5
* 14(sp) - a0
* 18(sp) - a1
* 1C(sp) - a2
* 20(sp) - d0
* 24(sp) - orig_d0
* 28(sp) - stack adjustment
* 2C(sp) - [ sr ] [ format & vector ]
* 2E(sp) - [ pc-hiword ] [ sr ]
* 30(sp) - [ pc-loword ] [ pc-hiword ]
* 32(sp) - [ format & vector ] [ pc-loword ]
* ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
* M68K COLDFIRE
*/
#define ALLOWINT 0xf8ff
#ifdef __ASSEMBLY__
/* process bits for task_struct.flags */
PF_TRACESYS_OFF = 3
PF_TRACESYS_BIT = 5
PF_PTRACED_OFF = 3
PF_PTRACED_BIT = 4
PF_DTRACE_OFF = 1
PF_DTRACE_BIT = 5
LENOSYS = 38
#define SWITCH_STACK_SIZE (6*4+4) /* Includes return address */
/*
* This defines the normal kernel pt-regs layout.
*
* regs are a2-a6 and d6-d7 preserved by C code
* the kernel doesn't mess with usp unless it needs to
*/
#ifdef CONFIG_COLDFIRE
/*
* This is made a little more tricky on the ColdFire. There is no
* separate kernel and user stack pointers. Need to artificially
* construct a usp in software... When doing this we need to disable
* interrupts, otherwise bad things could happen.
*/
.macro SAVE_ALL
move #0x2700,%sr /* disable intrs */
btst #5,%sp@(2) /* from user? */
bnes 6f /* no, skip */
movel %sp,sw_usp /* save user sp */
addql #8,sw_usp /* remove exception */
movel sw_ksp,%sp /* kernel sp */
subql #8,%sp /* room for exception */
clrl %sp@- /* stkadj */
movel %d0,%sp@- /* orig d0 */
movel %d0,%sp@- /* d0 */
lea %sp@(-32),%sp /* space for 8 regs */
moveml %d1-%d5/%a0-%a2,%sp@
movel sw_usp,%a0 /* get usp */
movel %a0@-,%sp@(PT_PC) /* copy exception program counter */
movel %a0@-,%sp@(PT_FORMATVEC)/* copy exception format/vector/sr */
bra 7f
6:
clrl %sp@- /* stkadj */
movel %d0,%sp@- /* orig d0 */
movel %d0,%sp@- /* d0 */
lea %sp@(-32),%sp /* space for 8 regs */
moveml %d1-%d5/%a0-%a2,%sp@
7:
.endm
.macro RESTORE_ALL
btst #5,%sp@(PT_SR) /* going user? */
bnes 8f /* no, skip */
move #0x2700,%sr /* disable intrs */
movel sw_usp,%a0 /* get usp */
movel %sp@(PT_PC),%a0@- /* copy exception program counter */
movel %sp@(PT_FORMATVEC),%a0@-/* copy exception format/vector/sr */
moveml %sp@,%d1-%d5/%a0-%a2
lea %sp@(32),%sp /* space for 8 regs */
movel %sp@+,%d0
addql #4,%sp /* orig d0 */
addl %sp@+,%sp /* stkadj */
addql #8,%sp /* remove exception */
movel %sp,sw_ksp /* save ksp */
subql #8,sw_usp /* set exception */
movel sw_usp,%sp /* restore usp */
rte
8:
moveml %sp@,%d1-%d5/%a0-%a2
lea %sp@(32),%sp /* space for 8 regs */
movel %sp@+,%d0
addql #4,%sp /* orig d0 */
addl %sp@+,%sp /* stkadj */
rte
.endm
/*
* Quick exception save, use current stack only.
*/
.macro SAVE_LOCAL
move #0x2700,%sr /* disable intrs */
clrl %sp@- /* stkadj */
movel %d0,%sp@- /* orig d0 */
movel %d0,%sp@- /* d0 */
lea %sp@(-32),%sp /* space for 8 regs */
moveml %d1-%d5/%a0-%a2,%sp@
.endm
.macro RESTORE_LOCAL
moveml %sp@,%d1-%d5/%a0-%a2
lea %sp@(32),%sp /* space for 8 regs */
movel %sp@+,%d0
addql #4,%sp /* orig d0 */
addl %sp@+,%sp /* stkadj */
rte
.endm
.macro SAVE_SWITCH_STACK
lea %sp@(-24),%sp /* 6 regs */
moveml %a3-%a6/%d6-%d7,%sp@
.endm
.macro RESTORE_SWITCH_STACK
moveml %sp@,%a3-%a6/%d6-%d7
lea %sp@(24),%sp /* 6 regs */
.endm
/*
* Software copy of the user and kernel stack pointers... Ugh...
* Need these to get around ColdFire not having separate kernel
* and user stack pointers.
*/
.globl sw_usp
.globl sw_ksp
#else /* !CONFIG_COLDFIRE */
/*
* Standard 68k interrupt entry and exit macros.
*/
.macro SAVE_ALL
clrl %sp@- /* stkadj */
movel %d0,%sp@- /* orig d0 */
movel %d0,%sp@- /* d0 */
moveml %d1-%d5/%a0-%a2,%sp@-
.endm
.macro RESTORE_ALL
moveml %sp@+,%a0-%a2/%d1-%d5
movel %sp@+,%d0
addql #4,%sp /* orig d0 */
addl %sp@+,%sp /* stkadj */
rte
.endm
.macro SAVE_SWITCH_STACK
moveml %a3-%a6/%d6-%d7,%sp@-
.endm
.macro RESTORE_SWITCH_STACK
moveml %sp@+,%a3-%a6/%d6-%d7
.endm
#endif /* !CONFIG_COLDFIRE */
#endif /* __ASSEMBLY__ */
#endif /* __M68KNOMMU_ENTRY_H */

View file

@ -0,0 +1 @@
#include <asm-m68k/errno.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/fcntl.h>

View file

@ -0,0 +1,16 @@
/*
* include/asm-m68knommu/flat.h -- uClinux flat-format executables
*/
#ifndef __M68KNOMMU_FLAT_H__
#define __M68KNOMMU_FLAT_H__
#define flat_stack_align(sp) /* nothing needed */
#define flat_argvp_envp_on_stack() 1
#define flat_old_ram_flag(flags) (flags)
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
#define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp)
#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
#define flat_get_relocate_addr(rel) (rel)
#endif /* __M68KNOMMU_FLAT_H__ */

View file

@ -0,0 +1,22 @@
#ifndef __M68KNOMMU_FPU_H
#define __M68KNOMMU_FPU_H
#include <linux/config.h>
/*
* MAX floating point unit state size (FSAVE/FRESTORE)
*/
#if defined(CONFIG_M68020) || defined(CONFIG_M68030)
#define FPSTATESIZE (216/sizeof(unsigned char))
#elif defined(CONFIG_M68040)
#define FPSTATESIZE (96/sizeof(unsigned char))
#elif defined(CONFIG_M68KFPU_EMU)
#define FPSTATESIZE (28/sizeof(unsigned char))
#elif defined(CONFIG_M68060)
#define FPSTATESIZE (12/sizeof(unsigned char))
#else
/* Assume no FP unit present then... */
#define FPSTATESIZE (2) /* dummy size */
#endif
#endif /* __M68K_FPU_H */

View file

@ -0,0 +1,25 @@
#ifndef __M68K_HARDIRQ_H
#define __M68K_HARDIRQ_H
#include <linux/config.h>
#include <linux/cache.h>
#include <linux/threads.h>
typedef struct {
unsigned int __softirq_pending;
} ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
#define HARDIRQ_BITS 8
/*
* The hardirq mask has to be large enough to have
* space for potentially all IRQ sources in the system
* nesting on a single CPU:
*/
#if (1 << HARDIRQ_BITS) < NR_IRQS
# error HARDIRQ_BITS is too low!
#endif
#endif /* __M68K_HARDIRQ_H */

View file

@ -0,0 +1 @@
#include <asm-m68k/hdreg.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/hwtest.h>

444
include/asm-m68knommu/ide.h Normal file
View file

@ -0,0 +1,444 @@
/****************************************************************************/
/*
* linux/include/asm-m68knommu/ide.h
*
* Copyright (C) 1994-1996 Linus Torvalds & authors
* Copyright (C) 2001 Lineo Inc., davidm@uclinux.org
*/
/****************************************************************************/
#ifndef _M68KNOMMU_IDE_H
#define _M68KNOMMU_IDE_H
#ifdef __KERNEL__
/****************************************************************************/
#include <linux/config.h>
#include <linux/interrupt.h>
#include <asm/setup.h>
#include <asm/io.h>
#include <asm/irq.h>
/****************************************************************************/
/*
* some coldfire specifics
*/
#ifdef CONFIG_COLDFIRE
#include <asm/coldfire.h>
#include <asm/mcfsim.h>
/*
* Save some space, only have 1 interface
*/
#define MAX_HWIFS 1 /* we only have one interface for now */
#ifdef CONFIG_SECUREEDGEMP3
#define MCFSIM_LOCALCS MCFSIM_CSCR4
#else
#define MCFSIM_LOCALCS MCFSIM_CSCR6
#endif
#endif /* CONFIG_COLDFIRE */
/****************************************************************************/
/*
* Fix up things that may not have been provided
*/
#ifndef MAX_HWIFS
#define MAX_HWIFS 4 /* same as the other archs */
#endif
#undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0
#undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0
/* this definition is used only on startup .. */
#undef HD_DATA
#define HD_DATA NULL
#define DBGIDE(fmt,a...)
// #define DBGIDE(fmt,a...) printk(fmt, ##a)
#define IDE_INLINE __inline__
// #define IDE_INLINE
/****************************************************************************/
typedef union {
unsigned all : 8; /* all of the bits together */
struct {
unsigned bit7 : 1; /* always 1 */
unsigned lba : 1; /* using LBA instead of CHS */
unsigned bit5 : 1; /* always 1 */
unsigned unit : 1; /* drive select number, 0 or 1 */
unsigned head : 4; /* always zeros here */
} b;
} select_t;
/*
* our list of ports/irq's for different boards
*/
static struct m68k_ide_defaults {
ide_ioreg_t base;
int irq;
} m68k_ide_defaults[MAX_HWIFS] = {
#if defined(CONFIG_SECUREEDGEMP3)
{ ((ide_ioreg_t)0x30800000), 29 },
#elif defined(CONFIG_eLIA)
{ ((ide_ioreg_t)0x30c00000), 29 },
#else
{ ((ide_ioreg_t)0x0), 0 }
#endif
};
/****************************************************************************/
static IDE_INLINE int ide_default_irq(ide_ioreg_t base)
{
int i;
for (i = 0; i < MAX_HWIFS; i++)
if (m68k_ide_defaults[i].base == base)
return(m68k_ide_defaults[i].irq);
return 0;
}
static IDE_INLINE ide_ioreg_t ide_default_io_base(int index)
{
if (index >= 0 && index < MAX_HWIFS)
return(m68k_ide_defaults[index].base);
return 0;
}
/*
* Set up a hw structure for a specified data port, control port and IRQ.
* This should follow whatever the default interface uses.
*/
static IDE_INLINE void ide_init_hwif_ports(
hw_regs_t *hw,
ide_ioreg_t data_port,
ide_ioreg_t ctrl_port,
int *irq)
{
ide_ioreg_t reg = data_port;
int i;
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
hw->io_ports[i] = reg;
reg += 1;
}
if (ctrl_port) {
hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
} else {
hw->io_ports[IDE_CONTROL_OFFSET] = data_port + 0xe;
}
}
#define ide_init_default_irq(base) ide_default_irq(base)
static IDE_INLINE int
ide_request_irq(
unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags,
const char *device,
void *dev_id)
{
#ifdef CONFIG_COLDFIRE
mcf_autovector(irq);
#endif
return(request_irq(irq, handler, flags, device, dev_id));
}
static IDE_INLINE void
ide_free_irq(unsigned int irq, void *dev_id)
{
free_irq(irq, dev_id);
}
static IDE_INLINE int
ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return 0;
}
static IDE_INLINE void
ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name)
{
}
static IDE_INLINE void
ide_release_region(ide_ioreg_t from, unsigned int extent)
{
}
static IDE_INLINE void
ide_fix_driveid(struct hd_driveid *id)
{
#ifdef CONFIG_COLDFIRE
int i, n;
unsigned short *wp = (unsigned short *) id;
int avoid[] = {49, 51, 52, 59, -1 }; /* do not swap these words */
/* Need to byte swap shorts, but not char fields */
for (i = n = 0; i < sizeof(*id) / sizeof(*wp); i++, wp++) {
if (avoid[n] == i) {
n++;
continue;
}
*wp = ((*wp & 0xff) << 8) | ((*wp >> 8) & 0xff);
}
/* have to word swap the one 32 bit field */
id->lba_capacity = ((id->lba_capacity & 0xffff) << 16) |
((id->lba_capacity >> 16) & 0xffff);
#endif
}
static IDE_INLINE void
ide_release_lock (int *ide_lock)
{
}
static IDE_INLINE void
ide_get_lock(
int *ide_lock,
void (*handler)(int, void *, struct pt_regs *),
void *data)
{
}
#define ide_ack_intr(hwif) \
((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
#define ide__sti() __sti()
/****************************************************************************/
/*
* System specific IO requirements
*/
#ifdef CONFIG_COLDFIRE
#ifdef CONFIG_SECUREEDGEMP3
/* Replace standard IO functions for funky mapping of MP3 board */
#undef outb
#undef outb_p
#undef inb
#undef inb_p
#define outb(v, a) ide_outb(v, (unsigned long) (a))
#define outb_p(v, a) ide_outb(v, (unsigned long) (a))
#define inb(a) ide_inb((unsigned long) (a))
#define inb_p(a) ide_inb((unsigned long) (a))
#define ADDR8_PTR(addr) (((addr) & 0x1) ? (0x8000 + (addr) - 1) : (addr))
#define ADDR16_PTR(addr) (addr)
#define ADDR32_PTR(addr) (addr)
#define SWAP8(w) ((((w) & 0xffff) << 8) | (((w) & 0xffff) >> 8))
#define SWAP16(w) (w)
#define SWAP32(w) (w)
static IDE_INLINE void
ide_outb(unsigned int val, unsigned int addr)
{
volatile unsigned short *rp;
DBGIDE("%s(val=%x,addr=%x)\n", __FUNCTION__, val, addr);
rp = (volatile unsigned short *) ADDR8_PTR(addr);
*rp = SWAP8(val);
}
static IDE_INLINE int
ide_inb(unsigned int addr)
{
volatile unsigned short *rp, val;
DBGIDE("%s(addr=%x)\n", __FUNCTION__, addr);
rp = (volatile unsigned short *) ADDR8_PTR(addr);
val = *rp;
return(SWAP8(val));
}
static IDE_INLINE void
ide_outw(unsigned int val, unsigned int addr)
{
volatile unsigned short *rp;
DBGIDE("%s(val=%x,addr=%x)\n", __FUNCTION__, val, addr);
rp = (volatile unsigned short *) ADDR16_PTR(addr);
*rp = SWAP16(val);
}
static IDE_INLINE void
ide_outsw(unsigned int addr, const void *vbuf, unsigned long len)
{
volatile unsigned short *rp, val;
unsigned short *buf;
DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
buf = (unsigned short *) vbuf;
rp = (volatile unsigned short *) ADDR16_PTR(addr);
for (; (len > 0); len--) {
val = *buf++;
*rp = SWAP16(val);
}
}
static IDE_INLINE int
ide_inw(unsigned int addr)
{
volatile unsigned short *rp, val;
DBGIDE("%s(addr=%x)\n", __FUNCTION__, addr);
rp = (volatile unsigned short *) ADDR16_PTR(addr);
val = *rp;
return(SWAP16(val));
}
static IDE_INLINE void
ide_insw(unsigned int addr, void *vbuf, unsigned long len)
{
volatile unsigned short *rp;
unsigned short w, *buf;
DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
buf = (unsigned short *) vbuf;
rp = (volatile unsigned short *) ADDR16_PTR(addr);
for (; (len > 0); len--) {
w = *rp;
*buf++ = SWAP16(w);
}
}
static IDE_INLINE void
ide_insl(unsigned int addr, void *vbuf, unsigned long len)
{
volatile unsigned long *rp;
unsigned long w, *buf;
DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
buf = (unsigned long *) vbuf;
rp = (volatile unsigned long *) ADDR32_PTR(addr);
for (; (len > 0); len--) {
w = *rp;
*buf++ = SWAP32(w);
}
}
static IDE_INLINE void
ide_outsl(unsigned int addr, const void *vbuf, unsigned long len)
{
volatile unsigned long *rp, val;
unsigned long *buf;
DBGIDE("%s(addr=%x,vbuf=%p,len=%x)\n", __FUNCTION__, addr, vbuf, len);
buf = (unsigned long *) vbuf;
rp = (volatile unsigned long *) ADDR32_PTR(addr);
for (; (len > 0); len--) {
val = *buf++;
*rp = SWAP32(val);
}
}
#elif CONFIG_eLIA
/* 8/16 bit acesses are controlled by flicking bits in the CS register */
#define ACCESS_MODE_16BIT() \
*((volatile unsigned short *) (MCF_MBAR + MCFSIM_LOCALCS)) = 0x0080
#define ACCESS_MODE_8BIT() \
*((volatile unsigned short *) (MCF_MBAR + MCFSIM_LOCALCS)) = 0x0040
static IDE_INLINE void
ide_outw(unsigned int val, unsigned int addr)
{
ACCESS_MODE_16BIT();
outw(val, addr);
ACCESS_MODE_8BIT();
}
static IDE_INLINE void
ide_outsw(unsigned int addr, const void *vbuf, unsigned long len)
{
ACCESS_MODE_16BIT();
outsw(addr, vbuf, len);
ACCESS_MODE_8BIT();
}
static IDE_INLINE int
ide_inw(unsigned int addr)
{
int ret;
ACCESS_MODE_16BIT();
ret = inw(addr);
ACCESS_MODE_8BIT();
return(ret);
}
static IDE_INLINE void
ide_insw(unsigned int addr, void *vbuf, unsigned long len)
{
ACCESS_MODE_16BIT();
insw(addr, vbuf, len);
ACCESS_MODE_8BIT();
}
static IDE_INLINE void
ide_insl(unsigned int addr, void *vbuf, unsigned long len)
{
ACCESS_MODE_16BIT();
insl(addr, vbuf, len);
ACCESS_MODE_8BIT();
}
static IDE_INLINE void
ide_outsl(unsigned int addr, const void *vbuf, unsigned long len)
{
ACCESS_MODE_16BIT();
outsl(addr, vbuf, len);
ACCESS_MODE_8BIT();
}
#endif /* CONFIG_SECUREEDGEMP3 */
#undef outw
#undef outw_p
#undef outsw
#undef inw
#undef inw_p
#undef insw
#undef insl
#undef outsl
#define outw(v, a) ide_outw(v, (unsigned long) (a))
#define outw_p(v, a) ide_outw(v, (unsigned long) (a))
#define outsw(a, b, n) ide_outsw((unsigned long) (a), b, n)
#define inw(a) ide_inw((unsigned long) (a))
#define inw_p(a) ide_inw((unsigned long) (a))
#define insw(a, b, n) ide_insw((unsigned long) (a), b, n)
#define insl(a, b, n) ide_insl((unsigned long) (a), b, n)
#define outsl(a, b, n) ide_outsl((unsigned long) (a), b, n)
#endif CONFIG_COLDFIRE
/****************************************************************************/
#endif /* __KERNEL__ */
#endif /* _M68KNOMMU_IDE_H */
/****************************************************************************/

203
include/asm-m68knommu/io.h Normal file
View file

@ -0,0 +1,203 @@
#ifndef _M68KNOMMU_IO_H
#define _M68KNOMMU_IO_H
#ifdef __KERNEL__
#include <linux/config.h>
/*
* These are for ISA/PCI shared memory _only_ and should never be used
* on any other type of memory, including Zorro memory. They are meant to
* access the bus in the bus byte order which is little-endian!.
*
* readX/writeX() are used to access memory mapped devices. On some
* architectures the memory mapped IO stuff needs to be accessed
* differently. On the m68k architecture, we just read/write the
* memory location directly.
*/
/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
* two accesses to memory, which may be undesireable for some devices.
*/
/*
* swap functions are sometimes needed to interface little-endian hardware
*/
static inline unsigned short _swapw(volatile unsigned short v)
{
return ((v << 8) | (v >> 8));
}
static inline unsigned int _swapl(volatile unsigned long v)
{
return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24));
}
#define readb(addr) \
({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
#define readw(addr) \
({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
#define readl(addr) \
({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
#define readb_relaxed(addr) readb(addr)
#define readw_relaxed(addr) readw(addr)
#define readl_relaxed(addr) readl(addr)
#define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
#define __raw_readb readb
#define __raw_readw readw
#define __raw_readl readl
#define __raw_writeb writeb
#define __raw_writew writew
#define __raw_writel writel
static inline void io_outsb(unsigned int addr, void *buf, int len)
{
volatile unsigned char *ap = (volatile unsigned char *) addr;
unsigned char *bp = (unsigned char *) buf;
while (len--)
*ap = *bp++;
}
static inline void io_outsw(unsigned int addr, void *buf, int len)
{
volatile unsigned short *ap = (volatile unsigned short *) addr;
unsigned short *bp = (unsigned short *) buf;
while (len--)
*ap = _swapw(*bp++);
}
static inline void io_outsl(unsigned int addr, void *buf, int len)
{
volatile unsigned int *ap = (volatile unsigned int *) addr;
unsigned int *bp = (unsigned int *) buf;
while (len--)
*ap = _swapl(*bp++);
}
static inline void io_insb(unsigned int addr, void *buf, int len)
{
volatile unsigned char *ap = (volatile unsigned char *) addr;
unsigned char *bp = (unsigned char *) buf;
while (len--)
*bp++ = *ap;
}
static inline void io_insw(unsigned int addr, void *buf, int len)
{
volatile unsigned short *ap = (volatile unsigned short *) addr;
unsigned short *bp = (unsigned short *) buf;
while (len--)
*bp++ = _swapw(*ap);
}
static inline void io_insl(unsigned int addr, void *buf, int len)
{
volatile unsigned int *ap = (volatile unsigned int *) addr;
unsigned int *bp = (unsigned int *) buf;
while (len--)
*bp++ = _swapl(*ap);
}
#define mmiowb()
/*
* make the short names macros so specific devices
* can override them as required
*/
#define memset_io(a,b,c) memset((void *)(a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
#define inb(addr) readb(addr)
#define inw(addr) readw(addr)
#define inl(addr) readl(addr)
#define outb(x,addr) ((void) writeb(x,addr))
#define outw(x,addr) ((void) writew(x,addr))
#define outl(x,addr) ((void) writel(x,addr))
#define inb_p(addr) inb(addr)
#define inw_p(addr) inw(addr)
#define inl_p(addr) inl(addr)
#define outb_p(x,addr) outb(x,addr)
#define outw_p(x,addr) outw(x,addr)
#define outl_p(x,addr) outl(x,addr)
#define outsb(a,b,l) io_outsb(a,b,l)
#define outsw(a,b,l) io_outsw(a,b,l)
#define outsl(a,b,l) io_outsl(a,b,l)
#define insb(a,b,l) io_insb(a,b,l)
#define insw(a,b,l) io_insw(a,b,l)
#define insl(a,b,l) io_insl(a,b,l)
#define IO_SPACE_LIMIT 0xffff
/* Values for nocacheflag and cmode */
#define IOMAP_FULL_CACHING 0
#define IOMAP_NOCACHE_SER 1
#define IOMAP_NOCACHE_NONSER 2
#define IOMAP_WRITETHROUGH 3
extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
extern void __iounmap(void *addr, unsigned long size);
extern inline void *ioremap(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
}
extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
}
extern inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
}
extern inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size)
{
return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
}
extern void iounmap(void *addr);
/* Nothing to do */
#define dma_cache_inv(_start,_size) do { } while (0)
#define dma_cache_wback(_start,_size) do { } while (0)
#define dma_cache_wback_inv(_start,_size) do { } while (0)
/* Pages to physical address... */
#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
/*
* Macros used for converting between virtual and physical mappings.
*/
#define mm_ptov(vaddr) ((void *) (vaddr))
#define mm_vtop(vaddr) ((unsigned long) (vaddr))
#define phys_to_virt(vaddr) ((void *) (vaddr))
#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
/*
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
* access
*/
#define xlate_dev_mem_ptr(p) __va(p)
/*
* Convert a virtual cached pointer to an uncached pointer
*/
#define xlate_dev_kmem_ptr(p) p
#endif /* __KERNEL__ */
#endif /* _M68KNOMMU_IO_H */

View file

@ -0,0 +1 @@
#include <asm-m68k/ioctl.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/ioctls.h>

View file

@ -0,0 +1 @@
#include <asm-generic/ipc.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/ipcbuf.h>

128
include/asm-m68knommu/irq.h Normal file
View file

@ -0,0 +1,128 @@
#ifndef _M68K_IRQ_H_
#define _M68K_IRQ_H_
#include <linux/config.h>
#include <linux/interrupt.h>
#include <asm/ptrace.h>
#ifdef CONFIG_COLDFIRE
/*
* On the ColdFire we keep track of all vectors. That way drivers
* can register whatever vector number they wish, and we can deal
* with it.
*/
#define SYS_IRQS 256
#define NR_IRQS SYS_IRQS
#else
/*
* # of m68k interrupts
*/
#define SYS_IRQS 8
#define NR_IRQS (24+SYS_IRQS)
#endif /* CONFIG_COLDFIRE */
/*
* Interrupt source definitions
* General interrupt sources are the level 1-7.
* Adding an interrupt service routine for one of these sources
* results in the addition of that routine to a chain of routines.
* Each one is called in succession. Each individual interrupt
* service routine should determine if the device associated with
* that routine requires service.
*/
#define IRQ1 (1) /* level 1 interrupt */
#define IRQ2 (2) /* level 2 interrupt */
#define IRQ3 (3) /* level 3 interrupt */
#define IRQ4 (4) /* level 4 interrupt */
#define IRQ5 (5) /* level 5 interrupt */
#define IRQ6 (6) /* level 6 interrupt */
#define IRQ7 (7) /* level 7 interrupt (non-maskable) */
/*
* Machine specific interrupt sources.
*
* Adding an interrupt service routine for a source with this bit
* set indicates a special machine specific interrupt source.
* The machine specific files define these sources.
*
* The IRQ_MACHSPEC bit is now gone - the only thing it did was to
* introduce unnecessary overhead.
*
* All interrupt handling is actually machine specific so it is better
* to use function pointers, as used by the Sparc port, and select the
* interrupt handling functions when initializing the kernel. This way
* we save some unnecessary overhead at run-time.
* 01/11/97 - Jes
*/
extern void (*mach_enable_irq)(unsigned int);
extern void (*mach_disable_irq)(unsigned int);
/*
* various flags for request_irq() - the Amiga now uses the standard
* mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
* are your friends.
*/
#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
#define IRQ_FLG_FAST (0x0004)
#define IRQ_FLG_SLOW (0x0008)
#define IRQ_FLG_STD (0x8000) /* internally used */
#ifdef CONFIG_M68360
#define CPM_INTERRUPT IRQ4
/* see MC68360 User's Manual, p. 7-377 */
#define CPM_VECTOR_BASE 0x04 /* 3 MSbits of CPM vector */
#endif /* CONFIG_M68360 */
/*
* This structure is used to chain together the ISRs for a particular
* interrupt source (if it supports chaining).
*/
typedef struct irq_node {
irqreturn_t (*handler)(int, void *, struct pt_regs *);
unsigned long flags;
void *dev_id;
const char *devname;
struct irq_node *next;
} irq_node_t;
/*
* This structure has only 4 elements for speed reasons
*/
typedef struct irq_handler {
irqreturn_t (*handler)(int, void *, struct pt_regs *);
unsigned long flags;
void *dev_id;
const char *devname;
} irq_handler_t;
/* count of spurious interrupts */
extern volatile unsigned int num_spurious;
/*
* This function returns a new irq_node_t
*/
extern irq_node_t *new_irq_node(void);
/*
* Some drivers want these entry points
*/
#define enable_irq(x) (mach_enable_irq ? (*mach_enable_irq)(x) : 0)
#define disable_irq(x) (mach_disable_irq ? (*mach_disable_irq)(x) : 0)
#define enable_irq_nosync(x) enable_irq(x)
#define disable_irq_nosync(x) disable_irq(x)
struct irqaction;
struct pt_regs;
int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
#endif /* _M68K_IRQ_H_ */

View file

@ -0,0 +1,21 @@
#ifndef __ASM_M68K_KMAP_TYPES_H
#define __ASM_M68K_KMAP_TYPES_H
enum km_type {
KM_BOUNCE_READ,
KM_SKB_SUNRPC_DATA,
KM_SKB_DATA_SOFTIRQ,
KM_USER0,
KM_USER1,
KM_BIO_SRC_IRQ,
KM_BIO_DST_IRQ,
KM_PTE0,
KM_PTE1,
KM_IRQ0,
KM_IRQ1,
KM_SOFTIRQ0,
KM_SOFTIRQ1,
KM_TYPE_NR
};
#endif

View file

@ -0,0 +1 @@
#include <asm-m68k/linkage.h>

View file

@ -0,0 +1,6 @@
#ifndef __M68KNOMMU_LOCAL_H
#define __M68KNOMMU_LOCAL_H
#include <asm-generic/local.h>
#endif /* __M68KNOMMU_LOCAL_H */

View file

@ -0,0 +1,132 @@
/****************************************************************************/
/*
* m5206sim.h -- ColdFire 5206 System Integration Module support.
*
* (C) Copyright 1999, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef m5206sim_h
#define m5206sim_h
/****************************************************************************/
#include <linux/config.h>
/*
* Define the 5206 SIM register set addresses.
*/
#define MCFSIM_SIMR 0x03 /* SIM Config reg (r/w) */
#define MCFSIM_ICR1 0x14 /* Intr Ctrl reg 1 (r/w) */
#define MCFSIM_ICR2 0x15 /* Intr Ctrl reg 2 (r/w) */
#define MCFSIM_ICR3 0x16 /* Intr Ctrl reg 3 (r/w) */
#define MCFSIM_ICR4 0x17 /* Intr Ctrl reg 4 (r/w) */
#define MCFSIM_ICR5 0x18 /* Intr Ctrl reg 5 (r/w) */
#define MCFSIM_ICR6 0x19 /* Intr Ctrl reg 6 (r/w) */
#define MCFSIM_ICR7 0x1a /* Intr Ctrl reg 7 (r/w) */
#define MCFSIM_ICR8 0x1b /* Intr Ctrl reg 8 (r/w) */
#define MCFSIM_ICR9 0x1c /* Intr Ctrl reg 9 (r/w) */
#define MCFSIM_ICR10 0x1d /* Intr Ctrl reg 10 (r/w) */
#define MCFSIM_ICR11 0x1e /* Intr Ctrl reg 11 (r/w) */
#define MCFSIM_ICR12 0x1f /* Intr Ctrl reg 12 (r/w) */
#define MCFSIM_ICR13 0x20 /* Intr Ctrl reg 13 (r/w) */
#ifdef CONFIG_M5206e
#define MCFSIM_ICR14 0x21 /* Intr Ctrl reg 14 (r/w) */
#define MCFSIM_ICR15 0x22 /* Intr Ctrl reg 15 (r/w) */
#endif
#define MCFSIM_IMR 0x36 /* Interrupt Mask reg (r/w) */
#define MCFSIM_IPR 0x3a /* Interrupt Pend reg (r/w) */
#define MCFSIM_RSR 0x40 /* Reset Status reg (r/w) */
#define MCFSIM_SYPCR 0x41 /* System Protection reg (r/w)*/
#define MCFSIM_SWIVR 0x42 /* SW Watchdog intr reg (r/w) */
#define MCFSIM_SWSR 0x43 /* SW Watchdog service (r/w) */
#define MCFSIM_DCRR 0x46 /* DRAM Refresh reg (r/w) */
#define MCFSIM_DCTR 0x4a /* DRAM Timing reg (r/w) */
#define MCFSIM_DAR0 0x4c /* DRAM 0 Address reg(r/w) */
#define MCFSIM_DMR0 0x50 /* DRAM 0 Mask reg (r/w) */
#define MCFSIM_DCR0 0x57 /* DRAM 0 Control reg (r/w) */
#define MCFSIM_DAR1 0x58 /* DRAM 1 Address reg (r/w) */
#define MCFSIM_DMR1 0x5c /* DRAM 1 Mask reg (r/w) */
#define MCFSIM_DCR1 0x63 /* DRAM 1 Control reg (r/w) */
#define MCFSIM_CSAR0 0x64 /* CS 0 Address 0 reg (r/w) */
#define MCFSIM_CSMR0 0x68 /* CS 0 Mask 0 reg (r/w) */
#define MCFSIM_CSCR0 0x6e /* CS 0 Control reg (r/w) */
#define MCFSIM_CSAR1 0x70 /* CS 1 Address reg (r/w) */
#define MCFSIM_CSMR1 0x74 /* CS 1 Mask reg (r/w) */
#define MCFSIM_CSCR1 0x7a /* CS 1 Control reg (r/w) */
#define MCFSIM_CSAR2 0x7c /* CS 2 Address reg (r/w) */
#define MCFSIM_CSMR2 0x80 /* CS 2 Mask reg (r/w) */
#define MCFSIM_CSCR2 0x86 /* CS 2 Control reg (r/w) */
#define MCFSIM_CSAR3 0x88 /* CS 3 Address reg (r/w) */
#define MCFSIM_CSMR3 0x8c /* CS 3 Mask reg (r/w) */
#define MCFSIM_CSCR3 0x92 /* CS 3 Control reg (r/w) */
#define MCFSIM_CSAR4 0x94 /* CS 4 Address reg (r/w) */
#define MCFSIM_CSMR4 0x98 /* CS 4 Mask reg (r/w) */
#define MCFSIM_CSCR4 0x9e /* CS 4 Control reg (r/w) */
#define MCFSIM_CSAR5 0xa0 /* CS 5 Address reg (r/w) */
#define MCFSIM_CSMR5 0xa4 /* CS 5 Mask reg (r/w) */
#define MCFSIM_CSCR5 0xaa /* CS 5 Control reg (r/w) */
#define MCFSIM_CSAR6 0xac /* CS 6 Address reg (r/w) */
#define MCFSIM_CSMR6 0xb0 /* CS 6 Mask reg (r/w) */
#define MCFSIM_CSCR6 0xb6 /* CS 6 Control reg (r/w) */
#define MCFSIM_CSAR7 0xb8 /* CS 7 Address reg (r/w) */
#define MCFSIM_CSMR7 0xbc /* CS 7 Mask reg (r/w) */
#define MCFSIM_CSCR7 0xc2 /* CS 7 Control reg (r/w) */
#define MCFSIM_DMCR 0xc6 /* Default control */
#ifdef CONFIG_M5206e
#define MCFSIM_PAR 0xca /* Pin Assignment reg (r/w) */
#else
#define MCFSIM_PAR 0xcb /* Pin Assignment reg (r/w) */
#endif
#define MCFSIM_PADDR 0x1c5 /* Parallel Direction (r/w) */
#define MCFSIM_PADAT 0x1c9 /* Parallel Port Value (r/w) */
/*
* Some symbol defines for the Parallel Port Pin Assignment Register
*/
#ifdef CONFIG_M5206e
#define MCFSIM_PAR_DREQ0 0x100 /* Set to select DREQ0 input */
/* Clear to select T0 input */
#define MCFSIM_PAR_DREQ1 0x200 /* Select DREQ1 input */
/* Clear to select T0 output */
#endif
/*
* Some symbol defines for the Interrupt Control Register
*/
#define MCFSIM_SWDICR MCFSIM_ICR8 /* Watchdog timer ICR */
#define MCFSIM_TIMER1ICR MCFSIM_ICR9 /* Timer 1 ICR */
#define MCFSIM_TIMER2ICR MCFSIM_ICR10 /* Timer 2 ICR */
#define MCFSIM_UART1ICR MCFSIM_ICR12 /* UART 1 ICR */
#define MCFSIM_UART2ICR MCFSIM_ICR13 /* UART 2 ICR */
#ifdef CONFIG_M5206e
#define MCFSIM_DMA1ICR MCFSIM_ICR14 /* DMA 1 ICR */
#define MCFSIM_DMA2ICR MCFSIM_ICR15 /* DMA 2 ICR */
#endif
#if defined(CONFIG_M5206e)
#define MCFSIM_IMR_MASKALL 0xfffe /* All SIM intr sources */
#endif
/*
* Macro to get and set IMR register. It is 16 bits on the 5206.
*/
#define mcf_getimr() \
*((volatile unsigned short *) (MCF_MBAR + MCFSIM_IMR))
#define mcf_setimr(imr) \
*((volatile unsigned short *) (MCF_MBAR + MCFSIM_IMR)) = (imr)
#define mcf_getipr() \
*((volatile unsigned short *) (MCF_MBAR + MCFSIM_IPR))
/****************************************************************************/
#endif /* m5206sim_h */

View file

@ -0,0 +1,209 @@
/****************************************************************************/
/*
* m5249sim.h -- ColdFire 5249 System Integration Module support.
*
* (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
*/
/****************************************************************************/
#ifndef m5249sim_h
#define m5249sim_h
/****************************************************************************/
/*
* Define the 5249 SIM register set addresses.
*/
#define MCFSIM_RSR 0x00 /* Reset Status reg (r/w) */
#define MCFSIM_SYPCR 0x01 /* System Protection reg (r/w)*/
#define MCFSIM_SWIVR 0x02 /* SW Watchdog intr reg (r/w) */
#define MCFSIM_SWSR 0x03 /* SW Watchdog service (r/w) */
#define MCFSIM_PAR 0x04 /* Pin Assignment reg (r/w) */
#define MCFSIM_IRQPAR 0x06 /* Interrupt Assignment reg (r/w) */
#define MCFSIM_MPARK 0x0C /* BUS Master Control Reg*/
#define MCFSIM_IPR 0x40 /* Interrupt Pend reg (r/w) */
#define MCFSIM_IMR 0x44 /* Interrupt Mask reg (r/w) */
#define MCFSIM_AVR 0x4b /* Autovector Ctrl reg (r/w) */
#define MCFSIM_ICR0 0x4c /* Intr Ctrl reg 0 (r/w) */
#define MCFSIM_ICR1 0x4d /* Intr Ctrl reg 1 (r/w) */
#define MCFSIM_ICR2 0x4e /* Intr Ctrl reg 2 (r/w) */
#define MCFSIM_ICR3 0x4f /* Intr Ctrl reg 3 (r/w) */
#define MCFSIM_ICR4 0x50 /* Intr Ctrl reg 4 (r/w) */
#define MCFSIM_ICR5 0x51 /* Intr Ctrl reg 5 (r/w) */
#define MCFSIM_ICR6 0x52 /* Intr Ctrl reg 6 (r/w) */
#define MCFSIM_ICR7 0x53 /* Intr Ctrl reg 7 (r/w) */
#define MCFSIM_ICR8 0x54 /* Intr Ctrl reg 8 (r/w) */
#define MCFSIM_ICR9 0x55 /* Intr Ctrl reg 9 (r/w) */
#define MCFSIM_ICR10 0x56 /* Intr Ctrl reg 10 (r/w) */
#define MCFSIM_ICR11 0x57 /* Intr Ctrl reg 11 (r/w) */
#define MCFSIM_CSAR0 0x80 /* CS 0 Address 0 reg (r/w) */
#define MCFSIM_CSMR0 0x84 /* CS 0 Mask 0 reg (r/w) */
#define MCFSIM_CSCR0 0x8a /* CS 0 Control reg (r/w) */
#define MCFSIM_CSAR1 0x8c /* CS 1 Address reg (r/w) */
#define MCFSIM_CSMR1 0x90 /* CS 1 Mask reg (r/w) */
#define MCFSIM_CSCR1 0x96 /* CS 1 Control reg (r/w) */
#define MCFSIM_CSAR2 0x98 /* CS 2 Adress reg (r/w) */
#define MCFSIM_CSMR2 0x9c /* CS 2 Mask reg (r/w) */
#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
#define MCFSIM_CSAR3 0xa4 /* CS 3 Adress reg (r/w) */
#define MCFSIM_CSMR3 0xa8 /* CS 3 Mask reg (r/w) */
#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
#define MCFSIM_DCR 0x100 /* DRAM Control reg (r/w) */
#define MCFSIM_DACR0 0x108 /* DRAM 0 Addr and Ctrl (r/w) */
#define MCFSIM_DMR0 0x10c /* DRAM 0 Mask reg (r/w) */
#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
/*
* Some symbol defines for the above...
*/
#define MCFSIM_SWDICR MCFSIM_ICR0 /* Watchdog timer ICR */
#define MCFSIM_TIMER1ICR MCFSIM_ICR1 /* Timer 1 ICR */
#define MCFSIM_TIMER2ICR MCFSIM_ICR2 /* Timer 2 ICR */
#define MCFSIM_UART1ICR MCFSIM_ICR4 /* UART 1 ICR */
#define MCFSIM_UART2ICR MCFSIM_ICR5 /* UART 2 ICR */
#define MCFSIM_DMA0ICR MCFSIM_ICR6 /* DMA 0 ICR */
#define MCFSIM_DMA1ICR MCFSIM_ICR7 /* DMA 1 ICR */
#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */
#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
/*
* General purpose IO registers (in MBAR2).
*/
#define MCFSIM2_GPIOREAD 0x0 /* GPIO read values */
#define MCFSIM2_GPIOWRITE 0x4 /* GPIO write values */
#define MCFSIM2_GPIOENABLE 0x8 /* GPIO enabled */
#define MCFSIM2_GPIOFUNC 0xc /* GPIO function */
#define MCFSIM2_GPIO1READ 0xb0 /* GPIO1 read values */
#define MCFSIM2_GPIO1WRITE 0xb4 /* GPIO1 write values */
#define MCFSIM2_GPIO1ENABLE 0xb8 /* GPIO1 enabled */
#define MCFSIM2_GPIO1FUNC 0xbc /* GPIO1 function */
#define MCFSIM2_GPIOINTSTAT 0xc0 /* GPIO interrupt status */
#define MCFSIM2_GPIOINTCLEAR 0xc0 /* GPIO interrupt clear */
#define MCFSIM2_GPIOINTENABLE 0xc4 /* GPIO interrupt enable */
#define MCFSIM2_INTLEVEL1 0x140 /* Interrupt level reg 1 */
#define MCFSIM2_INTLEVEL2 0x144 /* Interrupt level reg 2 */
#define MCFSIM2_INTLEVEL3 0x148 /* Interrupt level reg 3 */
#define MCFSIM2_INTLEVEL4 0x14c /* Interrupt level reg 4 */
#define MCFSIM2_INTLEVEL5 0x150 /* Interrupt level reg 5 */
#define MCFSIM2_INTLEVEL6 0x154 /* Interrupt level reg 6 */
#define MCFSIM2_INTLEVEL7 0x158 /* Interrupt level reg 7 */
#define MCFSIM2_INTLEVEL8 0x15c /* Interrupt level reg 8 */
#define MCFSIM2_DMAROUTE 0x188 /* DMA routing */
#define MCFSIM2_IDECONFIG1 0x18c /* IDEconfig1 */
#define MCFSIM2_IDECONFIG2 0x190 /* IDEconfig2 */
/*
* Macro to set IMR register. It is 32 bits on the 5249.
*/
#define MCFSIM_IMR_MASKALL 0x7fffe /* All SIM intr sources */
#define mcf_getimr() \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
#define mcf_setimr(imr) \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
#define mcf_getipr() \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
/****************************************************************************/
#ifdef __ASSEMBLER__
/*
* The M5249C3 board needs a little help getting all its SIM devices
* initialized at kernel start time. dBUG doesn't set much up, so
* we need to do it manually.
*/
.macro m5249c3_setup
/*
* Set MBAR1 and MBAR2, just incase they are not set.
*/
movel #0x10000001,%a0
movec %a0,%MBAR /* map MBAR region */
subql #1,%a0 /* get MBAR address in a0 */
movel #0x80000001,%a1
movec %a1,#3086 /* map MBAR2 region */
subql #1,%a1 /* get MBAR2 address in a1 */
/*
* Move secondary interrupts to base at 128.
*/
moveb #0x80,%d0
moveb %d0,0x16b(%a1) /* interrupt base register */
/*
* Work around broken CSMR0/DRAM vector problem.
*/
movel #0x001F0021,%d0 /* disable C/I bit */
movel %d0,0x84(%a0) /* set CSMR0 */
/*
* Disable the PLL firstly. (Who knows what state it is
* in here!).
*/
movel 0x180(%a1),%d0 /* get current PLL value */
andl #0xfffffffe,%d0 /* PLL bypass first */
movel %d0,0x180(%a1) /* set PLL register */
nop
#ifdef CONFIG_CLOCK_140MHz
/*
* Set initial clock frequency. This assumes M5249C3 board
* is fitted with 11.2896MHz crystal. It will program the
* PLL for 140MHz. Lets go fast :-)
*/
movel #0x125a40f0,%d0 /* set for 140MHz */
movel %d0,0x180(%a1) /* set PLL register */
orl #0x1,%d0
movel %d0,0x180(%a1) /* set PLL register */
#endif
/*
* Setup CS1 for ethernet controller.
* (Setup as per M5249C3 doco).
*/
movel #0xe0000000,%d0 /* CS1 mapped at 0xe0000000 */
movel %d0,0x8c(%a0)
movel #0x001f0021,%d0 /* CS1 size of 1Mb */
movel %d0,0x90(%a0)
movew #0x0080,%d0 /* CS1 = 16bit port, AA */
movew %d0,0x96(%a0)
/*
* Setup CS2 for IDE interface.
*/
movel #0x50000000,%d0 /* CS2 mapped at 0x50000000 */
movel %d0,0x98(%a0)
movel #0x001f0001,%d0 /* CS2 size of 1MB */
movel %d0,0x9c(%a0)
movew #0x0080,%d0 /* CS2 = 16bit, TA */
movew %d0,0xa2(%a0)
movel #0x00107000,%d0 /* IDEconfig1 */
movel %d0,0x18c(%a1)
movel #0x000c0400,%d0 /* IDEconfig2 */
movel %d0,0x190(%a1)
movel #0x00080000,%d0 /* GPIO19, IDE reset bit */
orl %d0,0xc(%a1) /* function GPIO19 */
orl %d0,0x8(%a1) /* enable GPIO19 as output */
orl %d0,0x4(%a1) /* de-assert IDE reset */
.endm
#define PLATFORM_SETUP m5249c3_setup
#endif /* __ASSEMBLER__ */
/****************************************************************************/
#endif /* m5249sim_h */

View file

@ -0,0 +1,79 @@
/****************************************************************************/
/*
* m5272sim.h -- ColdFire 5272 System Integration Module support.
*
* (C) Copyright 1999, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef m5272sim_h
#define m5272sim_h
/****************************************************************************/
#include <linux/config.h>
/*
* Define the 5272 SIM register set addresses.
*/
#define MCFSIM_SCR 0x04 /* SIM Config reg (r/w) */
#define MCFSIM_SPR 0x06 /* System Protection reg (r/w)*/
#define MCFSIM_PMR 0x08 /* Power Management reg (r/w) */
#define MCFSIM_APMR 0x0e /* Active Low Power reg (r/w) */
#define MCFSIM_DIR 0x10 /* Device Identity reg (r/w) */
#define MCFSIM_ICR1 0x20 /* Intr Ctrl reg 1 (r/w) */
#define MCFSIM_ICR2 0x24 /* Intr Ctrl reg 2 (r/w) */
#define MCFSIM_ICR3 0x28 /* Intr Ctrl reg 3 (r/w) */
#define MCFSIM_ICR4 0x2c /* Intr Ctrl reg 4 (r/w) */
#define MCFSIM_ISR 0x30 /* Interrupt Source reg (r/w) */
#define MCFSIM_PITR 0x34 /* Interrupt Transition (r/w) */
#define MCFSIM_PIWR 0x38 /* Interrupt Wakeup reg (r/w) */
#define MCFSIM_PIVR 0x3f /* Interrupt Vector reg (r/w( */
#define MCFSIM_WRRR 0x280 /* Watchdog reference (r/w) */
#define MCFSIM_WIRR 0x284 /* Watchdog interrupt (r/w) */
#define MCFSIM_WCR 0x288 /* Watchdog counter (r/w) */
#define MCFSIM_WER 0x28c /* Watchdog event (r/w) */
#define MCFSIM_CSBR0 0x40 /* CS0 Base Address (r/w) */
#define MCFSIM_CSOR0 0x44 /* CS0 Option (r/w) */
#define MCFSIM_CSBR1 0x48 /* CS1 Base Address (r/w) */
#define MCFSIM_CSOR1 0x4c /* CS1 Option (r/w) */
#define MCFSIM_CSBR2 0x50 /* CS2 Base Address (r/w) */
#define MCFSIM_CSOR2 0x54 /* CS2 Option (r/w) */
#define MCFSIM_CSBR3 0x58 /* CS3 Base Address (r/w) */
#define MCFSIM_CSOR3 0x5c /* CS3 Option (r/w) */
#define MCFSIM_CSBR4 0x60 /* CS4 Base Address (r/w) */
#define MCFSIM_CSOR4 0x64 /* CS4 Option (r/w) */
#define MCFSIM_CSBR5 0x68 /* CS5 Base Address (r/w) */
#define MCFSIM_CSOR5 0x6c /* CS5 Option (r/w) */
#define MCFSIM_CSBR6 0x70 /* CS6 Base Address (r/w) */
#define MCFSIM_CSOR6 0x74 /* CS6 Option (r/w) */
#define MCFSIM_CSBR7 0x78 /* CS7 Base Address (r/w) */
#define MCFSIM_CSOR7 0x7c /* CS7 Option (r/w) */
#define MCFSIM_SDCR 0x180 /* SDRAM Configuration (r/w) */
#define MCFSIM_SDTR 0x184 /* SDRAM Timing (r/w) */
#define MCFSIM_DCAR0 0x4c /* DRAM 0 Address reg(r/w) */
#define MCFSIM_DCMR0 0x50 /* DRAM 0 Mask reg (r/w) */
#define MCFSIM_DCCR0 0x57 /* DRAM 0 Control reg (r/w) */
#define MCFSIM_DCAR1 0x58 /* DRAM 1 Address reg (r/w) */
#define MCFSIM_DCMR1 0x5c /* DRAM 1 Mask reg (r/w) */
#define MCFSIM_DCCR1 0x63 /* DRAM 1 Control reg (r/w) */
#define MCFSIM_PACNT 0x80 /* Port A Control (r/w) */
#define MCFSIM_PADDR 0x84 /* Port A Direction (r/w) */
#define MCFSIM_PADAT 0x86 /* Port A Data (r/w) */
#define MCFSIM_PBCNT 0x88 /* Port B Control (r/w) */
#define MCFSIM_PBDDR 0x8c /* Port B Direction (r/w) */
#define MCFSIM_PBDAT 0x8e /* Port B Data (r/w) */
#define MCFSIM_PCDDR 0x94 /* Port C Direction (r/w) */
#define MCFSIM_PCDAT 0x96 /* Port C Data (r/w) */
#define MCFSIM_PDCNT 0x98 /* Port D Control (r/w) */
/****************************************************************************/
#endif /* m5272sim_h */

View file

@ -0,0 +1,58 @@
/****************************************************************************/
/*
* m527xsim.h -- ColdFire 5270/5271 System Integration Module support.
*
* (C) Copyright 2004, Greg Ungerer (gerg@snapgear.com)
*/
/****************************************************************************/
#ifndef m527xsim_h
#define m527xsim_h
/****************************************************************************/
#include <linux/config.h>
/*
* Define the 5270/5271 SIM register set addresses.
*/
#define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */
#define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 1 */
#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
#define MCFINTC_IRLR 0x18 /* */
#define MCFINTC_IACKL 0x19 /* */
#define MCFINTC_ICR0 0x40 /* Base ICR register */
#define MCFINT_VECBASE 64 /* Vector base number */
#define MCFINT_UART0 13 /* Interrupt number for UART0 */
#define MCFINT_UART1 14 /* Interrupt number for UART1 */
#define MCFINT_UART2 15 /* Interrupt number for UART2 */
#define MCFINT_PIT1 36 /* Interrupt number for PIT1 */
/*
* SDRAM configuration registers.
*/
#ifdef CONFIG_M5271EVB
#define MCFSIM_DCR 0x40 /* SDRAM control */
#define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */
#define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */
#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
#else
#define MCFSIM_DMR 0x40 /* SDRAM mode */
#define MCFSIM_DCR 0x44 /* SDRAM control */
#define MCFSIM_DCFG1 0x48 /* SDRAM configuration 1 */
#define MCFSIM_DCFG2 0x4c /* SDRAM configuration 2 */
#define MCFSIM_DBAR0 0x50 /* SDRAM base address 0 */
#define MCFSIM_DMR0 0x54 /* SDRAM address mask 0 */
#define MCFSIM_DBAR1 0x58 /* SDRAM base address 1 */
#define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */
#endif
/****************************************************************************/
#endif /* m527xsim_h */

View file

@ -0,0 +1,45 @@
/****************************************************************************/
/*
* m528xsim.h -- ColdFire 5280/5282 System Integration Module support.
*
* (C) Copyright 2003, Greg Ungerer (gerg@snapgear.com)
*/
/****************************************************************************/
#ifndef m528xsim_h
#define m528xsim_h
/****************************************************************************/
#include <linux/config.h>
/*
* Define the 5280/5282 SIM register set addresses.
*/
#define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */
#define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 0 */
#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
#define MCFINTC_IRLR 0x18 /* */
#define MCFINTC_IACKL 0x19 /* */
#define MCFINTC_ICR0 0x40 /* Base ICR register */
#define MCFINT_VECBASE 64 /* Vector base number */
#define MCFINT_UART0 13 /* Interrupt number for UART0 */
#define MCFINT_PIT1 55 /* Interrupt number for PIT1 */
/*
* SDRAM configuration registers.
*/
#define MCFSIM_DCR 0x44 /* SDRAM control */
#define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */
#define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */
#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
/****************************************************************************/
#endif /* m528xsim_h */

View file

@ -0,0 +1,181 @@
/****************************************************************************/
/*
* m5307sim.h -- ColdFire 5307 System Integration Module support.
*
* (C) Copyright 1999, Moreton Bay Ventures Pty Ltd.
* (C) Copyright 1999, Lineo (www.lineo.com)
*
* Modified by David W. Miller for the MCF5307 Eval Board.
*/
/****************************************************************************/
#ifndef m5307sim_h
#define m5307sim_h
/****************************************************************************/
/*
* Define the 5307 SIM register set addresses.
*/
#define MCFSIM_RSR 0x00 /* Reset Status reg (r/w) */
#define MCFSIM_SYPCR 0x01 /* System Protection reg (r/w)*/
#define MCFSIM_SWIVR 0x02 /* SW Watchdog intr reg (r/w) */
#define MCFSIM_SWSR 0x03 /* SW Watchdog service (r/w) */
#define MCFSIM_PAR 0x04 /* Pin Assignment reg (r/w) */
#define MCFSIM_IRQPAR 0x06 /* Interrupt Assignment reg (r/w) */
#define MCFSIM_PLLCR 0x08 /* PLL Controll Reg*/
#define MCFSIM_MPARK 0x0C /* BUS Master Control Reg*/
#define MCFSIM_IPR 0x40 /* Interrupt Pend reg (r/w) */
#define MCFSIM_IMR 0x44 /* Interrupt Mask reg (r/w) */
#define MCFSIM_AVR 0x4b /* Autovector Ctrl reg (r/w) */
#define MCFSIM_ICR0 0x4c /* Intr Ctrl reg 0 (r/w) */
#define MCFSIM_ICR1 0x4d /* Intr Ctrl reg 1 (r/w) */
#define MCFSIM_ICR2 0x4e /* Intr Ctrl reg 2 (r/w) */
#define MCFSIM_ICR3 0x4f /* Intr Ctrl reg 3 (r/w) */
#define MCFSIM_ICR4 0x50 /* Intr Ctrl reg 4 (r/w) */
#define MCFSIM_ICR5 0x51 /* Intr Ctrl reg 5 (r/w) */
#define MCFSIM_ICR6 0x52 /* Intr Ctrl reg 6 (r/w) */
#define MCFSIM_ICR7 0x53 /* Intr Ctrl reg 7 (r/w) */
#define MCFSIM_ICR8 0x54 /* Intr Ctrl reg 8 (r/w) */
#define MCFSIM_ICR9 0x55 /* Intr Ctrl reg 9 (r/w) */
#define MCFSIM_ICR10 0x56 /* Intr Ctrl reg 10 (r/w) */
#define MCFSIM_ICR11 0x57 /* Intr Ctrl reg 11 (r/w) */
#define MCFSIM_CSAR0 0x80 /* CS 0 Address 0 reg (r/w) */
#define MCFSIM_CSMR0 0x84 /* CS 0 Mask 0 reg (r/w) */
#define MCFSIM_CSCR0 0x8a /* CS 0 Control reg (r/w) */
#define MCFSIM_CSAR1 0x8c /* CS 1 Address reg (r/w) */
#define MCFSIM_CSMR1 0x90 /* CS 1 Mask reg (r/w) */
#define MCFSIM_CSCR1 0x96 /* CS 1 Control reg (r/w) */
#ifdef CONFIG_OLDMASK
#define MCFSIM_CSBAR 0x98 /* CS Base Address reg (r/w) */
#define MCFSIM_CSBAMR 0x9c /* CS Base Mask reg (r/w) */
#define MCFSIM_CSMR2 0x9e /* CS 2 Mask reg (r/w) */
#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
#define MCFSIM_CSMR3 0xaa /* CS 3 Mask reg (r/w) */
#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
#define MCFSIM_CSMR4 0xb6 /* CS 4 Mask reg (r/w) */
#define MCFSIM_CSCR4 0xba /* CS 4 Control reg (r/w) */
#define MCFSIM_CSMR5 0xc2 /* CS 5 Mask reg (r/w) */
#define MCFSIM_CSCR5 0xc6 /* CS 5 Control reg (r/w) */
#define MCFSIM_CSMR6 0xce /* CS 6 Mask reg (r/w) */
#define MCFSIM_CSCR6 0xd2 /* CS 6 Control reg (r/w) */
#define MCFSIM_CSMR7 0xda /* CS 7 Mask reg (r/w) */
#define MCFSIM_CSCR7 0xde /* CS 7 Control reg (r/w) */
#else
#define MCFSIM_CSAR2 0x98 /* CS 2 Adress reg (r/w) */
#define MCFSIM_CSMR2 0x9c /* CS 2 Mask reg (r/w) */
#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
#define MCFSIM_CSAR3 0xa4 /* CS 3 Adress reg (r/w) */
#define MCFSIM_CSMR3 0xa8 /* CS 3 Mask reg (r/w) */
#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
#define MCFSIM_CSAR4 0xb0 /* CS 4 Adress reg (r/w) */
#define MCFSIM_CSMR4 0xb4 /* CS 4 Mask reg (r/w) */
#define MCFSIM_CSCR4 0xba /* CS 4 Control reg (r/w) */
#define MCFSIM_CSAR5 0xbc /* CS 5 Adress reg (r/w) */
#define MCFSIM_CSMR5 0xc0 /* CS 5 Mask reg (r/w) */
#define MCFSIM_CSCR5 0xc6 /* CS 5 Control reg (r/w) */
#define MCFSIM_CSAR6 0xc8 /* CS 6 Adress reg (r/w) */
#define MCFSIM_CSMR6 0xcc /* CS 6 Mask reg (r/w) */
#define MCFSIM_CSCR6 0xd2 /* CS 6 Control reg (r/w) */
#define MCFSIM_CSAR7 0xd4 /* CS 7 Adress reg (r/w) */
#define MCFSIM_CSMR7 0xd8 /* CS 7 Mask reg (r/w) */
#define MCFSIM_CSCR7 0xde /* CS 7 Control reg (r/w) */
#endif /* CONFIG_OLDMASK */
#define MCFSIM_DCR 0x100 /* DRAM Control reg (r/w) */
#define MCFSIM_DACR0 0x108 /* DRAM 0 Addr and Ctrl (r/w) */
#define MCFSIM_DMR0 0x10c /* DRAM 0 Mask reg (r/w) */
#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
#define MCFSIM_PADDR 0x244 /* Parallel Direction (r/w) */
#define MCFSIM_PADAT 0x248 /* Parallel Data (r/w) */
/* Definition offset address for CS2-7 -- old mask 5307 */
#define MCF5307_CS2 (0x400000)
#define MCF5307_CS3 (0x600000)
#define MCF5307_CS4 (0x800000)
#define MCF5307_CS5 (0xA00000)
#define MCF5307_CS6 (0xC00000)
#define MCF5307_CS7 (0xE00000)
/*
* Some symbol defines for the above...
*/
#define MCFSIM_SWDICR MCFSIM_ICR0 /* Watchdog timer ICR */
#define MCFSIM_TIMER1ICR MCFSIM_ICR1 /* Timer 1 ICR */
#define MCFSIM_TIMER2ICR MCFSIM_ICR2 /* Timer 2 ICR */
#define MCFSIM_UART1ICR MCFSIM_ICR4 /* UART 1 ICR */
#define MCFSIM_UART2ICR MCFSIM_ICR5 /* UART 2 ICR */
#define MCFSIM_DMA0ICR MCFSIM_ICR6 /* DMA 0 ICR */
#define MCFSIM_DMA1ICR MCFSIM_ICR7 /* DMA 1 ICR */
#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */
#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
#if defined(CONFIG_M5307)
#define MCFSIM_IMR_MASKALL 0x3fffe /* All SIM intr sources */
#endif
/*
* Macro to set IMR register. It is 32 bits on the 5307.
*/
#define mcf_getimr() \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
#define mcf_setimr(imr) \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
#define mcf_getipr() \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
/*
* Some symbol defines for the Parallel Port Pin Assignment Register
*/
#define MCFSIM_PAR_DREQ0 0x40 /* Set to select DREQ0 input */
/* Clear to select par I/O */
#define MCFSIM_PAR_DREQ1 0x20 /* Select DREQ1 input */
/* Clear to select par I/O */
/*
* Defines for the IRQPAR Register
*/
#define IRQ5_LEVEL4 0x80
#define IRQ3_LEVEL6 0x40
#define IRQ1_LEVEL2 0x20
/*
* Define the Cache register flags.
*/
#define CACR_EC (1<<31)
#define CACR_ESB (1<<29)
#define CACR_DPI (1<<28)
#define CACR_HLCK (1<<27)
#define CACR_CINVA (1<<24)
#define CACR_DNFB (1<<10)
#define CACR_DCM_WTHRU (0<<8)
#define CACR_DCM_WBACK (1<<8)
#define CACR_DCM_OFF_PRE (2<<8)
#define CACR_DCM_OFF_IMP (3<<8)
#define CACR_DW (1<<5)
#define ACR_BASE_POS 24
#define ACR_MASK_POS 16
#define ACR_ENABLE (1<<15)
#define ACR_USER (0<<13)
#define ACR_SUPER (1<<13)
#define ACR_ANY (2<<13)
#define ACR_CM_WTHRU (0<<5)
#define ACR_CM_WBACK (1<<5)
#define ACR_CM_OFF_PRE (2<<5)
#define ACR_CM_OFF_IMP (3<<5)
#define ACR_WPROTECT (1<<2)
/****************************************************************************/
#endif /* m5307sim_h */

View file

@ -0,0 +1,157 @@
/****************************************************************************/
/*
* m5407sim.h -- ColdFire 5407 System Integration Module support.
*
* (C) Copyright 2000, Lineo (www.lineo.com)
* (C) Copyright 1999, Moreton Bay Ventures Pty Ltd.
*
* Modified by David W. Miller for the MCF5307 Eval Board.
*/
/****************************************************************************/
#ifndef m5407sim_h
#define m5407sim_h
/****************************************************************************/
/*
* Define the 5407 SIM register set addresses.
*/
#define MCFSIM_RSR 0x00 /* Reset Status reg (r/w) */
#define MCFSIM_SYPCR 0x01 /* System Protection reg (r/w)*/
#define MCFSIM_SWIVR 0x02 /* SW Watchdog intr reg (r/w) */
#define MCFSIM_SWSR 0x03 /* SW Watchdog service (r/w) */
#define MCFSIM_PAR 0x04 /* Pin Assignment reg (r/w) */
#define MCFSIM_IRQPAR 0x06 /* Interrupt Assignment reg (r/w) */
#define MCFSIM_PLLCR 0x08 /* PLL Controll Reg*/
#define MCFSIM_MPARK 0x0C /* BUS Master Control Reg*/
#define MCFSIM_IPR 0x40 /* Interrupt Pend reg (r/w) */
#define MCFSIM_IMR 0x44 /* Interrupt Mask reg (r/w) */
#define MCFSIM_AVR 0x4b /* Autovector Ctrl reg (r/w) */
#define MCFSIM_ICR0 0x4c /* Intr Ctrl reg 0 (r/w) */
#define MCFSIM_ICR1 0x4d /* Intr Ctrl reg 1 (r/w) */
#define MCFSIM_ICR2 0x4e /* Intr Ctrl reg 2 (r/w) */
#define MCFSIM_ICR3 0x4f /* Intr Ctrl reg 3 (r/w) */
#define MCFSIM_ICR4 0x50 /* Intr Ctrl reg 4 (r/w) */
#define MCFSIM_ICR5 0x51 /* Intr Ctrl reg 5 (r/w) */
#define MCFSIM_ICR6 0x52 /* Intr Ctrl reg 6 (r/w) */
#define MCFSIM_ICR7 0x53 /* Intr Ctrl reg 7 (r/w) */
#define MCFSIM_ICR8 0x54 /* Intr Ctrl reg 8 (r/w) */
#define MCFSIM_ICR9 0x55 /* Intr Ctrl reg 9 (r/w) */
#define MCFSIM_ICR10 0x56 /* Intr Ctrl reg 10 (r/w) */
#define MCFSIM_ICR11 0x57 /* Intr Ctrl reg 11 (r/w) */
#define MCFSIM_CSAR0 0x80 /* CS 0 Address 0 reg (r/w) */
#define MCFSIM_CSMR0 0x84 /* CS 0 Mask 0 reg (r/w) */
#define MCFSIM_CSCR0 0x8a /* CS 0 Control reg (r/w) */
#define MCFSIM_CSAR1 0x8c /* CS 1 Address reg (r/w) */
#define MCFSIM_CSMR1 0x90 /* CS 1 Mask reg (r/w) */
#define MCFSIM_CSCR1 0x96 /* CS 1 Control reg (r/w) */
#define MCFSIM_CSAR2 0x98 /* CS 2 Adress reg (r/w) */
#define MCFSIM_CSMR2 0x9c /* CS 2 Mask reg (r/w) */
#define MCFSIM_CSCR2 0xa2 /* CS 2 Control reg (r/w) */
#define MCFSIM_CSAR3 0xa4 /* CS 3 Adress reg (r/w) */
#define MCFSIM_CSMR3 0xa8 /* CS 3 Mask reg (r/w) */
#define MCFSIM_CSCR3 0xae /* CS 3 Control reg (r/w) */
#define MCFSIM_CSAR4 0xb0 /* CS 4 Adress reg (r/w) */
#define MCFSIM_CSMR4 0xb4 /* CS 4 Mask reg (r/w) */
#define MCFSIM_CSCR4 0xba /* CS 4 Control reg (r/w) */
#define MCFSIM_CSAR5 0xbc /* CS 5 Adress reg (r/w) */
#define MCFSIM_CSMR5 0xc0 /* CS 5 Mask reg (r/w) */
#define MCFSIM_CSCR5 0xc6 /* CS 5 Control reg (r/w) */
#define MCFSIM_CSAR6 0xc8 /* CS 6 Adress reg (r/w) */
#define MCFSIM_CSMR6 0xcc /* CS 6 Mask reg (r/w) */
#define MCFSIM_CSCR6 0xd2 /* CS 6 Control reg (r/w) */
#define MCFSIM_CSAR7 0xd4 /* CS 7 Adress reg (r/w) */
#define MCFSIM_CSMR7 0xd8 /* CS 7 Mask reg (r/w) */
#define MCFSIM_CSCR7 0xde /* CS 7 Control reg (r/w) */
#define MCFSIM_DCR 0x100 /* DRAM Control reg (r/w) */
#define MCFSIM_DACR0 0x108 /* DRAM 0 Addr and Ctrl (r/w) */
#define MCFSIM_DMR0 0x10c /* DRAM 0 Mask reg (r/w) */
#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
#define MCFSIM_PADDR 0x244 /* Parallel Direction (r/w) */
#define MCFSIM_PADAT 0x248 /* Parallel Data (r/w) */
/*
* Some symbol defines for the above...
*/
#define MCFSIM_SWDICR MCFSIM_ICR0 /* Watchdog timer ICR */
#define MCFSIM_TIMER1ICR MCFSIM_ICR1 /* Timer 1 ICR */
#define MCFSIM_TIMER2ICR MCFSIM_ICR2 /* Timer 2 ICR */
#define MCFSIM_UART1ICR MCFSIM_ICR4 /* UART 1 ICR */
#define MCFSIM_UART2ICR MCFSIM_ICR5 /* UART 2 ICR */
#define MCFSIM_DMA0ICR MCFSIM_ICR6 /* DMA 0 ICR */
#define MCFSIM_DMA1ICR MCFSIM_ICR7 /* DMA 1 ICR */
#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */
#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
/*
* Macro to set IMR register. It is 32 bits on the 5407.
*/
#define mcf_getimr() \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
#define mcf_setimr(imr) \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
#define mcf_getipr() \
*((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
/*
* Some symbol defines for the Parallel Port Pin Assignment Register
*/
#define MCFSIM_PAR_DREQ0 0x40 /* Set to select DREQ0 input */
/* Clear to select par I/O */
#define MCFSIM_PAR_DREQ1 0x20 /* Select DREQ1 input */
/* Clear to select par I/O */
/*
* Defines for the IRQPAR Register
*/
#define IRQ5_LEVEL4 0x80
#define IRQ3_LEVEL6 0x40
#define IRQ1_LEVEL2 0x20
/*
* Define the Cache register flags.
*/
#define CACR_DEC 0x80000000 /* Enable data cache */
#define CACR_DWP 0x40000000 /* Data write protection */
#define CACR_DESB 0x20000000 /* Enable data store buffer */
#define CACR_DDPI 0x10000000 /* Disable CPUSHL */
#define CACR_DHCLK 0x08000000 /* Half data cache lock mode */
#define CACR_DDCM_WT 0x00000000 /* Write through cache*/
#define CACR_DDCM_CP 0x02000000 /* Copyback cache */
#define CACR_DDCM_P 0x04000000 /* No cache, precise */
#define CACR_DDCM_IMP 0x06000000 /* No cache, imprecise */
#define CACR_DCINVA 0x01000000 /* Invalidate data cache */
#define CACR_BEC 0x00080000 /* Enable branch cache */
#define CACR_BCINVA 0x00040000 /* Invalidate branch cache */
#define CACR_IEC 0x00008000 /* Enable instruction cache */
#define CACR_DNFB 0x00002000 /* Inhibited fill buffer */
#define CACR_IDPI 0x00001000 /* Disable CPUSHL */
#define CACR_IHLCK 0x00000800 /* Intruction cache half lock */
#define CACR_IDCM 0x00000400 /* Intruction cache inhibit */
#define CACR_ICINVA 0x00000100 /* Invalidate instr cache */
#define ACR_BASE_POS 24 /* Address Base */
#define ACR_MASK_POS 16 /* Address Mask */
#define ACR_ENABLE 0x00008000 /* Enable address */
#define ACR_USER 0x00000000 /* User mode access only */
#define ACR_SUPER 0x00002000 /* Supervisor mode only */
#define ACR_ANY 0x00004000 /* Match any access mode */
#define ACR_CM_WT 0x00000000 /* Write through mode */
#define ACR_CM_CP 0x00000020 /* Copyback mode */
#define ACR_CM_OFF_PRE 0x00000040 /* No cache, precise */
#define ACR_CM_OFF_IMP 0x00000060 /* No cache, imprecise */
#define ACR_WPROTECT 0x00000004 /* Write protect */
/****************************************************************************/
#endif /* m5407sim_h */

View file

@ -0,0 +1,5 @@
#include "m68360_regs.h"
#include "m68360_pram.h"
#include "m68360_quicc.h"
#include "m68360_enet.h"

View file

@ -0,0 +1,177 @@
/***********************************
* $Id: m68360_enet.h,v 1.1 2002/03/02 15:01:07 gerg Exp $
***********************************
*
***************************************
* Definitions for the ETHERNET controllers
***************************************
*/
#ifndef __ETHER_H
#define __ETHER_H
#include "quicc_simple.h"
/*
* transmit BD's
*/
#define T_R 0x8000 /* ready bit */
#define E_T_PAD 0x4000 /* short frame padding */
#define T_W 0x2000 /* wrap bit */
#define T_I 0x1000 /* interrupt on completion */
#define T_L 0x0800 /* last in frame */
#define T_TC 0x0400 /* transmit CRC (when last) */
#define T_DEF 0x0200 /* defer indication */
#define T_HB 0x0100 /* heartbeat */
#define T_LC 0x0080 /* error: late collision */
#define T_RL 0x0040 /* error: retransmission limit */
#define T_RC 0x003c /* retry count */
#define T_UN 0x0002 /* error: underrun */
#define T_CSL 0x0001 /* carier sense lost */
#define T_ERROR (T_HB | T_LC | T_RL | T_UN | T_CSL)
/*
* receive BD's
*/
#define R_E 0x8000 /* buffer empty */
#define R_W 0x2000 /* wrap bit */
#define R_I 0x1000 /* interrupt on reception */
#define R_L 0x0800 /* last BD in frame */
#define R_F 0x0400 /* first BD in frame */
#define R_M 0x0100 /* received because of promisc. mode */
#define R_LG 0x0020 /* frame too long */
#define R_NO 0x0010 /* non-octet aligned */
#define R_SH 0x0008 /* short frame */
#define R_CR 0x0004 /* receive CRC error */
#define R_OV 0x0002 /* receive overrun */
#define R_CL 0x0001 /* collision */
#define ETHER_R_ERROR (R_LG | R_NO | R_SH | R_CR | R_OV | R_CL)
/*
* ethernet interrupts
*/
#define ETHERNET_GRA 0x0080 /* graceful stop complete */
#define ETHERNET_TXE 0x0010 /* transmit error */
#define ETHERNET_RXF 0x0008 /* receive frame */
#define ETHERNET_BSY 0x0004 /* busy condition */
#define ETHERNET_TXB 0x0002 /* transmit buffer */
#define ETHERNET_RXB 0x0001 /* receive buffer */
/*
* ethernet protocol specific mode register (PSMR)
*/
#define ETHER_HBC 0x8000 /* heartbeat checking */
#define ETHER_FC 0x4000 /* force collision */
#define ETHER_RSH 0x2000 /* receive short frames */
#define ETHER_IAM 0x1000 /* individual address mode */
#define ETHER_CRC_32 (0x2<<10) /* Enable CRC */
#define ETHER_PRO 0x0200 /* promiscuous */
#define ETHER_BRO 0x0100 /* broadcast address */
#define ETHER_SBT 0x0080 /* stop backoff timer */
#define ETHER_LPB 0x0040 /* Loop Back Mode */
#define ETHER_SIP 0x0020 /* sample input pins */
#define ETHER_LCW 0x0010 /* late collision window */
#define ETHER_NIB_13 (0x0<<1) /* # of ignored bits 13 */
#define ETHER_NIB_14 (0x1<<1) /* # of ignored bits 14 */
#define ETHER_NIB_15 (0x2<<1) /* # of ignored bits 15 */
#define ETHER_NIB_16 (0x3<<1) /* # of ignored bits 16 */
#define ETHER_NIB_21 (0x4<<1) /* # of ignored bits 21 */
#define ETHER_NIB_22 (0x5<<1) /* # of ignored bits 22 */
#define ETHER_NIB_23 (0x6<<1) /* # of ignored bits 23 */
#define ETHER_NIB_24 (0x7<<1) /* # of ignored bits 24 */
/*
* ethernet specific parameters
*/
#define CRC_WORD 4 /* Length in bytes of CRC */
#define C_PRES 0xffffffff /* preform 32 bit CRC */
#define C_MASK 0xdebb20e3 /* comply with 32 bit CRC */
#define CRCEC 0x00000000
#define ALEC 0x00000000
#define DISFC 0x00000000
#define PADS 0x00000000
#define RET_LIM 0x000f /* retry 15 times to send a frame before interrupt */
#define ETH_MFLR 0x05ee /* 1518 max frame size */
#define MINFLR 0x0040 /* Minimum frame size 64 */
#define MAXD1 0x05ee /* Max dma count 1518 */
#define MAXD2 0x05ee
#define GADDR1 0x00000000 /* Clear group address */
#define GADDR2 0x00000000
#define GADDR3 0x00000000
#define GADDR4 0x00000000
#define P_PER 0x00000000 /*not used */
#define IADDR1 0x00000000 /* Individual hash table not used */
#define IADDR2 0x00000000
#define IADDR3 0x00000000
#define IADDR4 0x00000000
#define TADDR_H 0x00000000 /* clear this regs */
#define TADDR_M 0x00000000
#define TADDR_L 0x00000000
/* SCC Parameter Ram */
#define RFCR 0x18 /* normal operation */
#define TFCR 0x18 /* normal operation */
#define E_MRBLR 1518 /* Max ethernet frame length */
/*
* ethernet specific structure
*/
typedef union {
unsigned char b[6];
struct {
unsigned short high;
unsigned short middl;
unsigned short low;
} w;
} ETHER_ADDR;
typedef struct {
int max_frame_length;
int promisc_mode;
int reject_broadcast;
ETHER_ADDR phys_adr;
} ETHER_SPECIFIC;
typedef struct {
ETHER_ADDR dst_addr;
ETHER_ADDR src_addr;
unsigned short type_or_len;
unsigned char data[1];
} ETHER_FRAME;
#define MAX_DATALEN 1500
typedef struct {
ETHER_ADDR dst_addr;
ETHER_ADDR src_addr;
unsigned short type_or_len;
unsigned char data[MAX_DATALEN];
unsigned char fcs[CRC_WORD];
} ETHER_MAX_FRAME;
/*
* Internal ethernet function prototypes
*/
void ether_interrupt(int scc_num);
/* mleslie: debug */
/* static void ethernet_rx_internal(int scc_num); */
/* static void ethernet_tx_internal(int scc_num); */
/*
* User callable routines prototypes (ethernet specific)
*/
void ethernet_init(int scc_number,
alloc_routine *alloc_buffer,
free_routine *free_buffer,
store_rx_buffer_routine *store_rx_buffer,
handle_tx_error_routine *handle_tx_error,
handle_rx_error_routine *handle_rx_error,
handle_lost_error_routine *handle_lost_error,
ETHER_SPECIFIC *ether_spec);
int ethernet_tx(int scc_number, void *buf, int length);
#endif

View file

@ -0,0 +1,431 @@
/***********************************
* $Id: m68360_pram.h,v 1.1 2002/03/02 15:01:07 gerg Exp $
***********************************
*
***************************************
* Definitions of the parameter area RAM.
* Note that different structures are overlaid
* at the same offsets for the different modes
* of operation.
***************************************
*/
#ifndef __PRAM_H
#define __PRAM_H
/* Time slot assignment table */
#define VALID_SLOT 0x8000
#define WRAP_SLOT 0x4000
/*****************************************************************
Global Multichannel parameter RAM
*****************************************************************/
struct global_multi_pram {
/*
* Global Multichannel parameter RAM
*/
unsigned long mcbase; /* Multichannel Base pointer */
unsigned short qmcstate; /* Multichannel Controller state */
unsigned short mrblr; /* Maximum Receive Buffer Length */
unsigned short tx_s_ptr; /* TSTATx Pointer */
unsigned short rxptr; /* Current Time slot entry in TSATRx */
unsigned short grfthr; /* Global Receive frame threshold */
unsigned short grfcnt; /* Global Receive Frame Count */
unsigned long intbase; /* Multichannel Base address */
unsigned long iintptr; /* Pointer to interrupt queue */
unsigned short rx_s_ptr; /* TSTARx Pointer */
unsigned short txptr; /* Current Time slot entry in TSATTx */
unsigned long c_mask32; /* CRC Constant (debb20e3) */
unsigned short tsatrx[32]; /* Time Slot Assignment Table Rx */
unsigned short tsattx[32]; /* Time Slot Assignment Table Tx */
unsigned short c_mask16; /* CRC Constant (f0b8) */
};
/*****************************************************************
Quicc32 HDLC parameter RAM
*****************************************************************/
struct quicc32_pram {
unsigned short tbase; /* Tx Buffer Descriptors Base Address */
unsigned short chamr; /* Channel Mode Register */
unsigned long tstate; /* Tx Internal State */
unsigned long txintr; /* Tx Internal Data Pointer */
unsigned short tbptr; /* Tx Buffer Descriptor Pointer */
unsigned short txcntr; /* Tx Internal Byte Count */
unsigned long tupack; /* (Tx Temp) */
unsigned long zistate; /* Zero Insertion machine state */
unsigned long tcrc; /* Temp Transmit CRC */
unsigned short intmask; /* Channel's interrupt mask flags */
unsigned short bdflags;
unsigned short rbase; /* Rx Buffer Descriptors Base Address */
unsigned short mflr; /* Max Frame Length Register */
unsigned long rstate; /* Rx Internal State */
unsigned long rxintr; /* Rx Internal Data Pointer */
unsigned short rbptr; /* Rx Buffer Descriptor Pointer */
unsigned short rxbyc; /* Rx Internal Byte Count */
unsigned long rpack; /* (Rx Temp) */
unsigned long zdstate; /* Zero Deletion machine state */
unsigned long rcrc; /* Temp Transmit CRC */
unsigned short maxc; /* Max_length counter */
unsigned short tmp_mb; /* Temp */
};
/*****************************************************************
HDLC parameter RAM
*****************************************************************/
struct hdlc_pram {
/*
* SCC parameter RAM
*/
unsigned short rbase; /* RX BD base address */
unsigned short tbase; /* TX BD base address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rtemp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
unsigned long rcrc; /* temp receive CRC */
unsigned long tcrc; /* temp transmit CRC */
/*
* HDLC specific parameter RAM
*/
unsigned char RESERVED1[4]; /* Reserved area */
unsigned long c_mask; /* CRC constant */
unsigned long c_pres; /* CRC preset */
unsigned short disfc; /* discarded frame counter */
unsigned short crcec; /* CRC error counter */
unsigned short abtsc; /* abort sequence counter */
unsigned short nmarc; /* nonmatching address rx cnt */
unsigned short retrc; /* frame retransmission cnt */
unsigned short mflr; /* maximum frame length reg */
unsigned short max_cnt; /* maximum length counter */
unsigned short rfthr; /* received frames threshold */
unsigned short rfcnt; /* received frames count */
unsigned short hmask; /* user defined frm addr mask */
unsigned short haddr1; /* user defined frm address 1 */
unsigned short haddr2; /* user defined frm address 2 */
unsigned short haddr3; /* user defined frm address 3 */
unsigned short haddr4; /* user defined frm address 4 */
unsigned short tmp; /* temp */
unsigned short tmp_mb; /* temp */
};
/*****************************************************************
UART parameter RAM
*****************************************************************/
/*
* bits in uart control characters table
*/
#define CC_INVALID 0x8000 /* control character is valid */
#define CC_REJ 0x4000 /* don't store char in buffer */
#define CC_CHAR 0x00ff /* control character */
/* UART */
struct uart_pram {
/*
* SCC parameter RAM
*/
unsigned short rbase; /* RX BD base address */
unsigned short tbase; /* TX BD base address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rx_temp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
unsigned long rcrc; /* temp receive CRC */
unsigned long tcrc; /* temp transmit CRC */
/*
* UART specific parameter RAM
*/
unsigned char RESERVED1[8]; /* Reserved area */
unsigned short max_idl; /* maximum idle characters */
unsigned short idlc; /* rx idle counter (internal) */
unsigned short brkcr; /* break count register */
unsigned short parec; /* Rx parity error counter */
unsigned short frmer; /* Rx framing error counter */
unsigned short nosec; /* Rx noise counter */
unsigned short brkec; /* Rx break character counter */
unsigned short brkln; /* Reaceive break length */
unsigned short uaddr1; /* address character 1 */
unsigned short uaddr2; /* address character 2 */
unsigned short rtemp; /* temp storage */
unsigned short toseq; /* Tx out of sequence char */
unsigned short cc[8]; /* Rx control characters */
unsigned short rccm; /* Rx control char mask */
unsigned short rccr; /* Rx control char register */
unsigned short rlbc; /* Receive last break char */
};
/*****************************************************************
BISYNC parameter RAM
*****************************************************************/
struct bisync_pram {
/*
* SCC parameter RAM
*/
unsigned short rbase; /* RX BD base address */
unsigned short tbase; /* TX BD base address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rtemp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
unsigned long rcrc; /* temp receive CRC */
unsigned long tcrc; /* temp transmit CRC */
/*
* BISYNC specific parameter RAM
*/
unsigned char RESERVED1[4]; /* Reserved area */
unsigned long crcc; /* CRC Constant Temp Value */
unsigned short prcrc; /* Preset Receiver CRC-16/LRC */
unsigned short ptcrc; /* Preset Transmitter CRC-16/LRC */
unsigned short parec; /* Receive Parity Error Counter */
unsigned short bsync; /* BISYNC SYNC Character */
unsigned short bdle; /* BISYNC DLE Character */
unsigned short cc[8]; /* Rx control characters */
unsigned short rccm; /* Receive Control Character Mask */
};
/*****************************************************************
IOM2 parameter RAM
(overlaid on tx bd[5] of SCC channel[2])
*****************************************************************/
struct iom2_pram {
unsigned short ci_data; /* ci data */
unsigned short monitor_data; /* monitor data */
unsigned short tstate; /* transmitter state */
unsigned short rstate; /* receiver state */
};
/*****************************************************************
SPI/SMC parameter RAM
(overlaid on tx bd[6,7] of SCC channel[2])
*****************************************************************/
#define SPI_R 0x8000 /* Ready bit in BD */
struct spi_pram {
unsigned short rbase; /* Rx BD Base Address */
unsigned short tbase; /* Tx BD Base Address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rtemp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
};
struct smc_uart_pram {
unsigned short rbase; /* Rx BD Base Address */
unsigned short tbase; /* Tx BD Base Address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rtemp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
unsigned short max_idl; /* Maximum IDLE Characters */
unsigned short idlc; /* Temporary IDLE Counter */
unsigned short brkln; /* Last Rx Break Length */
unsigned short brkec; /* Rx Break Condition Counter */
unsigned short brkcr; /* Break Count Register (Tx) */
unsigned short r_mask; /* Temporary bit mask */
};
struct smc_trnsp_pram {
unsigned short rbase; /* rx BD Base Address */
unsigned short tbase; /* Tx BD Base Address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rtemp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
unsigned short reserved[5]; /* Reserved */
};
struct idma_pram {
unsigned short ibase; /* IDMA BD Base Address */
unsigned short ibptr; /* IDMA buffer descriptor pointer */
unsigned long istate; /* IDMA internal state */
unsigned long itemp; /* IDMA temp */
};
struct ethernet_pram {
/*
* SCC parameter RAM
*/
unsigned short rbase; /* RX BD base address */
unsigned short tbase; /* TX BD base address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rtemp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
unsigned long rcrc; /* temp receive CRC */
unsigned long tcrc; /* temp transmit CRC */
/*
* ETHERNET specific parameter RAM
*/
unsigned long c_pres; /* preset CRC */
unsigned long c_mask; /* constant mask for CRC */
unsigned long crcec; /* CRC error counter */
unsigned long alec; /* alighnment error counter */
unsigned long disfc; /* discard frame counter */
unsigned short pads; /* short frame PAD characters */
unsigned short ret_lim; /* retry limit threshold */
unsigned short ret_cnt; /* retry limit counter */
unsigned short mflr; /* maximum frame length reg */
unsigned short minflr; /* minimum frame length reg */
unsigned short maxd1; /* maximum DMA1 length reg */
unsigned short maxd2; /* maximum DMA2 length reg */
unsigned short maxd; /* rx max DMA */
unsigned short dma_cnt; /* rx dma counter */
unsigned short max_b; /* max bd byte count */
unsigned short gaddr1; /* group address filter 1 */
unsigned short gaddr2; /* group address filter 2 */
unsigned short gaddr3; /* group address filter 3 */
unsigned short gaddr4; /* group address filter 4 */
unsigned long tbuf0_data0; /* save area 0 - current frm */
unsigned long tbuf0_data1; /* save area 1 - current frm */
unsigned long tbuf0_rba0;
unsigned long tbuf0_crc;
unsigned short tbuf0_bcnt;
union {
unsigned char b[6];
struct {
unsigned short high;
unsigned short middl;
unsigned short low;
} w;
} paddr;
unsigned short p_per; /* persistence */
unsigned short rfbd_ptr; /* rx first bd pointer */
unsigned short tfbd_ptr; /* tx first bd pointer */
unsigned short tlbd_ptr; /* tx last bd pointer */
unsigned long tbuf1_data0; /* save area 0 - next frame */
unsigned long tbuf1_data1; /* save area 1 - next frame */
unsigned long tbuf1_rba0;
unsigned long tbuf1_crc;
unsigned short tbuf1_bcnt;
unsigned short tx_len; /* tx frame length counter */
unsigned short iaddr1; /* individual address filter 1*/
unsigned short iaddr2; /* individual address filter 2*/
unsigned short iaddr3; /* individual address filter 3*/
unsigned short iaddr4; /* individual address filter 4*/
unsigned short boff_cnt; /* back-off counter */
unsigned short taddr_h; /* temp address (MSB) */
unsigned short taddr_m; /* temp address */
unsigned short taddr_l; /* temp address (LSB) */
};
struct transparent_pram {
/*
* SCC parameter RAM
*/
unsigned short rbase; /* RX BD base address */
unsigned short tbase; /* TX BD base address */
unsigned char rfcr; /* Rx function code */
unsigned char tfcr; /* Tx function code */
unsigned short mrblr; /* Rx buffer length */
unsigned long rstate; /* Rx internal state */
unsigned long rptr; /* Rx internal data pointer */
unsigned short rbptr; /* rb BD Pointer */
unsigned short rcount; /* Rx internal byte count */
unsigned long rtemp; /* Rx temp */
unsigned long tstate; /* Tx internal state */
unsigned long tptr; /* Tx internal data pointer */
unsigned short tbptr; /* Tx BD pointer */
unsigned short tcount; /* Tx byte count */
unsigned long ttemp; /* Tx temp */
unsigned long rcrc; /* temp receive CRC */
unsigned long tcrc; /* temp transmit CRC */
/*
* TRANSPARENT specific parameter RAM
*/
unsigned long crc_p; /* CRC Preset */
unsigned long crc_c; /* CRC constant */
};
struct timer_pram {
/*
* RISC timers parameter RAM
*/
unsigned short tm_base; /* RISC timer table base adr */
unsigned short tm_ptr; /* RISC timer table pointer */
unsigned short r_tmr; /* RISC timer mode register */
unsigned short r_tmv; /* RISC timer valid register */
unsigned long tm_cmd; /* RISC timer cmd register */
unsigned long tm_cnt; /* RISC timer internal cnt */
};
#endif

View file

@ -0,0 +1,362 @@
/***********************************
* $Id: m68360_quicc.h,v 1.1 2002/03/02 15:01:07 gerg Exp $
***********************************
*
***************************************
* Definitions of QUICC memory structures
***************************************
*/
#ifndef __M68360_QUICC_H
#define __M68360_QUICC_H
/*
* include registers and
* parameter ram definitions files
*/
#include <asm/m68360_regs.h>
#include <asm/m68360_pram.h>
/* Buffer Descriptors */
typedef struct quicc_bd {
volatile unsigned short status;
volatile unsigned short length;
volatile unsigned char *buf; /* WARNING: This is only true if *char is 32 bits */
} QUICC_BD;
#ifdef MOTOROLA_ORIGINAL
struct user_data {
/* BASE + 0x000: user data memory */
volatile unsigned char udata_bd_ucode[0x400]; /*user data bd's Ucode*/
volatile unsigned char udata_bd[0x200]; /*user data Ucode */
volatile unsigned char ucode_ext[0x100]; /*Ucode Extention ram */
volatile unsigned char RESERVED1[0x500]; /* Reserved area */
};
#else
struct user_data {
/* BASE + 0x000: user data memory */
volatile unsigned char udata_bd_ucode[0x400]; /* user data, bds, Ucode*/
volatile unsigned char udata_bd1[0x200]; /* user, bds */
volatile unsigned char ucode_bd_scratch[0x100]; /* user, bds, ucode scratch */
volatile unsigned char udata_bd2[0x100]; /* user, bds */
volatile unsigned char RESERVED1[0x400]; /* Reserved area */
};
#endif
/*
* internal ram
*/
typedef struct quicc {
union {
struct quicc32_pram ch_pram_tbl[32]; /* 32*64(bytes) per channel */
struct user_data u;
}ch_or_u; /* multipul or user space */
/* BASE + 0xc00: PARAMETER RAM */
union {
struct scc_pram {
union {
struct hdlc_pram h;
struct uart_pram u;
struct bisync_pram b;
struct transparent_pram t;
unsigned char RESERVED66[0x70];
} pscc; /* scc parameter area (protocol dependent) */
union {
struct {
unsigned char RESERVED70[0x10];
struct spi_pram spi;
unsigned char RESERVED72[0x8];
struct timer_pram timer;
} timer_spi;
struct {
struct idma_pram idma;
unsigned char RESERVED67[0x4];
union {
struct smc_uart_pram u;
struct smc_trnsp_pram t;
} psmc;
} idma_smc;
} pothers;
} scc;
struct ethernet_pram enet_scc;
struct global_multi_pram m;
unsigned char pr[0x100];
} pram[4];
/* reserved */
/* BASE + 0x1000: INTERNAL REGISTERS */
/* SIM */
volatile unsigned long sim_mcr; /* module configuration reg */
volatile unsigned short sim_simtr; /* module test register */
volatile unsigned char RESERVED2[0x2]; /* Reserved area */
volatile unsigned char sim_avr; /* auto vector reg */
volatile unsigned char sim_rsr; /* reset status reg */
volatile unsigned char RESERVED3[0x2]; /* Reserved area */
volatile unsigned char sim_clkocr; /* CLCO control register */
volatile unsigned char RESERVED62[0x3]; /* Reserved area */
volatile unsigned short sim_pllcr; /* PLL control register */
volatile unsigned char RESERVED63[0x2]; /* Reserved area */
volatile unsigned short sim_cdvcr; /* Clock devider control register */
volatile unsigned short sim_pepar; /* Port E pin assignment register */
volatile unsigned char RESERVED64[0xa]; /* Reserved area */
volatile unsigned char sim_sypcr; /* system protection control*/
volatile unsigned char sim_swiv; /* software interrupt vector*/
volatile unsigned char RESERVED6[0x2]; /* Reserved area */
volatile unsigned short sim_picr; /* periodic interrupt control reg */
volatile unsigned char RESERVED7[0x2]; /* Reserved area */
volatile unsigned short sim_pitr; /* periodic interrupt timing reg */
volatile unsigned char RESERVED8[0x3]; /* Reserved area */
volatile unsigned char sim_swsr; /* software service */
volatile unsigned long sim_bkar; /* breakpoint address register*/
volatile unsigned long sim_bkcr; /* breakpoint control register*/
volatile unsigned char RESERVED10[0x8]; /* Reserved area */
/* MEMC */
volatile unsigned long memc_gmr; /* Global memory register */
volatile unsigned short memc_mstat; /* MEMC status register */
volatile unsigned char RESERVED11[0xa]; /* Reserved area */
volatile unsigned long memc_br0; /* base register 0 */
volatile unsigned long memc_or0; /* option register 0 */
volatile unsigned char RESERVED12[0x8]; /* Reserved area */
volatile unsigned long memc_br1; /* base register 1 */
volatile unsigned long memc_or1; /* option register 1 */
volatile unsigned char RESERVED13[0x8]; /* Reserved area */
volatile unsigned long memc_br2; /* base register 2 */
volatile unsigned long memc_or2; /* option register 2 */
volatile unsigned char RESERVED14[0x8]; /* Reserved area */
volatile unsigned long memc_br3; /* base register 3 */
volatile unsigned long memc_or3; /* option register 3 */
volatile unsigned char RESERVED15[0x8]; /* Reserved area */
volatile unsigned long memc_br4; /* base register 3 */
volatile unsigned long memc_or4; /* option register 3 */
volatile unsigned char RESERVED16[0x8]; /* Reserved area */
volatile unsigned long memc_br5; /* base register 3 */
volatile unsigned long memc_or5; /* option register 3 */
volatile unsigned char RESERVED17[0x8]; /* Reserved area */
volatile unsigned long memc_br6; /* base register 3 */
volatile unsigned long memc_or6; /* option register 3 */
volatile unsigned char RESERVED18[0x8]; /* Reserved area */
volatile unsigned long memc_br7; /* base register 3 */
volatile unsigned long memc_or7; /* option register 3 */
volatile unsigned char RESERVED9[0x28]; /* Reserved area */
/* TEST */
volatile unsigned short test_tstmra; /* master shift a */
volatile unsigned short test_tstmrb; /* master shift b */
volatile unsigned short test_tstsc; /* shift count */
volatile unsigned short test_tstrc; /* repetition counter */
volatile unsigned short test_creg; /* control */
volatile unsigned short test_dreg; /* destributed register */
volatile unsigned char RESERVED58[0x404]; /* Reserved area */
/* IDMA1 */
volatile unsigned short idma_iccr; /* channel configuration reg*/
volatile unsigned char RESERVED19[0x2]; /* Reserved area */
volatile unsigned short idma1_cmr; /* dma mode reg */
volatile unsigned char RESERVED68[0x2]; /* Reserved area */
volatile unsigned long idma1_sapr; /* dma source addr ptr */
volatile unsigned long idma1_dapr; /* dma destination addr ptr */
volatile unsigned long idma1_bcr; /* dma byte count reg */
volatile unsigned char idma1_fcr; /* function code reg */
volatile unsigned char RESERVED20; /* Reserved area */
volatile unsigned char idma1_cmar; /* channel mask reg */
volatile unsigned char RESERVED21; /* Reserved area */
volatile unsigned char idma1_csr; /* channel status reg */
volatile unsigned char RESERVED22[0x3]; /* Reserved area */
/* SDMA */
volatile unsigned char sdma_sdsr; /* status reg */
volatile unsigned char RESERVED23; /* Reserved area */
volatile unsigned short sdma_sdcr; /* configuration reg */
volatile unsigned long sdma_sdar; /* address reg */
/* IDMA2 */
volatile unsigned char RESERVED69[0x2]; /* Reserved area */
volatile unsigned short idma2_cmr; /* dma mode reg */
volatile unsigned long idma2_sapr; /* dma source addr ptr */
volatile unsigned long idma2_dapr; /* dma destination addr ptr */
volatile unsigned long idma2_bcr; /* dma byte count reg */
volatile unsigned char idma2_fcr; /* function code reg */
volatile unsigned char RESERVED24; /* Reserved area */
volatile unsigned char idma2_cmar; /* channel mask reg */
volatile unsigned char RESERVED25; /* Reserved area */
volatile unsigned char idma2_csr; /* channel status reg */
volatile unsigned char RESERVED26[0x7]; /* Reserved area */
/* Interrupt Controller */
volatile unsigned long intr_cicr; /* CP interrupt configuration reg*/
volatile unsigned long intr_cipr; /* CP interrupt pending reg */
volatile unsigned long intr_cimr; /* CP interrupt mask reg */
volatile unsigned long intr_cisr; /* CP interrupt in service reg*/
/* Parallel I/O */
volatile unsigned short pio_padir; /* port A data direction reg */
volatile unsigned short pio_papar; /* port A pin assignment reg */
volatile unsigned short pio_paodr; /* port A open drain reg */
volatile unsigned short pio_padat; /* port A data register */
volatile unsigned char RESERVED28[0x8]; /* Reserved area */
volatile unsigned short pio_pcdir; /* port C data direction reg*/
volatile unsigned short pio_pcpar; /* port C pin assignment reg*/
volatile unsigned short pio_pcso; /* port C special options */
volatile unsigned short pio_pcdat; /* port C data register */
volatile unsigned short pio_pcint; /* port C interrupt cntrl reg */
volatile unsigned char RESERVED29[0x16]; /* Reserved area */
/* Timer */
volatile unsigned short timer_tgcr; /* timer global configuration reg */
volatile unsigned char RESERVED30[0xe]; /* Reserved area */
volatile unsigned short timer_tmr1; /* timer 1 mode reg */
volatile unsigned short timer_tmr2; /* timer 2 mode reg */
volatile unsigned short timer_trr1; /* timer 1 referance reg */
volatile unsigned short timer_trr2; /* timer 2 referance reg */
volatile unsigned short timer_tcr1; /* timer 1 capture reg */
volatile unsigned short timer_tcr2; /* timer 2 capture reg */
volatile unsigned short timer_tcn1; /* timer 1 counter reg */
volatile unsigned short timer_tcn2; /* timer 2 counter reg */
volatile unsigned short timer_tmr3; /* timer 3 mode reg */
volatile unsigned short timer_tmr4; /* timer 4 mode reg */
volatile unsigned short timer_trr3; /* timer 3 referance reg */
volatile unsigned short timer_trr4; /* timer 4 referance reg */
volatile unsigned short timer_tcr3; /* timer 3 capture reg */
volatile unsigned short timer_tcr4; /* timer 4 capture reg */
volatile unsigned short timer_tcn3; /* timer 3 counter reg */
volatile unsigned short timer_tcn4; /* timer 4 counter reg */
volatile unsigned short timer_ter1; /* timer 1 event reg */
volatile unsigned short timer_ter2; /* timer 2 event reg */
volatile unsigned short timer_ter3; /* timer 3 event reg */
volatile unsigned short timer_ter4; /* timer 4 event reg */
volatile unsigned char RESERVED34[0x8]; /* Reserved area */
/* CP */
volatile unsigned short cp_cr; /* command register */
volatile unsigned char RESERVED35[0x2]; /* Reserved area */
volatile unsigned short cp_rccr; /* main configuration reg */
volatile unsigned char RESERVED37; /* Reserved area */
volatile unsigned char cp_rmds; /* development support status reg */
volatile unsigned long cp_rmdr; /* development support control reg */
volatile unsigned short cp_rctr1; /* ram break register 1 */
volatile unsigned short cp_rctr2; /* ram break register 2 */
volatile unsigned short cp_rctr3; /* ram break register 3 */
volatile unsigned short cp_rctr4; /* ram break register 4 */
volatile unsigned char RESERVED59[0x2]; /* Reserved area */
volatile unsigned short cp_rter; /* RISC timers event reg */
volatile unsigned char RESERVED38[0x2]; /* Reserved area */
volatile unsigned short cp_rtmr; /* RISC timers mask reg */
volatile unsigned char RESERVED39[0x14]; /* Reserved area */
/* BRG */
union {
volatile unsigned long l;
struct {
volatile unsigned short BRGC_RESERV:14;
volatile unsigned short rst:1;
volatile unsigned short en:1;
volatile unsigned short extc:2;
volatile unsigned short atb:1;
volatile unsigned short cd:12;
volatile unsigned short div16:1;
} b;
} brgc[4]; /* BRG1-BRG4 configuration regs*/
/* SCC registers */
struct scc_regs {
union {
struct {
/* Low word. */
volatile unsigned short GSMR_RESERV2:1;
volatile unsigned short edge:2;
volatile unsigned short tci:1;
volatile unsigned short tsnc:2;
volatile unsigned short rinv:1;
volatile unsigned short tinv:1;
volatile unsigned short tpl:3;
volatile unsigned short tpp:2;
volatile unsigned short tend:1;
volatile unsigned short tdcr:2;
volatile unsigned short rdcr:2;
volatile unsigned short renc:3;
volatile unsigned short tenc:3;
volatile unsigned short diag:2;
volatile unsigned short enr:1;
volatile unsigned short ent:1;
volatile unsigned short mode:4;
/* High word. */
volatile unsigned short GSMR_RESERV1:14;
volatile unsigned short pri:1;
volatile unsigned short gde:1;
volatile unsigned short tcrc:2;
volatile unsigned short revd:1;
volatile unsigned short trx:1;
volatile unsigned short ttx:1;
volatile unsigned short cdp:1;
volatile unsigned short ctsp:1;
volatile unsigned short cds:1;
volatile unsigned short ctss:1;
volatile unsigned short tfl:1;
volatile unsigned short rfw:1;
volatile unsigned short txsy:1;
volatile unsigned short synl:2;
volatile unsigned short rtsm:1;
volatile unsigned short rsyn:1;
} b;
struct {
volatile unsigned long low;
volatile unsigned long high;
} w;
} scc_gsmr; /* SCC general mode reg */
volatile unsigned short scc_psmr; /* protocol specific mode reg */
volatile unsigned char RESERVED42[0x2]; /* Reserved area */
volatile unsigned short scc_todr; /* SCC transmit on demand */
volatile unsigned short scc_dsr; /* SCC data sync reg */
volatile unsigned short scc_scce; /* SCC event reg */
volatile unsigned char RESERVED43[0x2];/* Reserved area */
volatile unsigned short scc_sccm; /* SCC mask reg */
volatile unsigned char RESERVED44[0x1];/* Reserved area */
volatile unsigned char scc_sccs; /* SCC status reg */
volatile unsigned char RESERVED45[0x8]; /* Reserved area */
} scc_regs[4];
/* SMC */
struct smc_regs {
volatile unsigned char RESERVED46[0x2]; /* Reserved area */
volatile unsigned short smc_smcmr; /* SMC mode reg */
volatile unsigned char RESERVED60[0x2]; /* Reserved area */
volatile unsigned char smc_smce; /* SMC event reg */
volatile unsigned char RESERVED47[0x3]; /* Reserved area */
volatile unsigned char smc_smcm; /* SMC mask reg */
volatile unsigned char RESERVED48[0x5]; /* Reserved area */
} smc_regs[2];
/* SPI */
volatile unsigned short spi_spmode; /* SPI mode reg */
volatile unsigned char RESERVED51[0x4]; /* Reserved area */
volatile unsigned char spi_spie; /* SPI event reg */
volatile unsigned char RESERVED52[0x3]; /* Reserved area */
volatile unsigned char spi_spim; /* SPI mask reg */
volatile unsigned char RESERVED53[0x2]; /* Reserved area */
volatile unsigned char spi_spcom; /* SPI command reg */
volatile unsigned char RESERVED54[0x4]; /* Reserved area */
/* PIP */
volatile unsigned short pip_pipc; /* pip configuration reg */
volatile unsigned char RESERVED65[0x2]; /* Reserved area */
volatile unsigned short pip_ptpr; /* pip timing parameters reg */
volatile unsigned long pip_pbdir; /* port b data direction reg */
volatile unsigned long pip_pbpar; /* port b pin assignment reg */
volatile unsigned long pip_pbodr; /* port b open drain reg */
volatile unsigned long pip_pbdat; /* port b data reg */
volatile unsigned char RESERVED71[0x18]; /* Reserved area */
/* Serial Interface */
volatile unsigned long si_simode; /* SI mode register */
volatile unsigned char si_sigmr; /* SI global mode register */
volatile unsigned char RESERVED55; /* Reserved area */
volatile unsigned char si_sistr; /* SI status register */
volatile unsigned char si_sicmr; /* SI command register */
volatile unsigned char RESERVED56[0x4]; /* Reserved area */
volatile unsigned long si_sicr; /* SI clock routing */
volatile unsigned long si_sirp; /* SI ram pointers */
volatile unsigned char RESERVED57[0xc]; /* Reserved area */
volatile unsigned short si_siram[0x80]; /* SI routing ram */
} QUICC;
#endif
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/

View file

@ -0,0 +1,408 @@
/***********************************
* $Id: m68360_regs.h,v 1.2 2002/10/26 15:03:55 gerg Exp $
***********************************
*
***************************************
* Definitions of the QUICC registers
***************************************
*/
#ifndef __REGISTERS_H
#define __REGISTERS_H
#define CLEAR_BIT(x, bit) x =bit
/*****************************************************************
Command Register
*****************************************************************/
/* bit fields within command register */
#define SOFTWARE_RESET 0x8000
#define CMD_OPCODE 0x0f00
#define CMD_CHANNEL 0x00f0
#define CMD_FLAG 0x0001
/* general command opcodes */
#define INIT_RXTX_PARAMS 0x0000
#define INIT_RX_PARAMS 0x0100
#define INIT_TX_PARAMS 0x0200
#define ENTER_HUNT_MODE 0x0300
#define STOP_TX 0x0400
#define GR_STOP_TX 0x0500
#define RESTART_TX 0x0600
#define CLOSE_RX_BD 0x0700
#define SET_ENET_GROUP 0x0800
#define RESET_ENET_GROUP 0x0900
/* quicc32 CP commands */
#define STOP_TX_32 0x0e00 /*add chan# bits 2-6 */
#define ENTER_HUNT_MODE_32 0x1e00
/* quicc32 mask/event SCC register */
#define GOV 0x01
#define GUN 0x02
#define GINT 0x04
#define IQOV 0x08
/* Timer commands */
#define SET_TIMER 0x0800
/* Multi channel Interrupt structure */
#define INTR_VALID 0x8000 /* Valid interrupt entry */
#define INTR_WRAP 0x4000 /* Wrap bit in the interrupt entry table */
#define INTR_CH_NU 0x07c0 /* Channel Num in interrupt table */
#define INTR_MASK_BITS 0x383f
/*
* General SCC mode register (GSMR)
*/
#define MODE_HDLC 0x0
#define MODE_APPLE_TALK 0x2
#define MODE_SS7 0x3
#define MODE_UART 0x4
#define MODE_PROFIBUS 0x5
#define MODE_ASYNC_HDLC 0x6
#define MODE_V14 0x7
#define MODE_BISYNC 0x8
#define MODE_DDCMP 0x9
#define MODE_MULTI_CHANNEL 0xa
#define MODE_ETHERNET 0xc
#define DIAG_NORMAL 0x0
#define DIAG_LOCAL_LPB 0x1
#define DIAG_AUTO_ECHO 0x2
#define DIAG_LBP_ECHO 0x3
/* For RENC and TENC fields in GSMR */
#define ENC_NRZ 0x0
#define ENC_NRZI 0x1
#define ENC_FM0 0x2
#define ENC_MANCH 0x4
#define ENC_DIFF_MANC 0x6
/* For TDCR and RDCR fields in GSMR */
#define CLOCK_RATE_1 0x0
#define CLOCK_RATE_8 0x1
#define CLOCK_RATE_16 0x2
#define CLOCK_RATE_32 0x3
#define TPP_00 0x0
#define TPP_10 0x1
#define TPP_01 0x2
#define TPP_11 0x3
#define TPL_NO 0x0
#define TPL_8 0x1
#define TPL_16 0x2
#define TPL_32 0x3
#define TPL_48 0x4
#define TPL_64 0x5
#define TPL_128 0x6
#define TSNC_INFINITE 0x0
#define TSNC_14_65 0x1
#define TSNC_4_15 0x2
#define TSNC_3_1 0x3
#define EDGE_BOTH 0x0
#define EDGE_POS 0x1
#define EDGE_NEG 0x2
#define EDGE_NO 0x3
#define SYNL_NO 0x0
#define SYNL_4 0x1
#define SYNL_8 0x2
#define SYNL_16 0x3
#define TCRC_CCITT16 0x0
#define TCRC_CRC16 0x1
#define TCRC_CCITT32 0x2
/*****************************************************************
TODR (Transmit on demand) Register
*****************************************************************/
#define TODR_TOD 0x8000 /* Transmit on demand */
/*****************************************************************
CICR register settings
*****************************************************************/
/* note that relative irq priorities of the SCCs can be reordered
* if desired - see p. 7-377 of the MC68360UM */
#define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
#define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
#define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
#define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
#define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
#define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
#define CICR_VBA_MASK ((uint)0x000000e0) /* Vector Base Address */
#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
/*****************************************************************
Interrupt bits for CIPR and CIMR (MC68360UM p. 7-379)
*****************************************************************/
#define INTR_PIO_PC0 0x80000000 /* parallel I/O C bit 0 */
#define INTR_SCC1 0x40000000 /* SCC port 1 */
#define INTR_SCC2 0x20000000 /* SCC port 2 */
#define INTR_SCC3 0x10000000 /* SCC port 3 */
#define INTR_SCC4 0x08000000 /* SCC port 4 */
#define INTR_PIO_PC1 0x04000000 /* parallel i/o C bit 1 */
#define INTR_TIMER1 0x02000000 /* timer 1 */
#define INTR_PIO_PC2 0x01000000 /* parallel i/o C bit 2 */
#define INTR_PIO_PC3 0x00800000 /* parallel i/o C bit 3 */
#define INTR_SDMA_BERR 0x00400000 /* SDMA channel bus error */
#define INTR_DMA1 0x00200000 /* idma 1 */
#define INTR_DMA2 0x00100000 /* idma 2 */
#define INTR_TIMER2 0x00040000 /* timer 2 */
#define INTR_CP_TIMER 0x00020000 /* CP timer */
#define INTR_PIP_STATUS 0x00010000 /* PIP status */
#define INTR_PIO_PC4 0x00008000 /* parallel i/o C bit 4 */
#define INTR_PIO_PC5 0x00004000 /* parallel i/o C bit 5 */
#define INTR_TIMER3 0x00001000 /* timer 3 */
#define INTR_PIO_PC6 0x00000800 /* parallel i/o C bit 6 */
#define INTR_PIO_PC7 0x00000400 /* parallel i/o C bit 7 */
#define INTR_PIO_PC8 0x00000200 /* parallel i/o C bit 8 */
#define INTR_TIMER4 0x00000080 /* timer 4 */
#define INTR_PIO_PC9 0x00000040 /* parallel i/o C bit 9 */
#define INTR_SCP 0x00000020 /* SCP */
#define INTR_SMC1 0x00000010 /* SMC 1 */
#define INTR_SMC2 0x00000008 /* SMC 2 */
#define INTR_PIO_PC10 0x00000004 /* parallel i/o C bit 10 */
#define INTR_PIO_PC11 0x00000002 /* parallel i/o C bit 11 */
#define INTR_ERR 0x00000001 /* error */
/*****************************************************************
CPM Interrupt vector encodings (MC68360UM p. 7-376)
*****************************************************************/
#define CPMVEC_NR 32
#define CPMVEC_PIO_PC0 0x1f
#define CPMVEC_SCC1 0x1e
#define CPMVEC_SCC2 0x1d
#define CPMVEC_SCC3 0x1c
#define CPMVEC_SCC4 0x1b
#define CPMVEC_PIO_PC1 0x1a
#define CPMVEC_TIMER1 0x19
#define CPMVEC_PIO_PC2 0x18
#define CPMVEC_PIO_PC3 0x17
#define CPMVEC_SDMA_CB_ERR 0x16
#define CPMVEC_IDMA1 0x15
#define CPMVEC_IDMA2 0x14
#define CPMVEC_RESERVED3 0x13
#define CPMVEC_TIMER2 0x12
#define CPMVEC_RISCTIMER 0x11
#define CPMVEC_RESERVED2 0x10
#define CPMVEC_PIO_PC4 0x0f
#define CPMVEC_PIO_PC5 0x0e
#define CPMVEC_TIMER3 0x0c
#define CPMVEC_PIO_PC6 0x0b
#define CPMVEC_PIO_PC7 0x0a
#define CPMVEC_PIO_PC8 0x09
#define CPMVEC_RESERVED1 0x08
#define CPMVEC_TIMER4 0x07
#define CPMVEC_PIO_PC9 0x06
#define CPMVEC_SPI 0x05
#define CPMVEC_SMC1 0x04
#define CPMVEC_SMC2 0x03
#define CPMVEC_PIO_PC10 0x02
#define CPMVEC_PIO_PC11 0x01
#define CPMVEC_ERROR 0x00
/* #define CPMVEC_PIO_PC0 ((ushort)0x1f) */
/* #define CPMVEC_SCC1 ((ushort)0x1e) */
/* #define CPMVEC_SCC2 ((ushort)0x1d) */
/* #define CPMVEC_SCC3 ((ushort)0x1c) */
/* #define CPMVEC_SCC4 ((ushort)0x1b) */
/* #define CPMVEC_PIO_PC1 ((ushort)0x1a) */
/* #define CPMVEC_TIMER1 ((ushort)0x19) */
/* #define CPMVEC_PIO_PC2 ((ushort)0x18) */
/* #define CPMVEC_PIO_PC3 ((ushort)0x17) */
/* #define CPMVEC_SDMA_CB_ERR ((ushort)0x16) */
/* #define CPMVEC_IDMA1 ((ushort)0x15) */
/* #define CPMVEC_IDMA2 ((ushort)0x14) */
/* #define CPMVEC_RESERVED3 ((ushort)0x13) */
/* #define CPMVEC_TIMER2 ((ushort)0x12) */
/* #define CPMVEC_RISCTIMER ((ushort)0x11) */
/* #define CPMVEC_RESERVED2 ((ushort)0x10) */
/* #define CPMVEC_PIO_PC4 ((ushort)0x0f) */
/* #define CPMVEC_PIO_PC5 ((ushort)0x0e) */
/* #define CPMVEC_TIMER3 ((ushort)0x0c) */
/* #define CPMVEC_PIO_PC6 ((ushort)0x0b) */
/* #define CPMVEC_PIO_PC7 ((ushort)0x0a) */
/* #define CPMVEC_PIO_PC8 ((ushort)0x09) */
/* #define CPMVEC_RESERVED1 ((ushort)0x08) */
/* #define CPMVEC_TIMER4 ((ushort)0x07) */
/* #define CPMVEC_PIO_PC9 ((ushort)0x06) */
/* #define CPMVEC_SPI ((ushort)0x05) */
/* #define CPMVEC_SMC1 ((ushort)0x04) */
/* #define CPMVEC_SMC2 ((ushort)0x03) */
/* #define CPMVEC_PIO_PC10 ((ushort)0x02) */
/* #define CPMVEC_PIO_PC11 ((ushort)0x01) */
/* #define CPMVEC_ERROR ((ushort)0x00) */
/*****************************************************************
* PIO control registers
*****************************************************************/
/* Port A - See 360UM p. 7-358
*
* Note that most of these pins have alternate functions
*/
/* The macros are nice, but there are all sorts of references to 1-indexed
* facilities on the 68360... */
/* #define PA_RXD(n) ((ushort)(0x01<<(2*n))) */
/* #define PA_TXD(n) ((ushort)(0x02<<(2*n))) */
#define PA_RXD1 ((ushort)0x0001)
#define PA_TXD1 ((ushort)0x0002)
#define PA_RXD2 ((ushort)0x0004)
#define PA_TXD2 ((ushort)0x0008)
#define PA_RXD3 ((ushort)0x0010)
#define PA_TXD3 ((ushort)0x0020)
#define PA_RXD4 ((ushort)0x0040)
#define PA_TXD4 ((ushort)0x0080)
#define PA_CLK1 ((ushort)0x0100)
#define PA_CLK2 ((ushort)0x0200)
#define PA_CLK3 ((ushort)0x0400)
#define PA_CLK4 ((ushort)0x0800)
#define PA_CLK5 ((ushort)0x1000)
#define PA_CLK6 ((ushort)0x2000)
#define PA_CLK7 ((ushort)0x4000)
#define PA_CLK8 ((ushort)0x8000)
/* Port B - See 360UM p. 7-362
*/
/* Port C - See 360UM p. 7-365
*/
#define PC_RTS1 ((ushort)0x0001)
#define PC_RTS2 ((ushort)0x0002)
#define PC__RTS3 ((ushort)0x0004) /* !RTS3 */
#define PC__RTS4 ((ushort)0x0008) /* !RTS4 */
#define PC_CTS1 ((ushort)0x0010)
#define PC_CD1 ((ushort)0x0020)
#define PC_CTS2 ((ushort)0x0040)
#define PC_CD2 ((ushort)0x0080)
#define PC_CTS3 ((ushort)0x0100)
#define PC_CD3 ((ushort)0x0200)
#define PC_CTS4 ((ushort)0x0400)
#define PC_CD4 ((ushort)0x0800)
/*****************************************************************
chip select option register
*****************************************************************/
#define DTACK 0xe000
#define ADR_MASK 0x1ffc
#define RDWR_MASK 0x0002
#define FC_MASK 0x0001
/*****************************************************************
tbase and rbase registers
*****************************************************************/
#define TBD_ADDR(quicc,pram) ((struct quicc_bd *) \
(quicc->ch_or_u.u.udata_bd_ucode + pram->tbase))
#define RBD_ADDR(quicc,pram) ((struct quicc_bd *) \
(quicc->ch_or_u.u.udata_bd_ucode + pram->rbase))
#define TBD_CUR_ADDR(quicc,pram) ((struct quicc_bd *) \
(quicc->ch_or_u.u.udata_bd_ucode + pram->tbptr))
#define RBD_CUR_ADDR(quicc,pram) ((struct quicc_bd *) \
(quicc->ch_or_u.u.udata_bd_ucode + pram->rbptr))
#define TBD_SET_CUR_ADDR(bd,quicc,pram) pram->tbptr = \
((unsigned short)((char *)(bd) - (char *)(quicc->ch_or_u.u.udata_bd_ucode)))
#define RBD_SET_CUR_ADDR(bd,quicc,pram) pram->rbptr = \
((unsigned short)((char *)(bd) - (char *)(quicc->ch_or_u.u.udata_bd_ucode)))
#define INCREASE_TBD(bd,quicc,pram) { \
if((bd)->status & T_W) \
(bd) = TBD_ADDR(quicc,pram); \
else \
(bd)++; \
}
#define DECREASE_TBD(bd,quicc,pram) { \
if ((bd) == TBD_ADDR(quicc, pram)) \
while (!((bd)->status & T_W)) \
(bd)++; \
else \
(bd)--; \
}
#define INCREASE_RBD(bd,quicc,pram) { \
if((bd)->status & R_W) \
(bd) = RBD_ADDR(quicc,pram); \
else \
(bd)++; \
}
#define DECREASE_RBD(bd,quicc,pram) { \
if ((bd) == RBD_ADDR(quicc, pram)) \
while (!((bd)->status & T_W)) \
(bd)++; \
else \
(bd)--; \
}
/*****************************************************************
Macros for Multi channel
*****************************************************************/
#define QMC_BASE(quicc,page) (struct global_multi_pram *)(&quicc->pram[page])
#define MCBASE(quicc,page) (unsigned long)(quicc->pram[page].m.mcbase)
#define CHANNEL_PRAM_BASE(quicc,channel) ((struct quicc32_pram *) \
(&(quicc->ch_or_u.ch_pram_tbl[channel])))
#define TBD_32_ADDR(quicc,page,channel) ((struct quicc_bd *) \
(MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->tbase)))
#define RBD_32_ADDR(quicc,page,channel) ((struct quicc_bd *) \
(MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->rbase)))
#define TBD_32_CUR_ADDR(quicc,page,channel) ((struct quicc_bd *) \
(MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->tbptr)))
#define RBD_32_CUR_ADDR(quicc,page,channel) ((struct quicc_bd *) \
(MCBASE(quicc,page) + (CHANNEL_PRAM_BASE(quicc,channel)->rbptr)))
#define TBD_32_SET_CUR_ADDR(bd,quicc,page,channel) \
CHANNEL_PRAM_BASE(quicc,channel)->tbptr = \
((unsigned short)((char *)(bd) - (char *)(MCBASE(quicc,page))))
#define RBD_32_SET_CUR_ADDR(bd,quicc,page,channel) \
CHANNEL_PRAM_BASE(quicc,channel)->rbptr = \
((unsigned short)((char *)(bd) - (char *)(MCBASE(quicc,page))))
#define INCREASE_TBD_32(bd,quicc,page,channel) { \
if((bd)->status & T_W) \
(bd) = TBD_32_ADDR(quicc,page,channel); \
else \
(bd)++; \
}
#define DECREASE_TBD_32(bd,quicc,page,channel) { \
if ((bd) == TBD_32_ADDR(quicc, page,channel)) \
while (!((bd)->status & T_W)) \
(bd)++; \
else \
(bd)--; \
}
#define INCREASE_RBD_32(bd,quicc,page,channel) { \
if((bd)->status & R_W) \
(bd) = RBD_32_ADDR(quicc,page,channel); \
else \
(bd)++; \
}
#define DECREASE_RBD_32(bd,quicc,page,channel) { \
if ((bd) == RBD_32_ADDR(quicc, page,channel)) \
while (!((bd)->status & T_W)) \
(bd)++; \
else \
(bd)--; \
}
#endif

View file

@ -0,0 +1,54 @@
#ifndef _M68KNOMMU_MACHDEP_H
#define _M68KNOMMU_MACHDEP_H
#include <linux/seq_file.h>
#include <linux/interrupt.h>
struct pt_regs;
struct kbd_repeat;
struct mktime;
struct hwclk_time;
struct gendisk;
struct buffer_head;
extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *));
/* machine dependent keyboard functions */
extern int (*mach_keyb_init) (void);
extern int (*mach_kbdrate) (struct kbd_repeat *);
extern void (*mach_kbd_leds) (unsigned int);
/* machine dependent irq functions */
extern void (*mach_init_IRQ) (void);
extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id);
extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
extern void (*mach_get_model) (char *model);
extern int (*mach_get_hardware_list) (char *buffer);
extern int (*mach_get_irq_list) (struct seq_file *p, void *v);
extern void (*mach_process_int) (int irq, struct pt_regs *fp);
/* machine dependent timer functions */
extern unsigned long (*mach_gettimeoffset)(void);
extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
int *min, int *sec);
extern int (*mach_hwclk)(int, struct hwclk_time*);
extern int (*mach_set_clock_mmss)(unsigned long);
extern void (*mach_reset)( void );
extern void (*mach_halt)( void );
extern void (*mach_power_off)( void );
extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
extern void (*mach_hd_setup)(char *, int *);
extern long mach_max_dma_address;
extern void (*mach_floppy_setup)(char *, int *);
extern void (*mach_floppy_eject)(void);
extern void (*mach_heartbeat) (int);
extern void (*mach_l2_flush) (int);
extern int mach_sysrq_key;
extern int mach_sysrq_shift_state;
extern int mach_sysrq_shift_mask;
extern char *mach_sysrq_xlate;
extern void config_BSP(char *command, int len);
extern void (*mach_tick)(void);
extern void (*mach_trap_init)(void);
#endif /* _M68KNOMMU_MACHDEP_H */

View file

@ -0,0 +1 @@
#include <asm-m68k/math-emu.h>

View file

@ -0,0 +1,9 @@
/*
* Machine dependent access functions for RTC registers.
*/
#ifndef _M68KNOMMU_MC146818RTC_H
#define _M68KNOMMU_MC146818RTC_H
/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */
#endif /* _M68KNOMMU_MC146818RTC_H */

View file

@ -0,0 +1,125 @@
/****************************************************************************/
/*
* mcfcache.h -- ColdFire CPU cache support code
*
* (C) Copyright 2004, Greg Ungerer <gerg@snapgear.com>
*/
/****************************************************************************/
#ifndef __M68KNOMMU_MCFCACHE_H
#define __M68KNOMMU_MCFCACHE_H
/****************************************************************************/
#include <linux/config.h>
/*
* The different ColdFire families have different cache arrangments.
* Everything from a small instruction only cache, to configurable
* data and/or instruction cache, to unified instruction/data, to
* harvard style separate instruction and data caches.
*/
#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272)
/*
* Simple version 2 core cache. These have instruction cache only,
* we just need to invalidate it and enable it.
*/
.macro CACHE_ENABLE
movel #0x01000000,%d0 /* invalidate cache cmd */
movec %d0,%CACR /* do invalidate cache */
movel #0x80000100,%d0 /* setup cache mask */
movec %d0,%CACR /* enable cache */
.endm
#endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */
#if defined(CONFIG_M527x)
/*
* New version 2 cores have a configurable split cache arrangement.
* For now I am just enabling instruction cache - but ultimately I
* think a split instruction/data cache would be better.
*/
.macro CACHE_ENABLE
movel #0x01400000,%d0
movec %d0,%CACR /* invalidate cache */
nop
movel #0x0000c000,%d0 /* set SDRAM cached only */
movec %d0,%ACR0
movel #0x00000000,%d0 /* no other regions cached */
movec %d0,%ACR1
movel #0x80400100,%d0 /* configure cache */
movec %d0,%CACR /* enable cache */
nop
.endm
#endif /* CONFIG_M527x */
#if defined(CONFIG_M528x)
/*
* Cache is totally broken on early 5282 silicon. So far now we
* disable its cache all together.
*/
.macro CACHE_ENABLE
movel #0x01000000,%d0
movec %d0,%CACR /* invalidate cache */
nop
movel #0x0000c000,%d0 /* set SDRAM cached only */
movec %d0,%ACR0
movel #0x00000000,%d0 /* no other regions cached */
movec %d0,%ACR1
movel #0x00000000,%d0 /* configure cache */
movec %d0,%CACR /* enable cache */
nop
.endm
#endif /* CONFIG_M528x */
#if defined(CONFIG_M5249) || defined(CONFIG_M5307)
/*
* The version 3 core cache. Oddly enough the version 2 core 5249
* has the same SDRAM and cache setup as the version 3 cores.
* This is a single unified instruction/data cache.
*/
.macro CACHE_ENABLE
movel #0x01000000,%d0 /* invalidate whole cache */
movec %d0,%CACR
nop
#if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3)
movel #0x0000c000,%d0 /* set SDRAM cached (write-thru) */
#else
movel #0x0000c020,%d0 /* set SDRAM cached (copyback) */
#endif
movec %d0,%ACR0
movel #0x00000000,%d0 /* no other regions cached */
movec %d0,%ACR1
movel #0xa0000200,%d0 /* enable cache */
movec %d0,%CACR
nop
.endm
#endif /* CONFIG_M5249 || CONFIG_M5307 */
#if defined(CONFIG_M5407)
/*
* Version 4 cores have a true harvard style separate instruction
* and data cache. Invalidate and enable cache, also enable write
* buffers and branch accelerator.
*/
.macro CACHE_ENABLE
movel #0x01040100,%d0 /* invalidate whole cache */
movec %d0,%CACR
nop
movel #0x000fc000,%d0 /* set SDRAM cached only */
movec %d0, %ACR0
movel #0x00000000,%d0 /* no other regions cached */
movec %d0, %ACR1
movel #0x000fc000,%d0 /* set SDRAM cached only */
movec %d0, %ACR2
movel #0x00000000,%d0 /* no other regions cached */
movec %d0, %ACR3
movel #0xb6088400,%d0 /* enable caches */
movec %d0,%CACR
nop
.endm
#endif /* CONFIG_M5407 */
/****************************************************************************/
#endif /* __M68KNOMMU_MCFCACHE_H */

View file

@ -0,0 +1,145 @@
/****************************************************************************/
/*
* mcfdma.h -- Coldfire internal DMA support defines.
*
* (C) Copyright 1999, Rob Scott (rscott@mtrob.ml.org)
*/
/****************************************************************************/
#ifndef mcfdma_h
#define mcfdma_h
/****************************************************************************/
#include <linux/config.h>
/*
* Get address specific defines for this Coldfire member.
*/
#if defined(CONFIG_M5206) || defined(CONFIG_M5206e)
#define MCFDMA_BASE0 0x200 /* Base address of DMA 0 */
#define MCFDMA_BASE1 0x240 /* Base address of DMA 1 */
#elif defined(CONFIG_M5272)
#define MCFDMA_BASE0 0x0e0 /* Base address of DMA 0 */
#elif defined(CONFIG_M527x) || defined(CONFIG_M528x)
/* These are relative to the IPSBAR, not MBAR */
#define MCFDMA_BASE0 0x100 /* Base address of DMA 0 */
#define MCFDMA_BASE1 0x140 /* Base address of DMA 1 */
#define MCFDMA_BASE2 0x180 /* Base address of DMA 2 */
#define MCFDMA_BASE3 0x1C0 /* Base address of DMA 3 */
#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
#define MCFDMA_BASE0 0x300 /* Base address of DMA 0 */
#define MCFDMA_BASE1 0x340 /* Base address of DMA 1 */
#define MCFDMA_BASE2 0x380 /* Base address of DMA 2 */
#define MCFDMA_BASE3 0x3C0 /* Base address of DMA 3 */
#endif
#if !defined(CONFIG_M5272)
/*
* Define the DMA register set addresses.
* Note: these are longword registers, use unsigned long as data type
*/
#define MCFDMA_SAR 0x00 /* DMA source address (r/w) */
#define MCFDMA_DAR 0x01 /* DMA destination adr (r/w) */
/* these are word registers, use unsigned short data type */
#define MCFDMA_DCR 0x04 /* DMA control reg (r/w) */
#define MCFDMA_BCR 0x06 /* DMA byte count reg (r/w) */
/* these are byte registers, use unsiged char data type */
#define MCFDMA_DSR 0x10 /* DMA status reg (r/w) */
#define MCFDMA_DIVR 0x14 /* DMA interrupt vec (r/w) */
/*
* Bit definitions for the DMA Control Register (DCR).
*/
#define MCFDMA_DCR_INT 0x8000 /* Enable completion irq */
#define MCFDMA_DCR_EEXT 0x4000 /* Enable external DMA req */
#define MCFDMA_DCR_CS 0x2000 /* Enable cycle steal */
#define MCFDMA_DCR_AA 0x1000 /* Enable auto alignment */
#define MCFDMA_DCR_BWC_MASK 0x0E00 /* Bandwidth ctl mask */
#define MCFDMA_DCR_BWC_512 0x0200 /* Bandwidth: 512 Bytes */
#define MCFDMA_DCR_BWC_1024 0x0400 /* Bandwidth: 1024 Bytes */
#define MCFDMA_DCR_BWC_2048 0x0600 /* Bandwidth: 2048 Bytes */
#define MCFDMA_DCR_BWC_4096 0x0800 /* Bandwidth: 4096 Bytes */
#define MCFDMA_DCR_BWC_8192 0x0a00 /* Bandwidth: 8192 Bytes */
#define MCFDMA_DCR_BWC_16384 0x0c00 /* Bandwidth: 16384 Bytes */
#define MCFDMA_DCR_BWC_32768 0x0e00 /* Bandwidth: 32768 Bytes */
#define MCFDMA_DCR_SAA 0x0100 /* Single Address Access */
#define MCFDMA_DCR_S_RW 0x0080 /* SAA read/write value */
#define MCFDMA_DCR_SINC 0x0040 /* Source addr inc enable */
#define MCFDMA_DCR_SSIZE_MASK 0x0030 /* Src xfer size */
#define MCFDMA_DCR_SSIZE_LONG 0x0000 /* Src xfer size, 00 = longw */
#define MCFDMA_DCR_SSIZE_BYTE 0x0010 /* Src xfer size, 01 = byte */
#define MCFDMA_DCR_SSIZE_WORD 0x0020 /* Src xfer size, 10 = word */
#define MCFDMA_DCR_SSIZE_LINE 0x0030 /* Src xfer size, 11 = line */
#define MCFDMA_DCR_DINC 0x0008 /* Dest addr inc enable */
#define MCFDMA_DCR_DSIZE_MASK 0x0006 /* Dest xfer size */
#define MCFDMA_DCR_DSIZE_LONG 0x0000 /* Dest xfer size, 00 = long */
#define MCFDMA_DCR_DSIZE_BYTE 0x0002 /* Dest xfer size, 01 = byte */
#define MCFDMA_DCR_DSIZE_WORD 0x0004 /* Dest xfer size, 10 = word */
#define MCFDMA_DCR_DSIZE_LINE 0x0006 /* Dest xfer size, 11 = line */
#define MCFDMA_DCR_START 0x0001 /* Start transfer */
/*
* Bit definitions for the DMA Status Register (DSR).
*/
#define MCFDMA_DSR_CE 0x40 /* Config error */
#define MCFDMA_DSR_BES 0x20 /* Bus Error on source */
#define MCFDMA_DSR_BED 0x10 /* Bus Error on dest */
#define MCFDMA_DSR_REQ 0x04 /* Requests remaining */
#define MCFDMA_DSR_BSY 0x02 /* Busy */
#define MCFDMA_DSR_DONE 0x01 /* DMA transfer complete */
#else /* This is an MCF5272 */
#define MCFDMA_DMR 0x00 /* Mode Register (r/w) */
#define MCFDMA_DIR 0x03 /* Interrupt trigger register (r/w) */
#define MCFDMA_DSAR 0x03 /* Source Address register (r/w) */
#define MCFDMA_DDAR 0x04 /* Destination Address register (r/w) */
#define MCFDMA_DBCR 0x02 /* Byte Count Register (r/w) */
/* Bit definitions for the DMA Mode Register (DMR) */
#define MCFDMA_DMR_RESET 0x80000000L /* Reset bit */
#define MCFDMA_DMR_EN 0x40000000L /* DMA enable */
#define MCFDMA_DMR_RQM 0x000C0000L /* Request Mode Mask */
#define MCFDMA_DMR_RQM_DUAL 0x000C0000L /* Dual address mode, the only valid mode */
#define MCFDMA_DMR_DSTM 0x00002000L /* Destination addressing mask */
#define MCFDMA_DMR_DSTM_SA 0x00000000L /* Destination uses static addressing */
#define MCFDMA_DMR_DSTM_IA 0x00002000L /* Destination uses incremental addressing */
#define MCFDMA_DMR_DSTT_UD 0x00000400L /* Destination is user data */
#define MCFDMA_DMR_DSTT_UC 0x00000800L /* Destination is user code */
#define MCFDMA_DMR_DSTT_SD 0x00001400L /* Destination is supervisor data */
#define MCFDMA_DMR_DSTT_SC 0x00001800L /* Destination is supervisor code */
#define MCFDMA_DMR_DSTS_OFF 0x8 /* offset to the destination size bits */
#define MCFDMA_DMR_DSTS_LONG 0x00000000L /* Long destination size */
#define MCFDMA_DMR_DSTS_BYTE 0x00000100L /* Byte destination size */
#define MCFDMA_DMR_DSTS_WORD 0x00000200L /* Word destination size */
#define MCFDMA_DMR_DSTS_LINE 0x00000300L /* Line destination size */
#define MCFDMA_DMR_SRCM 0x00000020L /* Source addressing mask */
#define MCFDMA_DMR_SRCM_SA 0x00000000L /* Source uses static addressing */
#define MCFDMA_DMR_SRCM_IA 0x00000020L /* Source uses incremental addressing */
#define MCFDMA_DMR_SRCT_UD 0x00000004L /* Source is user data */
#define MCFDMA_DMR_SRCT_UC 0x00000008L /* Source is user code */
#define MCFDMA_DMR_SRCT_SD 0x00000014L /* Source is supervisor data */
#define MCFDMA_DMR_SRCT_SC 0x00000018L /* Source is supervisor code */
#define MCFDMA_DMR_SRCS_OFF 0x0 /* Offset to the source size bits */
#define MCFDMA_DMR_SRCS_LONG 0x00000000L /* Long source size */
#define MCFDMA_DMR_SRCS_BYTE 0x00000001L /* Byte source size */
#define MCFDMA_DMR_SRCS_WORD 0x00000002L /* Word source size */
#define MCFDMA_DMR_SRCS_LINE 0x00000003L /* Line source size */
/* Bit definitions for the DMA interrupt register (DIR) */
#define MCFDMA_DIR_INVEN 0x1000 /* Invalid Combination interrupt enable */
#define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */
#define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */
#define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */
#define MCFDMA_DIR_INV 0x1000 /* Invalid Combination */
#define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */
#define MCFDMA_DIR_TE 0x0002 /* Transfer Error */
#define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */
#endif /* !defined(CONFIG_M5272) */
/****************************************************************************/
#endif /* mcfdma_h */

View file

@ -0,0 +1,78 @@
/****************************************************************************/
/*
* mcfmbus.h -- Coldfire MBUS support defines.
*
* (C) Copyright 1999, Martin Floeer (mfloeer@axcent.de)
*/
/****************************************************************************/
#ifndef mcfmbus_h
#define mcfmbus_h
#include <linux/config.h>
#define MCFMBUS_BASE 0x280
#define MCFMBUS_IRQ_VECTOR 0x19
#define MCFMBUS_IRQ 0x1
#define MCFMBUS_CLK 0x3f
#define MCFMBUS_IRQ_LEVEL 0x07 /*IRQ Level 1*/
#define MCFMBUS_ADDRESS 0x01
/*
* Define the 5307 MBUS register set addresses
*/
#define MCFMBUS_MADR 0x00
#define MCFMBUS_MFDR 0x04
#define MCFMBUS_MBCR 0x08
#define MCFMBUS_MBSR 0x0C
#define MCFMBUS_MBDR 0x10
#define MCFMBUS_MADR_ADDR(a) (((a)&0x7F)<<0x01) /*Slave Address*/
#define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/
/*
* Define bit flags in Controll Register
*/
#define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */
#define MCFMBUS_MBCR_MIEN (0x40) /* M-Bus Interrupt Enable */
#define MCFMBUS_MBCR_MSTA (0x20) /* Master/Slave Mode Select Bit */
#define MCFMBUS_MBCR_MTX (0x10) /* Transmit/Rcv Mode Select Bit */
#define MCFMBUS_MBCR_TXAK (0x08) /* Transmit Acknowledge Enable */
#define MCFMBUS_MBCR_RSTA (0x04) /* Repeat Start */
/*
* Define bit flags in Status Register
*/
#define MCFMBUS_MBSR_MCF (0x80) /* Data Transfer Complete */
#define MCFMBUS_MBSR_MAAS (0x40) /* Addressed as a Slave */
#define MCFMBUS_MBSR_MBB (0x20) /* Bus Busy */
#define MCFMBUS_MBSR_MAL (0x10) /* Arbitration Lost */
#define MCFMBUS_MBSR_SRW (0x04) /* Slave Transmit */
#define MCFMBUS_MBSR_MIF (0x02) /* M-Bus Interrupt */
#define MCFMBUS_MBSR_RXAK (0x01) /* No Acknowledge Received */
/*
* Define bit flags in DATA I/O Register
*/
#define MCFMBUS_MBDR_READ (0x01) /* 1=read 0=write MBUS */
#define MBUSIOCSCLOCK 1
#define MBUSIOCGCLOCK 2
#define MBUSIOCSADDR 3
#define MBUSIOCGADDR 4
#define MBUSIOCSSLADDR 5
#define MBUSIOCGSLADDR 6
#define MBUSIOCSSUBADDR 7
#define MBUSIOCGSUBADDR 8
#endif

View file

@ -0,0 +1,353 @@
/****************************************************************************/
/*
* mcfne.h -- NE2000 in ColdFire eval boards.
*
* (C) Copyright 1999-2000, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo (www.lineo.com)
* (C) Copyright 2001, SnapGear (www.snapgear.com)
*
* 19990409 David W. Miller Converted from m5206ne.h for 5307 eval board
*
* Hacked support for m5206e Cadre III evaluation board
* Fred Stevens (fred.stevens@pemstar.com) 13 April 1999
*/
/****************************************************************************/
#ifndef mcfne_h
#define mcfne_h
/****************************************************************************/
#include <linux/config.h>
/*
* Support for NE2000 clones devices in ColdFire based boards.
* Not all boards address these parts the same way, some use a
* direct addressing method, others use a side-band address space
* to access odd address registers, some require byte swapping
* others do not.
*/
#define BSWAP(w) (((w) << 8) | ((w) >> 8))
#define RSWAP(w) (w)
/*
* Define the basic hardware resources of NE2000 boards.
*/
#if defined(CONFIG_M5206) && defined(CONFIG_ARNEWSH)
#define NE2000_ADDR 0x40000300
#define NE2000_ODDOFFSET 0x00010000
#define NE2000_IRQ_VECTOR 0xf0
#define NE2000_IRQ_PRIORITY 2
#define NE2000_IRQ_LEVEL 4
#define NE2000_BYTE volatile unsigned short
#endif
#if defined(CONFIG_M5206e) && defined(CONFIG_MOTOROLA)
#define NE2000_ADDR 0x40000300
#define NE2000_ODDOFFSET 0x00010000
#define NE2000_IRQ_VECTOR 0x1c
#define NE2000_IRQ_PRIORITY 2
#define NE2000_IRQ_LEVEL 4
#define NE2000_BYTE volatile unsigned short
#endif
#if defined(CONFIG_M5206e) && defined(CONFIG_NETtel)
#define NE2000_ADDR 0x30000300
#define NE2000_IRQ_VECTOR 25
#define NE2000_IRQ_PRIORITY 1
#define NE2000_IRQ_LEVEL 3
#define NE2000_BYTE volatile unsigned char
#endif
#if defined(CONFIG_M5206e) && defined(CONFIG_CFV240)
#define NE2000_ADDR 0x40010000
#define NE2000_ADDR1 0x40010001
#define NE2000_ODDOFFSET 0x00000000
#define NE2000_IRQ 1
#define NE2000_IRQ_VECTOR 0x19
#define NE2000_IRQ_PRIORITY 2
#define NE2000_IRQ_LEVEL 1
#define NE2000_BYTE volatile unsigned char
#endif
#if defined(CONFIG_M5307) && defined(CONFIG_MOTOROLA)
#define NE2000_ADDR 0x40000300
#define NE2000_ODDOFFSET 0x00010000
#define NE2000_IRQ_VECTOR 0x1b
#define NE2000_BYTE volatile unsigned short
#endif
#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
#define NE2000_ADDR 0x30600300
#define NE2000_ODDOFFSET 0x00008000
#define NE2000_IRQ_VECTOR 67
#undef BSWAP
#define BSWAP(w) (w)
#define NE2000_BYTE volatile unsigned short
#undef RSWAP
#define RSWAP(w) (((w) << 8) | ((w) >> 8))
#endif
#if defined(CONFIG_M5307) && defined(CONFIG_NETtel)
#define NE2000_ADDR0 0x30600300
#define NE2000_ADDR1 0x30800300
#define NE2000_ODDOFFSET 0x00008000
#define NE2000_IRQ_VECTOR0 27
#define NE2000_IRQ_VECTOR1 29
#undef BSWAP
#define BSWAP(w) (w)
#define NE2000_BYTE volatile unsigned short
#undef RSWAP
#define RSWAP(w) (((w) << 8) | ((w) >> 8))
#endif
#if defined(CONFIG_M5307) && defined(CONFIG_SECUREEDGEMP3)
#define NE2000_ADDR 0x30600300
#define NE2000_ODDOFFSET 0x00008000
#define NE2000_IRQ_VECTOR 27
#undef BSWAP
#define BSWAP(w) (w)
#define NE2000_BYTE volatile unsigned short
#undef RSWAP
#define RSWAP(w) (((w) << 8) | ((w) >> 8))
#endif
#if defined(CONFIG_M5307) && defined(CONFIG_ARNEWSH)
#define NE2000_ADDR 0xfe600300
#define NE2000_ODDOFFSET 0x00010000
#define NE2000_IRQ_VECTOR 0x1b
#define NE2000_IRQ_PRIORITY 2
#define NE2000_IRQ_LEVEL 3
#define NE2000_BYTE volatile unsigned short
#endif
#if defined(CONFIG_M5407)
#define NE2000_ADDR 0x40000300
#define NE2000_ODDOFFSET 0x00010000
#define NE2000_IRQ_VECTOR 0x1b
#define NE2000_BYTE volatile unsigned short
#endif
/****************************************************************************/
/*
* Side-band address space for odd address requires re-mapping
* many of the standard ISA access functions.
*/
#ifdef NE2000_ODDOFFSET
#undef outb
#undef outb_p
#undef inb
#undef inb_p
#undef outsb
#undef outsw
#undef insb
#undef insw
#define outb ne2000_outb
#define inb ne2000_inb
#define outb_p ne2000_outb
#define inb_p ne2000_inb
#define outsb ne2000_outsb
#define outsw ne2000_outsw
#define insb ne2000_insb
#define insw ne2000_insw
#ifndef COLDFIRE_NE2000_FUNCS
void ne2000_outb(unsigned int val, unsigned int addr);
int ne2000_inb(unsigned int addr);
void ne2000_insb(unsigned int addr, void *vbuf, int unsigned long len);
void ne2000_insw(unsigned int addr, void *vbuf, unsigned long len);
void ne2000_outsb(unsigned int addr, void *vbuf, unsigned long len);
void ne2000_outsw(unsigned int addr, void *vbuf, unsigned long len);
#else
/*
* This macro converts a conventional register address into the
* real memory pointer of the mapped NE2000 device.
* On most NE2000 implementations on ColdFire boards the chip is
* mapped in kinda funny, due to its ISA heritage.
*/
#ifdef CONFIG_CFV240
#define NE2000_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1) + 1)
#define NE2000_DATA_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1))
#else
#define NE2000_PTR(addr) ((addr&0x1)?(NE2000_ODDOFFSET+addr-1):(addr))
#define NE2000_DATA_PTR(addr) (addr)
#endif
void ne2000_outb(unsigned int val, unsigned int addr)
{
NE2000_BYTE *rp;
rp = (NE2000_BYTE *) NE2000_PTR(addr);
*rp = RSWAP(val);
}
int ne2000_inb(unsigned int addr)
{
NE2000_BYTE *rp, val;
rp = (NE2000_BYTE *) NE2000_PTR(addr);
val = *rp;
return((int) ((NE2000_BYTE) RSWAP(val)));
}
void ne2000_insb(unsigned int addr, void *vbuf, int unsigned long len)
{
NE2000_BYTE *rp, val;
unsigned char *buf;
buf = (unsigned char *) vbuf;
rp = (NE2000_BYTE *) NE2000_DATA_PTR(addr);
for (; (len > 0); len--) {
val = *rp;
*buf++ = RSWAP(val);
}
}
void ne2000_insw(unsigned int addr, void *vbuf, unsigned long len)
{
volatile unsigned short *rp;
unsigned short w, *buf;
buf = (unsigned short *) vbuf;
rp = (volatile unsigned short *) NE2000_DATA_PTR(addr);
for (; (len > 0); len--) {
w = *rp;
*buf++ = BSWAP(w);
}
}
void ne2000_outsb(unsigned int addr, const void *vbuf, unsigned long len)
{
NE2000_BYTE *rp, val;
unsigned char *buf;
buf = (unsigned char *) vbuf;
rp = (NE2000_BYTE *) NE2000_DATA_PTR(addr);
for (; (len > 0); len--) {
val = *buf++;
*rp = RSWAP(val);
}
}
void ne2000_outsw(unsigned int addr, const void *vbuf, unsigned long len)
{
volatile unsigned short *rp;
unsigned short w, *buf;
buf = (unsigned short *) vbuf;
rp = (volatile unsigned short *) NE2000_DATA_PTR(addr);
for (; (len > 0); len--) {
w = *buf++;
*rp = BSWAP(w);
}
}
#endif /* COLDFIRE_NE2000_FUNCS */
#endif /* NE2000_OFFOFFSET */
/****************************************************************************/
#ifdef COLDFIRE_NE2000_FUNCS
/*
* Lastly the interrupt set up code...
* Minor differences between the different board types.
*/
#if defined(CONFIG_M5206) && defined(CONFIG_ARNEWSH)
void ne2000_irqsetup(int irq)
{
volatile unsigned char *icrp;
icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR4);
*icrp = MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI2;
mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT4);
}
#endif
#if defined(CONFIG_M5206e) && defined(CONFIG_MOTOROLA)
void ne2000_irqsetup(int irq)
{
volatile unsigned char *icrp;
icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR4);
*icrp = MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI2 | MCFSIM_ICR_AUTOVEC;
mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT4);
}
#endif
#if defined(CONFIG_M5206e) && defined(CONFIG_CFV240)
void ne2000_irqsetup(int irq)
{
volatile unsigned char *icrp;
icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR1);
*icrp = MCFSIM_ICR_LEVEL1 | MCFSIM_ICR_PRI2 | MCFSIM_ICR_AUTOVEC;
mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT1);
}
#endif
#if defined(CONFIG_M5206e) && defined(CONFIG_NETtel)
void ne2000_irqsetup(int irq)
{
mcf_autovector(irq);
}
#endif
#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
void ne2000_irqsetup(int irq)
{
volatile unsigned long *icrp;
volatile unsigned long *pitr;
/* The NE2000 device uses external IRQ3 */
icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
*icrp = (*icrp & 0x77077777) | 0x00d00000;
pitr = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PITR);
*pitr = *pitr | 0x20000000;
}
void ne2000_irqack(int irq)
{
volatile unsigned long *icrp;
/* The NE2000 device uses external IRQ3 */
icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
*icrp = (*icrp & 0x77777777) | 0x00800000;
}
#endif
#if defined(CONFIG_M5307) || defined(CONFIG_M5407)
#if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3)
void ne2000_irqsetup(int irq)
{
mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT3);
mcf_autovector(irq);
}
#else
void ne2000_irqsetup(int irq)
{
mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT3);
}
#endif /* ! CONFIG_NETtel || CONFIG_SECUREEDGEMP3 */
#endif /* CONFIG_M5307 || CONFIG_M5407 */
#endif /* COLDFIRE_NE2000_FUNCS */
/****************************************************************************/
#endif /* mcfne_h */

View file

@ -0,0 +1,120 @@
/****************************************************************************/
/*
* mcfpci.h -- PCI bridge on ColdFire eval boards.
*
* (C) Copyright 2000, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef mcfpci_h
#define mcfpci_h
/****************************************************************************/
#include <linux/config.h>
#ifdef CONFIG_PCI
/*
* Address regions in the PCI address space are not mapped into the
* normal memory space of the ColdFire. They must be accessed via
* handler routines. This is easy for I/O space (inb/outb/etc) but
* needs some code changes to support ordinary memory. Interrupts
* also need to be vectored through the PCI handler first, then it
* will call the actual driver sub-handlers.
*/
/*
* Un-define all the standard I/O access routines.
*/
#undef inb
#undef inw
#undef inl
#undef inb_p
#undef inw_p
#undef insb
#undef insw
#undef insl
#undef outb
#undef outw
#undef outl
#undef outb_p
#undef outw_p
#undef outsb
#undef outsw
#undef outsl
#undef request_irq
#undef free_irq
#undef bus_to_virt
#undef virt_to_bus
/*
* Re-direct all I/O memory accesses functions to PCI specific ones.
*/
#define inb pci_inb
#define inw pci_inw
#define inl pci_inl
#define inb_p pci_inb
#define inw_p pci_inw
#define insb pci_insb
#define insw pci_insw
#define insl pci_insl
#define outb pci_outb
#define outw pci_outw
#define outl pci_outl
#define outb_p pci_outb
#define outw_p pci_outw
#define outsb pci_outsb
#define outsw pci_outsw
#define outsl pci_outsl
#define request_irq pci_request_irq
#define free_irq pci_free_irq
#define virt_to_bus pci_virt_to_bus
#define bus_to_virt pci_bus_to_virt
#define CONFIG_COMEMPCI 1
/*
* Prototypes of the real PCI functions (defined in bios32.c).
*/
unsigned char pci_inb(unsigned int addr);
unsigned short pci_inw(unsigned int addr);
unsigned int pci_inl(unsigned int addr);
void pci_insb(void *addr, void *buf, int len);
void pci_insw(void *addr, void *buf, int len);
void pci_insl(void *addr, void *buf, int len);
void pci_outb(unsigned char val, unsigned int addr);
void pci_outw(unsigned short val, unsigned int addr);
void pci_outl(unsigned int val, unsigned int addr);
void pci_outsb(void *addr, void *buf, int len);
void pci_outsw(void *addr, void *buf, int len);
void pci_outsl(void *addr, void *buf, int len);
int pci_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags,
const char *device,
void *dev_id);
void pci_free_irq(unsigned int irq, void *dev_id);
void *pci_bmalloc(int size);
void pci_bmfree(void *bmp, int len);
void pci_copytoshmem(unsigned long bmp, void *src, int size);
void pci_copyfromshmem(void *dst, unsigned long bmp, int size);
unsigned long pci_virt_to_bus(volatile void *address);
void *pci_bus_to_virt(unsigned long address);
void pci_bmcpyto(void *dst, void *src, int len);
void pci_bmcpyfrom(void *dst, void *src, int len);
#endif /* CONFIG_PCI */
/****************************************************************************/
#endif /* mcfpci_h */

View file

@ -0,0 +1,63 @@
/****************************************************************************/
/*
* mcfpit.h -- ColdFire internal PIT timer support defines.
*
* (C) Copyright 2003, Greg Ungerer (gerg@snapgear.com)
*/
/****************************************************************************/
#ifndef mcfpit_h
#define mcfpit_h
/****************************************************************************/
#include <linux/config.h>
/*
* Get address specific defines for the 5270/5271 and 5280/5282.
*/
#define MCFPIT_BASE1 0x00150000 /* Base address of TIMER1 */
#define MCFPIT_BASE2 0x00160000 /* Base address of TIMER2 */
#define MCFPIT_BASE3 0x00170000 /* Base address of TIMER3 */
#define MCFPIT_BASE4 0x00180000 /* Base address of TIMER4 */
/*
* Define the PIT timer register set addresses.
*/
struct mcfpit {
unsigned short pcsr; /* PIT control and status */
unsigned short pmr; /* PIT modulus register */
unsigned short pcntr; /* PIT count register */
} __attribute__((packed));
/*
* Bit definitions for the PIT Control and Status register.
*/
#define MCFPIT_PCSR_CLK1 0x0000 /* System clock divisor */
#define MCFPIT_PCSR_CLK2 0x0100 /* System clock divisor */
#define MCFPIT_PCSR_CLK4 0x0200 /* System clock divisor */
#define MCFPIT_PCSR_CLK8 0x0300 /* System clock divisor */
#define MCFPIT_PCSR_CLK16 0x0400 /* System clock divisor */
#define MCFPIT_PCSR_CLK32 0x0500 /* System clock divisor */
#define MCFPIT_PCSR_CLK64 0x0600 /* System clock divisor */
#define MCFPIT_PCSR_CLK128 0x0700 /* System clock divisor */
#define MCFPIT_PCSR_CLK256 0x0800 /* System clock divisor */
#define MCFPIT_PCSR_CLK512 0x0900 /* System clock divisor */
#define MCFPIT_PCSR_CLK1024 0x0a00 /* System clock divisor */
#define MCFPIT_PCSR_CLK2048 0x0b00 /* System clock divisor */
#define MCFPIT_PCSR_CLK4096 0x0c00 /* System clock divisor */
#define MCFPIT_PCSR_CLK8192 0x0d00 /* System clock divisor */
#define MCFPIT_PCSR_CLK16384 0x0e00 /* System clock divisor */
#define MCFPIT_PCSR_CLK32768 0x0f00 /* System clock divisor */
#define MCFPIT_PCSR_DOZE 0x0040 /* Clock run in doze mode */
#define MCFPIT_PCSR_HALTED 0x0020 /* Clock run in halt mode */
#define MCFPIT_PCSR_OVW 0x0010 /* Overwrite PIT counter now */
#define MCFPIT_PCSR_PIE 0x0008 /* Enable PIT interrupt */
#define MCFPIT_PCSR_PIF 0x0004 /* PIT interrupt flag */
#define MCFPIT_PCSR_RLD 0x0002 /* Reload counter */
#define MCFPIT_PCSR_EN 0x0001 /* Enable PIT */
#define MCFPIT_PCSR_DISABLE 0x0000 /* Disable PIT */
/****************************************************************************/
#endif /* mcfpit_h */

View file

@ -0,0 +1,109 @@
/****************************************************************************/
/*
* mcfsim.h -- ColdFire System Integration Module support.
*
* (C) Copyright 1999-2003, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef mcfsim_h
#define mcfsim_h
/****************************************************************************/
#include <linux/config.h>
/*
* Include 5204, 5206/e, 5249, 5270/5271, 5272, 5280/5282, 5307 or
* 5407 specific addresses.
*/
#if defined(CONFIG_M5204)
#include <asm/m5204sim.h>
#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e)
#include <asm/m5206sim.h>
#elif defined(CONFIG_M5249)
#include <asm/m5249sim.h>
#elif defined(CONFIG_M527x)
#include <asm/m527xsim.h>
#elif defined(CONFIG_M5272)
#include <asm/m5272sim.h>
#elif defined(CONFIG_M528x)
#include <asm/m528xsim.h>
#elif defined(CONFIG_M5307)
#include <asm/m5307sim.h>
#elif defined(CONFIG_M5407)
#include <asm/m5407sim.h>
#endif
/*
* Define the base address of the SIM within the MBAR address space.
*/
#define MCFSIM_BASE 0x0 /* Base address of SIM */
/*
* Bit definitions for the ICR family of registers.
*/
#define MCFSIM_ICR_AUTOVEC 0x80 /* Auto-vectored intr */
#define MCFSIM_ICR_LEVEL0 0x00 /* Level 0 intr */
#define MCFSIM_ICR_LEVEL1 0x04 /* Level 1 intr */
#define MCFSIM_ICR_LEVEL2 0x08 /* Level 2 intr */
#define MCFSIM_ICR_LEVEL3 0x0c /* Level 3 intr */
#define MCFSIM_ICR_LEVEL4 0x10 /* Level 4 intr */
#define MCFSIM_ICR_LEVEL5 0x14 /* Level 5 intr */
#define MCFSIM_ICR_LEVEL6 0x18 /* Level 6 intr */
#define MCFSIM_ICR_LEVEL7 0x1c /* Level 7 intr */
#define MCFSIM_ICR_PRI0 0x00 /* Priority 0 intr */
#define MCFSIM_ICR_PRI1 0x01 /* Priority 1 intr */
#define MCFSIM_ICR_PRI2 0x02 /* Priority 2 intr */
#define MCFSIM_ICR_PRI3 0x03 /* Priority 3 intr */
/*
* Bit definitions for the Interrupt Mask register (IMR).
*/
#define MCFSIM_IMR_EINT1 0x0002 /* External intr # 1 */
#define MCFSIM_IMR_EINT2 0x0004 /* External intr # 2 */
#define MCFSIM_IMR_EINT3 0x0008 /* External intr # 3 */
#define MCFSIM_IMR_EINT4 0x0010 /* External intr # 4 */
#define MCFSIM_IMR_EINT5 0x0020 /* External intr # 5 */
#define MCFSIM_IMR_EINT6 0x0040 /* External intr # 6 */
#define MCFSIM_IMR_EINT7 0x0080 /* External intr # 7 */
#define MCFSIM_IMR_SWD 0x0100 /* Software Watchdog intr */
#define MCFSIM_IMR_TIMER1 0x0200 /* TIMER 1 intr */
#define MCFSIM_IMR_TIMER2 0x0400 /* TIMER 2 intr */
#define MCFSIM_IMR_MBUS 0x0800 /* MBUS intr */
#define MCFSIM_IMR_UART1 0x1000 /* UART 1 intr */
#define MCFSIM_IMR_UART2 0x2000 /* UART 2 intr */
#if defined(CONFIG_M5206e)
#define MCFSIM_IMR_DMA1 0x4000 /* DMA 1 intr */
#define MCFSIM_IMR_DMA2 0x8000 /* DMA 2 intr */
#elif defined(CONFIG_M5249) || defined(CONFIG_M5307)
#define MCFSIM_IMR_DMA0 0x4000 /* DMA 0 intr */
#define MCFSIM_IMR_DMA1 0x8000 /* DMA 1 intr */
#define MCFSIM_IMR_DMA2 0x10000 /* DMA 2 intr */
#define MCFSIM_IMR_DMA3 0x20000 /* DMA 3 intr */
#endif
/*
* Mask for all of the SIM devices. Some parts have more or less
* SIM devices. This is a catchall for the sandard set.
*/
#ifndef MCFSIM_IMR_MASKALL
#define MCFSIM_IMR_MASKALL 0x3ffe /* All intr sources */
#endif
#ifndef __ASSEMBLY__
/*
* Definition for the interrupt auto-vectoring support.
*/
extern void mcf_autovector(unsigned int vec);
#endif /* __ASSEMBLY__ */
/****************************************************************************/
#endif /* mcfsim_h */

View file

@ -0,0 +1,188 @@
/****************************************************************************/
/*
* mcfsmc.h -- SMC ethernet support for ColdFire environments.
*
* (C) Copyright 1999-2002, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef mcfsmc_h
#define mcfsmc_h
/****************************************************************************/
/*
* None of the current ColdFire targets that use the SMC91x111
* allow 8 bit accesses. So this code is 16bit access only.
*/
#include <linux/config.h>
#undef outb
#undef inb
#undef outw
#undef outwd
#undef inw
#undef outl
#undef inl
#undef outsb
#undef outsw
#undef outsl
#undef insb
#undef insw
#undef insl
/*
* Re-defines for ColdFire environment... The SMC part is
* mapped into memory space, so remap the PC-style in/out
* routines to handle that.
*/
#define outb smc_outb
#define inb smc_inb
#define outw smc_outw
#define outwd smc_outwd
#define inw smc_inw
#define outl smc_outl
#define inl smc_inl
#define outsb smc_outsb
#define outsw smc_outsw
#define outsl smc_outsl
#define insb smc_insb
#define insw smc_insw
#define insl smc_insl
static inline int smc_inb(unsigned int addr)
{
register unsigned short w;
w = *((volatile unsigned short *) (addr & ~0x1));
return(((addr & 0x1) ? w : (w >> 8)) & 0xff);
}
static inline void smc_outw(unsigned int val, unsigned int addr)
{
*((volatile unsigned short *) addr) = (val << 8) | (val >> 8);
}
static inline int smc_inw(unsigned int addr)
{
register unsigned short w;
w = *((volatile unsigned short *) addr);
return(((w << 8) | (w >> 8)) & 0xffff);
}
static inline void smc_outl(unsigned long val, unsigned int addr)
{
*((volatile unsigned long *) addr) =
((val << 8) & 0xff000000) | ((val >> 8) & 0x00ff0000) |
((val << 8) & 0x0000ff00) | ((val >> 8) & 0x000000ff);
}
static inline void smc_outwd(unsigned int val, unsigned int addr)
{
*((volatile unsigned short *) addr) = val;
}
/*
* The rep* functions are used to feed the data port with
* raw data. So we do not byte swap them when copying.
*/
static inline void smc_insb(unsigned int addr, void *vbuf, int unsigned long len)
{
volatile unsigned short *rp;
unsigned short *buf, *ebuf;
buf = (unsigned short *) vbuf;
rp = (volatile unsigned short *) addr;
/* Copy as words for as long as possible */
for (ebuf = buf + (len >> 1); (buf < ebuf); )
*buf++ = *rp;
/* Lastly, handle left over byte */
if (len & 0x1)
*((unsigned char *) buf) = (*rp >> 8) & 0xff;
}
static inline void smc_insw(unsigned int addr, void *vbuf, unsigned long len)
{
volatile unsigned short *rp;
unsigned short *buf, *ebuf;
buf = (unsigned short *) vbuf;
rp = (volatile unsigned short *) addr;
for (ebuf = buf + len; (buf < ebuf); )
*buf++ = *rp;
}
static inline void smc_insl(unsigned int addr, void *vbuf, unsigned long len)
{
volatile unsigned long *rp;
unsigned long *buf, *ebuf;
buf = (unsigned long *) vbuf;
rp = (volatile unsigned long *) addr;
for (ebuf = buf + len; (buf < ebuf); )
*buf++ = *rp;
}
static inline void smc_outsw(unsigned int addr, const void *vbuf, unsigned long len)
{
volatile unsigned short *rp;
unsigned short *buf, *ebuf;
buf = (unsigned short *) vbuf;
rp = (volatile unsigned short *) addr;
for (ebuf = buf + len; (buf < ebuf); )
*rp = *buf++;
}
static inline void smc_outsl(unsigned int addr, void *vbuf, unsigned long len)
{
volatile unsigned long *rp;
unsigned long *buf, *ebuf;
buf = (unsigned long *) vbuf;
rp = (volatile unsigned long *) addr;
for (ebuf = buf + len; (buf < ebuf); )
*rp = *buf++;
}
#ifdef CONFIG_NETtel
/*
* Re-map the address space of at least one of the SMC ethernet
* parts. Both parts power up decoding the same address, so we
* need to move one of them first, before doing enything else.
*
* We also increase the number of wait states for this part by one.
*/
void smc_remap(unsigned int ioaddr)
{
static int once = 0;
extern unsigned short ppdata;
if (once++ == 0) {
*((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADDR)) = 0x00ec;
ppdata |= 0x0080;
*((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADAT)) = ppdata;
outw(0x0001, ioaddr + BANK_SELECT);
outw(0x0001, ioaddr + BANK_SELECT);
outw(0x0067, ioaddr + BASE);
ppdata &= ~0x0080;
*((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADAT)) = ppdata;
}
*((volatile unsigned short *)(MCF_MBAR+MCFSIM_CSCR3)) = 0x1180;
}
#endif
/****************************************************************************/
#endif /* mcfsmc_h */

View file

@ -0,0 +1,85 @@
/****************************************************************************/
/*
* mcftimer.h -- ColdFire internal TIMER support defines.
*
* (C) Copyright 1999-2002, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef mcftimer_h
#define mcftimer_h
/****************************************************************************/
#include <linux/config.h>
/*
* Get address specific defines for this ColdFire member.
*/
#if defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e)
#define MCFTIMER_BASE1 0x100 /* Base address of TIMER1 */
#define MCFTIMER_BASE2 0x120 /* Base address of TIMER2 */
#elif defined(CONFIG_M5272)
#define MCFTIMER_BASE1 0x200 /* Base address of TIMER1 */
#define MCFTIMER_BASE2 0x220 /* Base address of TIMER2 */
#define MCFTIMER_BASE3 0x240 /* Base address of TIMER4 */
#define MCFTIMER_BASE4 0x260 /* Base address of TIMER3 */
#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
#define MCFTIMER_BASE1 0x140 /* Base address of TIMER1 */
#define MCFTIMER_BASE2 0x180 /* Base address of TIMER2 */
#endif
/*
* Define the TIMER register set addresses.
*/
#define MCFTIMER_TMR 0x00 /* Timer Mode reg (r/w) */
#define MCFTIMER_TRR 0x02 /* Timer Reference (r/w) */
#define MCFTIMER_TCR 0x04 /* Timer Capture reg (r/w) */
#define MCFTIMER_TCN 0x06 /* Timer Counter reg (r/w) */
#define MCFTIMER_TER 0x11 /* Timer Event reg (r/w) */
struct mcftimer {
unsigned short tmr; /* Timer Mode reg (r/w) */
unsigned short reserved1;
unsigned short trr; /* Timer Reference (r/w) */
unsigned short reserved2;
unsigned short tcr; /* Timer Capture reg (r/w) */
unsigned short reserved3;
unsigned short tcn; /* Timer Counter reg (r/w) */
unsigned short reserved4;
unsigned char reserved5;
unsigned char ter; /* Timer Event reg (r/w) */
} __attribute__((packed));
/*
* Bit definitions for the Timer Mode Register (TMR).
* Register bit flags are common accross ColdFires.
*/
#define MCFTIMER_TMR_PREMASK 0xff00 /* Prescalar mask */
#define MCFTIMER_TMR_DISCE 0x0000 /* Disable capture */
#define MCFTIMER_TMR_ANYCE 0x00c0 /* Capture any edge */
#define MCFTIMER_TMR_FALLCE 0x0080 /* Capture fallingedge */
#define MCFTIMER_TMR_RISECE 0x0040 /* Capture rising edge */
#define MCFTIMER_TMR_ENOM 0x0020 /* Enable output toggle */
#define MCFTIMER_TMR_DISOM 0x0000 /* Do single output pulse */
#define MCFTIMER_TMR_ENORI 0x0010 /* Enable ref interrupt */
#define MCFTIMER_TMR_DISORI 0x0000 /* Disable ref interrupt */
#define MCFTIMER_TMR_RESTART 0x0008 /* Restart counter */
#define MCFTIMER_TMR_FREERUN 0x0000 /* Free running counter */
#define MCFTIMER_TMR_CLKTIN 0x0006 /* Input clock is TIN */
#define MCFTIMER_TMR_CLK16 0x0004 /* Input clock is /16 */
#define MCFTIMER_TMR_CLK1 0x0002 /* Input clock is /1 */
#define MCFTIMER_TMR_CLKSTOP 0x0000 /* Stop counter */
#define MCFTIMER_TMR_ENABLE 0x0001 /* Enable timer */
#define MCFTIMER_TMR_DISABLE 0x0000 /* Disable timer */
/*
* Bit definitions for the Timer Event Registers (TER).
*/
#define MCFTIMER_TER_CAP 0x01 /* Capture event */
#define MCFTIMER_TER_REF 0x02 /* Refernece event */
/****************************************************************************/
#endif /* mcftimer_h */

View file

@ -0,0 +1,200 @@
/****************************************************************************/
/*
* mcfuart.h -- ColdFire internal UART support defines.
*
* (C) Copyright 1999-2003, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2000, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef mcfuart_h
#define mcfuart_h
/****************************************************************************/
#include <linux/config.h>
/*
* Define the base address of the UARTS within the MBAR address
* space.
*/
#if defined(CONFIG_M5272)
#define MCFUART_BASE1 0x100 /* Base address of UART1 */
#define MCFUART_BASE2 0x140 /* Base address of UART2 */
#elif defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e)
#if defined(CONFIG_NETtel)
#define MCFUART_BASE1 0x180 /* Base address of UART1 */
#define MCFUART_BASE2 0x140 /* Base address of UART2 */
#else
#define MCFUART_BASE1 0x140 /* Base address of UART1 */
#define MCFUART_BASE2 0x180 /* Base address of UART2 */
#endif
#elif defined(CONFIG_M527x) || defined(CONFIG_M528x)
#define MCFUART_BASE1 0x200 /* Base address of UART1 */
#define MCFUART_BASE2 0x240 /* Base address of UART2 */
#define MCFUART_BASE3 0x280 /* Base address of UART3 */
#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
#if defined(CONFIG_NETtel) || defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3)
#define MCFUART_BASE1 0x200 /* Base address of UART1 */
#define MCFUART_BASE2 0x1c0 /* Base address of UART2 */
#else
#define MCFUART_BASE1 0x1c0 /* Base address of UART1 */
#define MCFUART_BASE2 0x200 /* Base address of UART2 */
#endif
#endif
/*
* Define the ColdFire UART register set addresses.
*/
#define MCFUART_UMR 0x00 /* Mode register (r/w) */
#define MCFUART_USR 0x04 /* Status register (r) */
#define MCFUART_UCSR 0x04 /* Clock Select (w) */
#define MCFUART_UCR 0x08 /* Command register (w) */
#define MCFUART_URB 0x0c /* Receiver Buffer (r) */
#define MCFUART_UTB 0x0c /* Transmit Buffer (w) */
#define MCFUART_UIPCR 0x10 /* Input Port Change (r) */
#define MCFUART_UACR 0x10 /* Auxiliary Control (w) */
#define MCFUART_UISR 0x14 /* Interrup Status (r) */
#define MCFUART_UIMR 0x14 /* Interrupt Mask (w) */
#define MCFUART_UBG1 0x18 /* Baud Rate MSB (r/w) */
#define MCFUART_UBG2 0x1c /* Baud Rate LSB (r/w) */
#ifdef CONFIG_M5272
#define MCFUART_UTF 0x28 /* Transmitter FIFO (r/w) */
#define MCFUART_URF 0x2c /* Receiver FIFO (r/w) */
#define MCFUART_UFPD 0x30 /* Frac Prec. Divider (r/w) */
#else
#define MCFUART_UIVR 0x30 /* Interrupt Vector (r/w) */
#endif
#define MCFUART_UIPR 0x34 /* Input Port (r) */
#define MCFUART_UOP1 0x38 /* Output Port Bit Set (w) */
#define MCFUART_UOP0 0x3c /* Output Port Bit Reset (w) */
/*
* Define bit flags in Mode Register 1 (MR1).
*/
#define MCFUART_MR1_RXRTS 0x80 /* Auto RTS flow control */
#define MCFUART_MR1_RXIRQFULL 0x40 /* RX IRQ type FULL */
#define MCFUART_MR1_RXIRQRDY 0x00 /* RX IRQ type RDY */
#define MCFUART_MR1_RXERRBLOCK 0x20 /* RX block error mode */
#define MCFUART_MR1_RXERRCHAR 0x00 /* RX char error mode */
#define MCFUART_MR1_PARITYNONE 0x10 /* No parity */
#define MCFUART_MR1_PARITYEVEN 0x00 /* Even parity */
#define MCFUART_MR1_PARITYODD 0x04 /* Odd parity */
#define MCFUART_MR1_PARITYSPACE 0x08 /* Space parity */
#define MCFUART_MR1_PARITYMARK 0x0c /* Mark parity */
#define MCFUART_MR1_CS5 0x00 /* 5 bits per char */
#define MCFUART_MR1_CS6 0x01 /* 6 bits per char */
#define MCFUART_MR1_CS7 0x02 /* 7 bits per char */
#define MCFUART_MR1_CS8 0x03 /* 8 bits per char */
/*
* Define bit flags in Mode Register 2 (MR2).
*/
#define MCFUART_MR2_LOOPBACK 0x80 /* Loopback mode */
#define MCFUART_MR2_REMOTELOOP 0xc0 /* Remote loopback mode */
#define MCFUART_MR2_AUTOECHO 0x40 /* Automatic echo */
#define MCFUART_MR2_TXRTS 0x20 /* Assert RTS on TX */
#define MCFUART_MR2_TXCTS 0x10 /* Auto CTS flow control */
#define MCFUART_MR2_STOP1 0x07 /* 1 stop bit */
#define MCFUART_MR2_STOP15 0x08 /* 1.5 stop bits */
#define MCFUART_MR2_STOP2 0x0f /* 2 stop bits */
/*
* Define bit flags in Status Register (USR).
*/
#define MCFUART_USR_RXBREAK 0x80 /* Received BREAK */
#define MCFUART_USR_RXFRAMING 0x40 /* Received framing error */
#define MCFUART_USR_RXPARITY 0x20 /* Received parity error */
#define MCFUART_USR_RXOVERRUN 0x10 /* Received overrun error */
#define MCFUART_USR_TXEMPTY 0x08 /* Transmitter empty */
#define MCFUART_USR_TXREADY 0x04 /* Transmitter ready */
#define MCFUART_USR_RXFULL 0x02 /* Receiver full */
#define MCFUART_USR_RXREADY 0x01 /* Receiver ready */
#define MCFUART_USR_RXERR (MCFUART_USR_RXBREAK | MCFUART_USR_RXFRAMING | \
MCFUART_USR_RXPARITY | MCFUART_USR_RXOVERRUN)
/*
* Define bit flags in Clock Select Register (UCSR).
*/
#define MCFUART_UCSR_RXCLKTIMER 0xd0 /* RX clock is timer */
#define MCFUART_UCSR_RXCLKEXT16 0xe0 /* RX clock is external x16 */
#define MCFUART_UCSR_RXCLKEXT1 0xf0 /* RX clock is external x1 */
#define MCFUART_UCSR_TXCLKTIMER 0x0d /* TX clock is timer */
#define MCFUART_UCSR_TXCLKEXT16 0x0e /* TX clock is external x16 */
#define MCFUART_UCSR_TXCLKEXT1 0x0f /* TX clock is external x1 */
/*
* Define bit flags in Command Register (UCR).
*/
#define MCFUART_UCR_CMDNULL 0x00 /* No command */
#define MCFUART_UCR_CMDRESETMRPTR 0x10 /* Reset MR pointer */
#define MCFUART_UCR_CMDRESETRX 0x20 /* Reset receiver */
#define MCFUART_UCR_CMDRESETTX 0x30 /* Reset transmitter */
#define MCFUART_UCR_CMDRESETERR 0x40 /* Reset error status */
#define MCFUART_UCR_CMDRESETBREAK 0x50 /* Reset BREAK change */
#define MCFUART_UCR_CMDBREAKSTART 0x60 /* Start BREAK */
#define MCFUART_UCR_CMDBREAKSTOP 0x70 /* Stop BREAK */
#define MCFUART_UCR_TXNULL 0x00 /* No TX command */
#define MCFUART_UCR_TXENABLE 0x04 /* Enable TX */
#define MCFUART_UCR_TXDISABLE 0x08 /* Disable TX */
#define MCFUART_UCR_RXNULL 0x00 /* No RX command */
#define MCFUART_UCR_RXENABLE 0x01 /* Enable RX */
#define MCFUART_UCR_RXDISABLE 0x02 /* Disable RX */
/*
* Define bit flags in Input Port Change Register (UIPCR).
*/
#define MCFUART_UIPCR_CTSCOS 0x10 /* CTS change of state */
#define MCFUART_UIPCR_CTS 0x01 /* CTS value */
/*
* Define bit flags in Input Port Register (UIP).
*/
#define MCFUART_UIPR_CTS 0x01 /* CTS value */
/*
* Define bit flags in Output Port Registers (UOP).
* Clear bit by writing to UOP0, set by writing to UOP1.
*/
#define MCFUART_UOP_RTS 0x01 /* RTS set or clear */
/*
* Define bit flags in the Auxiliary Control Register (UACR).
*/
#define MCFUART_UACR_IEC 0x01 /* Input enable control */
/*
* Define bit flags in Interrupt Status Register (UISR).
* These same bits are used for the Interrupt Mask Register (UIMR).
*/
#define MCFUART_UIR_COS 0x80 /* Change of state (CTS) */
#define MCFUART_UIR_DELTABREAK 0x04 /* Break start or stop */
#define MCFUART_UIR_RXREADY 0x02 /* Receiver ready */
#define MCFUART_UIR_TXREADY 0x01 /* Transmitter ready */
#ifdef CONFIG_M5272
/*
* Define bit flags in the Transmitter FIFO Register (UTF).
*/
#define MCFUART_UTF_TXB 0x1f /* Transmitter data level */
#define MCFUART_UTF_FULL 0x20 /* Transmitter fifo full */
#define MCFUART_UTF_TXS 0xc0 /* Transmitter status */
/*
* Define bit flags in the Receiver FIFO Register (URF).
*/
#define MCFUART_URF_RXB 0x1f /* Receiver data level */
#define MCFUART_URF_FULL 0x20 /* Receiver fifo full */
#define MCFUART_URF_RXS 0xc0 /* Receiver status */
#endif
/****************************************************************************/
#endif /* mcfuart_h */

View file

@ -0,0 +1,119 @@
/****************************************************************************/
/*
* mcfdebug.h -- ColdFire Debug Module support.
*
* (C) Copyright 2001, Lineo Inc. (www.lineo.com)
*/
/****************************************************************************/
#ifndef mcfdebug_h
#define mcfdebug_h
/****************************************************************************/
#include <linux/config.h>
/* Define the debug module registers */
#define MCFDEBUG_CSR 0x0 /* Configuration status */
#define MCFDEBUG_BAAR 0x5 /* BDM address attribute */
#define MCFDEBUG_AATR 0x6 /* Address attribute trigger */
#define MCFDEBUG_TDR 0x7 /* Trigger definition */
#define MCFDEBUG_PBR 0x8 /* PC breakpoint */
#define MCFDEBUG_PBMR 0x9 /* PC breakpoint mask */
#define MCFDEBUG_ABHR 0xc /* High address breakpoint */
#define MCFDEBUG_ABLR 0xd /* Low address breakpoint */
#define MCFDEBUG_DBR 0xe /* Data breakpoint */
#define MCFDEBUG_DBMR 0xf /* Data breakpoint mask */
/* Define some handy constants for the trigger definition register */
#define MCFDEBUG_TDR_TRC_DISP 0x00000000 /* display on DDATA only */
#define MCFDEBUG_TDR_TRC_HALT 0x40000000 /* Processor halt on BP */
#define MCFDEBUG_TDR_TRC_INTR 0x80000000 /* Debug intr on BP */
#define MCFDEBUG_TDR_LXT1 0x00004000 /* TDR level 1 */
#define MCFDEBUG_TDR_LXT2 0x00008000 /* TDR level 2 */
#define MCFDEBUG_TDR_EBL1 0x00002000 /* Enable breakpoint level 1 */
#define MCFDEBUG_TDR_EBL2 0x20000000 /* Enable breakpoint level 2 */
#define MCFDEBUG_TDR_EDLW1 0x00001000 /* Enable data BP longword */
#define MCFDEBUG_TDR_EDLW2 0x10000000
#define MCFDEBUG_TDR_EDWL1 0x00000800 /* Enable data BP lower word */
#define MCFDEBUG_TDR_EDWL2 0x08000000
#define MCFDEBUG_TDR_EDWU1 0x00000400 /* Enable data BP upper word */
#define MCFDEBUG_TDR_EDWU2 0x04000000
#define MCFDEBUG_TDR_EDLL1 0x00000200 /* Enable data BP low low byte */
#define MCFDEBUG_TDR_EDLL2 0x02000000
#define MCFDEBUG_TDR_EDLM1 0x00000100 /* Enable data BP low mid byte */
#define MCFDEBUG_TDR_EDLM2 0x01000000
#define MCFDEBUG_TDR_EDUM1 0x00000080 /* Enable data BP up mid byte */
#define MCFDEBUG_TDR_EDUM2 0x00800000
#define MCFDEBUG_TDR_EDUU1 0x00000040 /* Enable data BP up up byte */
#define MCFDEBUG_TDR_EDUU2 0x00400000
#define MCFDEBUG_TDR_DI1 0x00000020 /* Data BP invert */
#define MCFDEBUG_TDR_DI2 0x00200000
#define MCFDEBUG_TDR_EAI1 0x00000010 /* Enable address BP inverted */
#define MCFDEBUG_TDR_EAI2 0x00100000
#define MCFDEBUG_TDR_EAR1 0x00000008 /* Enable address BP range */
#define MCFDEBUG_TDR_EAR2 0x00080000
#define MCFDEBUG_TDR_EAL1 0x00000004 /* Enable address BP low */
#define MCFDEBUG_TDR_EAL2 0x00040000
#define MCFDEBUG_TDR_EPC1 0x00000002 /* Enable PC BP */
#define MCFDEBUG_TDR_EPC2 0x00020000
#define MCFDEBUG_TDR_PCI1 0x00000001 /* PC BP invert */
#define MCFDEBUG_TDR_PCI2 0x00010000
/* Constants for the address attribute trigger register */
#define MCFDEBUG_AAR_RESET 0x00000005
/* Fields not yet implemented */
/* And some definitions for the writable sections of the CSR */
#define MCFDEBUG_CSR_RESET 0x00100000
#define MCFDEBUG_CSR_PSTCLK 0x00020000 /* PSTCLK disable */
#define MCFDEBUG_CSR_IPW 0x00010000 /* Inhibit processor writes */
#define MCFDEBUG_CSR_MAP 0x00008000 /* Processor refs in emul mode */
#define MCFDEBUG_CSR_TRC 0x00004000 /* Emul mode on trace exception */
#define MCFDEBUG_CSR_EMU 0x00002000 /* Force emulation mode */
#define MCFDEBUG_CSR_DDC_READ 0x00000800 /* Debug data control */
#define MCFDEBUG_CSR_DDC_WRITE 0x00001000
#define MCFDEBUG_CSR_UHE 0x00000400 /* User mode halt enable */
#define MCFDEBUG_CSR_BTB0 0x00000000 /* Branch target 0 bytes */
#define MCFDEBUG_CSR_BTB2 0x00000100 /* Branch target 2 bytes */
#define MCFDEBUG_CSR_BTB3 0x00000200 /* Branch target 3 bytes */
#define MCFDEBUG_CSR_BTB4 0x00000300 /* Branch target 4 bytes */
#define MCFDEBUG_CSR_NPL 0x00000040 /* Non-pipelined mode */
#define MCFDEBUG_CSR_SSM 0x00000010 /* Single step mode */
/* Constants for the BDM address attribute register */
#define MCFDEBUG_BAAR_RESET 0x00000005
/* Fields not yet implemented */
/* This routine wrappers up the wdebug asm instruction so that the register
* and value can be relatively easily specified. The biggest hassle here is
* that the debug module instructions (2 longs) must be long word aligned and
* some pointer fiddling is performed to ensure this.
*/
extern inline void wdebug(int reg, unsigned long data) {
unsigned short dbg_spc[6];
unsigned short *dbg;
// Force alignment to long word boundary
dbg = (unsigned short *)((((unsigned long)dbg_spc) + 3) & 0xfffffffc);
// Build up the debug instruction
dbg[0] = 0x2c80 | (reg & 0xf);
dbg[1] = (data >> 16) & 0xffff;
dbg[2] = data & 0xffff;
dbg[3] = 0;
// Perform the wdebug instruction
#if 0
// This strain is for gas which doesn't have the wdebug instructions defined
asm( "move.l %0, %%a0\n\t"
".word 0xfbd0\n\t"
".word 0x0003\n\t"
:: "g" (dbg) : "a0");
#else
// And this is for when it does
asm( "wdebug (%0)" :: "a" (dbg));
#endif
}
#endif

View file

@ -0,0 +1 @@
#include <asm-m68k/md.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/mman.h>

View file

@ -0,0 +1,11 @@
#ifndef __M68KNOMMU_MMU_H
#define __M68KNOMMU_MMU_H
/* Copyright (C) 2002, David McCullough <[email protected]> */
typedef struct {
struct vm_list_struct *vmlist;
unsigned long end_brk;
} mm_context_t;
#endif /* __M68KNOMMU_MMU_H */

View file

@ -0,0 +1,33 @@
#ifndef __M68KNOMMU_MMU_CONTEXT_H
#define __M68KNOMMU_MMU_CONTEXT_H
#include <linux/config.h>
#include <asm/setup.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
}
extern inline int
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
// mm->context = virt_to_phys(mm->pgd);
return(0);
}
#define destroy_context(mm) do { } while(0)
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
{
}
#define deactivate_mm(tsk,mm) do { } while (0)
extern inline void activate_mm(struct mm_struct *prev_mm,
struct mm_struct *next_mm)
{
}
#endif

View file

@ -0,0 +1 @@
#include <asm-m68k/module.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/movs.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/msgbuf.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/namei.h>

View file

@ -0,0 +1,109 @@
/****************************************************************************/
/*
* nettel.h -- Lineo (formerly Moreton Bay) NETtel support.
*
* (C) Copyright 1999-2000, Moreton Bay (www.moretonbay.com)
* (C) Copyright 2000-2001, Lineo Inc. (www.lineo.com)
* (C) Copyright 2001-2002, SnapGear Inc., (www.snapgear.com)
*/
/****************************************************************************/
#ifndef nettel_h
#define nettel_h
/****************************************************************************/
#include <linux/config.h>
/****************************************************************************/
#ifdef CONFIG_NETtel
/****************************************************************************/
#ifdef CONFIG_COLDFIRE
#include <asm/coldfire.h>
#include <asm/mcfsim.h>
#endif
/*---------------------------------------------------------------------------*/
#if defined(CONFIG_M5307)
/*
* NETtel/5307 based hardware first. DTR/DCD lines are wired to
* GPIO lines. Most of the LED's are driver through a latch
* connected to CS2.
*/
#define MCFPP_DCD1 0x0001
#define MCFPP_DCD0 0x0002
#define MCFPP_DTR1 0x0004
#define MCFPP_DTR0 0x0008
#define NETtel_LEDADDR 0x30400000
#ifndef __ASSEMBLY__
extern volatile unsigned short ppdata;
/*
* These functions defined to give quasi generic access to the
* PPIO bits used for DTR/DCD.
*/
static __inline__ unsigned int mcf_getppdata(void)
{
volatile unsigned short *pp;
pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT);
return((unsigned int) *pp);
}
static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
{
volatile unsigned short *pp;
pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT);
ppdata = (ppdata & ~mask) | bits;
*pp = ppdata;
}
#endif
/*---------------------------------------------------------------------------*/
#elif defined(CONFIG_M5206e)
/*
* NETtel/5206e based hardware has leds on latch on CS3.
* No support modem for lines??
*/
#define NETtel_LEDADDR 0x50000000
/*---------------------------------------------------------------------------*/
#elif defined(CONFIG_M5272)
/*
* NETtel/5272 based hardware. DTR/DCD lines are wired to GPB lines.
*/
#define MCFPP_DCD0 0x0080
#define MCFPP_DCD1 0x0000 /* Port 1 no DCD support */
#define MCFPP_DTR0 0x0040
#define MCFPP_DTR1 0x0000 /* Port 1 no DTR support */
#ifndef __ASSEMBLY__
/*
* These functions defined to give quasi generic access to the
* PPIO bits used for DTR/DCD.
*/
static __inline__ unsigned int mcf_getppdata(void)
{
volatile unsigned short *pp;
pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
return((unsigned int) *pp);
}
static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
{
volatile unsigned short *pp;
pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT);
*pp = (*pp & ~mask) | bits;
}
#endif
#endif
/*---------------------------------------------------------------------------*/
/****************************************************************************/
#endif /* CONFIG_NETtel */
/****************************************************************************/
#endif /* nettel_h */

View file

@ -0,0 +1 @@
#include <asm-m68k/openprom.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/oplib.h>

View file

@ -0,0 +1,95 @@
#ifndef _M68KNOMMU_PAGE_H
#define _M68KNOMMU_PAGE_H
#include <linux/config.h>
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT (12)
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#ifdef __KERNEL__
#include <asm/setup.h>
#ifndef __ASSEMBLY__
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
#define free_user_page(page, addr) free_page(addr)
#define clear_page(page) memset((page), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
#define clear_user_page(page, vaddr, pg) clear_page(page)
#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr)
#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
/*
* These are used to make use of C type-checking..
*/
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long pmd[16]; } pmd_t;
typedef struct { unsigned long pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t;
#define pte_val(x) ((x).pte)
#define pmd_val(x) ((&x)->pmd[0])
#define pgd_val(x) ((x).pgd)
#define pgprot_val(x) ((x).pgprot)
#define __pte(x) ((pte_t) { (x) } )
#define __pmd(x) ((pmd_t) { (x) } )
#define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } )
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
/* Pure 2^n version of get_order */
extern __inline__ int get_order(unsigned long size)
{
int order;
size = (size-1) >> (PAGE_SHIFT-1);
order = -1;
do {
size >>= 1;
order++;
} while (size);
return order;
}
extern unsigned long memory_start;
extern unsigned long memory_end;
#endif /* !__ASSEMBLY__ */
#include <asm/page_offset.h>
#define PAGE_OFFSET (PAGE_OFFSET_RAW)
#ifndef __ASSEMBLY__
#define __pa(vaddr) virt_to_phys((void *)vaddr)
#define __va(paddr) phys_to_virt((unsigned long)paddr)
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
#define page_to_pfn(page) virt_to_pfn(page_to_virt(page))
#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
((void *)(kaddr) < (void *)memory_end))
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _M68KNOMMU_PAGE_H */

View file

@ -0,0 +1,47 @@
#include <linux/config.h>
/* This handles the memory map.. */
#ifdef CONFIG_COLDFIRE
#if defined(CONFIG_SMALL)
#define PAGE_OFFSET_RAW 0x30020000
#elif defined(CONFIG_CFV240)
#define PAGE_OFFSET_RAW 0x02000000
#else
#define PAGE_OFFSET_RAW 0x00000000
#endif
#endif
#ifdef CONFIG_M68360
#define PAGE_OFFSET_RAW 0x00000000
#endif
#ifdef CONFIG_PILOT
#ifdef CONFIG_M68328
#define PAGE_OFFSET_RAW 0x10000000
#endif
#ifdef CONFIG_M68EZ328
#define PAGE_OFFSET_RAW 0x00000000
#endif
#endif
#ifdef CONFIG_UCSIMM
#define PAGE_OFFSET_RAW 0x00000000
#endif
#if defined(CONFIG_UCDIMM) || defined(CONFIG_DRAGEN2)
#ifdef CONFIG_M68VZ328
#define PAGE_OFFSET_RAW 0x00000000
#endif /* CONFIG_M68VZ328 */
#endif /* CONFIG_UCDIMM */
#ifdef CONFIG_M68EZ328ADS
#define PAGE_OFFSET_RAW 0x00000000
#endif
#ifdef CONFIG_ALMA_ANS
#define PAGE_OFFSET_RAW 0x00000000
#endif
#ifdef CONFIG_M68EN302
#define PAGE_OFFSET_RAW 0x00000000
#endif

View file

@ -0,0 +1,26 @@
#ifndef _M68KNOMMU_PARAM_H
#define _M68KNOMMU_PARAM_H
#include <linux/config.h>
#if defined(CONFIG_CLEOPATRA)
#define HZ 1000
#endif
#ifndef HZ
#define HZ 100
#endif
#ifdef __KERNEL__
#define USER_HZ HZ
#define CLOCKS_PER_SEC (USER_HZ)
#endif
#define EXEC_PAGESIZE 4096
#ifndef NOGROUP
#define NOGROUP (-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
#endif /* _M68KNOMMU_PARAM_H */

View file

@ -0,0 +1,39 @@
#ifndef M68KNOMMU_PCI_H
#define M68KNOMMU_PCI_H
#include <asm-m68k/pci.h>
#ifdef CONFIG_COMEMPCI
/*
* These are pretty much arbitary with the CoMEM implementation.
* We have the whole address space to ourselves.
*/
#define PCIBIOS_MIN_IO 0x100
#define PCIBIOS_MIN_MEM 0x00010000
#define pcibios_scan_all_fns(a, b) 0
/*
* Return whether the given PCI device DMA address mask can
* be supported properly. For example, if your device can
* only drive the low 24-bits during PCI bus mastering, then
* you would pass 0x00ffffff as the mask to this function.
*/
static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
{
return 1;
}
/*
* Not supporting more than 32-bit PCI bus addresses now, but
* must satisfy references to this function. Change if needed.
*/
#define pci_dac_dma_supported(pci_dev, mask) (0)
static inline void pcibios_add_platform_entries(struct pci_dev *dev)
{
}
#endif /* CONFIG_COMEMPCI */
#endif /* M68KNOMMU_PCI_H */

View file

@ -0,0 +1,6 @@
#ifndef __ARCH_M68KNOMMU_PERCPU__
#define __ARCH_M68KNOMMU_PERCPU__
#include <asm-generic/percpu.h>
#endif /* __ARCH_M68KNOMMU_PERCPU__ */

View file

@ -0,0 +1,8 @@
#ifndef _M68KNOMMU_PGALLOC_H
#define _M68KNOMMU_PGALLOC_H
#include <asm/setup.h>
#define check_pgt_cache() do { } while (0)
#endif /* _M68KNOMMU_PGALLOC_H */

View file

@ -0,0 +1,76 @@
#ifndef _M68KNOMMU_PGTABLE_H
#define _M68KNOMMU_PGTABLE_H
#include <asm-generic/4level-fixup.h>
/*
* (C) Copyright 2000-2002, Greg Ungerer <gerg@snapgear.com>
*/
#include <linux/config.h>
#include <linux/slab.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/io.h>
/*
* Trivial page table functions.
*/
#define pgd_present(pgd) (1)
#define pgd_none(pgd) (0)
#define pgd_bad(pgd) (0)
#define pgd_clear(pgdp)
#define kern_addr_valid(addr) (1)
#define pmd_offset(a, b) ((void *)0)
#define PAGE_NONE __pgprot(0)
#define PAGE_SHARED __pgprot(0)
#define PAGE_COPY __pgprot(0)
#define PAGE_READONLY __pgprot(0)
#define PAGE_KERNEL __pgprot(0)
extern void paging_init(void);
#define swapper_pg_dir ((pgd_t *) 0)
#define __swp_type(x) (0)
#define __swp_offset(x) (0)
#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
static inline int pte_file(pte_t pte) { return 0; }
/*
* ZERO_PAGE is a global shared page that is always zero: used
* for zero-mapped memory areas etc..
*/
#define ZERO_PAGE(vaddr) (virt_to_page(0))
/*
* These would be in other places but having them here reduces the diffs.
*/
extern unsigned int kobjsize(const void *objp);
extern int is_in_rom(unsigned long);
/*
* No page table caches to initialise.
*/
#define pgtable_cache_init() do { } while (0)
#define io_remap_page_range(vma, vaddr, paddr, size, prot) \
remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot)
#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
remap_pfn_range(vma, vaddr, pfn, size, prot)
#define MK_IOSPACE_PFN(space, pfn) (pfn)
#define GET_IOSPACE(pfn) 0
#define GET_PFN(pfn) (pfn)
/*
* All 32bit addresses are effectively valid for vmalloc...
* Sort of meaningless for non-VM targets.
*/
#define VMALLOC_START 0
#define VMALLOC_END 0xffffffff
#endif /* _M68KNOMMU_PGTABLE_H */

View file

@ -0,0 +1 @@
#include <asm-m68k/poll.h>

View file

@ -0,0 +1 @@
#include <asm-m68k/posix_types.h>

View file

@ -0,0 +1,131 @@
/*
* include/asm-m68k/processor.h
*
* Copyright (C) 1995 Hamish Macdonald
*/
#ifndef __ASM_M68K_PROCESSOR_H
#define __ASM_M68K_PROCESSOR_H
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
*/
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
#include <linux/config.h>
#include <linux/threads.h>
#include <asm/types.h>
#include <asm/segment.h>
#include <asm/fpu.h>
#include <asm/ptrace.h>
#include <asm/current.h>
extern inline unsigned long rdusp(void)
{
#ifdef CONFIG_COLDFIRE
extern unsigned int sw_usp;
return(sw_usp);
#else
unsigned long usp;
__asm__ __volatile__("move %/usp,%0" : "=a" (usp));
return usp;
#endif
}
extern inline void wrusp(unsigned long usp)
{
#ifdef CONFIG_COLDFIRE
extern unsigned int sw_usp;
sw_usp = usp;
#else
__asm__ __volatile__("move %0,%/usp" : : "a" (usp));
#endif
}
/*
* User space process size: 3.75GB. This is hardcoded into a few places,
* so don't change it unless you know what you are doing.
*/
#define TASK_SIZE (0xF0000000UL)
/*
* This decides where the kernel will search for a free chunk of vm
* space during mmap's. We won't be using it
*/
#define TASK_UNMAPPED_BASE 0
/*
* if you change this structure, you must change the code and offsets
* in m68k/machasm.S
*/
struct thread_struct {
unsigned long ksp; /* kernel stack pointer */
unsigned long usp; /* user stack pointer */
unsigned short sr; /* saved status register */
unsigned short fs; /* saved fs (sfc, dfc) */
unsigned long crp[2]; /* cpu root pointer */
unsigned long esp0; /* points to SR of stack frame */
unsigned long fp[8*3];
unsigned long fpcntl[3]; /* fp control regs */
unsigned char fpstate[FPSTATESIZE]; /* floating point state */
};
#define INIT_THREAD { \
sizeof(init_stack) + (unsigned long) init_stack, 0, \
PS_S, __KERNEL_DS, \
{0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \
}
/*
* Do necessary setup to start up a newly executed thread.
*
* pass the data segment into user programs if it exists,
* it can't hurt anything as far as I can tell
*/
#define start_thread(_regs, _pc, _usp) \
do { \
set_fs(USER_DS); /* reads from user space */ \
(_regs)->pc = (_pc); \
if (current->mm) \
(_regs)->d5 = current->mm->start_data; \
(_regs)->sr &= ~0x2000; \
wrusp(_usp); \
} while(0)
/* Forward declaration, a strange C thing */
struct task_struct;
/* Free all resources held by a thread. */
static inline void release_thread(struct task_struct *dead_task)
{
}
/* Prepare to copy thread state - unlazy all lazy status */
#define prepare_to_copy(tsk) do { } while (0)
extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
/*
* Free current thread data structures etc..
*/
static inline void exit_thread(void)
{
}
unsigned long thread_saved_pc(struct task_struct *tsk);
unsigned long get_wchan(struct task_struct *p);
#define KSTK_EIP(tsk) \
({ \
unsigned long eip = 0; \
if ((tsk)->thread.esp0 > PAGE_SIZE && \
(virt_addr_valid((tsk)->thread.esp0))) \
eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
eip; })
#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
#define cpu_relax() do { } while (0)
#endif

View file

@ -0,0 +1,91 @@
#ifndef _M68K_PTRACE_H
#define _M68K_PTRACE_H
#define PT_D1 0
#define PT_D2 1
#define PT_D3 2
#define PT_D4 3
#define PT_D5 4
#define PT_D6 5
#define PT_D7 6
#define PT_A0 7
#define PT_A1 8
#define PT_A2 9
#define PT_A3 10
#define PT_A4 11
#define PT_A5 12
#define PT_A6 13
#define PT_D0 14
#define PT_USP 15
#define PT_ORIG_D0 16
#define PT_SR 17
#define PT_PC 18
#ifndef __ASSEMBLY__
/* this struct defines the way the registers are stored on the
stack during a system call. */
struct pt_regs {
long d1;
long d2;
long d3;
long d4;
long d5;
long a0;
long a1;
long a2;
long d0;
long orig_d0;
long stkadj;
#ifdef CONFIG_COLDFIRE
unsigned format : 4; /* frame format specifier */
unsigned vector : 12; /* vector offset */
unsigned short sr;
unsigned long pc;
#else
unsigned short sr;
unsigned long pc;
#ifndef NO_FORMAT_VEC
unsigned format : 4; /* frame format specifier */
unsigned vector : 12; /* vector offset */
#endif
#endif
};
/*
* This is the extended stack used by signal handlers and the context
* switcher: it's pushed after the normal "struct pt_regs".
*/
struct switch_stack {
unsigned long d6;
unsigned long d7;
unsigned long a3;
unsigned long a4;
unsigned long a5;
unsigned long a6;
unsigned long retpc;
};
/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
#define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13
#ifdef COFNIG_FPU
#define PTRACE_GETFPREGS 14
#define PTRACE_SETFPREGS 15
#endif
#ifdef __KERNEL__
#ifndef PS_S
#define PS_S (0x2000)
#define PS_M (0x1000)
#endif
#define user_mode(regs) (!((regs)->sr & PS_S))
#define instruction_pointer(regs) ((regs)->pc)
#define profile_pc(regs) instruction_pointer(regs)
extern void show_regs(struct pt_regs *);
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
#endif /* _M68K_PTRACE_H */

View file

@ -0,0 +1,52 @@
/***********************************
* $Id: quicc_simple.h,v 1.1 2002/03/02 15:01:10 gerg Exp $
***********************************
*
***************************************
* Simple drivers common header
***************************************
*/
#ifndef __SIMPLE_H
#define __SIMPLE_H
/* #include "quicc.h" */
#define GLB_SCC_0 0
#define GLB_SCC_1 1
#define GLB_SCC_2 2
#define GLB_SCC_3 3
typedef void (int_routine)(unsigned short interrupt_event);
typedef int_routine *int_routine_ptr;
typedef void *(alloc_routine)(int length);
typedef void (free_routine)(int scc_num, int channel_num, void *buf);
typedef void (store_rx_buffer_routine)(int scc_num, int channel_num, void *buff, int length);
typedef int (handle_tx_error_routine)(int scc_num, int channel_num, QUICC_BD *tbd);
typedef void (handle_rx_error_routine)(int scc_num, int channel_num, QUICC_BD *rbd);
typedef void (handle_lost_error_routine)(int scc_num, int channel_num);
/* user defined functions for global errors */
typedef void (handle_glob_overrun_routine)(int scc_number);
typedef void (handle_glob_underrun_routine)(int scc_number);
typedef void (glob_intr_q_overflow_routine)(int scc_number);
/*
* General initialization and command routines
*/
void quicc_issue_cmd (unsigned short cmd, int scc_num);
void quicc_init(void);
void quicc_scc_init(int scc_number, int number_of_rx_buf, int number_of_tx_buf);
void quicc_smc_init(int smc_number, int number_of_rx_buf, int number_of_tx_buf);
void quicc_scc_start(int scc_num);
void quicc_scc_loopback(int scc_num);
/* Interrupt enable/disable routines for critical pieces of code*/
unsigned short IntrDis(void);
void IntrEna(unsigned short old_sr);
/* For debugging */
void print_rbd(int scc_num);
void print_tbd(int scc_num);
#endif

View file

@ -0,0 +1 @@
#include <asm-m68k/resource.h>

View file

@ -0,0 +1,13 @@
#ifndef _M68KNOMMU_SCATTERLIST_H
#define _M68KNOMMU_SCATTERLIST_H
struct scatterlist {
struct page *page;
unsigned int offset;
dma_addr_t dma_address;
unsigned int length;
};
#define ISA_DMA_THRESHOLD (0xffffffff)
#endif /* !(_M68KNOMMU_SCATTERLIST_H) */

View file

@ -0,0 +1,7 @@
#ifndef _M68KNOMMU_SECTIONS_H
#define _M68KNOMMU_SECTIONS_H
/* nothing to see, move along */
#include <asm-generic/sections.h>
#endif

View file

@ -0,0 +1,51 @@
#ifndef _M68K_SEGMENT_H
#define _M68K_SEGMENT_H
/* define constants */
/* Address spaces (FC0-FC2) */
#define USER_DATA (1)
#ifndef __USER_DS
#define __USER_DS (USER_DATA)
#endif
#define USER_PROGRAM (2)
#define SUPER_DATA (5)
#ifndef __KERNEL_DS
#define __KERNEL_DS (SUPER_DATA)
#endif
#define SUPER_PROGRAM (6)
#define CPU_SPACE (7)
#ifndef __ASSEMBLY__
typedef struct {
unsigned long seg;
} mm_segment_t;
#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
#define USER_DS MAKE_MM_SEG(__USER_DS)
#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
/*
* Get/set the SFC/DFC registers for MOVES instructions
*/
static inline mm_segment_t get_fs(void)
{
return USER_DS;
}
static inline mm_segment_t get_ds(void)
{
/* return the supervisor data space code */
return KERNEL_DS;
}
static inline void set_fs(mm_segment_t val)
{
}
#define segment_eq(a,b) ((a).seg == (b).seg)
#endif /* __ASSEMBLY__ */
#endif /* _M68K_SEGMENT_H */

Some files were not shown because too many files have changed in this diff Show more