mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561 (Dual Core) devices, with a variety of development platforms including those avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP, BF561-EZKIT), and Bluetechnix! Tinyboards. The Blackfin architecture was jointly developed by Intel and Analog Devices Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in December of 2000. Since then ADI has put this core into its Blackfin processor family of devices. The Blackfin core has the advantages of a clean, orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC (Multiply/Accumulate), state-of-the-art signal processing engine and single-instruction, multiple-data (SIMD) multimedia capabilities into a single instruction-set architecture. The Blackfin architecture, including the instruction set, is described by the ADSP-BF53x/BF56x Blackfin Processor Programming Reference http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf The Blackfin processor is already supported by major releases of gcc, and there are binary and source rpms/tarballs for many architectures at: http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete documentation, including "getting started" guides available at: http://docs.blackfin.uclinux.org/ which provides links to the sources and patches you will need in order to set up a cross-compiling environment for bfin-linux-uclibc This patch, as well as the other patches (toolchain, distribution, uClibc) are actively supported by Analog Devices Inc, at: http://blackfin.uclinux.org/ We have tested this on LTP, and our test plan (including pass/fails) can be found at: http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel [[email protected]: balance parenthesis in blackfin header files] Signed-off-by: Bryan Wu <[email protected]> Signed-off-by: Mariusz Kozlowski <[email protected]> Signed-off-by: Aubrey Li <[email protected]> Signed-off-by: Jie Zhang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7324328446
commit
1394f03221
257 changed files with 47285 additions and 6 deletions
1
include/asm-blackfin/Kbuild
Normal file
1
include/asm-blackfin/Kbuild
Normal file
|
|
@ -0,0 +1 @@
|
|||
include include/asm-generic/Kbuild.asm
|
||||
25
include/asm-blackfin/a.out.h
Normal file
25
include/asm-blackfin/a.out.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef __BFIN_A_OUT_H__
|
||||
#define __BFIN_A_OUT_H__
|
||||
|
||||
struct exec {
|
||||
unsigned long a_info; /* Use macros N_MAGIC, etc for access */
|
||||
unsigned a_text; /* length of text, in bytes */
|
||||
unsigned a_data; /* length of data, in bytes */
|
||||
unsigned a_bss; /* length of uninitialized data area for file, in bytes */
|
||||
unsigned a_syms; /* length of symbol table data in file, in bytes */
|
||||
unsigned a_entry; /* start address */
|
||||
unsigned a_trsize; /* length of relocation info for text, in bytes */
|
||||
unsigned a_drsize; /* length of relocation info for data, in bytes */
|
||||
};
|
||||
|
||||
#define N_TRSIZE(a) ((a).a_trsize)
|
||||
#define N_DRSIZE(a) ((a).a_drsize)
|
||||
#define N_SYMSIZE(a) ((a).a_syms)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define STACK_TOP TASK_SIZE
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __BFIN_A_OUT_H__ */
|
||||
144
include/asm-blackfin/atomic.h
Normal file
144
include/asm-blackfin/atomic.h
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
#ifndef __ARCH_BLACKFIN_ATOMIC__
|
||||
#define __ARCH_BLACKFIN_ATOMIC__
|
||||
|
||||
#include <asm/system.h> /* local_irq_XXX() */
|
||||
|
||||
/*
|
||||
* Atomic operations that C can't guarantee us. Useful for
|
||||
* resource counting etc..
|
||||
*
|
||||
* Generally we do not concern about SMP BFIN systems, so we don't have
|
||||
* to deal with that.
|
||||
*
|
||||
* Tony Kou (tonyko@lineo.ca) Lineo Inc. 2001
|
||||
*/
|
||||
|
||||
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)
|
||||
{
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter += i;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static __inline__ void atomic_sub(int i, atomic_t * v)
|
||||
{
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter -= i;
|
||||
local_irq_restore(flags);
|
||||
|
||||
}
|
||||
|
||||
static inline int atomic_add_return(int i, atomic_t * v)
|
||||
{
|
||||
int __temp = 0;
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter += i;
|
||||
__temp = v->counter;
|
||||
local_irq_restore(flags);
|
||||
|
||||
|
||||
return __temp;
|
||||
}
|
||||
|
||||
#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
|
||||
static inline int atomic_sub_return(int i, atomic_t * v)
|
||||
{
|
||||
int __temp = 0;
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter -= i;
|
||||
__temp = v->counter;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return __temp;
|
||||
}
|
||||
|
||||
static __inline__ void atomic_inc(volatile atomic_t * v)
|
||||
{
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter++;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
|
||||
#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
|
||||
|
||||
#define atomic_add_unless(v, a, u) \
|
||||
({ \
|
||||
int c, old; \
|
||||
c = atomic_read(v); \
|
||||
while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
|
||||
c = old; \
|
||||
c != (u); \
|
||||
})
|
||||
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
|
||||
|
||||
static __inline__ void atomic_dec(volatile atomic_t * v)
|
||||
{
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter--;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t * v)
|
||||
{
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter &= ~mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static __inline__ void atomic_set_mask(unsigned int mask, atomic_t * v)
|
||||
{
|
||||
long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
v->counter |= mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
/* 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()
|
||||
|
||||
#define atomic_dec_return(v) atomic_sub_return(1,(v))
|
||||
#define atomic_inc_return(v) atomic_add_return(1,(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.
|
||||
*/
|
||||
#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
|
||||
|
||||
#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
|
||||
#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
|
||||
|
||||
#include <asm-generic/atomic.h>
|
||||
|
||||
#endif /* __ARCH_BLACKFIN_ATOMIC __ */
|
||||
4
include/asm-blackfin/auxvec.h
Normal file
4
include/asm-blackfin/auxvec.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef __ASMBFIN_AUXVEC_H
|
||||
#define __ASMBFIN_AUXVEC_H
|
||||
|
||||
#endif
|
||||
209
include/asm-blackfin/bf5xx_timers.h
Normal file
209
include/asm-blackfin/bf5xx_timers.h
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
* include/asm/bf5xx_timers.h
|
||||
*
|
||||
* This file contains the major Data structures and constants
|
||||
* used for General Purpose Timer Implementation in BF5xx
|
||||
*
|
||||
* Copyright (C) 2005 John DeHority
|
||||
* Copyright (C) 2006 Hella Aglaia GmbH (awe@aglaia-gmbh.de)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BLACKFIN_TIMERS_H_
|
||||
#define _BLACKFIN_TIMERS_H_
|
||||
|
||||
#undef MAX_BLACKFIN_GPTIMERS
|
||||
/*
|
||||
* BF537: 8 timers:
|
||||
*/
|
||||
#if defined(CONFIG_BF537)
|
||||
# define MAX_BLACKFIN_GPTIMERS 8
|
||||
# define TIMER0_GROUP_REG TIMER_ENABLE
|
||||
#endif
|
||||
/*
|
||||
* BF561: 12 timers:
|
||||
*/
|
||||
#if defined(CONFIG_BF561)
|
||||
# define MAX_BLACKFIN_GPTIMERS 12
|
||||
# define TIMER0_GROUP_REG TMRS8_ENABLE
|
||||
# define TIMER8_GROUP_REG TMRS4_ENABLE
|
||||
#endif
|
||||
/*
|
||||
* All others: 3 timers:
|
||||
*/
|
||||
#if !defined(MAX_BLACKFIN_GPTIMERS)
|
||||
# define MAX_BLACKFIN_GPTIMERS 3
|
||||
# define TIMER0_GROUP_REG TIMER_ENABLE
|
||||
#endif
|
||||
|
||||
#define BLACKFIN_GPTIMER_IDMASK ((1UL << MAX_BLACKFIN_GPTIMERS) - 1)
|
||||
#define BFIN_TIMER_OCTET(x) ((x) >> 3)
|
||||
|
||||
/* used in masks for timer_enable() and timer_disable() */
|
||||
#define TIMER0bit 0x0001 /* 0001b */
|
||||
#define TIMER1bit 0x0002 /* 0010b */
|
||||
#define TIMER2bit 0x0004 /* 0100b */
|
||||
|
||||
#if (MAX_BLACKFIN_GPTIMERS > 3)
|
||||
# define TIMER3bit 0x0008
|
||||
# define TIMER4bit 0x0010
|
||||
# define TIMER5bit 0x0020
|
||||
# define TIMER6bit 0x0040
|
||||
# define TIMER7bit 0x0080
|
||||
#endif
|
||||
|
||||
#if (MAX_BLACKFIN_GPTIMERS > 8)
|
||||
# define TIMER8bit 0x0100
|
||||
# define TIMER9bit 0x0200
|
||||
# define TIMER10bit 0x0400
|
||||
# define TIMER11bit 0x0800
|
||||
#endif
|
||||
|
||||
#define TIMER0_id 0
|
||||
#define TIMER1_id 1
|
||||
#define TIMER2_id 2
|
||||
|
||||
#if (MAX_BLACKFIN_GPTIMERS > 3)
|
||||
# define TIMER3_id 3
|
||||
# define TIMER4_id 4
|
||||
# define TIMER5_id 5
|
||||
# define TIMER6_id 6
|
||||
# define TIMER7_id 7
|
||||
#endif
|
||||
|
||||
#if (MAX_BLACKFIN_GPTIMERS > 8)
|
||||
# define TIMER8_id 8
|
||||
# define TIMER9_id 9
|
||||
# define TIMER10_id 10
|
||||
# define TIMER11_id 11
|
||||
#endif
|
||||
|
||||
/* associated timers for ppi framesync: */
|
||||
|
||||
#if defined(CONFIG_BF561)
|
||||
# define FS0_1_TIMER_ID TIMER8_id
|
||||
# define FS0_2_TIMER_ID TIMER9_id
|
||||
# define FS1_1_TIMER_ID TIMER10_id
|
||||
# define FS1_2_TIMER_ID TIMER11_id
|
||||
# define FS0_1_TIMER_BIT TIMER8bit
|
||||
# define FS0_2_TIMER_BIT TIMER9bit
|
||||
# define FS1_1_TIMER_BIT TIMER10bit
|
||||
# define FS1_2_TIMER_BIT TIMER11bit
|
||||
# undef FS1_TIMER_ID
|
||||
# undef FS2_TIMER_ID
|
||||
# undef FS1_TIMER_BIT
|
||||
# undef FS2_TIMER_BIT
|
||||
#else
|
||||
# define FS1_TIMER_ID TIMER0_id
|
||||
# define FS2_TIMER_ID TIMER1_id
|
||||
# define FS1_TIMER_BIT TIMER0bit
|
||||
# define FS2_TIMER_BIT TIMER1bit
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Timer Configuration Register Bits
|
||||
*/
|
||||
#define TIMER_ERR 0xC000
|
||||
#define TIMER_ERR_OVFL 0x4000
|
||||
#define TIMER_ERR_PROG_PER 0x8000
|
||||
#define TIMER_ERR_PROG_PW 0xC000
|
||||
#define TIMER_EMU_RUN 0x0200
|
||||
#define TIMER_TOGGLE_HI 0x0100
|
||||
#define TIMER_CLK_SEL 0x0080
|
||||
#define TIMER_OUT_DIS 0x0040
|
||||
#define TIMER_TIN_SEL 0x0020
|
||||
#define TIMER_IRQ_ENA 0x0010
|
||||
#define TIMER_PERIOD_CNT 0x0008
|
||||
#define TIMER_PULSE_HI 0x0004
|
||||
#define TIMER_MODE 0x0003
|
||||
#define TIMER_MODE_PWM 0x0001
|
||||
#define TIMER_MODE_WDTH 0x0002
|
||||
#define TIMER_MODE_EXT_CLK 0x0003
|
||||
|
||||
/*
|
||||
** Timer Status Register Bits
|
||||
*/
|
||||
#define TIMER_STATUS_TIMIL0 0x0001
|
||||
#define TIMER_STATUS_TIMIL1 0x0002
|
||||
#define TIMER_STATUS_TIMIL2 0x0004
|
||||
#if (MAX_BLACKFIN_GPTIMERS > 3)
|
||||
# define TIMER_STATUS_TIMIL3 0x00000008
|
||||
# define TIMER_STATUS_TIMIL4 0x00010000
|
||||
# define TIMER_STATUS_TIMIL5 0x00020000
|
||||
# define TIMER_STATUS_TIMIL6 0x00040000
|
||||
# define TIMER_STATUS_TIMIL7 0x00080000
|
||||
# if (MAX_BLACKFIN_GPTIMERS > 8)
|
||||
# define TIMER_STATUS_TIMIL8 0x0001
|
||||
# define TIMER_STATUS_TIMIL9 0x0002
|
||||
# define TIMER_STATUS_TIMIL10 0x0004
|
||||
# define TIMER_STATUS_TIMIL11 0x0008
|
||||
# endif
|
||||
# define TIMER_STATUS_INTR 0x000F000F
|
||||
#else
|
||||
# define TIMER_STATUS_INTR 0x0007 /* any timer interrupt */
|
||||
#endif
|
||||
|
||||
#define TIMER_STATUS_TOVF0 0x0010 /* timer 0 overflow error */
|
||||
#define TIMER_STATUS_TOVF1 0x0020
|
||||
#define TIMER_STATUS_TOVF2 0x0040
|
||||
#if (MAX_BLACKFIN_GPTIMERS > 3)
|
||||
# define TIMER_STATUS_TOVF3 0x00000080
|
||||
# define TIMER_STATUS_TOVF4 0x00100000
|
||||
# define TIMER_STATUS_TOVF5 0x00200000
|
||||
# define TIMER_STATUS_TOVF6 0x00400000
|
||||
# define TIMER_STATUS_TOVF7 0x00800000
|
||||
# if (MAX_BLACKFIN_GPTIMERS > 8)
|
||||
# define TIMER_STATUS_TOVF8 0x0010
|
||||
# define TIMER_STATUS_TOVF9 0x0020
|
||||
# define TIMER_STATUS_TOVF10 0x0040
|
||||
# define TIMER_STATUS_TOVF11 0x0080
|
||||
# endif
|
||||
# define TIMER_STATUS_OFLOW 0x00F000F0
|
||||
#else
|
||||
# define TIMER_STATUS_OFLOW 0x0070 /* any timer overflow */
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Timer Slave Enable Status : write 1 to clear
|
||||
*/
|
||||
#define TIMER_STATUS_TRUN0 0x1000
|
||||
#define TIMER_STATUS_TRUN1 0x2000
|
||||
#define TIMER_STATUS_TRUN2 0x4000
|
||||
#if (MAX_BLACKFIN_GPTIMERS > 3)
|
||||
# define TIMER_STATUS_TRUN3 0x00008000
|
||||
# define TIMER_STATUS_TRUN4 0x10000000
|
||||
# define TIMER_STATUS_TRUN5 0x20000000
|
||||
# define TIMER_STATUS_TRUN6 0x40000000
|
||||
# define TIMER_STATUS_TRUN7 0x80000000
|
||||
# define TIMER_STATUS_TRUN 0xF000F000
|
||||
# if (MAX_BLACKFIN_GPTIMERS > 8)
|
||||
# define TIMER_STATUS_TRUN8 0x1000
|
||||
# define TIMER_STATUS_TRUN9 0x2000
|
||||
# define TIMER_STATUS_TRUN10 0x4000
|
||||
# define TIMER_STATUS_TRUN11 0x8000
|
||||
# endif
|
||||
#else
|
||||
# define TIMER_STATUS_TRUN 0x7000
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* GP_TIMER API's
|
||||
*******************************************************************************/
|
||||
|
||||
void set_gptimer_pwidth (int timer_id, int width);
|
||||
int get_gptimer_pwidth (int timer_id);
|
||||
void set_gptimer_period (int timer_id, int period);
|
||||
int get_gptimer_period (int timer_id);
|
||||
int get_gptimer_count (int timer_id);
|
||||
short get_gptimer_intr (int timer_id);
|
||||
void set_gptimer_config (int timer_id, short config);
|
||||
short get_gptimer_config (int timer_id);
|
||||
void set_gptimer_pulse_hi (int timer_id);
|
||||
void clear_gptimer_pulse_hi(int timer_id);
|
||||
void enable_gptimers (short mask);
|
||||
void disable_gptimers (short mask);
|
||||
short get_enabled_timers (void);
|
||||
int get_gptimer_status (int octet);
|
||||
void set_gptimer_status (int octet, int value);
|
||||
|
||||
#endif
|
||||
120
include/asm-blackfin/bfin-global.h
Normal file
120
include/asm-blackfin/bfin-global.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/bfin-global.h
|
||||
* Based on:
|
||||
* Author: *
|
||||
* Created:
|
||||
* Description: Global extern defines for blackfin
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _BFIN_GLOBAL_H_
|
||||
#define _BFIN_GLOBAL_H_
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <asm-generic/sections.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/user.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#if defined(CONFIG_DMA_UNCACHED_2M)
|
||||
# define DMA_UNCACHED_REGION (2 * 1024 * 1024)
|
||||
#elif defined(CONFIG_DMA_UNCACHED_1M)
|
||||
# define DMA_UNCACHED_REGION (1024 * 1024)
|
||||
#else
|
||||
# define DMA_UNCACHED_REGION (0)
|
||||
#endif
|
||||
|
||||
extern unsigned long get_cclk(void);
|
||||
extern unsigned long get_sclk(void);
|
||||
|
||||
extern void dump_thread(struct pt_regs *regs, struct user *dump);
|
||||
extern void dump_bfin_regs(struct pt_regs *fp, void *retaddr);
|
||||
extern void dump_bfin_trace_buffer(void);
|
||||
|
||||
extern int init_arch_irq(void);
|
||||
extern void bfin_reset(void);
|
||||
extern void _cplb_hdr(void);
|
||||
/* Blackfin cache functions */
|
||||
extern void bfin_icache_init(void);
|
||||
extern void bfin_dcache_init(void);
|
||||
extern int read_iloc(void);
|
||||
extern int bfin_console_init(void);
|
||||
extern asmlinkage void lower_to_irq14(void);
|
||||
extern void init_dma(void);
|
||||
extern void program_IAR(void);
|
||||
extern void evt14_softirq(void);
|
||||
extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
|
||||
extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type);
|
||||
|
||||
extern void *l1_data_A_sram_alloc(size_t);
|
||||
extern void *l1_data_B_sram_alloc(size_t);
|
||||
extern void *l1_inst_sram_alloc(size_t);
|
||||
extern void *l1_data_sram_alloc(size_t);
|
||||
extern void *l1_data_sram_zalloc(size_t);
|
||||
extern int l1_data_A_sram_free(const void*);
|
||||
extern int l1_data_B_sram_free(const void*);
|
||||
extern int l1_inst_sram_free(const void*);
|
||||
extern int l1_data_sram_free(const void*);
|
||||
extern int sram_free(const void*);
|
||||
|
||||
#define L1_INST_SRAM 0x00000001
|
||||
#define L1_DATA_A_SRAM 0x00000002
|
||||
#define L1_DATA_B_SRAM 0x00000004
|
||||
#define L1_DATA_SRAM 0x00000006
|
||||
extern void *sram_alloc_with_lsl(size_t, unsigned long);
|
||||
extern int sram_free_with_lsl(const void*);
|
||||
|
||||
extern void led_on(int);
|
||||
extern void led_off(int);
|
||||
extern void led_toggle(int);
|
||||
extern void led_disp_num(int);
|
||||
extern void led_toggle_num(int);
|
||||
extern void init_leds(void);
|
||||
|
||||
extern char *bfin_board_name __attribute__ ((weak));
|
||||
extern unsigned long wall_jiffies;
|
||||
extern unsigned long ipdt_table[];
|
||||
extern unsigned long dpdt_table[];
|
||||
extern unsigned long icplb_table[];
|
||||
extern unsigned long dcplb_table[];
|
||||
|
||||
extern unsigned long ipdt_swapcount_table[];
|
||||
extern unsigned long dpdt_swapcount_table[];
|
||||
|
||||
extern unsigned long table_start, table_end;
|
||||
|
||||
extern struct file_operations dpmc_fops;
|
||||
extern char _start;
|
||||
extern unsigned long _ramstart, _ramend, _rambase;
|
||||
extern unsigned long memory_start, memory_end, physical_mem_end;
|
||||
extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
|
||||
_ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[];
|
||||
|
||||
#ifdef CONFIG_MTD_UCLINUX
|
||||
extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _BLACKFIN_H_ */
|
||||
170
include/asm-blackfin/bfin5xx_spi.h
Normal file
170
include/asm-blackfin/bfin5xx_spi.h
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/************************************************************
|
||||
*
|
||||
* Copyright (C) 2004, Analog Devices. All Rights Reserved
|
||||
*
|
||||
* FILE bfin5xx_spi.h
|
||||
* PROGRAMMER(S): Luke Yang (Analog Devices Inc.)
|
||||
*
|
||||
*
|
||||
* DATE OF CREATION: March. 10th 2006
|
||||
*
|
||||
* SYNOPSIS:
|
||||
*
|
||||
* DESCRIPTION: header file for SPI controller driver for Blackfin5xx.
|
||||
**************************************************************
|
||||
|
||||
* MODIFICATION HISTORY:
|
||||
* March 10, 2006 bfin5xx_spi.h Created. (Luke Yang)
|
||||
|
||||
************************************************************/
|
||||
|
||||
#ifndef _SPI_CHANNEL_H_
|
||||
#define _SPI_CHANNEL_H_
|
||||
|
||||
#define SPI0_REGBASE 0xffc00500
|
||||
|
||||
#define SPI_READ 0
|
||||
#define SPI_WRITE 1
|
||||
|
||||
#define SPI_CTRL_OFF 0x0
|
||||
#define SPI_FLAG_OFF 0x4
|
||||
#define SPI_STAT_OFF 0x8
|
||||
#define SPI_TXBUFF_OFF 0xc
|
||||
#define SPI_RXBUFF_OFF 0x10
|
||||
#define SPI_BAUD_OFF 0x14
|
||||
#define SPI_SHAW_OFF 0x18
|
||||
|
||||
#define CMD_SPI_OUT_ENABLE 1
|
||||
#define CMD_SPI_SET_BAUDRATE 2
|
||||
#define CMD_SPI_SET_POLAR 3
|
||||
#define CMD_SPI_SET_PHASE 4
|
||||
#define CMD_SPI_SET_MASTER 5
|
||||
#define CMD_SPI_SET_SENDOPT 6
|
||||
#define CMD_SPI_SET_RECVOPT 7
|
||||
#define CMD_SPI_SET_ORDER 8
|
||||
#define CMD_SPI_SET_LENGTH16 9
|
||||
#define CMD_SPI_GET_STAT 11
|
||||
#define CMD_SPI_GET_CFG 12
|
||||
#define CMD_SPI_SET_CSAVAIL 13
|
||||
#define CMD_SPI_SET_CSHIGH 14 /* CS unavail */
|
||||
#define CMD_SPI_SET_CSLOW 15 /* CS avail */
|
||||
#define CMD_SPI_MISO_ENABLE 16
|
||||
#define CMD_SPI_SET_CSENABLE 17
|
||||
#define CMD_SPI_SET_CSDISABLE 18
|
||||
|
||||
#define CMD_SPI_SET_TRIGGER_MODE 19
|
||||
#define CMD_SPI_SET_TRIGGER_SENSE 20
|
||||
#define CMD_SPI_SET_TRIGGER_EDGE 21
|
||||
#define CMD_SPI_SET_TRIGGER_LEVEL 22
|
||||
|
||||
#define CMD_SPI_SET_TIME_SPS 23
|
||||
#define CMD_SPI_SET_TIME_SAMPLES 24
|
||||
#define CMD_SPI_GET_SYSTEMCLOCK 25
|
||||
|
||||
#define CMD_SPI_SET_WRITECONTINUOUS 26
|
||||
#define CMD_SPI_SET_SKFS 27
|
||||
|
||||
#define CMD_SPI_GET_ALLCONFIG 32 /* For debug */
|
||||
|
||||
#define SPI_DEFAULT_BARD 0x0100
|
||||
|
||||
#define SPI0_IRQ_NUM IRQ_SPI
|
||||
#define SPI_ERR_TRIG -1
|
||||
|
||||
#define BIT_CTL_ENABLE 0x4000
|
||||
#define BIT_CTL_OPENDRAIN 0x2000
|
||||
#define BIT_CTL_MASTER 0x1000
|
||||
#define BIT_CTL_POLAR 0x0800
|
||||
#define BIT_CTL_PHASE 0x0400
|
||||
#define BIT_CTL_BITORDER 0x0200
|
||||
#define BIT_CTL_WORDSIZE 0x0100
|
||||
#define BIT_CTL_MISOENABLE 0x0020
|
||||
#define BIT_CTL_RXMOD 0x0000
|
||||
#define BIT_CTL_TXMOD 0x0001
|
||||
#define BIT_CTL_TIMOD_DMA_TX 0x0003
|
||||
#define BIT_CTL_TIMOD_DMA_RX 0x0002
|
||||
#define BIT_CTL_SENDOPT 0x0004
|
||||
#define BIT_CTL_TIMOD 0x0003
|
||||
|
||||
#define BIT_STAT_SPIF 0x0001
|
||||
#define BIT_STAT_MODF 0x0002
|
||||
#define BIT_STAT_TXE 0x0004
|
||||
#define BIT_STAT_TXS 0x0008
|
||||
#define BIT_STAT_RBSY 0x0010
|
||||
#define BIT_STAT_RXS 0x0020
|
||||
#define BIT_STAT_TXCOL 0x0040
|
||||
#define BIT_STAT_CLR 0xFFFF
|
||||
|
||||
#define BIT_STU_SENDOVER 0x0001
|
||||
#define BIT_STU_RECVFULL 0x0020
|
||||
|
||||
#define CFG_SPI_ENABLE 1
|
||||
#define CFG_SPI_DISABLE 0
|
||||
|
||||
#define CFG_SPI_OUTENABLE 1
|
||||
#define CFG_SPI_OUTDISABLE 0
|
||||
|
||||
#define CFG_SPI_ACTLOW 1
|
||||
#define CFG_SPI_ACTHIGH 0
|
||||
|
||||
#define CFG_SPI_PHASESTART 1
|
||||
#define CFG_SPI_PHASEMID 0
|
||||
|
||||
#define CFG_SPI_MASTER 1
|
||||
#define CFG_SPI_SLAVE 0
|
||||
|
||||
#define CFG_SPI_SENELAST 0
|
||||
#define CFG_SPI_SENDZERO 1
|
||||
|
||||
#define CFG_SPI_RCVFLUSH 1
|
||||
#define CFG_SPI_RCVDISCARD 0
|
||||
|
||||
#define CFG_SPI_LSBFIRST 1
|
||||
#define CFG_SPI_MSBFIRST 0
|
||||
|
||||
#define CFG_SPI_WORDSIZE16 1
|
||||
#define CFG_SPI_WORDSIZE8 0
|
||||
|
||||
#define CFG_SPI_MISOENABLE 1
|
||||
#define CFG_SPI_MISODISABLE 0
|
||||
|
||||
#define CFG_SPI_READ 0x00
|
||||
#define CFG_SPI_WRITE 0x01
|
||||
#define CFG_SPI_DMAREAD 0x02
|
||||
#define CFG_SPI_DMAWRITE 0x03
|
||||
|
||||
#define CFG_SPI_CSCLEARALL 0
|
||||
#define CFG_SPI_CHIPSEL1 1
|
||||
#define CFG_SPI_CHIPSEL2 2
|
||||
#define CFG_SPI_CHIPSEL3 3
|
||||
#define CFG_SPI_CHIPSEL4 4
|
||||
#define CFG_SPI_CHIPSEL5 5
|
||||
#define CFG_SPI_CHIPSEL6 6
|
||||
#define CFG_SPI_CHIPSEL7 7
|
||||
|
||||
#define CFG_SPI_CS1VALUE 1
|
||||
#define CFG_SPI_CS2VALUE 2
|
||||
#define CFG_SPI_CS3VALUE 3
|
||||
#define CFG_SPI_CS4VALUE 4
|
||||
#define CFG_SPI_CS5VALUE 5
|
||||
#define CFG_SPI_CS6VALUE 6
|
||||
#define CFG_SPI_CS7VALUE 7
|
||||
|
||||
/* device.platform_data for SSP controller devices */
|
||||
struct bfin5xx_spi_master {
|
||||
u16 num_chipselect;
|
||||
u8 enable_dma;
|
||||
};
|
||||
|
||||
/* spi_board_info.controller_data for SPI slave devices,
|
||||
* copied to spi_device.platform_data ... mostly for dma tuning
|
||||
*/
|
||||
struct bfin5xx_spi_chip {
|
||||
u16 ctl_reg;
|
||||
u8 enable_dma;
|
||||
u8 bits_per_word;
|
||||
u8 cs_change_per_word;
|
||||
u8 cs_chg_udelay;
|
||||
};
|
||||
|
||||
#endif /* _SPI_CHANNEL_H_ */
|
||||
13
include/asm-blackfin/bfin_simple_timer.h
Normal file
13
include/asm-blackfin/bfin_simple_timer.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef _bfin_simple_timer_h_
|
||||
#define _bfin_simple_timer_h_
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define BFIN_SIMPLE_TIMER_IOCTL_MAGIC 't'
|
||||
|
||||
#define BFIN_SIMPLE_TIMER_SET_PERIOD _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 2)
|
||||
#define BFIN_SIMPLE_TIMER_START _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 6)
|
||||
#define BFIN_SIMPLE_TIMER_STOP _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 8)
|
||||
#define BFIN_SIMPLE_TIMER_READ _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 10)
|
||||
|
||||
#endif
|
||||
175
include/asm-blackfin/bfin_sport.h
Normal file
175
include/asm-blackfin/bfin_sport.h
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/bfin_sport.h
|
||||
* Based on:
|
||||
* Author: Roy Huang (roy.huang@analog.com)
|
||||
*
|
||||
* Created: Thu Aug. 24 2006
|
||||
* Description:
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef __BFIN_SPORT_H__
|
||||
#define __BFIN_SPORT_H__
|
||||
|
||||
#define SPORT_MAJOR 237
|
||||
#define SPORT_NR_DEVS 2
|
||||
|
||||
/* Sport mode: it can be set to TDM, i2s or others */
|
||||
#define NORM_MODE 0x0
|
||||
#define TDM_MODE 0x1
|
||||
#define I2S_MODE 0x2
|
||||
|
||||
/* Data format, normal, a-law or u-law */
|
||||
#define NORM_FORMAT 0x0
|
||||
#define ALAW_FORMAT 0x2
|
||||
#define ULAW_FORMAT 0x3
|
||||
struct sport_register;
|
||||
|
||||
/* Function driver which use sport must initialize the structure */
|
||||
struct sport_config {
|
||||
/*TDM (multichannels), I2S or other mode */
|
||||
unsigned int mode:3;
|
||||
|
||||
/* if TDM mode is selected, channels must be set */
|
||||
int channels; /* Must be in 8 units */
|
||||
unsigned int frame_delay:4; /* Delay between frame sync pulse and first bit */
|
||||
|
||||
/* I2S mode */
|
||||
unsigned int right_first:1; /* Right stereo channel first */
|
||||
|
||||
/* In mormal mode, the following item need to be set */
|
||||
unsigned int lsb_first:1; /* order of transmit or receive data */
|
||||
unsigned int fsync:1; /* Frame sync required */
|
||||
unsigned int data_indep:1; /* data independent frame sync generated */
|
||||
unsigned int act_low:1; /* Active low TFS */
|
||||
unsigned int late_fsync:1; /* Late frame sync */
|
||||
unsigned int tckfe:1;
|
||||
unsigned int sec_en:1; /* Secondary side enabled */
|
||||
|
||||
/* Choose clock source */
|
||||
unsigned int int_clk:1; /* Internal or external clock */
|
||||
|
||||
/* If external clock is used, the following fields are ignored */
|
||||
int serial_clk;
|
||||
int fsync_clk;
|
||||
|
||||
unsigned int data_format:2; /*Normal, u-law or a-law */
|
||||
|
||||
int word_len; /* How length of the word in bits, 3-32 bits */
|
||||
int dma_enabled;
|
||||
};
|
||||
|
||||
struct sport_register {
|
||||
unsigned short tcr1;
|
||||
unsigned short reserved0;
|
||||
unsigned short tcr2;
|
||||
unsigned short reserved1;
|
||||
unsigned short tclkdiv;
|
||||
unsigned short reserved2;
|
||||
unsigned short tfsdiv;
|
||||
unsigned short reserved3;
|
||||
unsigned long tx;
|
||||
unsigned long reserved_l0;
|
||||
unsigned long rx;
|
||||
unsigned long reserved_l1;
|
||||
unsigned short rcr1;
|
||||
unsigned short reserved4;
|
||||
unsigned short rcr2;
|
||||
unsigned short reserved5;
|
||||
unsigned short rclkdiv;
|
||||
unsigned short reserved6;
|
||||
unsigned short rfsdiv;
|
||||
unsigned short reserved7;
|
||||
unsigned short stat;
|
||||
unsigned short reserved8;
|
||||
unsigned short chnl;
|
||||
unsigned short reserved9;
|
||||
unsigned short mcmc1;
|
||||
unsigned short reserved10;
|
||||
unsigned short mcmc2;
|
||||
unsigned short reserved11;
|
||||
unsigned long mtcs0;
|
||||
unsigned long mtcs1;
|
||||
unsigned long mtcs2;
|
||||
unsigned long mtcs3;
|
||||
unsigned long mrcs0;
|
||||
unsigned long mrcs1;
|
||||
unsigned long mrcs2;
|
||||
unsigned long mrcs3;
|
||||
};
|
||||
|
||||
#define SPORT_IOC_MAGIC 'P'
|
||||
#define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config)
|
||||
|
||||
/* Test purpose */
|
||||
#define ENABLE_AD73311 _IOWR('P', 0x02, int)
|
||||
|
||||
struct sport_dev {
|
||||
struct cdev cdev; /* Char device structure */
|
||||
|
||||
int sport_num;
|
||||
|
||||
int dma_rx_chan;
|
||||
int dma_tx_chan;
|
||||
|
||||
int rx_irq;
|
||||
unsigned char *rx_buf; /* Buffer store the received data */
|
||||
int rx_len; /* How many bytes will be received */
|
||||
int rx_received; /* How many bytes has been received */
|
||||
|
||||
int tx_irq;
|
||||
const unsigned char *tx_buf;
|
||||
int tx_len;
|
||||
int tx_sent;
|
||||
|
||||
int sport_err_irq;
|
||||
|
||||
struct mutex mutex; /* mutual exclusion semaphore */
|
||||
struct task_struct *task;
|
||||
|
||||
wait_queue_head_t waitq;
|
||||
int wait_con;
|
||||
struct sport_register *regs;
|
||||
struct sport_config config;
|
||||
};
|
||||
|
||||
#define SPORT_TCR1 0
|
||||
#define SPORT_TCR2 1
|
||||
#define SPORT_TCLKDIV 2
|
||||
#define SPORT_TFSDIV 3
|
||||
#define SPORT_RCR1 8
|
||||
#define SPORT_RCR2 9
|
||||
#define SPORT_RCLKDIV 10
|
||||
#define SPORT_RFSDIV 11
|
||||
#define SPORT_CHANNEL 13
|
||||
#define SPORT_MCMC1 14
|
||||
#define SPORT_MCMC2 15
|
||||
#define SPORT_MTCS0 16
|
||||
#define SPORT_MTCS1 17
|
||||
#define SPORT_MTCS2 18
|
||||
#define SPORT_MTCS3 19
|
||||
#define SPORT_MRCS0 20
|
||||
#define SPORT_MRCS1 21
|
||||
#define SPORT_MRCS2 22
|
||||
#define SPORT_MRCS3 23
|
||||
|
||||
#endif /*__BFIN_SPORT_H__*/
|
||||
213
include/asm-blackfin/bitops.h
Normal file
213
include/asm-blackfin/bitops.h
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
#ifndef _BLACKFIN_BITOPS_H
|
||||
#define _BLACKFIN_BITOPS_H
|
||||
|
||||
/*
|
||||
* Copyright 1992, Linus Torvalds.
|
||||
*/
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/byteorder.h> /* swab32 */
|
||||
#include <asm/system.h> /* save_flags */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm-generic/bitops/ffs.h>
|
||||
#include <asm-generic/bitops/__ffs.h>
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
#include <asm-generic/bitops/ffz.h>
|
||||
|
||||
static __inline__ void set_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int *a = (int *)addr;
|
||||
int mask;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
local_irq_save(flags);
|
||||
*a |= mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static __inline__ void __set_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int *a = (int *)addr;
|
||||
int mask;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
*a |= mask;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
int *a = (int *)addr;
|
||||
int mask;
|
||||
unsigned long flags;
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
local_irq_save(flags);
|
||||
*a &= ~mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static __inline__ void __clear_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int *a = (int *)addr;
|
||||
int mask;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
*a &= ~mask;
|
||||
}
|
||||
|
||||
static __inline__ void change_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int mask, flags;
|
||||
unsigned long *ADDR = (unsigned long *)addr;
|
||||
|
||||
ADDR += nr >> 5;
|
||||
mask = 1 << (nr & 31);
|
||||
local_irq_save(flags);
|
||||
*ADDR ^= mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static __inline__ void __change_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int mask;
|
||||
unsigned long *ADDR = (unsigned long *)addr;
|
||||
|
||||
ADDR += nr >> 5;
|
||||
mask = 1 << (nr & 31);
|
||||
*ADDR ^= mask;
|
||||
}
|
||||
|
||||
static __inline__ int test_and_set_bit(int nr, void *addr)
|
||||
{
|
||||
int mask, retval;
|
||||
volatile unsigned int *a = (volatile unsigned int *)addr;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
local_irq_save(flags);
|
||||
retval = (mask & *a) != 0;
|
||||
*a |= mask;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int mask, retval;
|
||||
volatile unsigned int *a = (volatile unsigned int *)addr;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
retval = (mask & *a) != 0;
|
||||
*a |= mask;
|
||||
return retval;
|
||||
}
|
||||
|
||||
static __inline__ int test_and_clear_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int mask, retval;
|
||||
volatile unsigned int *a = (volatile unsigned int *)addr;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
local_irq_save(flags);
|
||||
retval = (mask & *a) != 0;
|
||||
*a &= ~mask;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int mask, retval;
|
||||
volatile unsigned int *a = (volatile unsigned int *)addr;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
retval = (mask & *a) != 0;
|
||||
*a &= ~mask;
|
||||
return retval;
|
||||
}
|
||||
|
||||
static __inline__ int test_and_change_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
int mask, retval;
|
||||
volatile unsigned int *a = (volatile unsigned int *)addr;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
local_irq_save(flags);
|
||||
retval = (mask & *a) != 0;
|
||||
*a ^= mask;
|
||||
local_irq_restore(flags);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static __inline__ int __test_and_change_bit(int nr,
|
||||
volatile unsigned long *addr)
|
||||
{
|
||||
int mask, retval;
|
||||
volatile unsigned int *a = (volatile unsigned int *)addr;
|
||||
|
||||
a += nr >> 5;
|
||||
mask = 1 << (nr & 0x1f);
|
||||
retval = (mask & *a) != 0;
|
||||
*a ^= mask;
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* This routine doesn't need to be atomic.
|
||||
*/
|
||||
static __inline__ int __constant_test_bit(int nr, const void *addr)
|
||||
{
|
||||
return ((1UL << (nr & 31)) &
|
||||
(((const volatile unsigned int *)addr)[nr >> 5])) != 0;
|
||||
}
|
||||
|
||||
static __inline__ int __test_bit(int nr, const void *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)))
|
||||
|
||||
#include <asm-generic/bitops/find.h>
|
||||
#include <asm-generic/bitops/hweight.h>
|
||||
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#include <asm-generic/bitops/fls.h>
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
|
||||
#endif /* _BLACKFIN_BITOPS_H */
|
||||
81
include/asm-blackfin/blackfin.h
Normal file
81
include/asm-blackfin/blackfin.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Common header file for blackfin family of processors.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BLACKFIN_H_
|
||||
#define _BLACKFIN_H_
|
||||
|
||||
#include <asm/macros.h>
|
||||
#include <asm/mach/blackfin.h>
|
||||
#include <asm/bfin-global.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* SSYNC implementation for C file */
|
||||
#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
|
||||
static inline void SSYNC (void)
|
||||
{
|
||||
int _tmp;
|
||||
__asm__ __volatile__ ("cli %0;\n\t"
|
||||
"nop;nop;\n\t"
|
||||
"ssync;\n\t"
|
||||
"sti %0;\n\t"
|
||||
:"=d"(_tmp):);
|
||||
}
|
||||
#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
|
||||
static inline void SSYNC (void)
|
||||
{
|
||||
int _tmp;
|
||||
__asm__ __volatile__ ("cli %0;\n\t"
|
||||
"ssync;\n\t"
|
||||
"sti %0;\n\t"
|
||||
:"=d"(_tmp):);
|
||||
}
|
||||
#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
|
||||
static inline void SSYNC (void)
|
||||
{
|
||||
__builtin_bfin_ssync();
|
||||
}
|
||||
#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
|
||||
static inline void SSYNC (void)
|
||||
{
|
||||
__asm__ __volatile__ ("ssync;\n\t");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* CSYNC implementation for C file */
|
||||
#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
|
||||
static inline void CSYNC (void)
|
||||
{
|
||||
int _tmp;
|
||||
__asm__ __volatile__ ("cli %0;\n\t"
|
||||
"nop;nop;\n\t"
|
||||
"csync;\n\t"
|
||||
"sti %0;\n\t"
|
||||
:"=d"(_tmp):);
|
||||
}
|
||||
#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
|
||||
static inline void CSYNC (void)
|
||||
{
|
||||
int _tmp;
|
||||
__asm__ __volatile__ ("cli %0;\n\t"
|
||||
"csync;\n\t"
|
||||
"sti %0;\n\t"
|
||||
:"=d"(_tmp):);
|
||||
}
|
||||
#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
|
||||
static inline void CSYNC (void)
|
||||
{
|
||||
__builtin_bfin_csync();
|
||||
}
|
||||
#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
|
||||
static inline void CSYNC (void)
|
||||
{
|
||||
__asm__ __volatile__ ("csync;\n\t");
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _BLACKFIN_H_ */
|
||||
4
include/asm-blackfin/bug.h
Normal file
4
include/asm-blackfin/bug.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _BLACKFIN_BUG_H
|
||||
#define _BLACKFIN_BUG_H
|
||||
#include <asm-generic/bug.h>
|
||||
#endif
|
||||
16
include/asm-blackfin/bugs.h
Normal file
16
include/asm-blackfin/bugs.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* include/asm-blackfin/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)
|
||||
{
|
||||
}
|
||||
48
include/asm-blackfin/byteorder.h
Normal file
48
include/asm-blackfin/byteorder.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#ifndef _BLACKFIN_BYTEORDER_H
|
||||
#define _BLACKFIN_BYTEORDER_H
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
static __inline__ __attribute_const__ __u32 ___arch__swahb32(__u32 xx)
|
||||
{
|
||||
__u32 tmp;
|
||||
__asm__("%1 = %0 >> 8 (V);\n\t"
|
||||
"%0 = %0 << 8 (V);\n\t"
|
||||
"%0 = %0 | %1;\n\t"
|
||||
: "+d"(xx), "=&d"(tmp));
|
||||
return xx;
|
||||
}
|
||||
|
||||
static __inline__ __attribute_const__ __u32 ___arch__swahw32(__u32 xx)
|
||||
{
|
||||
__u32 rv;
|
||||
__asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx));
|
||||
return rv;
|
||||
}
|
||||
|
||||
#define __arch__swahb32(x) ___arch__swahb32(x)
|
||||
#define __arch__swahw32(x) ___arch__swahw32(x)
|
||||
#define __arch__swab32(x) ___arch__swahb32(___arch__swahw32(x))
|
||||
|
||||
static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 xx)
|
||||
{
|
||||
__u32 xw = xx;
|
||||
__asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw));
|
||||
return (__u16)xw;
|
||||
}
|
||||
|
||||
#define __arch__swab16(x) ___arch__swab16(x)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
|
||||
# define __BYTEORDER_HAS_U64__
|
||||
# define __SWAB_64_THRU_32__
|
||||
#endif
|
||||
|
||||
#include <linux/byteorder/little_endian.h>
|
||||
|
||||
#endif /* _BLACKFIN_BYTEORDER_H */
|
||||
29
include/asm-blackfin/cache.h
Normal file
29
include/asm-blackfin/cache.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* include/asm-blackfin/cache.h
|
||||
*/
|
||||
#ifndef __ARCH_BLACKFIN_CACHE_H
|
||||
#define __ARCH_BLACKFIN_CACHE_H
|
||||
|
||||
/*
|
||||
* Bytes per L1 cache line
|
||||
* Blackfin loads 32 bytes for cache
|
||||
*/
|
||||
#define L1_CACHE_SHIFT 5
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
#define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
|
||||
/*
|
||||
* Put cacheline_aliged data to L1 data memory
|
||||
*/
|
||||
#ifdef CONFIG_CACHELINE_ALIGNED_L1
|
||||
#define __cacheline_aligned \
|
||||
__attribute__((__aligned__(L1_CACHE_BYTES), \
|
||||
__section__(".data_l1.cacheline_aligned")))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* largest L1 which this arch supports
|
||||
*/
|
||||
#define L1_CACHE_SHIFT_MAX 5
|
||||
|
||||
#endif
|
||||
90
include/asm-blackfin/cacheflush.h
Normal file
90
include/asm-blackfin/cacheflush.h
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/cacheflush.h
|
||||
* Based on: include/asm-m68knommu/cacheflush.h
|
||||
* Author: LG Soft India
|
||||
* Copyright (C) 2004 Analog Devices Inc.
|
||||
* Created: Tue Sep 21 2004
|
||||
* Description: Blackfin low-level cache routines adapted from the i386
|
||||
* and PPC versions by Greg Ungerer (gerg@snapgear.com)
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _BLACKFIN_CACHEFLUSH_H
|
||||
#define _BLACKFIN_CACHEFLUSH_H
|
||||
|
||||
#include <asm/cplb.h>
|
||||
|
||||
extern void blackfin_icache_dcache_flush_range(unsigned int, unsigned int);
|
||||
extern void blackfin_icache_flush_range(unsigned int, unsigned int);
|
||||
extern void blackfin_dcache_flush_range(unsigned int, unsigned int);
|
||||
extern void blackfin_dcache_invalidate_range(unsigned int, unsigned int);
|
||||
extern void blackfin_dflush_page(void *);
|
||||
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma, start, end) do { } while (0)
|
||||
#define flush_cache_page(vma, vmaddr) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
|
||||
static inline void flush_icache_range(unsigned start, unsigned end)
|
||||
{
|
||||
#if defined(CONFIG_BLKFIN_DCACHE) && defined(CONFIG_BLKFIN_CACHE)
|
||||
|
||||
# if defined(CONFIG_BLKFIN_WT)
|
||||
blackfin_icache_flush_range((start), (end));
|
||||
# else
|
||||
blackfin_icache_dcache_flush_range((start), (end));
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
# if defined(CONFIG_BLKFIN_CACHE)
|
||||
blackfin_icache_flush_range((start), (end));
|
||||
# endif
|
||||
# if defined(CONFIG_BLKFIN_DCACHE)
|
||||
blackfin_dcache_flush_range((start), (end));
|
||||
# endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
do { memcpy(dst, src, len); \
|
||||
flush_icache_range ((unsigned) (dst), (unsigned) (dst) + (len)); \
|
||||
} while (0)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
|
||||
|
||||
#if defined(CONFIG_BLKFIN_DCACHE)
|
||||
# define invalidate_dcache_range(start,end) blackfin_dcache_invalidate_range((start), (end))
|
||||
#else
|
||||
# define invalidate_dcache_range(start,end) do { } while (0)
|
||||
#endif
|
||||
#if defined(CONFIG_BLKFIN_DCACHE) && defined(CONFIG_BLKFIN_WB)
|
||||
# define flush_dcache_range(start,end) blackfin_dcache_flush_range((start), (end))
|
||||
# define flush_dcache_page(page) blackfin_dflush_page(page_address(page))
|
||||
#else
|
||||
# define flush_dcache_range(start,end) do { } while (0)
|
||||
# define flush_dcache_page(page) do { } while (0)
|
||||
#endif
|
||||
|
||||
#endif /* _BLACKFIN_CACHEFLUSH_H */
|
||||
101
include/asm-blackfin/checksum.h
Normal file
101
include/asm-blackfin/checksum.h
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
#ifndef _BFIN_CHECKSUM_H
|
||||
#define _BFIN_CHECKSUM_H
|
||||
|
||||
/*
|
||||
* MODIFIED FOR BFIN April 30, 2001 akbar.hussain@lineo.com
|
||||
*
|
||||
* 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 unsigned char *src, unsigned 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 unsigned char *src,
|
||||
unsigned 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)
|
||||
{
|
||||
while (sum >> 16)
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
return ((~(sum << 16)) >> 16);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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__ ("%0 = %0 + %1;\n\t"
|
||||
"CC = AC0;\n\t"
|
||||
"if !CC jump 4;\n\t"
|
||||
"%0 = %0 + %4;\n\t"
|
||||
"%0 = %0 + %2;\n\t"
|
||||
"CC = AC0;\n\t"
|
||||
"if !CC jump 4;\n\t"
|
||||
"%0 = %0 + %4;\n\t"
|
||||
"%0 = %0 + %3;\n\t"
|
||||
"CC = AC0;\n\t"
|
||||
"if !CC jump 4;\n\t"
|
||||
"%0 = %0 + %4;\n\t"
|
||||
"NOP;\n\t"
|
||||
: "=d" (sum)
|
||||
: "d" (daddr), "d" (saddr), "d" ((ntohs(len)<<16)+proto*256), "d" (1), "0"(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);
|
||||
|
||||
#endif /* _BFIN_CHECKSUM_H */
|
||||
51
include/asm-blackfin/cplb.h
Normal file
51
include/asm-blackfin/cplb.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/************************************************************************
|
||||
*
|
||||
* cplb.h
|
||||
*
|
||||
* (c) Copyright 2002-2003 Analog Devices, Inc. All rights reserved.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
/* Defines necessary for cplb initialisation routines. */
|
||||
|
||||
#ifndef _CPLB_H
|
||||
#define _CPLB_H
|
||||
|
||||
# include <asm/blackfin.h>
|
||||
|
||||
#define CPLB_ENABLE_ICACHE_P 0
|
||||
#define CPLB_ENABLE_DCACHE_P 1
|
||||
#define CPLB_ENABLE_DCACHE2_P 2
|
||||
#define CPLB_ENABLE_CPLBS_P 3 /* Deprecated! */
|
||||
#define CPLB_ENABLE_ICPLBS_P 4
|
||||
#define CPLB_ENABLE_DCPLBS_P 5
|
||||
|
||||
#define CPLB_ENABLE_ICACHE (1<<CPLB_ENABLE_ICACHE_P)
|
||||
#define CPLB_ENABLE_DCACHE (1<<CPLB_ENABLE_DCACHE_P)
|
||||
#define CPLB_ENABLE_DCACHE2 (1<<CPLB_ENABLE_DCACHE2_P)
|
||||
#define CPLB_ENABLE_CPLBS (1<<CPLB_ENABLE_CPLBS_P)
|
||||
#define CPLB_ENABLE_ICPLBS (1<<CPLB_ENABLE_ICPLBS_P)
|
||||
#define CPLB_ENABLE_DCPLBS (1<<CPLB_ENABLE_DCPLBS_P)
|
||||
#define CPLB_ENABLE_ANY_CPLBS CPLB_ENABLE_CPLBS | \
|
||||
CPLB_ENABLE_ICPLBS | \
|
||||
CPLB_ENABLE_DCPLBS
|
||||
|
||||
#define CPLB_RELOADED 0x0000
|
||||
#define CPLB_NO_UNLOCKED 0x0001
|
||||
#define CPLB_NO_ADDR_MATCH 0x0002
|
||||
#define CPLB_PROT_VIOL 0x0003
|
||||
#define CPLB_UNKNOWN_ERR 0x0004
|
||||
|
||||
#define CPLB_DEF_CACHE CPLB_L1_CHBL | CPLB_WT
|
||||
#define CPLB_CACHE_ENABLED CPLB_L1_CHBL | CPLB_DIRTY
|
||||
|
||||
#define CPLB_ALL_ACCESS CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR
|
||||
|
||||
#define CPLB_I_PAGE_MGMT CPLB_LOCK | CPLB_VALID
|
||||
#define CPLB_D_PAGE_MGMT CPLB_LOCK | CPLB_ALL_ACCESS | CPLB_VALID
|
||||
#define CPLB_DNOCACHE CPLB_ALL_ACCESS | CPLB_VALID
|
||||
#define CPLB_DDOCACHE CPLB_DNOCACHE | CPLB_DEF_CACHE
|
||||
#define CPLB_INOCACHE CPLB_USER_RD | CPLB_VALID
|
||||
#define CPLB_IDOCACHE CPLB_INOCACHE | CPLB_L1_CHBL
|
||||
|
||||
#endif /* _CPLB_H */
|
||||
203
include/asm-blackfin/cplbinit.h
Normal file
203
include/asm-blackfin/cplbinit.h
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/cplbinit.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <asm/blackfin.h>
|
||||
#include <asm/cplb.h>
|
||||
|
||||
#define INITIAL_T 0x1
|
||||
#define SWITCH_T 0x2
|
||||
#define I_CPLB 0x4
|
||||
#define D_CPLB 0x8
|
||||
|
||||
#define IN_KERNEL 1
|
||||
|
||||
enum
|
||||
{ZERO_P, L1I_MEM, L1D_MEM, SDRAM_KERN , SDRAM_RAM_MTD, SDRAM_DMAZ, RES_MEM, ASYNC_MEM, L2_MEM};
|
||||
|
||||
struct cplb_desc {
|
||||
u32 start; /* start address */
|
||||
u32 end; /* end address */
|
||||
u32 psize; /* prefered size if any otherwise 1MB or 4MB*/
|
||||
u16 attr;/* attributes */
|
||||
u16 i_conf;/* I-CPLB DATA */
|
||||
u16 d_conf;/* D-CPLB DATA */
|
||||
u16 valid;/* valid */
|
||||
const s8 name[30];/* name */
|
||||
};
|
||||
|
||||
struct cplb_tab {
|
||||
u_long *tab;
|
||||
u16 pos;
|
||||
u16 size;
|
||||
};
|
||||
|
||||
u_long icplb_table[MAX_CPLBS+1];
|
||||
u_long dcplb_table[MAX_CPLBS+1];
|
||||
|
||||
/* Till here we are discussing about the static memory management model.
|
||||
* However, the operating envoronments commonly define more CPLB
|
||||
* descriptors to cover the entire addressable memory than will fit into
|
||||
* the available on-chip 16 CPLB MMRs. When this happens, the below table
|
||||
* will be used which will hold all the potentially required CPLB descriptors
|
||||
*
|
||||
* This is how Page descriptor Table is implemented in uClinux/Blackfin.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CPLB_SWITCH_TAB_L1
|
||||
u_long ipdt_table[MAX_SWITCH_I_CPLBS+1]__attribute__((l1_data));
|
||||
u_long dpdt_table[MAX_SWITCH_D_CPLBS+1]__attribute__((l1_data));
|
||||
|
||||
#ifdef CONFIG_CPLB_INFO
|
||||
u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS]__attribute__((l1_data));
|
||||
u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS]__attribute__((l1_data));
|
||||
#endif /* CONFIG_CPLB_INFO */
|
||||
|
||||
#else
|
||||
|
||||
u_long ipdt_table[MAX_SWITCH_I_CPLBS+1];
|
||||
u_long dpdt_table[MAX_SWITCH_D_CPLBS+1];
|
||||
|
||||
#ifdef CONFIG_CPLB_INFO
|
||||
u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS];
|
||||
u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS];
|
||||
#endif /* CONFIG_CPLB_INFO */
|
||||
|
||||
#endif /*CONFIG_CPLB_SWITCH_TAB_L1*/
|
||||
|
||||
struct s_cplb {
|
||||
struct cplb_tab init_i;
|
||||
struct cplb_tab init_d;
|
||||
struct cplb_tab switch_i;
|
||||
struct cplb_tab switch_d;
|
||||
};
|
||||
|
||||
#if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE)
|
||||
static struct cplb_desc cplb_data[] = {
|
||||
{
|
||||
.start = 0,
|
||||
.end = SIZE_4K,
|
||||
.psize = SIZE_4K,
|
||||
.attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
|
||||
.i_conf = SDRAM_OOPS,
|
||||
.d_conf = SDRAM_OOPS,
|
||||
#if defined(CONFIG_DEBUG_HUNT_FOR_ZERO)
|
||||
.valid = 1,
|
||||
#else
|
||||
.valid = 0,
|
||||
#endif
|
||||
.name = "ZERO Pointer Saveguard",
|
||||
},
|
||||
{
|
||||
.start = L1_CODE_START,
|
||||
.end = L1_CODE_START + L1_CODE_LENGTH,
|
||||
.psize = SIZE_4M,
|
||||
.attr = INITIAL_T | SWITCH_T | I_CPLB,
|
||||
.i_conf = L1_IMEMORY,
|
||||
.d_conf = 0,
|
||||
.valid = 1,
|
||||
.name = "L1 I-Memory",
|
||||
},
|
||||
{
|
||||
.start = L1_DATA_A_START,
|
||||
.end = L1_DATA_B_START + L1_DATA_B_LENGTH,
|
||||
.psize = SIZE_4M,
|
||||
.attr = INITIAL_T | SWITCH_T | D_CPLB,
|
||||
.i_conf = 0,
|
||||
.d_conf = L1_DMEMORY,
|
||||
#if ((L1_DATA_A_LENGTH > 0) || (L1_DATA_B_LENGTH > 0))
|
||||
.valid = 1,
|
||||
#else
|
||||
.valid = 0,
|
||||
#endif
|
||||
.name = "L1 D-Memory",
|
||||
},
|
||||
{
|
||||
.start = 0,
|
||||
.end = 0, /* dynamic */
|
||||
.psize = 0,
|
||||
.attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
|
||||
.i_conf = SDRAM_IGENERIC,
|
||||
.d_conf = SDRAM_DGENERIC,
|
||||
.valid = 1,
|
||||
.name = "SDRAM Kernel",
|
||||
},
|
||||
{
|
||||
.start = 0, /* dynamic */
|
||||
.end = 0, /* dynamic */
|
||||
.psize = 0,
|
||||
.attr = INITIAL_T | SWITCH_T | D_CPLB,
|
||||
.i_conf = SDRAM_IGENERIC,
|
||||
.d_conf = SDRAM_DNON_CHBL,
|
||||
.valid = 1,
|
||||
.name = "SDRAM RAM MTD",
|
||||
},
|
||||
{
|
||||
.start = 0, /* dynamic */
|
||||
.end = 0, /* dynamic */
|
||||
.psize = SIZE_1M,
|
||||
.attr = INITIAL_T | SWITCH_T | D_CPLB,
|
||||
.d_conf = SDRAM_DNON_CHBL,
|
||||
.valid = 1,//(DMA_UNCACHED_REGION > 0),
|
||||
.name = "SDRAM Uncached DMA ZONE",
|
||||
},
|
||||
{
|
||||
.start = 0, /* dynamic */
|
||||
.end = 0, /* dynamic */
|
||||
.psize = 0,
|
||||
.attr = SWITCH_T | D_CPLB,
|
||||
.i_conf = 0, /* dynamic */
|
||||
.d_conf = 0, /* dynamic */
|
||||
.valid = 1,
|
||||
.name = "SDRAM Reserved Memory",
|
||||
},
|
||||
{
|
||||
.start = ASYNC_BANK0_BASE,
|
||||
.end = ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE,
|
||||
.psize = 0,
|
||||
.attr = SWITCH_T | D_CPLB,
|
||||
.d_conf = SDRAM_EBIU,
|
||||
.valid = 1,
|
||||
.name = "ASYNC Memory",
|
||||
},
|
||||
{
|
||||
#if defined(CONFIG_BF561)
|
||||
.start = L2_SRAM,
|
||||
.end = L2_SRAM_END,
|
||||
.psize = SIZE_1M,
|
||||
.attr = SWITCH_T | D_CPLB,
|
||||
.i_conf = L2_MEMORY,
|
||||
.d_conf = L2_MEMORY,
|
||||
.valid = 1,
|
||||
#else
|
||||
.valid = 0,
|
||||
#endif
|
||||
.name = "L2 Memory",
|
||||
}
|
||||
};
|
||||
#endif
|
||||
6
include/asm-blackfin/cpumask.h
Normal file
6
include/asm-blackfin/cpumask.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _ASM_BLACKFIN_CPUMASK_H
|
||||
#define _ASM_BLACKFIN_CPUMASK_H
|
||||
|
||||
#include <asm-generic/cpumask.h>
|
||||
|
||||
#endif /* _ASM_BLACKFIN_CPUMASK_H */
|
||||
6
include/asm-blackfin/cputime.h
Normal file
6
include/asm-blackfin/cputime.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef __BLACKFIN_CPUTIME_H
|
||||
#define __BLACKFIN_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif /* __BLACKFIN_CPUTIME_H */
|
||||
23
include/asm-blackfin/current.h
Normal file
23
include/asm-blackfin/current.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef _BLACKFIN_CURRENT_H
|
||||
#define _BLACKFIN_CURRENT_H
|
||||
/*
|
||||
* current.h
|
||||
* (C) Copyright 2000, Lineo, David McCullough <davidm@lineo.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) __attribute__ ((__const__));
|
||||
static inline struct task_struct *get_current(void)
|
||||
{
|
||||
return (current_thread_info()->task);
|
||||
}
|
||||
|
||||
#define current (get_current())
|
||||
|
||||
#endif /* _BLACKFIN_CURRENT_H */
|
||||
44
include/asm-blackfin/delay.h
Normal file
44
include/asm-blackfin/delay.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#ifndef _BLACKFIN_DELAY_H
|
||||
#define _BLACKFIN_DELAY_H
|
||||
|
||||
static inline void __delay(unsigned long loops)
|
||||
{
|
||||
|
||||
/* FIXME: Currently the assembler doesn't recognize Loop Register Clobbers,
|
||||
uncomment this as soon those are implemented */
|
||||
/*
|
||||
__asm__ __volatile__ ( "\t LSETUP (1f,1f) LC0= %0\n\t"
|
||||
"1:\t NOP;\n\t"
|
||||
: :"a" (loops)
|
||||
: "LT0","LB0","LC0");
|
||||
|
||||
*/
|
||||
|
||||
__asm__ __volatile__("[--SP] = LC0;\n\t"
|
||||
"[--SP] = LT0;\n\t"
|
||||
"[--SP] = LB0;\n\t"
|
||||
"LSETUP (1f,1f) LC0 = %0;\n\t"
|
||||
"1:\t NOP;\n\t"
|
||||
"LB0 = [SP++];\n\t"
|
||||
"LT0 = [SP++];\n\t"
|
||||
"LC0 = [SP++];\n"
|
||||
:
|
||||
:"a" (loops));
|
||||
}
|
||||
|
||||
#include <linux/param.h> /* needed for HZ */
|
||||
|
||||
/*
|
||||
* Use only for very small delays ( < 1 msec). Should probably use a
|
||||
* lookup table, really, as the multiplications take much too long with
|
||||
* short delays. This is a "reasonable" implementation, though (and the
|
||||
* first constant multiplications gets optimized away if the delay is
|
||||
* a constant)
|
||||
*/
|
||||
static inline void udelay(unsigned long usecs)
|
||||
{
|
||||
extern unsigned long loops_per_jiffy;
|
||||
__delay(usecs * loops_per_jiffy / (1000000 / HZ));
|
||||
}
|
||||
|
||||
#endif /* defined(_BLACKFIN_DELAY_H) */
|
||||
7
include/asm-blackfin/device.h
Normal file
7
include/asm-blackfin/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
1
include/asm-blackfin/div64.h
Normal file
1
include/asm-blackfin/div64.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/div64.h>
|
||||
66
include/asm-blackfin/dma-mapping.h
Normal file
66
include/asm-blackfin/dma-mapping.h
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#ifndef _BLACKFIN_DMA_MAPPING_H
|
||||
#define _BLACKFIN_DMA_MAPPING_H
|
||||
|
||||
#include <asm/scatterlist.h>
|
||||
|
||||
void dma_alloc_init(unsigned long start, unsigned long end);
|
||||
void *dma_alloc_coherent(struct device *dev, size_t size,
|
||||
dma_addr_t *dma_handle, gfp_t gfp);
|
||||
void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
|
||||
dma_addr_t dma_handle);
|
||||
|
||||
/*
|
||||
* Now for the API extensions over the pci_ one
|
||||
*/
|
||||
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
|
||||
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
|
||||
|
||||
/*
|
||||
* Map a single buffer of the indicated size for DMA in streaming mode.
|
||||
* The 32-bit bus address to use is returned.
|
||||
*
|
||||
* Once the device is given the dma address, the device owns this memory
|
||||
* until either pci_unmap_single or pci_dma_sync_single is performed.
|
||||
*/
|
||||
extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
|
||||
enum dma_data_direction direction);
|
||||
|
||||
/*
|
||||
* Unmap a single streaming mode DMA translation. The dma_addr and size
|
||||
* must match what was provided for in a previous pci_map_single call. All
|
||||
* other usages are undefined.
|
||||
*
|
||||
* After this call, reads by the cpu to the buffer are guarenteed to see
|
||||
* whatever the device wrote there.
|
||||
*/
|
||||
extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
|
||||
enum dma_data_direction direction);
|
||||
|
||||
/*
|
||||
* Map a set of buffers described by scatterlist in streaming
|
||||
* mode for DMA. This is the scather-gather version of the
|
||||
* above pci_map_single interface. Here the scatter gather list
|
||||
* elements are each tagged with the appropriate dma address
|
||||
* and length. They are obtained via sg_dma_{address,length}(SG).
|
||||
*
|
||||
* NOTE: An implementation may be able to use a smaller number of
|
||||
* DMA address/length pairs than there are SG table elements.
|
||||
* (for example via virtual mapping capabilities)
|
||||
* The routine returns the number of addr/length pairs actually
|
||||
* used, at most nents.
|
||||
*
|
||||
* Device ownership issues as mentioned above for pci_map_single are
|
||||
* the same here.
|
||||
*/
|
||||
extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
|
||||
enum dma_data_direction direction);
|
||||
|
||||
/*
|
||||
* Unmap a set of streaming mode DMA translations.
|
||||
* Again, cpu read rules concerning calls here are the same as for
|
||||
* pci_unmap_single() above.
|
||||
*/
|
||||
extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
|
||||
int nhwentries, enum dma_data_direction direction);
|
||||
|
||||
#endif /* _BLACKFIN_DMA_MAPPING_H */
|
||||
188
include/asm-blackfin/dma.h
Normal file
188
include/asm-blackfin/dma.h
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/simple_bf533_dma.h
|
||||
* Based on: none - original work
|
||||
* Author: LG Soft India
|
||||
* Copyright (C) 2004-2005 Analog Devices Inc.
|
||||
* Created: Tue Sep 21 2004
|
||||
* Description: This file contains the major Data structures and constants
|
||||
* used for DMA Implementation in BF533
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _BLACKFIN_DMA_H_
|
||||
#define _BLACKFIN_DMA_H_
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/signal.h>
|
||||
#include <asm/semaphore.h>
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/mach/dma.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <asm/blackfin.h>
|
||||
|
||||
#define MAX_DMA_ADDRESS PAGE_OFFSET
|
||||
|
||||
/*****************************************************************************
|
||||
* Generic DMA Declarations
|
||||
*
|
||||
****************************************************************************/
|
||||
enum dma_chan_status {
|
||||
DMA_CHANNEL_FREE,
|
||||
DMA_CHANNEL_REQUESTED,
|
||||
DMA_CHANNEL_ENABLED,
|
||||
};
|
||||
|
||||
/*-------------------------
|
||||
* config reg bits value
|
||||
*-------------------------*/
|
||||
#define DATA_SIZE_8 0
|
||||
#define DATA_SIZE_16 1
|
||||
#define DATA_SIZE_32 2
|
||||
|
||||
#define DMA_FLOW_STOP 0
|
||||
#define DMA_FLOW_AUTO 1
|
||||
#define DMA_FLOW_ARRAY 4
|
||||
#define DMA_FLOW_SMALL 6
|
||||
#define DMA_FLOW_LARGE 7
|
||||
|
||||
#define DIMENSION_LINEAR 0
|
||||
#define DIMENSION_2D 1
|
||||
|
||||
#define DIR_READ 0
|
||||
#define DIR_WRITE 1
|
||||
|
||||
#define INTR_DISABLE 0
|
||||
#define INTR_ON_BUF 2
|
||||
#define INTR_ON_ROW 3
|
||||
|
||||
struct dmasg {
|
||||
unsigned long next_desc_addr;
|
||||
unsigned long start_addr;
|
||||
unsigned short cfg;
|
||||
unsigned short x_count;
|
||||
short x_modify;
|
||||
unsigned short y_count;
|
||||
short y_modify;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct dma_register {
|
||||
unsigned long next_desc_ptr; /* DMA Next Descriptor Pointer register */
|
||||
unsigned long start_addr; /* DMA Start address register */
|
||||
|
||||
unsigned short cfg; /* DMA Configuration register */
|
||||
unsigned short dummy1; /* DMA Configuration register */
|
||||
|
||||
unsigned long reserved;
|
||||
|
||||
unsigned short x_count; /* DMA x_count register */
|
||||
unsigned short dummy2;
|
||||
|
||||
short x_modify; /* DMA x_modify register */
|
||||
unsigned short dummy3;
|
||||
|
||||
unsigned short y_count; /* DMA y_count register */
|
||||
unsigned short dummy4;
|
||||
|
||||
short y_modify; /* DMA y_modify register */
|
||||
unsigned short dummy5;
|
||||
|
||||
unsigned long curr_desc_ptr; /* DMA Current Descriptor Pointer
|
||||
register */
|
||||
unsigned short curr_addr_ptr_lo; /* DMA Current Address Pointer
|
||||
register */
|
||||
unsigned short curr_addr_ptr_hi; /* DMA Current Address Pointer
|
||||
register */
|
||||
unsigned short irq_status; /* DMA irq status register */
|
||||
unsigned short dummy6;
|
||||
|
||||
unsigned short peripheral_map; /* DMA peripheral map register */
|
||||
unsigned short dummy7;
|
||||
|
||||
unsigned short curr_x_count; /* DMA Current x-count register */
|
||||
unsigned short dummy8;
|
||||
|
||||
unsigned long reserved2;
|
||||
|
||||
unsigned short curr_y_count; /* DMA Current y-count register */
|
||||
unsigned short dummy9;
|
||||
|
||||
unsigned long reserved3;
|
||||
|
||||
};
|
||||
|
||||
typedef irqreturn_t(*dma_interrupt_t) (int irq, void *dev_id);
|
||||
|
||||
struct dma_channel {
|
||||
struct mutex dmalock;
|
||||
char *device_id;
|
||||
enum dma_chan_status chan_status;
|
||||
struct dma_register *regs;
|
||||
struct dmasg *sg; /* large mode descriptor */
|
||||
unsigned int ctrl_num; /* controller number */
|
||||
dma_interrupt_t irq_callback;
|
||||
void *data;
|
||||
unsigned int dma_enable_flag;
|
||||
unsigned int loopback_flag;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
* DMA API's
|
||||
*******************************************************************************/
|
||||
/* functions to set register mode */
|
||||
void set_dma_start_addr(unsigned int channel, unsigned long addr);
|
||||
void set_dma_next_desc_addr(unsigned int channel, unsigned long addr);
|
||||
void set_dma_x_count(unsigned int channel, unsigned short x_count);
|
||||
void set_dma_x_modify(unsigned int channel, short x_modify);
|
||||
void set_dma_y_count(unsigned int channel, unsigned short y_count);
|
||||
void set_dma_y_modify(unsigned int channel, short y_modify);
|
||||
void set_dma_config(unsigned int channel, unsigned short config);
|
||||
unsigned short set_bfin_dma_config(char direction, char flow_mode,
|
||||
char intr_mode, char dma_mode, char width);
|
||||
|
||||
/* get curr status for polling */
|
||||
unsigned short get_dma_curr_irqstat(unsigned int channel);
|
||||
unsigned short get_dma_curr_xcount(unsigned int channel);
|
||||
unsigned short get_dma_curr_ycount(unsigned int channel);
|
||||
|
||||
/* set large DMA mode descriptor */
|
||||
void set_dma_sg(unsigned int channel, struct dmasg *sg, int nr_sg);
|
||||
|
||||
/* check if current channel is in use */
|
||||
int dma_channel_active(unsigned int channel);
|
||||
|
||||
/* common functions must be called in any mode */
|
||||
void free_dma(unsigned int channel);
|
||||
int dma_channel_active(unsigned int channel); /* check if a channel is in use */
|
||||
void disable_dma(unsigned int channel);
|
||||
void enable_dma(unsigned int channel);
|
||||
int request_dma(unsigned int channel, char *device_id);
|
||||
int set_dma_callback(unsigned int channel, dma_interrupt_t callback,
|
||||
void *data);
|
||||
void dma_disable_irq(unsigned int channel);
|
||||
void dma_enable_irq(unsigned int channel);
|
||||
void clear_dma_irqstat(unsigned int channel);
|
||||
void *dma_memcpy(void *dest, const void *src, size_t count);
|
||||
void *safe_dma_memcpy(void *dest, const void *src, size_t count);
|
||||
|
||||
#endif
|
||||
70
include/asm-blackfin/dpmc.h
Normal file
70
include/asm-blackfin/dpmc.h
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* include/asm-blackfin/dpmc.h - Miscellaneous IOCTL commands for Dynamic Power
|
||||
* Management Controller Driver.
|
||||
* Copyright (C) 2004 Analog Device Inc.
|
||||
*
|
||||
*/
|
||||
#ifndef _BLACKFIN_DPMC_H_
|
||||
#define _BLACKFIN_DPMC_H_
|
||||
|
||||
#define SLEEP_MODE 1
|
||||
#define DEEP_SLEEP_MODE 2
|
||||
#define ACTIVE_PLL_DISABLED 3
|
||||
#define FULLON_MODE 4
|
||||
#define ACTIVE_PLL_ENABLED 5
|
||||
#define HIBERNATE_MODE 6
|
||||
|
||||
#define IOCTL_FULL_ON_MODE _IO('s', 0xA0)
|
||||
#define IOCTL_ACTIVE_MODE _IO('s', 0xA1)
|
||||
#define IOCTL_SLEEP_MODE _IO('s', 0xA2)
|
||||
#define IOCTL_DEEP_SLEEP_MODE _IO('s', 0xA3)
|
||||
#define IOCTL_HIBERNATE_MODE _IO('s', 0xA4)
|
||||
#define IOCTL_CHANGE_FREQUENCY _IOW('s', 0xA5, unsigned long)
|
||||
#define IOCTL_CHANGE_VOLTAGE _IOW('s', 0xA6, unsigned long)
|
||||
#define IOCTL_SET_CCLK _IOW('s', 0xA7, unsigned long)
|
||||
#define IOCTL_SET_SCLK _IOW('s', 0xA8, unsigned long)
|
||||
#define IOCTL_GET_PLLSTATUS _IOW('s', 0xA9, unsigned long)
|
||||
#define IOCTL_GET_CORECLOCK _IOW('s', 0xAA, unsigned long)
|
||||
#define IOCTL_GET_SYSTEMCLOCK _IOW('s', 0xAB, unsigned long)
|
||||
#define IOCTL_GET_VCO _IOW('s', 0xAC, unsigned long)
|
||||
#define IOCTL_DISABLE_WDOG_TIMER _IO('s', 0xAD)
|
||||
#define IOCTL_UNMASK_WDOG_WAKEUP_EVENT _IO('s',0xAE)
|
||||
#define IOCTL_PROGRAM_WDOG_TIMER _IOW('s',0xAF,unsigned long)
|
||||
#define IOCTL_CLEAR_WDOG_WAKEUP_EVENT _IO('s',0xB0)
|
||||
#define IOCTL_SLEEP_DEEPER_MODE _IO('s',0xB1)
|
||||
|
||||
#define DPMC_MINOR 254
|
||||
|
||||
#define ON 0
|
||||
#define OFF 1
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
unsigned long calc_volt(void);
|
||||
int calc_vlev(int vlt);
|
||||
unsigned long change_voltage(unsigned long volt);
|
||||
int calc_msel(int vco_hz);
|
||||
unsigned long change_frequency(unsigned long vco_mhz);
|
||||
int set_pll_div(unsigned short sel, unsigned char flag);
|
||||
int get_vco(void);
|
||||
unsigned long change_system_clock(unsigned long clock);
|
||||
unsigned long change_core_clock(unsigned long clock);
|
||||
unsigned long get_pll_status(void);
|
||||
void change_baud(int baud);
|
||||
void fullon_mode(void);
|
||||
void active_mode(void);
|
||||
void sleep_mode(u32 sic_iwr);
|
||||
void deep_sleep(u32 sic_iwr);
|
||||
void hibernate_mode(u32 sic_iwr);
|
||||
void sleep_deeper(u32 sic_iwr);
|
||||
void program_wdog_timer(unsigned long);
|
||||
void unmask_wdog_wakeup_evt(void);
|
||||
void clear_wdog_wakeup_evt(void);
|
||||
void disable_wdog_timer(void);
|
||||
|
||||
extern unsigned long get_cclk(void);
|
||||
extern unsigned long get_sclk(void);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /*_BLACKFIN_DPMC_H_*/
|
||||
127
include/asm-blackfin/elf.h
Normal file
127
include/asm-blackfin/elf.h
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/* Changes made by LG Soft Oct 2004*/
|
||||
|
||||
#ifndef __ASMBFIN_ELF_H
|
||||
#define __ASMBFIN_ELF_H
|
||||
|
||||
/*
|
||||
* ELF register definitions..
|
||||
*/
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/user.h>
|
||||
|
||||
/* Processor specific flags for the ELF header e_flags field. */
|
||||
#define EF_BFIN_PIC 0x00000001 /* -fpic */
|
||||
#define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */
|
||||
#define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */
|
||||
#define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */
|
||||
|
||||
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_bfinfp_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_BLACKFIN)
|
||||
|
||||
#define elf_check_fdpic(x) ((x)->e_flags & EF_BFIN_FDPIC /* && !((x)->e_flags & EF_FRV_NON_PIC_RELOCS) */)
|
||||
#define elf_check_const_displacement(x) ((x)->e_flags & EF_BFIN_PIC)
|
||||
|
||||
/* EM_BLACKFIN defined in linux/elf.h */
|
||||
|
||||
/*
|
||||
* These are used to set parameters in the core dumps.
|
||||
*/
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_DATA ELFDATA2LSB
|
||||
#define ELF_ARCH EM_BLACKFIN
|
||||
|
||||
#define ELF_PLAT_INIT(_r) _r->p1 = 0
|
||||
|
||||
#define ELF_FDPIC_PLAT_INIT(_regs, _exec_map_addr, _interp_map_addr, _dynamic_addr) \
|
||||
do { \
|
||||
_regs->r7 = 0; \
|
||||
_regs->p0 = _exec_map_addr; \
|
||||
_regs->p1 = _interp_map_addr; \
|
||||
_regs->p2 = _dynamic_addr; \
|
||||
} while(0)
|
||||
|
||||
#define USE_ELF_CORE_DUMP
|
||||
#define ELF_FDPIC_CORE_EFLAGS EF_BFIN_FDPIC
|
||||
#define ELF_EXEC_PAGESIZE 4096
|
||||
|
||||
#define R_unused0 0 /* relocation type 0 is not defined */
|
||||
#define R_pcrel5m2 1 /*LSETUP part a */
|
||||
#define R_unused1 2 /* relocation type 2 is not defined */
|
||||
#define R_pcrel10 3 /* type 3, if cc jump <target> */
|
||||
#define R_pcrel12_jump 4 /* type 4, jump <target> */
|
||||
#define R_rimm16 5 /* type 0x5, rN = <target> */
|
||||
#define R_luimm16 6 /* # 0x6, preg.l=<target> Load imm 16 to lower half */
|
||||
#define R_huimm16 7 /* # 0x7, preg.h=<target> Load imm 16 to upper half */
|
||||
#define R_pcrel12_jump_s 8 /* # 0x8 jump.s <target> */
|
||||
#define R_pcrel24_jump_x 9 /* # 0x9 jump.x <target> */
|
||||
#define R_pcrel24 10 /* # 0xa call <target> , not expandable */
|
||||
#define R_unusedb 11 /* # 0xb not generated */
|
||||
#define R_unusedc 12 /* # 0xc not used */
|
||||
#define R_pcrel24_jump_l 13 /*0xd jump.l <target> */
|
||||
#define R_pcrel24_call_x 14 /* 0xE, call.x <target> if <target> is above 24 bit limit call through P1 */
|
||||
#define R_var_eq_symb 15 /* 0xf, linker should treat it same as 0x12 */
|
||||
#define R_byte_data 16 /* 0x10, .byte var = symbol */
|
||||
#define R_byte2_data 17 /* 0x11, .byte2 var = symbol */
|
||||
#define R_byte4_data 18 /* 0x12, .byte4 var = symbol and .var var=symbol */
|
||||
#define R_pcrel11 19 /* 0x13, lsetup part b */
|
||||
#define R_unused14 20 /* 0x14, undefined */
|
||||
#define R_unused15 21 /* not generated by VDSP 3.5 */
|
||||
|
||||
/* arithmetic relocations */
|
||||
#define R_push 0xE0
|
||||
#define R_const 0xE1
|
||||
#define R_add 0xE2
|
||||
#define R_sub 0xE3
|
||||
#define R_mult 0xE4
|
||||
#define R_div 0xE5
|
||||
#define R_mod 0xE6
|
||||
#define R_lshift 0xE7
|
||||
#define R_rshift 0xE8
|
||||
#define R_and 0xE9
|
||||
#define R_or 0xEA
|
||||
#define R_xor 0xEB
|
||||
#define R_land 0xEC
|
||||
#define R_lor 0xED
|
||||
#define R_len 0xEE
|
||||
#define R_neg 0xEF
|
||||
#define R_comp 0xF0
|
||||
#define R_page 0xF1
|
||||
#define R_hwpage 0xF2
|
||||
#define R_addr 0xF3
|
||||
|
||||
/* 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) \
|
||||
memcpy((char *) &pr_reg, (char *)regs, \
|
||||
sizeof(struct pt_regs));
|
||||
|
||||
/* 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
|
||||
6
include/asm-blackfin/emergency-restart.h
Normal file
6
include/asm-blackfin/emergency-restart.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _ASM_EMERGENCY_RESTART_H
|
||||
#define _ASM_EMERGENCY_RESTART_H
|
||||
|
||||
#include <asm-generic/emergency-restart.h>
|
||||
|
||||
#endif /* _ASM_EMERGENCY_RESTART_H */
|
||||
56
include/asm-blackfin/entry.h
Normal file
56
include/asm-blackfin/entry.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#ifndef __BFIN_ENTRY_H
|
||||
#define __BFIN_ENTRY_H
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
#define LFLUSH_I_AND_D 0x00000808
|
||||
#define LSIGTRAP 5
|
||||
|
||||
/* process bits for task_struct.flags */
|
||||
#define PF_TRACESYS_OFF 3
|
||||
#define PF_TRACESYS_BIT 5
|
||||
#define PF_PTRACED_OFF 3
|
||||
#define PF_PTRACED_BIT 4
|
||||
#define PF_DTRACE_OFF 1
|
||||
#define PF_DTRACE_BIT 5
|
||||
|
||||
/* This one is used for exceptions, emulation, and NMI. It doesn't push
|
||||
RETI and doesn't do cli. */
|
||||
#define SAVE_ALL_SYS save_context_no_interrupts
|
||||
/* This is used for all normal interrupts. It saves a minimum of registers
|
||||
to the stack, loads the IRQ number, and jumps to common code. */
|
||||
#define INTERRUPT_ENTRY(N) \
|
||||
[--sp] = SYSCFG; \
|
||||
\
|
||||
[--sp] = P0; /*orig_p0*/ \
|
||||
[--sp] = R0; /*orig_r0*/ \
|
||||
[--sp] = (R7:0,P5:0); \
|
||||
R0 = (N); \
|
||||
jump __common_int_entry;
|
||||
|
||||
/* For timer interrupts, we need to save IPEND, since the user_mode
|
||||
macro accesses it to determine where to account time. */
|
||||
#define TIMER_INTERRUPT_ENTRY(N) \
|
||||
[--sp] = SYSCFG; \
|
||||
\
|
||||
[--sp] = P0; /*orig_p0*/ \
|
||||
[--sp] = R0; /*orig_r0*/ \
|
||||
[--sp] = (R7:0,P5:0); \
|
||||
p0.l = lo(IPEND); \
|
||||
p0.h = hi(IPEND); \
|
||||
r1 = [p0]; \
|
||||
R0 = (N); \
|
||||
jump __common_int_entry;
|
||||
|
||||
/* This one pushes RETI without using CLI. Interrupts are enabled. */
|
||||
#define SAVE_CONTEXT_SYSCALL save_context_syscall
|
||||
#define SAVE_CONTEXT save_context_with_interrupts
|
||||
|
||||
#define RESTORE_ALL_SYS restore_context_no_interrupts
|
||||
#define RESTORE_CONTEXT restore_context_with_interrupts
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BFIN_ENTRY_H */
|
||||
6
include/asm-blackfin/errno.h
Normal file
6
include/asm-blackfin/errno.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _BFIN_ERRNO_H
|
||||
#define _BFIN_ERRNO_H
|
||||
|
||||
#include<asm-generic/errno.h>
|
||||
|
||||
#endif /* _BFIN_ERRNO_H */
|
||||
13
include/asm-blackfin/fcntl.h
Normal file
13
include/asm-blackfin/fcntl.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef _BFIN_FCNTL_H
|
||||
#define _BFIN_FCNTL_H
|
||||
|
||||
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
|
||||
located on an ext2 file system */
|
||||
#define O_DIRECTORY 040000 /* must be a directory */
|
||||
#define O_NOFOLLOW 0100000 /* don't follow links */
|
||||
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
|
||||
#define O_LARGEFILE 0400000
|
||||
|
||||
#include <asm-generic/fcntl.h>
|
||||
|
||||
#endif
|
||||
58
include/asm-blackfin/flat.h
Normal file
58
include/asm-blackfin/flat.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* include/asm-blackfin/flat.h -- uClinux flat-format executables
|
||||
*
|
||||
* Copyright (C) 2003,
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BLACKFIN_FLAT_H__
|
||||
#define __BLACKFIN_FLAT_H__
|
||||
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
#define flat_stack_align(sp) /* nothing needed */
|
||||
#define flat_argvp_envp_on_stack() 0
|
||||
#define flat_old_ram_flag(flags) (flags)
|
||||
|
||||
extern unsigned long bfin_get_addr_from_rp (unsigned long *ptr,
|
||||
unsigned long relval,
|
||||
unsigned long flags,
|
||||
unsigned long *persistent);
|
||||
|
||||
extern void bfin_put_addr_at_rp(unsigned long *ptr, unsigned long addr,
|
||||
unsigned long relval);
|
||||
|
||||
/* The amount by which a relocation can exceed the program image limits
|
||||
without being regarded as an error. */
|
||||
|
||||
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
|
||||
|
||||
#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
|
||||
bfin_get_addr_from_rp(rp, relval, flags, persistent)
|
||||
#define flat_put_addr_at_rp(rp, val, relval) \
|
||||
bfin_put_addr_at_rp(rp, val, relval)
|
||||
|
||||
/* Convert a relocation entry into an address. */
|
||||
static inline unsigned long
|
||||
flat_get_relocate_addr (unsigned long relval)
|
||||
{
|
||||
return relval & 0x03ffffff; /* Mask out top 6 bits */
|
||||
}
|
||||
|
||||
static inline int flat_set_persistent(unsigned long relval,
|
||||
unsigned long *persistent)
|
||||
{
|
||||
int type = (relval >> 26) & 7;
|
||||
if (type == 3) {
|
||||
*persistent = relval << 16;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int flat_addr_absolute(unsigned long relval)
|
||||
{
|
||||
return (relval & (1 << 29)) != 0;
|
||||
}
|
||||
|
||||
#endif /* __BLACKFIN_FLAT_H__ */
|
||||
6
include/asm-blackfin/futex.h
Normal file
6
include/asm-blackfin/futex.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _ASM_FUTEX_H
|
||||
#define _ASM_FUTEX_H
|
||||
|
||||
#include <asm-generic/futex.h>
|
||||
|
||||
#endif
|
||||
367
include/asm-blackfin/gpio.h
Normal file
367
include/asm-blackfin/gpio.h
Normal file
|
|
@ -0,0 +1,367 @@
|
|||
/*
|
||||
* File: arch/blackfin/kernel/bfin_gpio.h
|
||||
* Based on:
|
||||
* Author: Michael Hennerich (hennerich@blackfin.uclinux.org)
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* Number BF537/6/4 BF561 BF533/2/1
|
||||
*
|
||||
* GPIO_0 PF0 PF0 PF0
|
||||
* GPIO_1 PF1 PF1 PF1
|
||||
* GPIO_2 PF2 PF2 PF2
|
||||
* GPIO_3 PF3 PF3 PF3
|
||||
* GPIO_4 PF4 PF4 PF4
|
||||
* GPIO_5 PF5 PF5 PF5
|
||||
* GPIO_6 PF6 PF6 PF6
|
||||
* GPIO_7 PF7 PF7 PF7
|
||||
* GPIO_8 PF8 PF8 PF8
|
||||
* GPIO_9 PF9 PF9 PF9
|
||||
* GPIO_10 PF10 PF10 PF10
|
||||
* GPIO_11 PF11 PF11 PF11
|
||||
* GPIO_12 PF12 PF12 PF12
|
||||
* GPIO_13 PF13 PF13 PF13
|
||||
* GPIO_14 PF14 PF14 PF14
|
||||
* GPIO_15 PF15 PF15 PF15
|
||||
* GPIO_16 PG0 PF16
|
||||
* GPIO_17 PG1 PF17
|
||||
* GPIO_18 PG2 PF18
|
||||
* GPIO_19 PG3 PF19
|
||||
* GPIO_20 PG4 PF20
|
||||
* GPIO_21 PG5 PF21
|
||||
* GPIO_22 PG6 PF22
|
||||
* GPIO_23 PG7 PF23
|
||||
* GPIO_24 PG8 PF24
|
||||
* GPIO_25 PG9 PF25
|
||||
* GPIO_26 PG10 PF26
|
||||
* GPIO_27 PG11 PF27
|
||||
* GPIO_28 PG12 PF28
|
||||
* GPIO_29 PG13 PF29
|
||||
* GPIO_30 PG14 PF30
|
||||
* GPIO_31 PG15 PF31
|
||||
* GPIO_32 PH0 PF32
|
||||
* GPIO_33 PH1 PF33
|
||||
* GPIO_34 PH2 PF34
|
||||
* GPIO_35 PH3 PF35
|
||||
* GPIO_36 PH4 PF36
|
||||
* GPIO_37 PH5 PF37
|
||||
* GPIO_38 PH6 PF38
|
||||
* GPIO_39 PH7 PF39
|
||||
* GPIO_40 PH8 PF40
|
||||
* GPIO_41 PH9 PF41
|
||||
* GPIO_42 PH10 PF42
|
||||
* GPIO_43 PH11 PF43
|
||||
* GPIO_44 PH12 PF44
|
||||
* GPIO_45 PH13 PF45
|
||||
* GPIO_46 PH14 PF46
|
||||
* GPIO_47 PH15 PF47
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_BLACKFIN_GPIO_H__
|
||||
#define __ARCH_BLACKFIN_GPIO_H__
|
||||
|
||||
#define gpio_bank(x) ((x) >> 4)
|
||||
#define gpio_bit(x) (1<<((x) & 0xF))
|
||||
#define gpio_sub_n(x) ((x) & 0xF)
|
||||
|
||||
#define GPIO_BANKSIZE 16
|
||||
|
||||
#define GPIO_0 0
|
||||
#define GPIO_1 1
|
||||
#define GPIO_2 2
|
||||
#define GPIO_3 3
|
||||
#define GPIO_4 4
|
||||
#define GPIO_5 5
|
||||
#define GPIO_6 6
|
||||
#define GPIO_7 7
|
||||
#define GPIO_8 8
|
||||
#define GPIO_9 9
|
||||
#define GPIO_10 10
|
||||
#define GPIO_11 11
|
||||
#define GPIO_12 12
|
||||
#define GPIO_13 13
|
||||
#define GPIO_14 14
|
||||
#define GPIO_15 15
|
||||
#define GPIO_16 16
|
||||
#define GPIO_17 17
|
||||
#define GPIO_18 18
|
||||
#define GPIO_19 19
|
||||
#define GPIO_20 20
|
||||
#define GPIO_21 21
|
||||
#define GPIO_22 22
|
||||
#define GPIO_23 23
|
||||
#define GPIO_24 24
|
||||
#define GPIO_25 25
|
||||
#define GPIO_26 26
|
||||
#define GPIO_27 27
|
||||
#define GPIO_28 28
|
||||
#define GPIO_29 29
|
||||
#define GPIO_30 30
|
||||
#define GPIO_31 31
|
||||
#define GPIO_32 32
|
||||
#define GPIO_33 33
|
||||
#define GPIO_34 34
|
||||
#define GPIO_35 35
|
||||
#define GPIO_36 36
|
||||
#define GPIO_37 37
|
||||
#define GPIO_38 38
|
||||
#define GPIO_39 39
|
||||
#define GPIO_40 40
|
||||
#define GPIO_41 41
|
||||
#define GPIO_42 42
|
||||
#define GPIO_43 43
|
||||
#define GPIO_44 44
|
||||
#define GPIO_45 45
|
||||
#define GPIO_46 46
|
||||
#define GPIO_47 47
|
||||
|
||||
|
||||
#define PERIPHERAL_USAGE 1
|
||||
#define GPIO_USAGE 0
|
||||
|
||||
#ifdef BF533_FAMILY
|
||||
#define MAX_BLACKFIN_GPIOS 16
|
||||
#endif
|
||||
|
||||
#ifdef BF537_FAMILY
|
||||
#define MAX_BLACKFIN_GPIOS 48
|
||||
#define PORT_F 0
|
||||
#define PORT_G 1
|
||||
#define PORT_H 2
|
||||
#define PORT_J 3
|
||||
|
||||
#define GPIO_PF0 0
|
||||
#define GPIO_PF1 1
|
||||
#define GPIO_PF2 2
|
||||
#define GPIO_PF3 3
|
||||
#define GPIO_PF4 4
|
||||
#define GPIO_PF5 5
|
||||
#define GPIO_PF6 6
|
||||
#define GPIO_PF7 7
|
||||
#define GPIO_PF8 8
|
||||
#define GPIO_PF9 9
|
||||
#define GPIO_PF10 10
|
||||
#define GPIO_PF11 11
|
||||
#define GPIO_PF12 12
|
||||
#define GPIO_PF13 13
|
||||
#define GPIO_PF14 14
|
||||
#define GPIO_PF15 15
|
||||
#define GPIO_PG0 16
|
||||
#define GPIO_PG1 17
|
||||
#define GPIO_PG2 18
|
||||
#define GPIO_PG3 19
|
||||
#define GPIO_PG4 20
|
||||
#define GPIO_PG5 21
|
||||
#define GPIO_PG6 22
|
||||
#define GPIO_PG7 23
|
||||
#define GPIO_PG8 24
|
||||
#define GPIO_PG9 25
|
||||
#define GPIO_PG10 26
|
||||
#define GPIO_PG11 27
|
||||
#define GPIO_PG12 28
|
||||
#define GPIO_PG13 29
|
||||
#define GPIO_PG14 30
|
||||
#define GPIO_PG15 31
|
||||
#define GPIO_PH0 32
|
||||
#define GPIO_PH1 33
|
||||
#define GPIO_PH2 34
|
||||
#define GPIO_PH3 35
|
||||
#define GPIO_PH4 36
|
||||
#define GPIO_PH5 37
|
||||
#define GPIO_PH6 38
|
||||
#define GPIO_PH7 39
|
||||
#define GPIO_PH8 40
|
||||
#define GPIO_PH9 41
|
||||
#define GPIO_PH10 42
|
||||
#define GPIO_PH11 43
|
||||
#define GPIO_PH12 44
|
||||
#define GPIO_PH13 45
|
||||
#define GPIO_PH14 46
|
||||
#define GPIO_PH15 47
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BF561_FAMILY
|
||||
#define MAX_BLACKFIN_GPIOS 48
|
||||
#define PORT_FIO0 0
|
||||
#define PORT_FIO1 1
|
||||
#define PORT_FIO2 2
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* FUNCTIONS: Blackfin General Purpose Ports Access Functions
|
||||
*
|
||||
* INPUTS/OUTPUTS:
|
||||
* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: These functions abstract direct register access
|
||||
* to Blackfin processor General Purpose
|
||||
* Ports Regsiters
|
||||
*
|
||||
* CAUTION: These functions do not belong to the GPIO Driver API
|
||||
*************************************************************
|
||||
* MODIFICATION HISTORY :
|
||||
**************************************************************/
|
||||
|
||||
void set_gpio_dir(unsigned short, unsigned short);
|
||||
void set_gpio_inen(unsigned short, unsigned short);
|
||||
void set_gpio_polar(unsigned short, unsigned short);
|
||||
void set_gpio_edge(unsigned short, unsigned short);
|
||||
void set_gpio_both(unsigned short, unsigned short);
|
||||
void set_gpio_data(unsigned short, unsigned short);
|
||||
void set_gpio_maska(unsigned short, unsigned short);
|
||||
void set_gpio_maskb(unsigned short, unsigned short);
|
||||
void set_gpio_toggle(unsigned short);
|
||||
void set_gpiop_dir(unsigned short, unsigned short);
|
||||
void set_gpiop_inen(unsigned short, unsigned short);
|
||||
void set_gpiop_polar(unsigned short, unsigned short);
|
||||
void set_gpiop_edge(unsigned short, unsigned short);
|
||||
void set_gpiop_both(unsigned short, unsigned short);
|
||||
void set_gpiop_data(unsigned short, unsigned short);
|
||||
void set_gpiop_maska(unsigned short, unsigned short);
|
||||
void set_gpiop_maskb(unsigned short, unsigned short);
|
||||
unsigned short get_gpio_dir(unsigned short);
|
||||
unsigned short get_gpio_inen(unsigned short);
|
||||
unsigned short get_gpio_polar(unsigned short);
|
||||
unsigned short get_gpio_edge(unsigned short);
|
||||
unsigned short get_gpio_both(unsigned short);
|
||||
unsigned short get_gpio_maska(unsigned short);
|
||||
unsigned short get_gpio_maskb(unsigned short);
|
||||
unsigned short get_gpio_data(unsigned short);
|
||||
unsigned short get_gpiop_dir(unsigned short);
|
||||
unsigned short get_gpiop_inen(unsigned short);
|
||||
unsigned short get_gpiop_polar(unsigned short);
|
||||
unsigned short get_gpiop_edge(unsigned short);
|
||||
unsigned short get_gpiop_both(unsigned short);
|
||||
unsigned short get_gpiop_maska(unsigned short);
|
||||
unsigned short get_gpiop_maskb(unsigned short);
|
||||
unsigned short get_gpiop_data(unsigned short);
|
||||
|
||||
struct gpio_port_t {
|
||||
unsigned short data;
|
||||
unsigned short dummy1;
|
||||
unsigned short data_clear;
|
||||
unsigned short dummy2;
|
||||
unsigned short data_set;
|
||||
unsigned short dummy3;
|
||||
unsigned short toggle;
|
||||
unsigned short dummy4;
|
||||
unsigned short maska;
|
||||
unsigned short dummy5;
|
||||
unsigned short maska_clear;
|
||||
unsigned short dummy6;
|
||||
unsigned short maska_set;
|
||||
unsigned short dummy7;
|
||||
unsigned short maska_toggle;
|
||||
unsigned short dummy8;
|
||||
unsigned short maskb;
|
||||
unsigned short dummy9;
|
||||
unsigned short maskb_clear;
|
||||
unsigned short dummy10;
|
||||
unsigned short maskb_set;
|
||||
unsigned short dummy11;
|
||||
unsigned short maskb_toggle;
|
||||
unsigned short dummy12;
|
||||
unsigned short dir;
|
||||
unsigned short dummy13;
|
||||
unsigned short polar;
|
||||
unsigned short dummy14;
|
||||
unsigned short edge;
|
||||
unsigned short dummy15;
|
||||
unsigned short both;
|
||||
unsigned short dummy16;
|
||||
unsigned short inen;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#define PM_WAKE_RISING 0x1
|
||||
#define PM_WAKE_FALLING 0x2
|
||||
#define PM_WAKE_HIGH 0x4
|
||||
#define PM_WAKE_LOW 0x8
|
||||
#define PM_WAKE_BOTH_EDGES (PM_WAKE_RISING | PM_WAKE_FALLING)
|
||||
|
||||
int gpio_pm_wakeup_request(unsigned short gpio, unsigned char type);
|
||||
void gpio_pm_wakeup_free(unsigned short gpio);
|
||||
unsigned int gpio_pm_setup(void);
|
||||
void gpio_pm_restore(void);
|
||||
|
||||
struct gpio_port_s {
|
||||
unsigned short data;
|
||||
unsigned short data_clear;
|
||||
unsigned short data_set;
|
||||
unsigned short toggle;
|
||||
unsigned short maska;
|
||||
unsigned short maska_clear;
|
||||
unsigned short maska_set;
|
||||
unsigned short maska_toggle;
|
||||
unsigned short maskb;
|
||||
unsigned short maskb_clear;
|
||||
unsigned short maskb_set;
|
||||
unsigned short maskb_toggle;
|
||||
unsigned short dir;
|
||||
unsigned short polar;
|
||||
unsigned short edge;
|
||||
unsigned short both;
|
||||
unsigned short inen;
|
||||
|
||||
unsigned short fer;
|
||||
};
|
||||
#endif /*CONFIG_PM*/
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* FUNCTIONS: Blackfin GPIO Driver
|
||||
*
|
||||
* INPUTS/OUTPUTS:
|
||||
* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Blackfin GPIO Driver API
|
||||
*
|
||||
* CAUTION:
|
||||
*************************************************************
|
||||
* MODIFICATION HISTORY :
|
||||
**************************************************************/
|
||||
|
||||
int gpio_request(unsigned short, const char *);
|
||||
void gpio_free(unsigned short);
|
||||
|
||||
void gpio_set_value(unsigned short gpio, unsigned short arg);
|
||||
unsigned short gpio_get_value(unsigned short gpio);
|
||||
|
||||
#define gpio_get_value(gpio) get_gpio_data(gpio)
|
||||
#define gpio_set_value(gpio, value) set_gpio_data(gpio, value)
|
||||
|
||||
void gpio_direction_input(unsigned short gpio);
|
||||
void gpio_direction_output(unsigned short gpio);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* __ARCH_BLACKFIN_GPIO_H__ */
|
||||
41
include/asm-blackfin/hardirq.h
Normal file
41
include/asm-blackfin/hardirq.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef __BFIN_HARDIRQ_H
|
||||
#define __BFIN_HARDIRQ_H
|
||||
|
||||
#include <linux/cache.h>
|
||||
#include <linux/threads.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
typedef struct {
|
||||
unsigned int __softirq_pending;
|
||||
unsigned int __syscall_count;
|
||||
struct task_struct *__ksoftirqd_task;
|
||||
} ____cacheline_aligned irq_cpustat_t;
|
||||
|
||||
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
|
||||
|
||||
/*
|
||||
* We put the hardirq and softirq counter into the preemption
|
||||
* counter. The bitmask has the following meaning:
|
||||
*
|
||||
* - bits 0-7 are the preemption count (max preemption depth: 256)
|
||||
* - bits 8-15 are the softirq count (max # of softirqs: 256)
|
||||
* - bits 16-23 are the hardirq count (max # of hardirqs: 256)
|
||||
*
|
||||
* - ( bit 26 is the PREEMPT_ACTIVE flag. )
|
||||
*
|
||||
* PREEMPT_MASK: 0x000000ff
|
||||
* HARDIRQ_MASK: 0x0000ff00
|
||||
* SOFTIRQ_MASK: 0x00ff0000
|
||||
*/
|
||||
|
||||
#define HARDIRQ_BITS 8
|
||||
|
||||
#ifdef NR_IRQS
|
||||
# if (1 << HARDIRQ_BITS) < NR_IRQS
|
||||
# error HARDIRQ_BITS is too low!
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
|
||||
|
||||
#endif
|
||||
6
include/asm-blackfin/hw_irq.h
Normal file
6
include/asm-blackfin/hw_irq.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef __ASM_BFIN_HW_IRQ_H
|
||||
#define __ASM_BFIN_HW_IRQ_H
|
||||
|
||||
/* Dummy include. */
|
||||
|
||||
#endif
|
||||
32
include/asm-blackfin/ide.h
Normal file
32
include/asm-blackfin/ide.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* linux/include/asm-blackfin/ide.h
|
||||
*
|
||||
* Copyright (C) 1994-1996 Linus Torvalds & authors
|
||||
* Copyright (C) 2001 Lineo Inc., davidm@snapgear.com
|
||||
* Copyright (C) 2002 Greg Ungerer (gerg@snapgear.com)
|
||||
* Copyright (C) 2002 Yoshinori Sato (ysato@users.sourceforge.jp)
|
||||
* Copyright (C) 2005 Hennerich Michael (hennerich@blackfin.uclinux.org)
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
#ifndef _BLACKFIN_IDE_H
|
||||
#define _BLACKFIN_IDE_H
|
||||
/****************************************************************************/
|
||||
#ifdef __KERNEL__
|
||||
/****************************************************************************/
|
||||
|
||||
#define MAX_HWIFS 1
|
||||
|
||||
/* Legacy ... BLK_DEV_IDECS */
|
||||
#define IDE_ARCH_OBSOLETE_INIT
|
||||
#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
|
||||
|
||||
|
||||
#include <asm-generic/ide_iops.h>
|
||||
|
||||
/****************************************************************************/
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _BLACKFIN_IDE_H */
|
||||
/****************************************************************************/
|
||||
207
include/asm-blackfin/io.h
Normal file
207
include/asm-blackfin/io.h
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
#ifndef _BFIN_IO_H
|
||||
#define _BFIN_IO_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <linux/types.h>
|
||||
#endif
|
||||
#include <linux/compiler.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 bfin architecture, we just read/write the
|
||||
* memory location directly.
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
static inline unsigned char readb(void __iomem *addr)
|
||||
{
|
||||
unsigned int val;
|
||||
int tmp;
|
||||
|
||||
__asm__ __volatile__ ("cli %1;\n\t"
|
||||
"NOP; NOP; SSYNC;\n\t"
|
||||
"%0 = b [%2] (z);\n\t"
|
||||
"sti %1;\n\t"
|
||||
: "=d"(val), "=d"(tmp): "a"(addr)
|
||||
);
|
||||
|
||||
return (unsigned char) val;
|
||||
}
|
||||
|
||||
static inline unsigned short readw(void __iomem *addr)
|
||||
{
|
||||
unsigned int val;
|
||||
int tmp;
|
||||
|
||||
__asm__ __volatile__ ("cli %1;\n\t"
|
||||
"NOP; NOP; SSYNC;\n\t"
|
||||
"%0 = w [%2] (z);\n\t"
|
||||
"sti %1;\n\t"
|
||||
: "=d"(val), "=d"(tmp): "a"(addr)
|
||||
);
|
||||
|
||||
return (unsigned short) val;
|
||||
}
|
||||
|
||||
static inline unsigned int readl(void __iomem *addr)
|
||||
{
|
||||
unsigned int val;
|
||||
int tmp;
|
||||
|
||||
__asm__ __volatile__ ("cli %1;\n\t"
|
||||
"NOP; NOP; SSYNC;\n\t"
|
||||
"%0 = [%2];\n\t"
|
||||
"sti %1;\n\t"
|
||||
: "=d"(val), "=d"(tmp): "a"(addr)
|
||||
);
|
||||
return val;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#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
|
||||
#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 ioread8_rep(a,d,c) insb(a,d,c)
|
||||
#define ioread16_rep(a,d,c) insw(a,d,c)
|
||||
#define ioread32_rep(a,d,c) insl(a,d,c)
|
||||
#define iowrite8_rep(a,s,c) outsb(a,s,c)
|
||||
#define iowrite16_rep(a,s,c) outsw(a,s,c)
|
||||
#define iowrite32_rep(a,s,c) outsl(a,s,c)
|
||||
|
||||
#define ioread8(X) readb(X)
|
||||
#define ioread16(X) readw(X)
|
||||
#define ioread32(X) readl(X)
|
||||
#define iowrite8(val,X) writeb(val,X)
|
||||
#define iowrite16(val,X) writew(val,X)
|
||||
#define iowrite32(val,X) writel(val,X)
|
||||
|
||||
#define IO_SPACE_LIMIT 0xffffffff
|
||||
|
||||
/* Values for nocacheflag and cmode */
|
||||
#define IOMAP_NOCACHE_SER 1
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
extern void outsb(void __iomem *port, const void *addr, unsigned long count);
|
||||
extern void outsw(void __iomem *port, const void *addr, unsigned long count);
|
||||
extern void outsl(void __iomem *port, const void *addr, unsigned long count);
|
||||
|
||||
extern void insb(const void __iomem *port, void *addr, unsigned long count);
|
||||
extern void insw(const void __iomem *port, void *addr, unsigned long count);
|
||||
extern void insl(const void __iomem *port, void *addr, unsigned long count);
|
||||
|
||||
/*
|
||||
* Map some physical address range into the kernel address space.
|
||||
*/
|
||||
static inline void __iomem *__ioremap(unsigned long physaddr, unsigned long size,
|
||||
int cacheflag)
|
||||
{
|
||||
return (void __iomem *)physaddr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmap a ioremap()ed region again
|
||||
*/
|
||||
static inline void iounmap(void *addr)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* __iounmap unmaps nearly everything, so be careful
|
||||
* it doesn't free currently pointer/page tables anymore but it
|
||||
* wans't used anyway and might be added later.
|
||||
*/
|
||||
static inline void __iounmap(void *addr, unsigned long size)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Set new cache mode for some kernel address space.
|
||||
* The caller must push data for that range itself, if such data may already
|
||||
* be in the cache.
|
||||
*/
|
||||
static inline void kernel_set_cachemode(void *addr, unsigned long size,
|
||||
int cmode)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
|
||||
{
|
||||
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
|
||||
}
|
||||
static inline void __iomem *ioremap_nocache(unsigned long physaddr,
|
||||
unsigned long size)
|
||||
{
|
||||
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
|
||||
}
|
||||
|
||||
extern void blkfin_inv_cache_all(void);
|
||||
|
||||
#endif
|
||||
|
||||
#define ioport_map(port, nr) ((void __iomem*)(port))
|
||||
#define ioport_unmap(addr)
|
||||
|
||||
#define dma_cache_inv(_start,_size) do { blkfin_inv_cache_all();} while (0)
|
||||
#define dma_cache_wback(_start,_size) do { } while (0)
|
||||
#define dma_cache_wback_inv(_start,_size) do { blkfin_inv_cache_all();} 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)
|
||||
|
||||
#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 /* _BFIN_IO_H */
|
||||
1
include/asm-blackfin/ioctl.h
Normal file
1
include/asm-blackfin/ioctl.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/ioctl.h>
|
||||
82
include/asm-blackfin/ioctls.h
Normal file
82
include/asm-blackfin/ioctls.h
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
#ifndef __ARCH_BFIN_IOCTLS_H__
|
||||
#define __ARCH_BFIN_IOCTLS_H__
|
||||
|
||||
#include <asm/ioctl.h>
|
||||
|
||||
/* 0x54 is just a magic number to make these relatively unique ('T') */
|
||||
|
||||
#define TCGETS 0x5401
|
||||
#define TCSETS 0x5402
|
||||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
#define TCGETA 0x5405
|
||||
#define TCSETA 0x5406
|
||||
#define TCSETAW 0x5407
|
||||
#define TCSETAF 0x5408
|
||||
#define TCSBRK 0x5409
|
||||
#define TCXONC 0x540A
|
||||
#define TCFLSH 0x540B
|
||||
#define TIOCEXCL 0x540C
|
||||
#define TIOCNXCL 0x540D
|
||||
#define TIOCSCTTY 0x540E
|
||||
#define TIOCGPGRP 0x540F
|
||||
#define TIOCSPGRP 0x5410
|
||||
#define TIOCOUTQ 0x5411
|
||||
#define TIOCSTI 0x5412
|
||||
#define TIOCGWINSZ 0x5413
|
||||
#define TIOCSWINSZ 0x5414
|
||||
#define TIOCMGET 0x5415
|
||||
#define TIOCMBIS 0x5416
|
||||
#define TIOCMBIC 0x5417
|
||||
#define TIOCMSET 0x5418
|
||||
#define TIOCGSOFTCAR 0x5419
|
||||
#define TIOCSSOFTCAR 0x541A
|
||||
#define FIONREAD 0x541B
|
||||
#define TIOCINQ FIONREAD
|
||||
#define TIOCLINUX 0x541C
|
||||
#define TIOCCONS 0x541D
|
||||
#define TIOCGSERIAL 0x541E
|
||||
#define TIOCSSERIAL 0x541F
|
||||
#define TIOCPKT 0x5420
|
||||
#define FIONBIO 0x5421
|
||||
#define TIOCNOTTY 0x5422
|
||||
#define TIOCSETD 0x5423
|
||||
#define TIOCGETD 0x5424
|
||||
#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
|
||||
#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
|
||||
#define TIOCSBRK 0x5427 /* BSD compatibility */
|
||||
#define TIOCCBRK 0x5428 /* BSD compatibility */
|
||||
#define TIOCGSID 0x5429 /* Return the session ID of FD */
|
||||
#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
|
||||
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
|
||||
|
||||
#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
|
||||
#define FIOCLEX 0x5451
|
||||
#define FIOASYNC 0x5452
|
||||
#define TIOCSERCONFIG 0x5453
|
||||
#define TIOCSERGWILD 0x5454
|
||||
#define TIOCSERSWILD 0x5455
|
||||
#define TIOCGLCKTRMIOS 0x5456
|
||||
#define TIOCSLCKTRMIOS 0x5457
|
||||
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
|
||||
#define TIOCSERGETLSR 0x5459 /* Get line status register */
|
||||
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
|
||||
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
|
||||
|
||||
#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
|
||||
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
|
||||
|
||||
#define FIOQSIZE 0x545E
|
||||
|
||||
/* Used for packet mode */
|
||||
#define TIOCPKT_DATA 0
|
||||
#define TIOCPKT_FLUSHREAD 1
|
||||
#define TIOCPKT_FLUSHWRITE 2
|
||||
#define TIOCPKT_STOP 4
|
||||
#define TIOCPKT_START 8
|
||||
#define TIOCPKT_NOSTOP 16
|
||||
#define TIOCPKT_DOSTOP 32
|
||||
|
||||
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
|
||||
#endif /* __ARCH_BFIN_IOCTLS_H__ */
|
||||
1
include/asm-blackfin/ipc.h
Normal file
1
include/asm-blackfin/ipc.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/ipc.h>
|
||||
30
include/asm-blackfin/ipcbuf.h
Normal file
30
include/asm-blackfin/ipcbuf.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* Changes origined from m68k version. Lineo Inc. May 2001 */
|
||||
|
||||
#ifndef __BFIN_IPCBUF_H__
|
||||
#define __BFIN_IPCBUF_H__
|
||||
|
||||
/*
|
||||
* The user_ipc_perm structure for m68k architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 32-bit mode_t and seq
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct ipc64_perm {
|
||||
__kernel_key_t key;
|
||||
__kernel_uid32_t uid;
|
||||
__kernel_gid32_t gid;
|
||||
__kernel_uid32_t cuid;
|
||||
__kernel_gid32_t cgid;
|
||||
__kernel_mode_t mode;
|
||||
unsigned short __pad1;
|
||||
unsigned short seq;
|
||||
unsigned short __pad2;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
};
|
||||
|
||||
#endif /* __BFIN_IPCBUF_H__ */
|
||||
70
include/asm-blackfin/irq.h
Normal file
70
include/asm-blackfin/irq.h
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file COPYING in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Changed by HuTao Apr18, 2003
|
||||
*
|
||||
* Copyright was missing when I got the code so took from MIPS arch ...MaTed---
|
||||
* Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
|
||||
* Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 by Ralf Baechle
|
||||
*
|
||||
* Adapted for BlackFin (ADI) by Ted Ma <mated@sympatico.ca>
|
||||
* Copyright (c) 2002 Arcturus Networks Inc. (www.arcturusnetworks.com)
|
||||
* Copyright (c) 2002 Lineo, Inc. <mattw@lineo.com>
|
||||
*/
|
||||
|
||||
#ifndef _BFIN_IRQ_H_
|
||||
#define _BFIN_IRQ_H_
|
||||
|
||||
#include <asm/mach/irq.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
/*******************************************************************************
|
||||
***** INTRODUCTION ***********
|
||||
* On the Blackfin, the interrupt structure allows remmapping of the hardware
|
||||
* levels.
|
||||
* - I'm going to assume that the H/W level is going to stay at the default
|
||||
* settings. If someone wants to go through and abstart this out, feel free
|
||||
* to mod the interrupt numbering scheme.
|
||||
* - I'm abstracting the interrupts so that uClinux does not know anything
|
||||
* about the H/W levels. If you want to change the H/W AND keep the abstracted
|
||||
* levels that uClinux sees, you should be able to do most of it here.
|
||||
* - I've left the "abstract" numbering sparce in case someone wants to pull the
|
||||
* interrupts apart (just the TX/RX for the various devices)
|
||||
*******************************************************************************/
|
||||
|
||||
/* SYS_IRQS and NR_IRQS are defined in <asm/mach-bf5xx/irq.h>*/
|
||||
|
||||
/*
|
||||
* 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 ack_bad_irq(unsigned int irq);
|
||||
|
||||
static __inline__ int irq_canonicalize(int irq)
|
||||
{
|
||||
return irq;
|
||||
}
|
||||
|
||||
/* count of spurious interrupts */
|
||||
/* extern volatile unsigned int num_spurious; */
|
||||
|
||||
#ifndef NO_IRQ
|
||||
#define NO_IRQ ((unsigned int)(-1))
|
||||
#endif
|
||||
|
||||
#endif /* _BFIN_IRQ_H_ */
|
||||
22
include/asm-blackfin/irq_handler.h
Normal file
22
include/asm-blackfin/irq_handler.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef _IRQ_HANDLER_H
|
||||
#define _IRQ_HANDLER_H
|
||||
|
||||
/* BASE LEVEL interrupt handler routines */
|
||||
asmlinkage void evt_emulation(void);
|
||||
asmlinkage void evt_exception(void);
|
||||
asmlinkage void trap(void);
|
||||
asmlinkage void evt_ivhw(void);
|
||||
asmlinkage void evt_timer(void);
|
||||
asmlinkage void evt_evt2(void);
|
||||
asmlinkage void evt_evt7(void);
|
||||
asmlinkage void evt_evt8(void);
|
||||
asmlinkage void evt_evt9(void);
|
||||
asmlinkage void evt_evt10(void);
|
||||
asmlinkage void evt_evt11(void);
|
||||
asmlinkage void evt_evt12(void);
|
||||
asmlinkage void evt_evt13(void);
|
||||
asmlinkage void evt_soft_int1(void);
|
||||
asmlinkage void evt_system_call(void);
|
||||
asmlinkage void init_exception_buff(void);
|
||||
|
||||
#endif
|
||||
1
include/asm-blackfin/irq_regs.h
Normal file
1
include/asm-blackfin/irq_regs.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/irq_regs.h>
|
||||
1
include/asm-blackfin/kdebug.h
Normal file
1
include/asm-blackfin/kdebug.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/kdebug.h>
|
||||
21
include/asm-blackfin/kmap_types.h
Normal file
21
include/asm-blackfin/kmap_types.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef _ASM_KMAP_TYPES_H
|
||||
#define _ASM_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
|
||||
31
include/asm-blackfin/l1layout.h
Normal file
31
include/asm-blackfin/l1layout.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* l1layout.h
|
||||
* Defines a layout of L1 scratchpad memory that userspace can rely on.
|
||||
*/
|
||||
|
||||
#ifndef _L1LAYOUT_H_
|
||||
#define _L1LAYOUT_H_
|
||||
|
||||
#include <asm/blackfin.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* Data that is "mapped" into the process VM at the start of the L1 scratch
|
||||
memory, so that each process can access it at a fixed address. Used for
|
||||
stack checking. */
|
||||
struct l1_scratch_task_info
|
||||
{
|
||||
/* Points to the start of the stack. */
|
||||
void *stack_start;
|
||||
/* Not updated by the kernel; a user process can modify this to
|
||||
keep track of the lowest address of the stack pointer during its
|
||||
runtime. */
|
||||
void *lowest_sp;
|
||||
};
|
||||
|
||||
/* A pointer to the structure in memory. */
|
||||
#define L1_SCRATCH_TASK_INFO ((struct l1_scratch_task_info *)L1_SCRATCH_START)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
7
include/asm-blackfin/linkage.h
Normal file
7
include/asm-blackfin/linkage.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef __ASM_LINKAGE_H
|
||||
#define __ASM_LINKAGE_H
|
||||
|
||||
#define __ALIGN .align 4
|
||||
#define __ALIGN_STR ".align 4"
|
||||
|
||||
#endif
|
||||
6
include/asm-blackfin/local.h
Normal file
6
include/asm-blackfin/local.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef __BLACKFIN_LOCAL_H
|
||||
#define __BLACKFIN_LOCAL_H
|
||||
|
||||
#include <asm-generic/local.h>
|
||||
|
||||
#endif /* __BLACKFIN_LOCAL_H */
|
||||
175
include/asm-blackfin/mach-bf533/anomaly.h
Normal file
175
include/asm-blackfin/mach-bf533/anomaly.h
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/anomaly.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* This file shoule be up to date with:
|
||||
* - Revision U, May 17, 2006; ADSP-BF533 Blackfin Processor Anomaly List
|
||||
* - Revision Y, May 17, 2006; ADSP-BF532 Blackfin Processor Anomaly List
|
||||
* - Revision T, May 17, 2006; ADSP-BF531 Blackfin Processor Anomaly List
|
||||
*/
|
||||
|
||||
#ifndef _MACH_ANOMALY_H_
|
||||
#define _MACH_ANOMALY_H_
|
||||
|
||||
/* We do not support 0.1 or 0.2 silicon - sorry */
|
||||
#if (defined(CONFIG_BF_REV_0_1) || defined(CONFIG_BF_REV_0_2))
|
||||
#error Kernel will not work on BF533 Version 0.1 or 0.2
|
||||
#endif
|
||||
|
||||
/* Issues that are common to 0.5, 0.4, and 0.3 silicon */
|
||||
#if (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_4) || defined(CONFIG_BF_REV_0_3))
|
||||
#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
|
||||
slot1 and store of a P register in slot 2 is not
|
||||
supported */
|
||||
#define ANOMALY_05000105 /* Watchpoint Status Register (WPSTAT) bits are set on
|
||||
every corresponding match */
|
||||
#define ANOMALY_05000119 /* DMA_RUN bit is not valid after a Peripheral Receive
|
||||
Channel DMA stops */
|
||||
#define ANOMALY_05000122 /* Rx.H can not be used to access 16-bit System MMR
|
||||
registers. */
|
||||
#define ANOMALY_05000166 /* PPI Data Lengths Between 8 and 16 do not zero out
|
||||
upper bits*/
|
||||
#define ANOMALY_05000167 /* Turning Serial Ports on With External Frame Syncs */
|
||||
#define ANOMALY_05000180 /* PPI_DELAY not functional in PPI modes with 0 frame
|
||||
syncs */
|
||||
#define ANOMALY_05000208 /* VSTAT status bit in PLL_STAT register is not
|
||||
functional */
|
||||
#define ANOMALY_05000219 /* NMI event at boot time results in unpredictable
|
||||
state */
|
||||
#define ANOMALY_05000229 /* SPI Slave Boot Mode modifies registers */
|
||||
#define ANOMALY_05000272 /* Certain data cache write through modes fail for
|
||||
VDDint <=0.9V */
|
||||
#define ANOMALY_05000273 /* Writes to Synchronous SDRAM memory may be lost */
|
||||
#define ANOMALY_05000277 /* Writes to a flag data register one SCLK cycle after
|
||||
an edge is detected may clear interrupt */
|
||||
#define ANOMALY_05000278 /* Disabling Peripherals with DMA running may cause
|
||||
DMA system instability */
|
||||
#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context is
|
||||
not restored */
|
||||
#define ANOMALY_05000282 /* Memory DMA corruption with 32-bit data and traffic
|
||||
control */
|
||||
#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when
|
||||
killed in a particular stage*/
|
||||
#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
|
||||
registers are interrupted */
|
||||
#define ANOMALY_05000311 /* Erroneous flag pin operations under specific sequences*/
|
||||
|
||||
#endif
|
||||
|
||||
/* These issues only occur on 0.3 or 0.4 BF533 */
|
||||
#if (defined(CONFIG_BF_REV_0_4) || defined(CONFIG_BF_REV_0_3))
|
||||
#define ANOMALY_05000099 /* UART Line Status Register (UART_LSR) bits are not
|
||||
updated at the same time. */
|
||||
#define ANOMALY_05000158 /* Boot fails when data cache enabled: Data from a Data
|
||||
Cache Fill can be corrupted after or during
|
||||
Instruction DMA if certain core stalls exist */
|
||||
#define ANOMALY_05000179 /* PPI_COUNT cannot be programmed to 0 in General
|
||||
Purpose TX or RX modes */
|
||||
#define ANOMALY_05000198 /* Failing SYSTEM MMR accesses when stalled by
|
||||
preceding memory read */
|
||||
#define ANOMALY_05000200 /* SPORT TFS and DT are incorrectly driven during
|
||||
inactive channels in certain conditions */
|
||||
#define ANOMALY_05000202 /* Possible infinite stall with specific dual dag
|
||||
situation */
|
||||
#define ANOMALY_05000215 /* UART TX Interrupt masked erroneously */
|
||||
#define ANOMALY_05000225 /* Incorrect pulse-width of UART start-bit */
|
||||
#define ANOMALY_05000227 /* Scratchpad memory bank reads may return incorrect
|
||||
data*/
|
||||
#define ANOMALY_05000230 /* UART Receiver is less robust against Baudrate
|
||||
Differences in certain Conditions */
|
||||
#define ANOMALY_05000231 /* UART STB bit incorrectly affects receiver setting */
|
||||
#define ANOMALY_05000242 /* DF bit in PLL_CTL register does not respond to
|
||||
hardware reset */
|
||||
#define ANOMALY_05000244 /* With instruction cache enabled, a CSYNC or SSYNC or
|
||||
IDLE around a Change of Control causes
|
||||
unpredictable results */
|
||||
#define ANOMALY_05000245 /* Spurious Hardware Error from an access in the
|
||||
shadow of a conditional branch */
|
||||
#define ANOMALY_05000246 /* Data CPLB's should prevent spurious hardware
|
||||
errors */
|
||||
#define ANOMALY_05000253 /* Maximum external clock speed for Timers */
|
||||
#define ANOMALY_05000255 /* Entering Hibernate Mode with RTC Seconds event
|
||||
interrupt not functional */
|
||||
#define ANOMALY_05000257 /* An interrupt or exception during short Hardware
|
||||
loops may cause the instruction fetch unit to
|
||||
malfunction */
|
||||
#define ANOMALY_05000258 /* Instruction Cache is corrupted when bit 9 and 12 of
|
||||
the ICPLB Data registers differ */
|
||||
#define ANOMALY_05000260 /* ICPLB_STATUS MMR register may be corrupted */
|
||||
#define ANOMALY_05000261 /* DCPLB_FAULT_ADDR MMR register may be corrupted */
|
||||
#define ANOMALY_05000262 /* Stores to data cache may be lost */
|
||||
#define ANOMALY_05000263 /* Hardware loop corrupted when taking an ICPLB exception */
|
||||
#define ANOMALY_05000264 /* A Sync instruction (CSYNC, SSYNC) or an IDLE
|
||||
instruction will cause an infinite stall in the
|
||||
second to last instruction in a hardware loop */
|
||||
#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
|
||||
SPORT external receive and transmit clocks. */
|
||||
#define ANOMALY_05000269 /* High I/O activity causes the output voltage of the
|
||||
internal voltage regulator (VDDint) to increase. */
|
||||
#define ANOMALY_05000270 /* High I/O activity causes the output voltage of the
|
||||
internal voltage regulator (VDDint) to decrease */
|
||||
#endif
|
||||
|
||||
/* These issues are only on 0.4 silicon */
|
||||
#if (defined(CONFIG_BF_REV_0_4))
|
||||
#define ANOMALY_05000234 /* Incorrect Revision Number in DSPID Register */
|
||||
#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel
|
||||
(TDM) */
|
||||
#endif
|
||||
|
||||
/* These issues are only on 0.3 silicon */
|
||||
#if defined(CONFIG_BF_REV_0_3)
|
||||
#define ANOMALY_05000183 /* Timer Pin limitations for PPI TX Modes with
|
||||
External Frame Syncs */
|
||||
#define ANOMALY_05000189 /* False Protection Exceptions caused by Speculative
|
||||
Instruction or Data Fetches, or by Fetches at the
|
||||
boundary of reserved memory space */
|
||||
#define ANOMALY_05000193 /* False Flag Pin Interrupts on Edge Sensitive Inputs
|
||||
when polarity setting is changed */
|
||||
#define ANOMALY_05000194 /* Sport Restarting in specific modes may cause data
|
||||
corruption */
|
||||
#define ANOMALY_05000199 /* DMA current address shows wrong value during carry
|
||||
fix */
|
||||
#define ANOMALY_05000201 /* Receive frame sync not ignored during active
|
||||
frames in sport MCM */
|
||||
#define ANOMALY_05000203 /* Specific sequence that can cause DMA error or DMA
|
||||
stopping */
|
||||
#if defined(CONFIG_BF533)
|
||||
#define ANOMALY_05000204 /* Incorrect data read with write-through cache and
|
||||
allocate cache lines on reads only mode */
|
||||
#endif /* CONFIG_BF533 */
|
||||
#define ANOMALY_05000207 /* Recovery from "brown-out" condition */
|
||||
#define ANOMALY_05000209 /* Speed-Path in computational unit affects certain
|
||||
instructions */
|
||||
#define ANOMALY_05000233 /* PPI_FS3 is not driven in 2 or 3 internal Frame
|
||||
Sync Transmit Mode */
|
||||
#define ANOMALY_05000271 /* Spontaneous reset of Internal Voltage Regulator */
|
||||
#endif
|
||||
|
||||
#endif /* _MACH_ANOMALY_H_ */
|
||||
306
include/asm-blackfin/mach-bf533/bf533.h
Normal file
306
include/asm-blackfin/mach-bf533/bf533.h
Normal file
|
|
@ -0,0 +1,306 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/bf533.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF561
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef __MACH_BF533_H__
|
||||
#define __MACH_BF533_H__
|
||||
|
||||
#define SUPPORTED_REVID 2
|
||||
|
||||
#define OFFSET_(x) ((x) & 0x0000FFFF)
|
||||
|
||||
/*some misc defines*/
|
||||
#define IMASK_IVG15 0x8000
|
||||
#define IMASK_IVG14 0x4000
|
||||
#define IMASK_IVG13 0x2000
|
||||
#define IMASK_IVG12 0x1000
|
||||
|
||||
#define IMASK_IVG11 0x0800
|
||||
#define IMASK_IVG10 0x0400
|
||||
#define IMASK_IVG9 0x0200
|
||||
#define IMASK_IVG8 0x0100
|
||||
|
||||
#define IMASK_IVG7 0x0080
|
||||
#define IMASK_IVGTMR 0x0040
|
||||
#define IMASK_IVGHW 0x0020
|
||||
|
||||
/***************************/
|
||||
|
||||
|
||||
#define BLKFIN_DSUBBANKS 4
|
||||
#define BLKFIN_DWAYS 2
|
||||
#define BLKFIN_DLINES 64
|
||||
#define BLKFIN_ISUBBANKS 4
|
||||
#define BLKFIN_IWAYS 4
|
||||
#define BLKFIN_ILINES 32
|
||||
|
||||
#define WAY0_L 0x1
|
||||
#define WAY1_L 0x2
|
||||
#define WAY01_L 0x3
|
||||
#define WAY2_L 0x4
|
||||
#define WAY02_L 0x5
|
||||
#define WAY12_L 0x6
|
||||
#define WAY012_L 0x7
|
||||
|
||||
#define WAY3_L 0x8
|
||||
#define WAY03_L 0x9
|
||||
#define WAY13_L 0xA
|
||||
#define WAY013_L 0xB
|
||||
|
||||
#define WAY32_L 0xC
|
||||
#define WAY320_L 0xD
|
||||
#define WAY321_L 0xE
|
||||
#define WAYALL_L 0xF
|
||||
|
||||
#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
|
||||
|
||||
/* IAR0 BIT FIELDS*/
|
||||
#define RTC_ERROR_BIT 0x0FFFFFFF
|
||||
#define UART_ERROR_BIT 0xF0FFFFFF
|
||||
#define SPORT1_ERROR_BIT 0xFF0FFFFF
|
||||
#define SPI_ERROR_BIT 0xFFF0FFFF
|
||||
#define SPORT0_ERROR_BIT 0xFFFF0FFF
|
||||
#define PPI_ERROR_BIT 0xFFFFF0FF
|
||||
#define DMA_ERROR_BIT 0xFFFFFF0F
|
||||
#define PLLWAKE_ERROR_BIT 0xFFFFFFFF
|
||||
|
||||
/* IAR1 BIT FIELDS*/
|
||||
#define DMA7_UARTTX_BIT 0x0FFFFFFF
|
||||
#define DMA6_UARTRX_BIT 0xF0FFFFFF
|
||||
#define DMA5_SPI_BIT 0xFF0FFFFF
|
||||
#define DMA4_SPORT1TX_BIT 0xFFF0FFFF
|
||||
#define DMA3_SPORT1RX_BIT 0xFFFF0FFF
|
||||
#define DMA2_SPORT0TX_BIT 0xFFFFF0FF
|
||||
#define DMA1_SPORT0RX_BIT 0xFFFFFF0F
|
||||
#define DMA0_PPI_BIT 0xFFFFFFFF
|
||||
|
||||
/* IAR2 BIT FIELDS*/
|
||||
#define WDTIMER_BIT 0x0FFFFFFF
|
||||
#define MEMDMA1_BIT 0xF0FFFFFF
|
||||
#define MEMDMA0_BIT 0xFF0FFFFF
|
||||
#define PFB_BIT 0xFFF0FFFF
|
||||
#define PFA_BIT 0xFFFF0FFF
|
||||
#define TIMER2_BIT 0xFFFFF0FF
|
||||
#define TIMER1_BIT 0xFFFFFF0F
|
||||
#define TIMER0_BIT 0xFFFFFFFF
|
||||
|
||||
/********************************* EBIU Settings ************************************/
|
||||
#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
|
||||
#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
|
||||
|
||||
#ifdef CONFIG_C_AMBEN_ALL
|
||||
#define V_AMBEN AMBEN_ALL
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN
|
||||
#define V_AMBEN 0x0
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0
|
||||
#define V_AMBEN AMBEN_B0
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0_B1
|
||||
#define V_AMBEN AMBEN_B0_B1
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0_B1_B2
|
||||
#define V_AMBEN AMBEN_B0_B1_B2
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMCKEN
|
||||
#define V_AMCKEN AMCKEN
|
||||
#else
|
||||
#define V_AMCKEN 0x0
|
||||
#endif
|
||||
#ifdef CONFIG_C_CDPRIO
|
||||
#define V_CDPRIO 0x100
|
||||
#else
|
||||
#define V_CDPRIO 0x0
|
||||
#endif
|
||||
|
||||
#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
|
||||
|
||||
#define MAX_VC 650000000
|
||||
#define MIN_VC 50000000
|
||||
|
||||
#ifdef CONFIG_BFIN_KERNEL_CLOCK
|
||||
/********************************PLL Settings **************************************/
|
||||
#if (CONFIG_VCO_MULT < 0)
|
||||
#error "VCO Multiplier is less than 0. Please select a different value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_MULT == 0)
|
||||
#error "VCO Multiplier should be greater than 0. Please select a different value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_MULT > 64)
|
||||
#error "VCO Multiplier is more than 64. Please select a different value"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CLKIN_HALF
|
||||
#define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
|
||||
#else
|
||||
#define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_PLL_BYPASS
|
||||
#define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
|
||||
#define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
|
||||
#else
|
||||
#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
|
||||
#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_DIV < 1)
|
||||
#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_DIV > 15)
|
||||
#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CCLK_DIV != 1)
|
||||
#if (CONFIG_CCLK_DIV != 2)
|
||||
#if (CONFIG_CCLK_DIV != 4)
|
||||
#if (CONFIG_CCLK_DIV != 8)
|
||||
#error "CCLK DIV can be 1,2,4 or 8 only. Please select a proper value"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_HZ > MAX_VC)
|
||||
#error "VCO selected is more than maximum value. Please change the VCO multipler"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ > 133000000)
|
||||
#error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ < 27000000)
|
||||
#error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ > CONFIG_CCLK_HZ)
|
||||
#if (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ)
|
||||
#if (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
|
||||
#error "Please select sclk less than cclk"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CCLK_DIV == 1)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 2)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 4)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 8)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
|
||||
#endif
|
||||
#ifndef CONFIG_CCLK_ACT_DIV
|
||||
#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
|
||||
#endif
|
||||
|
||||
#if defined(ANOMALY_05000273) && (CONFIG_CCLK_DIV == 1)
|
||||
#error ANOMALY 05000273, please make sure CCLK is at least 2x SCLK
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_BFIN_KERNEL_CLOCK */
|
||||
|
||||
#ifdef CONFIG_BF533
|
||||
#define CPU "BF533"
|
||||
#define CPUID 0x027a5000
|
||||
#endif
|
||||
#ifdef CONFIG_BF532
|
||||
#define CPU "BF532"
|
||||
#define CPUID 0x0275A000
|
||||
#endif
|
||||
#ifdef CONFIG_BF531
|
||||
#define CPU "BF531"
|
||||
#define CPUID 0x027a5000
|
||||
#endif
|
||||
#ifndef CPU
|
||||
#define CPU "UNKNOWN"
|
||||
#define CPUID 0x0
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_SIZE % 4)
|
||||
#error "SDRAM mem size must be multible of 4MB"
|
||||
#endif
|
||||
|
||||
#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
|
||||
#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
|
||||
#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
|
||||
#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
|
||||
|
||||
/*Use the menuconfig cache policy here - CONFIG_BLKFIN_WT/CONFIG_BLKFIN_WB*/
|
||||
|
||||
#define ANOMALY_05000158_WORKAROUND 0x200
|
||||
#ifdef CONFIG_BLKFIN_WB /*Write Back Policy */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_DIRTY \
|
||||
| CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
|
||||
#else /*Write Through */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_DIRTY \
|
||||
| CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
|
||||
#endif
|
||||
|
||||
#define L1_DMEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
|
||||
#define SDRAM_DNON_CHBL (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
|
||||
#define SDRAM_EBIU (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
|
||||
#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
|
||||
|
||||
#define SIZE_1K 0x00000400 /* 1K */
|
||||
#define SIZE_4K 0x00001000 /* 4K */
|
||||
#define SIZE_1M 0x00100000 /* 1M */
|
||||
#define SIZE_4M 0x00400000 /* 4M */
|
||||
|
||||
#define MAX_CPLBS (16 * 2)
|
||||
|
||||
/*
|
||||
* Number of required data CPLB switchtable entries
|
||||
* MEMSIZE / 4 (we mostly install 4M page size CPLBs
|
||||
* approx 16 for smaller 1MB page size CPLBs for allignment purposes
|
||||
* 1 for L1 Data Memory
|
||||
* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
|
||||
* 1 for ASYNC Memory
|
||||
*/
|
||||
|
||||
|
||||
#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1) * 2)
|
||||
|
||||
/*
|
||||
* Number of required instruction CPLB switchtable entries
|
||||
* MEMSIZE / 4 (we mostly install 4M page size CPLBs
|
||||
* approx 12 for smaller 1MB page size CPLBs for allignment purposes
|
||||
* 1 for L1 Instruction Memory
|
||||
* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
|
||||
*/
|
||||
|
||||
#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1) * 2)
|
||||
|
||||
#endif /* __MACH_BF533_H__ */
|
||||
108
include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
Normal file
108
include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#include <linux/serial.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
#define NR_PORTS 1
|
||||
|
||||
#define OFFSET_THR 0x00 /* Transmit Holding register */
|
||||
#define OFFSET_RBR 0x00 /* Receive Buffer register */
|
||||
#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
|
||||
#define OFFSET_IER 0x04 /* Interrupt Enable Register */
|
||||
#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
|
||||
#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
|
||||
#define OFFSET_LCR 0x0C /* Line Control Register */
|
||||
#define OFFSET_MCR 0x10 /* Modem Control Register */
|
||||
#define OFFSET_LSR 0x14 /* Line Status Register */
|
||||
#define OFFSET_MSR 0x18 /* Modem Status Register */
|
||||
#define OFFSET_SCR 0x1C /* SCR Scratch Register */
|
||||
#define OFFSET_GCTL 0x24 /* Global Control Register */
|
||||
|
||||
#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
|
||||
#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
|
||||
#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
|
||||
#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
|
||||
#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
|
||||
#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
|
||||
#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
|
||||
#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
|
||||
|
||||
#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
|
||||
#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
|
||||
#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
|
||||
#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
|
||||
#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
|
||||
#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
|
||||
|
||||
#ifdef CONFIG_BFIN_UART0_CTSRTS
|
||||
# define CONFIG_SERIAL_BFIN_CTSRTS
|
||||
# ifndef CONFIG_UART0_CTS_PIN
|
||||
# define CONFIG_UART0_CTS_PIN -1
|
||||
# endif
|
||||
# ifndef CONFIG_UART0_RTS_PIN
|
||||
# define CONFIG_UART0_RTS_PIN -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct bfin_serial_port {
|
||||
struct uart_port port;
|
||||
unsigned int old_status;
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
int tx_done;
|
||||
int tx_count;
|
||||
struct circ_buf rx_dma_buf;
|
||||
struct timer_list rx_dma_timer;
|
||||
int rx_dma_nrows;
|
||||
unsigned int tx_dma_channel;
|
||||
unsigned int rx_dma_channel;
|
||||
struct work_struct tx_dma_workqueue;
|
||||
#else
|
||||
struct work_struct cts_workqueue;
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
int cts_pin;
|
||||
int rts_pin;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bfin_serial_port bfin_serial_ports[NR_PORTS];
|
||||
struct bfin_serial_res {
|
||||
unsigned long uart_base_addr;
|
||||
int uart_irq;
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
unsigned int uart_tx_dma_channel;
|
||||
unsigned int uart_rx_dma_channel;
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
int uart_cts_pin;
|
||||
int uart_rts_pin;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bfin_serial_res bfin_serial_resource[] = {
|
||||
0xFFC00400,
|
||||
IRQ_UART_RX,
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
CH_UART_TX,
|
||||
CH_UART_RX,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_UART0_CTSRTS
|
||||
CONFIG_UART0_CTS_PIN,
|
||||
CONFIG_UART0_RTS_PIN,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
int nr_ports = NR_PORTS;
|
||||
static void bfin_serial_hw_init(struct bfin_serial_port *uart)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
if (uart->cts_pin >= 0) {
|
||||
gpio_request(uart->cts_pin, NULL);
|
||||
gpio_direction_input(uart->cts_pin);
|
||||
}
|
||||
if (uart->rts_pin >= 0) {
|
||||
gpio_request(uart->rts_pin, NULL);
|
||||
gpio_direction_input(uart->rts_pin);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
45
include/asm-blackfin/mach-bf533/blackfin.h
Normal file
45
include/asm-blackfin/mach-bf533/blackfin.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/blackfin.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_BLACKFIN_H_
|
||||
#define _MACH_BLACKFIN_H_
|
||||
|
||||
#define BF533_FAMILY
|
||||
|
||||
#include "bf533.h"
|
||||
#include "mem_map.h"
|
||||
#include "defBF532.h"
|
||||
#include "anomaly.h"
|
||||
|
||||
#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
|
||||
#include "cdefBF532.h"
|
||||
#endif
|
||||
|
||||
#endif /* _MACH_BLACKFIN_H_ */
|
||||
706
include/asm-blackfin/mach-bf533/cdefBF532.h
Normal file
706
include/asm-blackfin/mach-bf533/cdefBF532.h
Normal file
|
|
@ -0,0 +1,706 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/cdefBF532.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _CDEF_BF532_H
|
||||
#define _CDEF_BF532_H
|
||||
/*
|
||||
#if !defined(__ADSPLPBLACKFIN__)
|
||||
#warning cdefBF532.h should only be included for 532 compatible chips.
|
||||
#endif
|
||||
*/
|
||||
/*include all Core registers and bit definitions*/
|
||||
#include "defBF532.h"
|
||||
|
||||
/*include core specific register pointer definitions*/
|
||||
#include <asm/mach-common/cdef_LPBlackfin.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
|
||||
/* Clock and System Control (0xFFC0 0400-0xFFC0 07FF) */
|
||||
#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
|
||||
#define bfin_write_PLL_CTL(val) bfin_write16(PLL_CTL,val)
|
||||
#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
|
||||
#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
|
||||
#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
|
||||
#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
|
||||
#define bfin_read_CHIPID() bfin_read32(CHIPID)
|
||||
#define bfin_read_SWRST() bfin_read16(SWRST)
|
||||
#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
|
||||
#define bfin_read_SYSCR() bfin_read16(SYSCR)
|
||||
#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
|
||||
#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
|
||||
#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
|
||||
#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
|
||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||
{
|
||||
unsigned long flags, iwr;
|
||||
|
||||
bfin_write16(VR_CTL, val);
|
||||
__builtin_bfin_ssync();
|
||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||
iwr = bfin_read32(SIC_IWR);
|
||||
/* Only allow PPL Wakeup) */
|
||||
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
||||
local_irq_save(flags);
|
||||
asm("IDLE;");
|
||||
local_irq_restore(flags);
|
||||
bfin_write32(SIC_IWR, iwr);
|
||||
}
|
||||
|
||||
/* System Interrupt Controller (0xFFC0 0C00-0xFFC0 0FFF) */
|
||||
#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
|
||||
#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0,val)
|
||||
#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
|
||||
#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1,val)
|
||||
#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
|
||||
#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2,val)
|
||||
#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
|
||||
#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3,val)
|
||||
#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK)
|
||||
#define bfin_write_SIC_IMASK(val) bfin_write32(SIC_IMASK,val)
|
||||
#define bfin_read_SIC_ISR() bfin_read32(SIC_ISR)
|
||||
#define bfin_write_SIC_ISR(val) bfin_write32(SIC_ISR,val)
|
||||
#define bfin_read_SIC_IWR() bfin_read32(SIC_IWR)
|
||||
#define bfin_write_SIC_IWR(val) bfin_write32(SIC_IWR,val)
|
||||
|
||||
/* Watchdog Timer (0xFFC0 1000-0xFFC0 13FF) */
|
||||
#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
|
||||
#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL,val)
|
||||
#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
|
||||
#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT,val)
|
||||
#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
|
||||
#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT,val)
|
||||
|
||||
/* Real Time Clock (0xFFC0 1400-0xFFC0 17FF) */
|
||||
#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
|
||||
#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT,val)
|
||||
#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
|
||||
#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL,val)
|
||||
#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
|
||||
#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT,val)
|
||||
#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
|
||||
#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT,val)
|
||||
#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
|
||||
#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM,val)
|
||||
#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
|
||||
#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST,val)
|
||||
#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
|
||||
#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val)
|
||||
|
||||
/* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */
|
||||
#define bfin_read_FIO_DIR() bfin_read16(FIO_DIR)
|
||||
#define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val)
|
||||
#define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C)
|
||||
#define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val)
|
||||
#define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S)
|
||||
#define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val)
|
||||
#define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C)
|
||||
#define bfin_write_FIO_MASKA_C(val) bfin_write16(FIO_MASKA_C,val)
|
||||
#define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S)
|
||||
#define bfin_write_FIO_MASKA_S(val) bfin_write16(FIO_MASKA_S,val)
|
||||
#define bfin_read_FIO_MASKB_C() bfin_read16(FIO_MASKB_C)
|
||||
#define bfin_write_FIO_MASKB_C(val) bfin_write16(FIO_MASKB_C,val)
|
||||
#define bfin_read_FIO_MASKB_S() bfin_read16(FIO_MASKB_S)
|
||||
#define bfin_write_FIO_MASKB_S(val) bfin_write16(FIO_MASKB_S,val)
|
||||
#define bfin_read_FIO_POLAR() bfin_read16(FIO_POLAR)
|
||||
#define bfin_write_FIO_POLAR(val) bfin_write16(FIO_POLAR,val)
|
||||
#define bfin_read_FIO_EDGE() bfin_read16(FIO_EDGE)
|
||||
#define bfin_write_FIO_EDGE(val) bfin_write16(FIO_EDGE,val)
|
||||
#define bfin_read_FIO_BOTH() bfin_read16(FIO_BOTH)
|
||||
#define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val)
|
||||
#define bfin_read_FIO_INEN() bfin_read16(FIO_INEN)
|
||||
#define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val)
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val)
|
||||
#define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T)
|
||||
#define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val)
|
||||
#define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D)
|
||||
#define bfin_write_FIO_MASKA_D(val) bfin_write16(FIO_MASKA_D,val)
|
||||
#define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T)
|
||||
#define bfin_write_FIO_MASKA_T(val) bfin_write16(FIO_MASKA_T,val)
|
||||
#define bfin_read_FIO_MASKB_D() bfin_read16(FIO_MASKB_D)
|
||||
#define bfin_write_FIO_MASKB_D(val) bfin_write16(FIO_MASKB_D,val)
|
||||
#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T)
|
||||
#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val)
|
||||
|
||||
/* DMA Traffic controls */
|
||||
#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
|
||||
#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
|
||||
#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
|
||||
#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
|
||||
#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
|
||||
#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER,val)
|
||||
#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
|
||||
#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT,val)
|
||||
|
||||
/* DMA Controller */
|
||||
#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
|
||||
#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
|
||||
#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
|
||||
#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR,val)
|
||||
#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
|
||||
#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT,val)
|
||||
#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
|
||||
#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT,val)
|
||||
#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
|
||||
#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY,val)
|
||||
#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
|
||||
#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY,val)
|
||||
#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
|
||||
#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR,val)
|
||||
#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
|
||||
#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
|
||||
#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
|
||||
#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG,val)
|
||||
#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
|
||||
#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR,val)
|
||||
#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
|
||||
#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT,val)
|
||||
#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
|
||||
#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT,val)
|
||||
#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
|
||||
#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY,val)
|
||||
#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
|
||||
#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY,val)
|
||||
#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
|
||||
#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR,val)
|
||||
#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
|
||||
#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
|
||||
#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
|
||||
#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG,val)
|
||||
#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
|
||||
#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR,val)
|
||||
#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
|
||||
#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT,val)
|
||||
#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
|
||||
#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT,val)
|
||||
#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
|
||||
#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY,val)
|
||||
#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
|
||||
#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY,val)
|
||||
#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
|
||||
#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR,val)
|
||||
#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
|
||||
#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
|
||||
#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
|
||||
#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG,val)
|
||||
#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
|
||||
#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR,val)
|
||||
#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
|
||||
#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT,val)
|
||||
#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
|
||||
#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT,val)
|
||||
#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
|
||||
#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY,val)
|
||||
#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
|
||||
#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY,val)
|
||||
#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
|
||||
#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR,val)
|
||||
#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
|
||||
#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
|
||||
#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
|
||||
#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG,val)
|
||||
#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
|
||||
#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR,val)
|
||||
#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
|
||||
#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT,val)
|
||||
#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
|
||||
#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT,val)
|
||||
#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
|
||||
#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY,val)
|
||||
#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
|
||||
#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY,val)
|
||||
#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
|
||||
#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR,val)
|
||||
#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
|
||||
#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
|
||||
#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
|
||||
#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG,val)
|
||||
#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
|
||||
#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR,val)
|
||||
#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
|
||||
#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT,val)
|
||||
#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
|
||||
#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT,val)
|
||||
#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
|
||||
#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY,val)
|
||||
#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
|
||||
#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY,val)
|
||||
#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
|
||||
#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR,val)
|
||||
#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
|
||||
#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
|
||||
#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
|
||||
#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG,val)
|
||||
#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
|
||||
#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR,val)
|
||||
#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
|
||||
#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT,val)
|
||||
#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
|
||||
#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT,val)
|
||||
#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
|
||||
#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY,val)
|
||||
#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
|
||||
#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY,val)
|
||||
#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
|
||||
#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR,val)
|
||||
#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
|
||||
#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
|
||||
#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
|
||||
#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG,val)
|
||||
#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
|
||||
#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
|
||||
#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR,val)
|
||||
#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
|
||||
#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT,val)
|
||||
#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
|
||||
#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT,val)
|
||||
#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
|
||||
#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY,val)
|
||||
#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
|
||||
#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY,val)
|
||||
#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
|
||||
#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR,val)
|
||||
#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
|
||||
#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR,val)
|
||||
#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
|
||||
#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT,val)
|
||||
#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
|
||||
#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT,val)
|
||||
#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
|
||||
#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS,val)
|
||||
#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
|
||||
#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
|
||||
#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG,val)
|
||||
#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
|
||||
#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
|
||||
#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR,val)
|
||||
#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
|
||||
#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT,val)
|
||||
#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
|
||||
#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
|
||||
#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY,val)
|
||||
#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
|
||||
#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY,val)
|
||||
#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
|
||||
#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
|
||||
#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR,val)
|
||||
#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
|
||||
#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT,val)
|
||||
#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
|
||||
#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
|
||||
#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS,val)
|
||||
#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
|
||||
#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
|
||||
#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG,val)
|
||||
#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
|
||||
#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
|
||||
#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR,val)
|
||||
#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
|
||||
#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT,val)
|
||||
#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
|
||||
#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
|
||||
#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY,val)
|
||||
#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
|
||||
#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY,val)
|
||||
#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
|
||||
#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
|
||||
#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR,val)
|
||||
#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
|
||||
#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT,val)
|
||||
#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
|
||||
#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
|
||||
#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS,val)
|
||||
#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
|
||||
#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
|
||||
#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG,val)
|
||||
#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
|
||||
#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
|
||||
#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR,val)
|
||||
#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
|
||||
#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT,val)
|
||||
#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
|
||||
#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
|
||||
#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY,val)
|
||||
#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
|
||||
#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY,val)
|
||||
#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
|
||||
#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
|
||||
#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR,val)
|
||||
#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
|
||||
#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT,val)
|
||||
#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
|
||||
#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
|
||||
#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS,val)
|
||||
#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
|
||||
#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP,val)
|
||||
|
||||
#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
|
||||
#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG,val)
|
||||
#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
|
||||
#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
|
||||
#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR,val)
|
||||
#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
|
||||
#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT,val)
|
||||
#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
|
||||
#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
|
||||
#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY,val)
|
||||
#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
|
||||
#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY,val)
|
||||
#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
|
||||
#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR,val)
|
||||
#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
|
||||
#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR,val)
|
||||
#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
|
||||
#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT,val)
|
||||
#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
|
||||
#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT,val)
|
||||
#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
|
||||
#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS,val)
|
||||
#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
|
||||
#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP,val)
|
||||
|
||||
/* Aysnchronous Memory Controller - External Bus Interface Unit (0xFFC0 3C00-0xFFC0 3FFF) */
|
||||
#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
|
||||
#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL,val)
|
||||
#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
|
||||
#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0,val)
|
||||
#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
|
||||
#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1,val)
|
||||
|
||||
/* SDRAM Controller External Bus Interface Unit (0xFFC0 4C00-0xFFC0 4FFF) */
|
||||
#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
|
||||
#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL,val)
|
||||
#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
|
||||
#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC,val)
|
||||
#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
|
||||
#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
|
||||
#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
|
||||
#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL,val)
|
||||
|
||||
/* UART Controller */
|
||||
#define bfin_read_UART_THR() bfin_read16(UART_THR)
|
||||
#define bfin_write_UART_THR(val) bfin_write16(UART_THR,val)
|
||||
#define bfin_read_UART_RBR() bfin_read16(UART_RBR)
|
||||
#define bfin_write_UART_RBR(val) bfin_write16(UART_RBR,val)
|
||||
#define bfin_read_UART_DLL() bfin_read16(UART_DLL)
|
||||
#define bfin_write_UART_DLL(val) bfin_write16(UART_DLL,val)
|
||||
#define bfin_read_UART_IER() bfin_read16(UART_IER)
|
||||
#define bfin_write_UART_IER(val) bfin_write16(UART_IER,val)
|
||||
#define bfin_read_UART_DLH() bfin_read16(UART_DLH)
|
||||
#define bfin_write_UART_DLH(val) bfin_write16(UART_DLH,val)
|
||||
#define bfin_read_UART_IIR() bfin_read16(UART_IIR)
|
||||
#define bfin_write_UART_IIR(val) bfin_write16(UART_IIR,val)
|
||||
#define bfin_read_UART_LCR() bfin_read16(UART_LCR)
|
||||
#define bfin_write_UART_LCR(val) bfin_write16(UART_LCR,val)
|
||||
#define bfin_read_UART_MCR() bfin_read16(UART_MCR)
|
||||
#define bfin_write_UART_MCR(val) bfin_write16(UART_MCR,val)
|
||||
#define bfin_read_UART_LSR() bfin_read16(UART_LSR)
|
||||
#define bfin_write_UART_LSR(val) bfin_write16(UART_LSR,val)
|
||||
/*
|
||||
#define UART_MSR
|
||||
*/
|
||||
#define bfin_read_UART_SCR() bfin_read16(UART_SCR)
|
||||
#define bfin_write_UART_SCR(val) bfin_write16(UART_SCR,val)
|
||||
#define bfin_read_UART_GCTL() bfin_read16(UART_GCTL)
|
||||
#define bfin_write_UART_GCTL(val) bfin_write16(UART_GCTL,val)
|
||||
|
||||
/* SPI Controller */
|
||||
#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
|
||||
#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL,val)
|
||||
#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
|
||||
#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG,val)
|
||||
#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
|
||||
#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT,val)
|
||||
#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
|
||||
#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR,val)
|
||||
#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
|
||||
#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR,val)
|
||||
#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
|
||||
#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD,val)
|
||||
#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
|
||||
#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW,val)
|
||||
|
||||
/* TIMER 0, 1, 2 Registers */
|
||||
#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
|
||||
#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG,val)
|
||||
#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
|
||||
#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER,val)
|
||||
#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
|
||||
#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD,val)
|
||||
#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
|
||||
#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH,val)
|
||||
|
||||
#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
|
||||
#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG,val)
|
||||
#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
|
||||
#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER,val)
|
||||
#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
|
||||
#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD,val)
|
||||
#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
|
||||
#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH,val)
|
||||
|
||||
#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
|
||||
#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG,val)
|
||||
#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
|
||||
#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER,val)
|
||||
#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
|
||||
#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD,val)
|
||||
#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
|
||||
#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH,val)
|
||||
|
||||
#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
|
||||
#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE,val)
|
||||
#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
|
||||
#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE,val)
|
||||
#define bfin_read_TIMER_STATUS() bfin_read16(TIMER_STATUS)
|
||||
#define bfin_write_TIMER_STATUS(val) bfin_write16(TIMER_STATUS,val)
|
||||
|
||||
/* SPORT0 Controller */
|
||||
#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
|
||||
#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1,val)
|
||||
#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
|
||||
#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2,val)
|
||||
#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
|
||||
#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV,val)
|
||||
#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
|
||||
#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV,val)
|
||||
#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
|
||||
#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX,val)
|
||||
#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
|
||||
#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX,val)
|
||||
#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX)
|
||||
#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX,val)
|
||||
#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX)
|
||||
#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX,val)
|
||||
#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX)
|
||||
#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX,val)
|
||||
#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX)
|
||||
#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX,val)
|
||||
#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
|
||||
#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1,val)
|
||||
#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
|
||||
#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2,val)
|
||||
#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
|
||||
#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV,val)
|
||||
#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
|
||||
#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV,val)
|
||||
#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
|
||||
#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT,val)
|
||||
#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
|
||||
#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL,val)
|
||||
#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
|
||||
#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1,val)
|
||||
#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
|
||||
#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2,val)
|
||||
#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
|
||||
#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0,val)
|
||||
#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
|
||||
#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1,val)
|
||||
#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
|
||||
#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2,val)
|
||||
#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
|
||||
#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3,val)
|
||||
#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
|
||||
#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0,val)
|
||||
#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
|
||||
#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1,val)
|
||||
#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
|
||||
#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2,val)
|
||||
#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
|
||||
#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3,val)
|
||||
|
||||
/* SPORT1 Controller */
|
||||
#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
|
||||
#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1,val)
|
||||
#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
|
||||
#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2,val)
|
||||
#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
|
||||
#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV,val)
|
||||
#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
|
||||
#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV,val)
|
||||
#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
|
||||
#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val)
|
||||
#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
|
||||
#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX,val)
|
||||
#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX)
|
||||
#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val)
|
||||
#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX)
|
||||
#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX,val)
|
||||
#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX)
|
||||
#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
|
||||
#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX)
|
||||
#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX,val)
|
||||
#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
|
||||
#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1,val)
|
||||
#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
|
||||
#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2,val)
|
||||
#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
|
||||
#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV,val)
|
||||
#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
|
||||
#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV,val)
|
||||
#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
|
||||
#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT,val)
|
||||
#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
|
||||
#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL,val)
|
||||
#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
|
||||
#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1,val)
|
||||
#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
|
||||
#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2,val)
|
||||
#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
|
||||
#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0,val)
|
||||
#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
|
||||
#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1,val)
|
||||
#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
|
||||
#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2,val)
|
||||
#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
|
||||
#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3,val)
|
||||
#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
|
||||
#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0,val)
|
||||
#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
|
||||
#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1,val)
|
||||
#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
|
||||
#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2,val)
|
||||
#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
|
||||
#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3,val)
|
||||
|
||||
/* Parallel Peripheral Interface (PPI) */
|
||||
#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
|
||||
#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL,val)
|
||||
#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
|
||||
#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS,val)
|
||||
#define bfin_clear_PPI_STATUS() bfin_read_PPI_STATUS()
|
||||
#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
|
||||
#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY,val)
|
||||
#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
|
||||
#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT,val)
|
||||
#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
|
||||
#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val)
|
||||
|
||||
#endif /* _CDEF_BF532_H */
|
||||
1175
include/asm-blackfin/mach-bf533/defBF532.h
Normal file
1175
include/asm-blackfin/mach-bf533/defBF532.h
Normal file
File diff suppressed because it is too large
Load diff
54
include/asm-blackfin/mach-bf533/dma.h
Normal file
54
include/asm-blackfin/mach-bf533/dma.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*****************************************************************************
|
||||
*
|
||||
* BF-533/2/1 Specific Declarations
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/dma.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_DMA_H_
|
||||
#define _MACH_DMA_H_
|
||||
|
||||
#define MAX_BLACKFIN_DMA_CHANNEL 12
|
||||
|
||||
#define CH_PPI 0
|
||||
#define CH_SPORT0_RX 1
|
||||
#define CH_SPORT0_TX 2
|
||||
#define CH_SPORT1_RX 3
|
||||
#define CH_SPORT1_TX 4
|
||||
#define CH_SPI 5
|
||||
#define CH_UART_RX 6
|
||||
#define CH_UART_TX 7
|
||||
#define CH_MEM_STREAM0_DEST 8 /* TX */
|
||||
#define CH_MEM_STREAM0_SRC 9 /* RX */
|
||||
#define CH_MEM_STREAM1_DEST 10 /* TX */
|
||||
#define CH_MEM_STREAM1_SRC 11 /* RX */
|
||||
|
||||
#endif
|
||||
177
include/asm-blackfin/mach-bf533/irq.h
Normal file
177
include/asm-blackfin/mach-bf533/irq.h
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/defBF532.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _BF533_IRQ_H_
|
||||
#define _BF533_IRQ_H_
|
||||
|
||||
/*
|
||||
* Interrupt source definitions
|
||||
Event Source Core Event Name
|
||||
Core Emulation **
|
||||
Events (highest priority) EMU 0
|
||||
Reset RST 1
|
||||
NMI NMI 2
|
||||
Exception EVX 3
|
||||
Reserved -- 4
|
||||
Hardware Error IVHW 5
|
||||
Core Timer IVTMR 6 *
|
||||
PLL Wakeup Interrupt IVG7 7
|
||||
DMA Error (generic) IVG7 8
|
||||
PPI Error Interrupt IVG7 9
|
||||
SPORT0 Error Interrupt IVG7 10
|
||||
SPORT1 Error Interrupt IVG7 11
|
||||
SPI Error Interrupt IVG7 12
|
||||
UART Error Interrupt IVG7 13
|
||||
RTC Interrupt IVG8 14
|
||||
DMA0 Interrupt (PPI) IVG8 15
|
||||
DMA1 (SPORT0 RX) IVG9 16
|
||||
DMA2 (SPORT0 TX) IVG9 17
|
||||
DMA3 (SPORT1 RX) IVG9 18
|
||||
DMA4 (SPORT1 TX) IVG9 19
|
||||
DMA5 (PPI) IVG10 20
|
||||
DMA6 (UART RX) IVG10 21
|
||||
DMA7 (UART TX) IVG10 22
|
||||
Timer0 IVG11 23
|
||||
Timer1 IVG11 24
|
||||
Timer2 IVG11 25
|
||||
PF Interrupt A IVG12 26
|
||||
PF Interrupt B IVG12 27
|
||||
DMA8/9 Interrupt IVG13 28
|
||||
DMA10/11 Interrupt IVG13 29
|
||||
Watchdog Timer IVG13 30
|
||||
Software Interrupt 1 IVG14 31
|
||||
Software Interrupt 2 --
|
||||
(lowest priority) IVG15 32 *
|
||||
*/
|
||||
#define SYS_IRQS 32
|
||||
#define NR_PERI_INTS 24
|
||||
|
||||
/* The ABSTRACT IRQ definitions */
|
||||
/** the first seven of the following are fixed, the rest you change if you need to **/
|
||||
#define IRQ_EMU 0 /*Emulation */
|
||||
#define IRQ_RST 1 /*reset */
|
||||
#define IRQ_NMI 2 /*Non Maskable */
|
||||
#define IRQ_EVX 3 /*Exception */
|
||||
#define IRQ_UNUSED 4 /*- unused interrupt*/
|
||||
#define IRQ_HWERR 5 /*Hardware Error */
|
||||
#define IRQ_CORETMR 6 /*Core timer */
|
||||
|
||||
#define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */
|
||||
#define IRQ_DMA_ERROR 8 /*DMA Error (general) */
|
||||
#define IRQ_PPI_ERROR 9 /*PPI Error Interrupt */
|
||||
#define IRQ_SPORT0_ERROR 10 /*SPORT0 Error Interrupt */
|
||||
#define IRQ_SPORT1_ERROR 11 /*SPORT1 Error Interrupt */
|
||||
#define IRQ_SPI_ERROR 12 /*SPI Error Interrupt */
|
||||
#define IRQ_UART_ERROR 13 /*UART Error Interrupt */
|
||||
#define IRQ_RTC 14 /*RTC Interrupt */
|
||||
#define IRQ_PPI 15 /*DMA0 Interrupt (PPI) */
|
||||
#define IRQ_SPORT0_RX 16 /*DMA1 Interrupt (SPORT0 RX) */
|
||||
#define IRQ_SPORT0_TX 17 /*DMA2 Interrupt (SPORT0 TX) */
|
||||
#define IRQ_SPORT1_RX 18 /*DMA3 Interrupt (SPORT1 RX) */
|
||||
#define IRQ_SPORT1_TX 19 /*DMA4 Interrupt (SPORT1 TX) */
|
||||
#define IRQ_SPI 20 /*DMA5 Interrupt (SPI) */
|
||||
#define IRQ_UART_RX 21 /*DMA6 Interrupt (UART RX) */
|
||||
#define IRQ_UART_TX 22 /*DMA7 Interrupt (UART TX) */
|
||||
#define IRQ_TMR0 23 /*Timer 0 */
|
||||
#define IRQ_TMR1 24 /*Timer 1 */
|
||||
#define IRQ_TMR2 25 /*Timer 2 */
|
||||
#define IRQ_PROG_INTA 26 /*Programmable Flags A (8) */
|
||||
#define IRQ_PROG_INTB 27 /*Programmable Flags B (8) */
|
||||
#define IRQ_MEM_DMA0 28 /*DMA8/9 Interrupt (Memory DMA Stream 0) */
|
||||
#define IRQ_MEM_DMA1 29 /*DMA10/11 Interrupt (Memory DMA Stream 1) */
|
||||
#define IRQ_WATCH 30 /*Watch Dog Timer */
|
||||
|
||||
#define IRQ_SW_INT1 31 /*Software Int 1 */
|
||||
#define IRQ_SW_INT2 32 /*Software Int 2 (reserved for SYSCALL) */
|
||||
|
||||
#define IRQ_PF0 33
|
||||
#define IRQ_PF1 34
|
||||
#define IRQ_PF2 35
|
||||
#define IRQ_PF3 36
|
||||
#define IRQ_PF4 37
|
||||
#define IRQ_PF5 38
|
||||
#define IRQ_PF6 39
|
||||
#define IRQ_PF7 40
|
||||
#define IRQ_PF8 41
|
||||
#define IRQ_PF9 42
|
||||
#define IRQ_PF10 43
|
||||
#define IRQ_PF11 44
|
||||
#define IRQ_PF12 45
|
||||
#define IRQ_PF13 46
|
||||
#define IRQ_PF14 47
|
||||
#define IRQ_PF15 48
|
||||
|
||||
#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
|
||||
#define NR_IRQS (IRQ_PF15+1)
|
||||
#else
|
||||
#define NR_IRQS SYS_IRQS
|
||||
#endif
|
||||
|
||||
#define IVG7 7
|
||||
#define IVG8 8
|
||||
#define IVG9 9
|
||||
#define IVG10 10
|
||||
#define IVG11 11
|
||||
#define IVG12 12
|
||||
#define IVG13 13
|
||||
#define IVG14 14
|
||||
#define IVG15 15
|
||||
|
||||
/* IAR0 BIT FIELDS*/
|
||||
#define RTC_ERROR_POS 28
|
||||
#define UART_ERROR_POS 24
|
||||
#define SPORT1_ERROR_POS 20
|
||||
#define SPI_ERROR_POS 16
|
||||
#define SPORT0_ERROR_POS 12
|
||||
#define PPI_ERROR_POS 8
|
||||
#define DMA_ERROR_POS 4
|
||||
#define PLLWAKE_ERROR_POS 0
|
||||
|
||||
/* IAR1 BIT FIELDS*/
|
||||
#define DMA7_UARTTX_POS 28
|
||||
#define DMA6_UARTRX_POS 24
|
||||
#define DMA5_SPI_POS 20
|
||||
#define DMA4_SPORT1TX_POS 16
|
||||
#define DMA3_SPORT1RX_POS 12
|
||||
#define DMA2_SPORT0TX_POS 8
|
||||
#define DMA1_SPORT0RX_POS 4
|
||||
#define DMA0_PPI_POS 0
|
||||
|
||||
/* IAR2 BIT FIELDS*/
|
||||
#define WDTIMER_POS 28
|
||||
#define MEMDMA1_POS 24
|
||||
#define MEMDMA0_POS 20
|
||||
#define PFB_POS 16
|
||||
#define PFA_POS 12
|
||||
#define TIMER2_POS 8
|
||||
#define TIMER1_POS 4
|
||||
#define TIMER0_POS 0
|
||||
|
||||
#endif /* _BF533_IRQ_H_ */
|
||||
316
include/asm-blackfin/mach-bf533/mem_init.h
Normal file
316
include/asm-blackfin/mach-bf533/mem_init.h
Normal file
|
|
@ -0,0 +1,316 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/mem_init.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_GENERIC_BOARD)
|
||||
#if (CONFIG_SCLK_HZ > 119402985)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_7
|
||||
#define SDRAM_tRAS_num 7
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_6
|
||||
#define SDRAM_tRAS_num 6
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 8955223) && (CONFIG_SCLK_HZ <= 104477612)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_5
|
||||
#define SDRAM_tRAS_num 5
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_4
|
||||
#define SDRAM_tRAS_num 4
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_3
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_4
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_3
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_2
|
||||
#define SDRAM_tRAS_num 2
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ <= 29850746)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_1
|
||||
#define SDRAM_tRAS_num 1
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC16M16A2TG_75)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_GENERIC_BOARD)
|
||||
/*SDRAM INFORMATION: Modify this for your board */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_SIZE == 128)
|
||||
#define SDRAM_SIZE EBSZ_128
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 64)
|
||||
#define SDRAM_SIZE EBSZ_64
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 32)
|
||||
#define SDRAM_SIZE EBSZ_32
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 16)
|
||||
#define SDRAM_SIZE EBSZ_16
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 11)
|
||||
#define SDRAM_WIDTH EBCAW_11
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 10)
|
||||
#define SDRAM_WIDTH EBCAW_10
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 9)
|
||||
#define SDRAM_WIDTH EBCAW_9
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 8)
|
||||
#define SDRAM_WIDTH EBCAW_8
|
||||
#endif
|
||||
|
||||
#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE)
|
||||
|
||||
/* Equation from section 17 (p17-46) of BF533 HRM */
|
||||
#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
|
||||
|
||||
/* Enable SCLK Out */
|
||||
#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
|
||||
|
||||
#if defined CONFIG_CLKIN_HALF
|
||||
#define CLKIN_HALF 1
|
||||
#else
|
||||
#define CLKIN_HALF 0
|
||||
#endif
|
||||
|
||||
#if defined CONFIG_PLL_BYPASS
|
||||
#define PLL_BYPASS 1
|
||||
#else
|
||||
#define PLL_BYPASS 0
|
||||
#endif
|
||||
|
||||
/***************************************Currently Not Being Used *********************************/
|
||||
#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
|
||||
#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
|
||||
#if (flash_EBIU_AMBCTL_TT > 3)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT == 3)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT == 2)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT < 2)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_ST > 3)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST == 3)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST == 2)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST < 2)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_HT > 2)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 2)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 1)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_1
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_0
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_WAT > 14)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_15
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 14)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_14
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 13)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_13
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 12)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_12
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 11)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_11
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 10)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_10
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 9)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_9
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 8)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_8
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 7)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_7
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 6)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_6
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 5)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_5
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 4)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 3)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 2)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 1)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_RAT > 14)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_15
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 14)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_14
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 13)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_13
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 12)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_12
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 11)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_11
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 10)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_10
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 9)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_9
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 8)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_8
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 7)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_7
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 6)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_6
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 5)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_5
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 4)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 3)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 2)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 1)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_1
|
||||
#endif
|
||||
|
||||
#define flash_EBIU_AMBCTL0 \
|
||||
(flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
|
||||
flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
|
||||
168
include/asm-blackfin/mach-bf533/mem_map.h
Normal file
168
include/asm-blackfin/mach-bf533/mem_map.h
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
|
||||
/*
|
||||
* File: include/asm-blackfin/mach-bf533/mem_map.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _MEM_MAP_533_H_
|
||||
#define _MEM_MAP_533_H_
|
||||
|
||||
#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
|
||||
#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
|
||||
|
||||
/* Async Memory Banks */
|
||||
#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
|
||||
#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */
|
||||
#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */
|
||||
#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
|
||||
#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */
|
||||
|
||||
/* Boot ROM Memory */
|
||||
|
||||
#define BOOT_ROM_START 0xEF000000
|
||||
|
||||
/* Level 1 Memory */
|
||||
|
||||
#ifdef CONFIG_BLKFIN_CACHE
|
||||
#define BLKFIN_ICACHESIZE (16*1024)
|
||||
#else
|
||||
#define BLKFIN_ICACHESIZE (0*1024)
|
||||
#endif
|
||||
|
||||
/* Memory Map for ADSP-BF533 processors */
|
||||
|
||||
#ifdef CONFIG_BF533
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF800000
|
||||
#define L1_DATA_B_START 0xFF900000
|
||||
|
||||
#ifdef CONFIG_BLKFIN_CACHE
|
||||
#define L1_CODE_LENGTH (0x14000 - 0x4000)
|
||||
#else
|
||||
#define L1_CODE_LENGTH 0x14000
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (16*1024)
|
||||
#define BLKFIN_DSUPBANKS 1
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
|
||||
#define BLKFIN_DCACHESIZE (32*1024)
|
||||
#define BLKFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x8000
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (0*1024)
|
||||
#define BLKFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BLKFIN_DCACHE*/
|
||||
#endif
|
||||
|
||||
/* Memory Map for ADSP-BF532 processors */
|
||||
|
||||
#ifdef CONFIG_BF532
|
||||
#define L1_CODE_START 0xFFA08000
|
||||
#define L1_DATA_A_START 0xFF804000
|
||||
#define L1_DATA_B_START 0xFF904000
|
||||
|
||||
#ifdef CONFIG_BLKFIN_CACHE
|
||||
#define L1_CODE_LENGTH (0xC000 - 0x4000)
|
||||
#else
|
||||
#define L1_CODE_LENGTH 0xC000
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x4000
|
||||
#define BLKFIN_DCACHESIZE (16*1024)
|
||||
#define BLKFIN_DSUPBANKS 1
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x4000 - 0x4000)
|
||||
#define BLKFIN_DCACHESIZE (32*1024)
|
||||
#define BLKFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x4000
|
||||
#define L1_DATA_B_LENGTH 0x4000
|
||||
#define BLKFIN_DCACHESIZE (0*1024)
|
||||
#define BLKFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BLKFIN_DCACHE*/
|
||||
#endif
|
||||
|
||||
/* Memory Map for ADSP-BF531 processors */
|
||||
|
||||
#ifdef CONFIG_BF531
|
||||
#define L1_CODE_START 0xFFA08000
|
||||
#define L1_DATA_A_START 0xFF804000
|
||||
#define L1_DATA_B_START 0xFF904000
|
||||
#define L1_CODE_LENGTH 0x4000
|
||||
#define L1_DATA_B_LENGTH 0x0000
|
||||
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
|
||||
#define BLKFIN_DCACHESIZE (16*1024)
|
||||
#define BLKFIN_DSUPBANKS 1
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x4000
|
||||
#define BLKFIN_DCACHESIZE (0*1024)
|
||||
#define BLKFIN_DSUPBANKS 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Scratch Pad Memory */
|
||||
|
||||
#if defined(CONFIG_BF533) || defined(CONFIG_BF532) || defined(CONFIG_BF531)
|
||||
#define L1_SCRATCH_START 0xFFB00000
|
||||
#define L1_SCRATCH_LENGTH 0x1000
|
||||
#endif
|
||||
|
||||
#endif /* _MEM_MAP_533_H_ */
|
||||
120
include/asm-blackfin/mach-bf537/anomaly.h
Normal file
120
include/asm-blackfin/mach-bf537/anomaly.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
|
||||
/*
|
||||
* File: include/asm-blackfin/mach-bf537/anomaly.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* This file shoule be up to date with:
|
||||
* - Revision J, June 1, 2006; ADSP-BF537 Blackfin Processor Anomaly List
|
||||
* - Revision I, June 1, 2006; ADSP-BF536 Blackfin Processor Anomaly List
|
||||
* - Revision J, June 1, 2006; ADSP-BF534 Blackfin Processor Anomaly List
|
||||
*/
|
||||
|
||||
#ifndef _MACH_ANOMALY_H_
|
||||
#define _MACH_ANOMALY_H_
|
||||
|
||||
/* We do not support 0.1 silicon - sorry */
|
||||
#if (defined(CONFIG_BF_REV_0_1))
|
||||
#error Kernel will not work on BF537/6/4 Version 0.1
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_BF_REV_0_3) || defined(CONFIG_BF_REV_0_2))
|
||||
#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
|
||||
slot1 and store of a P register in slot 2 is not
|
||||
supported */
|
||||
#define ANOMALY_05000119 /* DMA_RUN bit is not valid after a Peripheral Receive
|
||||
Channel DMA stops */
|
||||
#define ANOMALY_05000122 /* Rx.H can not be used to access 16-bit System MMR
|
||||
registers. */
|
||||
#define ANOMALY_05000166 /* PPI Data Lengths Between 8 and 16 do not zero out
|
||||
upper bits*/
|
||||
#define ANOMALY_05000180 /* PPI_DELAY not functional in PPI modes with 0 frame
|
||||
syncs */
|
||||
#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
|
||||
#define ANOMALY_05000247 /* CLKIN Buffer Output Enable Reset Behavior Is
|
||||
Changed */
|
||||
#endif
|
||||
#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
|
||||
SPORT external receive and transmit clocks. */
|
||||
#define ANOMALY_05000272 /* Certain data cache write through modes fail for
|
||||
VDDint <=0.9V */
|
||||
#define ANOMALY_05000273 /* Writes to Synchronous SDRAM memory may be lost */
|
||||
#define ANOMALY_05000277 /* Writes to a flag data register one SCLK cycle after
|
||||
an edge is detected may clear interrupt */
|
||||
#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context is
|
||||
not restored */
|
||||
#define ANOMALY_05000282 /* Memory DMA corruption with 32-bit data and traffic
|
||||
control */
|
||||
#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when
|
||||
killed in a particular stage*/
|
||||
#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
|
||||
registers are interrupted */
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BF_REV_0_2)
|
||||
#define ANOMALY_05000244 /* With instruction cache enabled, a CSYNC or SSYNC or
|
||||
IDLE around a Change of Control causes
|
||||
unpredictable results */
|
||||
#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel
|
||||
(TDM) */
|
||||
#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
|
||||
#define ANOMALY_05000252 /* EMAC Tx DMA error after an early frame abort */
|
||||
#endif
|
||||
#define ANOMALY_05000253 /* Maximum external clock speed for Timers */
|
||||
#define ANOMALY_05000255 /* Entering Hibernate Mode with RTC Seconds event
|
||||
interrupt not functional */
|
||||
#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
|
||||
#define ANOMALY_05000256 /* EMAC MDIO input latched on wrong MDC edge */
|
||||
#endif
|
||||
#define ANOMALY_05000257 /* An interrupt or exception during short Hardware
|
||||
loops may cause the instruction fetch unit to
|
||||
malfunction */
|
||||
#define ANOMALY_05000258 /* Instruction Cache is corrupted when bit 9 and 12 of
|
||||
the ICPLB Data registers differ */
|
||||
#define ANOMALY_05000260 /* ICPLB_STATUS MMR register may be corrupted */
|
||||
#define ANOMALY_05000261 /* DCPLB_FAULT_ADDR MMR register may be corrupted */
|
||||
#define ANOMALY_05000262 /* Stores to data cache may be lost */
|
||||
#define ANOMALY_05000263 /* Hardware loop corrupted when taking an ICPLB exception */
|
||||
#define ANOMALY_05000264 /* A Sync instruction (CSYNC, SSYNC) or an IDLE
|
||||
instruction will cause an infinite stall in the
|
||||
second to last instruction in a hardware loop */
|
||||
#define ANOMALY_05000268 /* Memory DMA error when peripheral DMA is running
|
||||
and non-zero DEB_TRAFFIC_PERIOD value */
|
||||
#define ANOMALY_05000270 /* High I/O activity causes the output voltage of the
|
||||
internal voltage regulator (VDDint) to decrease */
|
||||
#define ANOMALY_05000277 /* Writes to a flag data register one SCLK cycle after
|
||||
an edge is detected may clear interrupt */
|
||||
#define ANOMALY_05000278 /* Disabling Peripherals with DMA running may cause
|
||||
DMA system instability */
|
||||
#define ANOMALY_05000280 /* SPI Master boot mode does not work well with
|
||||
Atmel Dataflash devices */
|
||||
|
||||
#endif /* CONFIG_BF_REV_0_2 */
|
||||
|
||||
#endif /* _MACH_ANOMALY_H_ */
|
||||
287
include/asm-blackfin/mach-bf537/bf537.h
Normal file
287
include/asm-blackfin/mach-bf537/bf537.h
Normal file
|
|
@ -0,0 +1,287 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf537/bf537.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF537
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef __MACH_BF537_H__
|
||||
#define __MACH_BF537_H__
|
||||
|
||||
#define SUPPORTED_REVID 2
|
||||
|
||||
/* Masks for generic ERROR IRQ demultiplexing used in int-priority-sc.c */
|
||||
|
||||
#define SPI_ERR_MASK (TXCOL | RBSY | MODF | TXE) /* SPI_STAT */
|
||||
#define SPORT_ERR_MASK (ROVF | RUVF | TOVF | TUVF) /* SPORTx_STAT */
|
||||
#define PPI_ERR_MASK (0xFFFF & ~FLD) /* PPI_STATUS */
|
||||
#define EMAC_ERR_MASK (PHYINT | MMCINT | RXFSINT | TXFSINT | WAKEDET | RXDMAERR | TXDMAERR | STMDONE) /* EMAC_SYSTAT */
|
||||
#define UART_ERR_MASK_STAT1 (0x4) /* UARTx_IIR */
|
||||
#define UART_ERR_MASK_STAT0 (0x2) /* UARTx_IIR */
|
||||
#define CAN_ERR_MASK (EWTIF | EWRIF | EPIF | BOIF | WUIF | UIAIF | AAIF | RMLIF | UCEIF | EXTIF | ADIF) /* CAN_GIF */
|
||||
|
||||
#define OFFSET_(x) ((x) & 0x0000FFFF)
|
||||
|
||||
/*some misc defines*/
|
||||
#define IMASK_IVG15 0x8000
|
||||
#define IMASK_IVG14 0x4000
|
||||
#define IMASK_IVG13 0x2000
|
||||
#define IMASK_IVG12 0x1000
|
||||
|
||||
#define IMASK_IVG11 0x0800
|
||||
#define IMASK_IVG10 0x0400
|
||||
#define IMASK_IVG9 0x0200
|
||||
#define IMASK_IVG8 0x0100
|
||||
|
||||
#define IMASK_IVG7 0x0080
|
||||
#define IMASK_IVGTMR 0x0040
|
||||
#define IMASK_IVGHW 0x0020
|
||||
|
||||
/***************************/
|
||||
|
||||
|
||||
#define BLKFIN_DSUBBANKS 4
|
||||
#define BLKFIN_DWAYS 2
|
||||
#define BLKFIN_DLINES 64
|
||||
#define BLKFIN_ISUBBANKS 4
|
||||
#define BLKFIN_IWAYS 4
|
||||
#define BLKFIN_ILINES 32
|
||||
|
||||
#define WAY0_L 0x1
|
||||
#define WAY1_L 0x2
|
||||
#define WAY01_L 0x3
|
||||
#define WAY2_L 0x4
|
||||
#define WAY02_L 0x5
|
||||
#define WAY12_L 0x6
|
||||
#define WAY012_L 0x7
|
||||
|
||||
#define WAY3_L 0x8
|
||||
#define WAY03_L 0x9
|
||||
#define WAY13_L 0xA
|
||||
#define WAY013_L 0xB
|
||||
|
||||
#define WAY32_L 0xC
|
||||
#define WAY320_L 0xD
|
||||
#define WAY321_L 0xE
|
||||
#define WAYALL_L 0xF
|
||||
|
||||
#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
|
||||
|
||||
/********************************* EBIU Settings ************************************/
|
||||
#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
|
||||
#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
|
||||
|
||||
#ifdef CONFIG_C_AMBEN_ALL
|
||||
#define V_AMBEN AMBEN_ALL
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN
|
||||
#define V_AMBEN 0x0
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0
|
||||
#define V_AMBEN AMBEN_B0
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0_B1
|
||||
#define V_AMBEN AMBEN_B0_B1
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0_B1_B2
|
||||
#define V_AMBEN AMBEN_B0_B1_B2
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMCKEN
|
||||
#define V_AMCKEN AMCKEN
|
||||
#else
|
||||
#define V_AMCKEN 0x0
|
||||
#endif
|
||||
#ifdef CONFIG_C_CDPRIO
|
||||
#define V_CDPRIO 0x100
|
||||
#else
|
||||
#define V_CDPRIO 0x0
|
||||
#endif
|
||||
|
||||
#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
|
||||
|
||||
#define MAX_VC 650000000
|
||||
#define MIN_VC 50000000
|
||||
|
||||
/********************************PLL Settings **************************************/
|
||||
#ifdef CONFIG_BFIN_KERNEL_CLOCK
|
||||
#if (CONFIG_VCO_MULT < 0)
|
||||
#error "VCO Multiplier is less than 0. Please select a different value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_MULT == 0)
|
||||
#error "VCO Multiplier should be greater than 0. Please select a different value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_MULT > 64)
|
||||
#error "VCO Multiplier is more than 64. Please select a different value"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CLKIN_HALF
|
||||
#define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
|
||||
#else
|
||||
#define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_PLL_BYPASS
|
||||
#define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
|
||||
#define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
|
||||
#else
|
||||
#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
|
||||
#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_DIV < 1)
|
||||
#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_DIV > 15)
|
||||
#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CCLK_DIV != 1)
|
||||
#if (CONFIG_CCLK_DIV != 2)
|
||||
#if (CONFIG_CCLK_DIV != 4)
|
||||
#if (CONFIG_CCLK_DIV != 8)
|
||||
#error "CCLK DIV can be 1,2,4 or 8 only. Please select a proper value"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_HZ > MAX_VC)
|
||||
#error "VCO selected is more than maximum value. Please change the VCO multipler"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ > 133000000)
|
||||
#error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ < 27000000)
|
||||
#error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ >= CONFIG_CCLK_HZ)
|
||||
#if (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ)
|
||||
#if (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
|
||||
#error "Please select sclk less than cclk"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CCLK_DIV == 1)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 2)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 4)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 8)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
|
||||
#endif
|
||||
#ifndef CONFIG_CCLK_ACT_DIV
|
||||
#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
|
||||
#endif
|
||||
|
||||
#if defined(ANOMALY_05000273) && (CONFIG_CCLK_DIV == 1)
|
||||
#error ANOMALY 05000273, please make sure CCLK is at least 2x SCLK
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_BFIN_KERNEL_CLOCK */
|
||||
|
||||
#ifdef CONFIG_BF537
|
||||
#define CPU "BF537"
|
||||
#define CPUID 0x027c8000
|
||||
#endif
|
||||
#ifdef CONFIG_BF536
|
||||
#define CPU "BF536"
|
||||
#define CPUID 0x027c8000
|
||||
#endif
|
||||
#ifdef CONFIG_BF534
|
||||
#define CPU "BF534"
|
||||
#define CPUID 0x027c6000
|
||||
#endif
|
||||
#ifndef CPU
|
||||
#define CPU "UNKNOWN"
|
||||
#define CPUID 0x0
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_SIZE % 4)
|
||||
#error "SDRAM mem size must be multible of 4MB"
|
||||
#endif
|
||||
|
||||
#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
|
||||
#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
|
||||
#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
|
||||
#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
|
||||
|
||||
/*Use the menuconfig cache policy here - CONFIG_BLKFIN_WT/CONFIG_BLKFIN_WB*/
|
||||
|
||||
#define ANOMALY_05000158_WORKAROUND 0x200
|
||||
#ifdef CONFIG_BLKFIN_WB /*Write Back Policy */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_DIRTY \
|
||||
| CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
|
||||
#else /*Write Through */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW \
|
||||
| CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
|
||||
#endif
|
||||
|
||||
|
||||
#define L1_DMEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY )
|
||||
#define SDRAM_DNON_CHBL (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
|
||||
#define SDRAM_EBIU (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
|
||||
#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY )
|
||||
|
||||
#define SIZE_1K 0x00000400 /* 1K */
|
||||
#define SIZE_4K 0x00001000 /* 4K */
|
||||
#define SIZE_1M 0x00100000 /* 1M */
|
||||
#define SIZE_4M 0x00400000 /* 4M */
|
||||
|
||||
#define MAX_CPLBS (16 * 2)
|
||||
|
||||
/*
|
||||
* Number of required data CPLB switchtable entries
|
||||
* MEMSIZE / 4 (we mostly install 4M page size CPLBs
|
||||
* approx 16 for smaller 1MB page size CPLBs for allignment purposes
|
||||
* 1 for L1 Data Memory
|
||||
* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
|
||||
* 1 for ASYNC Memory
|
||||
*/
|
||||
|
||||
|
||||
#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1) * 2)
|
||||
|
||||
/*
|
||||
* Number of required instruction CPLB switchtable entries
|
||||
* MEMSIZE / 4 (we mostly install 4M page size CPLBs
|
||||
* approx 12 for smaller 1MB page size CPLBs for allignment purposes
|
||||
* 1 for L1 Instruction Memory
|
||||
* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
|
||||
*/
|
||||
|
||||
#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1) * 2)
|
||||
|
||||
#endif /* __MACH_BF537_H__ */
|
||||
147
include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
Normal file
147
include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
#include <linux/serial.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
#define NR_PORTS 2
|
||||
|
||||
#define OFFSET_THR 0x00 /* Transmit Holding register */
|
||||
#define OFFSET_RBR 0x00 /* Receive Buffer register */
|
||||
#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
|
||||
#define OFFSET_IER 0x04 /* Interrupt Enable Register */
|
||||
#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
|
||||
#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
|
||||
#define OFFSET_LCR 0x0C /* Line Control Register */
|
||||
#define OFFSET_MCR 0x10 /* Modem Control Register */
|
||||
#define OFFSET_LSR 0x14 /* Line Status Register */
|
||||
#define OFFSET_MSR 0x18 /* Modem Status Register */
|
||||
#define OFFSET_SCR 0x1C /* SCR Scratch Register */
|
||||
#define OFFSET_GCTL 0x24 /* Global Control Register */
|
||||
|
||||
#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
|
||||
#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
|
||||
#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
|
||||
#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
|
||||
#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
|
||||
#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
|
||||
#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
|
||||
#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
|
||||
|
||||
#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
|
||||
#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
|
||||
#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
|
||||
#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
|
||||
#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
|
||||
#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
|
||||
|
||||
#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
|
||||
# define CONFIG_SERIAL_BFIN_CTSRTS
|
||||
|
||||
# ifndef CONFIG_UART0_CTS_PIN
|
||||
# define CONFIG_UART0_CTS_PIN -1
|
||||
# endif
|
||||
|
||||
# ifndef CONFIG_UART0_RTS_PIN
|
||||
# define CONFIG_UART0_RTS_PIN -1
|
||||
# endif
|
||||
|
||||
# ifndef CONFIG_UART1_CTS_PIN
|
||||
# define CONFIG_UART1_CTS_PIN -1
|
||||
# endif
|
||||
|
||||
# ifndef CONFIG_UART1_RTS_PIN
|
||||
# define CONFIG_UART1_RTS_PIN -1
|
||||
# endif
|
||||
#endif
|
||||
/*
|
||||
* The pin configuration is different from schematic
|
||||
*/
|
||||
struct bfin_serial_port {
|
||||
struct uart_port port;
|
||||
unsigned int old_status;
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
int tx_done;
|
||||
int tx_count;
|
||||
struct circ_buf rx_dma_buf;
|
||||
struct timer_list rx_dma_timer;
|
||||
int rx_dma_nrows;
|
||||
unsigned int tx_dma_channel;
|
||||
unsigned int rx_dma_channel;
|
||||
struct work_struct tx_dma_workqueue;
|
||||
#else
|
||||
struct work_struct cts_workqueue;
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
int cts_pin;
|
||||
int rts_pin;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bfin_serial_port bfin_serial_ports[NR_PORTS];
|
||||
struct bfin_serial_res {
|
||||
unsigned long uart_base_addr;
|
||||
int uart_irq;
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
unsigned int uart_tx_dma_channel;
|
||||
unsigned int uart_rx_dma_channel;
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
int uart_cts_pin;
|
||||
int uart_rts_pin;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bfin_serial_res bfin_serial_resource[] = {
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
{
|
||||
0xFFC00400,
|
||||
IRQ_UART0_RX,
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
CH_UART0_TX,
|
||||
CH_UART0_RX,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_UART0_CTSRTS
|
||||
CONFIG_UART0_CTS_PIN,
|
||||
CONFIG_UART0_RTS_PIN,
|
||||
#endif
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
{
|
||||
0xFFC02000,
|
||||
IRQ_UART1_RX,
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
CH_UART1_TX,
|
||||
CH_UART1_RX,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_UART1_CTSRTS
|
||||
CONFIG_UART1_CTS_PIN,
|
||||
CONFIG_UART1_RTS_PIN,
|
||||
#endif
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
int nr_ports = ARRAY_SIZE(bfin_serial_resource);
|
||||
|
||||
static void bfin_serial_hw_init(struct bfin_serial_port *uart)
|
||||
{
|
||||
unsigned short val;
|
||||
val = bfin_read16(BFIN_PORT_MUX);
|
||||
val &= ~(PFDE | PFTE);
|
||||
bfin_write16(BFIN_PORT_MUX, val);
|
||||
|
||||
val = bfin_read16(PORTF_FER);
|
||||
val |= 0xF;
|
||||
bfin_write16(PORTF_FER, val);
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
if (uart->cts_pin >= 0) {
|
||||
gpio_request(uart->cts_pin, NULL);
|
||||
gpio_direction_input(uart->cts_pin);
|
||||
}
|
||||
|
||||
if (uart->rts_pin >= 0) {
|
||||
gpio_request(uart->rts_pin, NULL);
|
||||
gpio_direction_output(uart->rts_pin);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
430
include/asm-blackfin/mach-bf537/blackfin.h
Normal file
430
include/asm-blackfin/mach-bf537/blackfin.h
Normal file
|
|
@ -0,0 +1,430 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf537/blackfin.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_BLACKFIN_H_
|
||||
#define _MACH_BLACKFIN_H_
|
||||
|
||||
#define BF537_FAMILY
|
||||
|
||||
#include "bf537.h"
|
||||
#include "mem_map.h"
|
||||
#include "defBF534.h"
|
||||
#include "anomaly.h"
|
||||
|
||||
#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
|
||||
#include "defBF537.h"
|
||||
#endif
|
||||
|
||||
#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
|
||||
#include "cdefBF534.h"
|
||||
|
||||
/* UART 0*/
|
||||
#define bfin_read_UART_THR() bfin_read_UART0_THR()
|
||||
#define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
|
||||
#define bfin_read_UART_RBR() bfin_read_UART0_RBR()
|
||||
#define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
|
||||
#define bfin_read_UART_DLL() bfin_read_UART0_DLL()
|
||||
#define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
|
||||
#define bfin_read_UART_IER() bfin_read_UART0_IER()
|
||||
#define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
|
||||
#define bfin_read_UART_DLH() bfin_read_UART0_DLH()
|
||||
#define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
|
||||
#define bfin_read_UART_IIR() bfin_read_UART0_IIR()
|
||||
#define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
|
||||
#define bfin_read_UART_LCR() bfin_read_UART0_LCR()
|
||||
#define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
|
||||
#define bfin_read_UART_MCR() bfin_read_UART0_MCR()
|
||||
#define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
|
||||
#define bfin_read_UART_LSR() bfin_read_UART0_LSR()
|
||||
#define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
|
||||
#define bfin_read_UART_SCR() bfin_read_UART0_SCR()
|
||||
#define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
|
||||
#define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
|
||||
#define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
|
||||
|
||||
#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
|
||||
#include "cdefBF537.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* MAP used DEFINES from BF533 to BF537 - so we don't need to change them in the driver, kernel, etc. */
|
||||
|
||||
/* UART_IIR Register */
|
||||
#define STATUS(x) ((x << 1) & 0x06)
|
||||
#define STATUS_P1 0x02
|
||||
#define STATUS_P0 0x01
|
||||
|
||||
/* UART 0*/
|
||||
|
||||
/* DMA Channnel */
|
||||
#define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX()
|
||||
#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val)
|
||||
#define CH_UART_RX CH_UART0_RX
|
||||
#define bfin_read_CH_UART_TX() bfin_read_CH_UART0_TX()
|
||||
#define bfin_write_CH_UART_TX(val) bfin_write_CH_UART0_TX(val)
|
||||
#define CH_UART_TX CH_UART0_TX
|
||||
|
||||
/* System Interrupt Controller */
|
||||
#define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART0_RX()
|
||||
#define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART0_RX(val)
|
||||
#define IRQ_UART_RX IRQ_UART0_RX
|
||||
#define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART0_TX()
|
||||
#define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART0_TX(val)
|
||||
#define IRQ_UART_TX IRQ_UART0_TX
|
||||
#define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART0_ERROR()
|
||||
#define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART0_ERROR(val)
|
||||
#define IRQ_UART_ERROR IRQ_UART0_ERROR
|
||||
|
||||
/* MMR Registers*/
|
||||
#define bfin_read_UART_THR() bfin_read_UART0_THR()
|
||||
#define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
|
||||
#define UART_THR UART0_THR
|
||||
#define bfin_read_UART_RBR() bfin_read_UART0_RBR()
|
||||
#define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
|
||||
#define UART_RBR UART0_RBR
|
||||
#define bfin_read_UART_DLL() bfin_read_UART0_DLL()
|
||||
#define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
|
||||
#define UART_DLL UART0_DLL
|
||||
#define bfin_read_UART_IER() bfin_read_UART0_IER()
|
||||
#define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
|
||||
#define UART_IER UART0_IER
|
||||
#define bfin_read_UART_DLH() bfin_read_UART0_DLH()
|
||||
#define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
|
||||
#define UART_DLH UART0_DLH
|
||||
#define bfin_read_UART_IIR() bfin_read_UART0_IIR()
|
||||
#define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
|
||||
#define UART_IIR UART0_IIR
|
||||
#define bfin_read_UART_LCR() bfin_read_UART0_LCR()
|
||||
#define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
|
||||
#define UART_LCR UART0_LCR
|
||||
#define bfin_read_UART_MCR() bfin_read_UART0_MCR()
|
||||
#define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
|
||||
#define UART_MCR UART0_MCR
|
||||
#define bfin_read_UART_LSR() bfin_read_UART0_LSR()
|
||||
#define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
|
||||
#define UART_LSR UART0_LSR
|
||||
#define bfin_read_UART_SCR() bfin_read_UART0_SCR()
|
||||
#define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
|
||||
#define UART_SCR UART0_SCR
|
||||
#define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
|
||||
#define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
|
||||
#define UART_GCTL UART0_GCTL
|
||||
|
||||
/* DPMC*/
|
||||
#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
|
||||
#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
|
||||
#define STOPCK_OFF STOPCK
|
||||
|
||||
/* FIO USE PORT F*/
|
||||
#ifdef CONFIG_BF537_PORT_F
|
||||
#define bfin_read_PORT_FER() bfin_read_PORTF_FER()
|
||||
#define bfin_write_PORT_FER(val) bfin_write_PORTF_FER(val)
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
|
||||
#define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
|
||||
#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
|
||||
#define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
|
||||
#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
|
||||
#define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
|
||||
#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
|
||||
#define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
|
||||
#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
|
||||
#define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
|
||||
#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
|
||||
#define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
|
||||
#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
|
||||
#define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
|
||||
#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
|
||||
#define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
|
||||
#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
|
||||
#define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
|
||||
#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
|
||||
#define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
|
||||
#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
|
||||
#define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
|
||||
#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
|
||||
#define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
|
||||
#define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
|
||||
#define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
|
||||
#define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
|
||||
#define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
|
||||
#define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
|
||||
#define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
|
||||
#define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
|
||||
#define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
|
||||
#define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
|
||||
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
|
||||
#define FIO_FLAG_D PORTFIO
|
||||
#define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
|
||||
#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
|
||||
#define FIO_FLAG_C PORTFIO_CLEAR
|
||||
#define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
|
||||
#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
|
||||
#define FIO_FLAG_S PORTFIO_SET
|
||||
#define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
|
||||
#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
|
||||
#define FIO_FLAG_T PORTFIO_TOGGLE
|
||||
#define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
|
||||
#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
|
||||
#define FIO_MASKA_D PORTFIO_MASKA
|
||||
#define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
|
||||
#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
|
||||
#define FIO_MASKA_C PORTFIO_MASKA_CLEAR
|
||||
#define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
|
||||
#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
|
||||
#define FIO_MASKA_S PORTFIO_MASKA_SET
|
||||
#define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
|
||||
#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
|
||||
#define FIO_MASKA_T PORTFIO_MASKA_TOGGLE
|
||||
#define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
|
||||
#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
|
||||
#define FIO_MASKB_D PORTFIO_MASKB
|
||||
#define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
|
||||
#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
|
||||
#define FIO_MASKB_C PORTFIO_MASKB_CLEAR
|
||||
#define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
|
||||
#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
|
||||
#define FIO_MASKB_S PORTFIO_MASKB_SET
|
||||
#define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
|
||||
#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
|
||||
#define FIO_MASKB_T PORTFIO_MASKB_TOGGLE
|
||||
#define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
|
||||
#define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
|
||||
#define FIO_DIR PORTFIO_DIR
|
||||
#define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
|
||||
#define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
|
||||
#define FIO_POLAR PORTFIO_POLAR
|
||||
#define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
|
||||
#define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
|
||||
#define FIO_EDGE PORTFIO_EDGE
|
||||
#define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
|
||||
#define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
|
||||
#define FIO_BOTH PORTFIO_BOTH
|
||||
#define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
|
||||
#define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
|
||||
#define FIO_INEN PORTFIO_INEN
|
||||
#endif
|
||||
|
||||
/* FIO USE PORT G*/
|
||||
#ifdef CONFIG_BF537_PORT_G
|
||||
#define bfin_read_PORT_FER() bfin_read_PORTG_FER()
|
||||
#define bfin_write_PORT_FER(val) bfin_write_PORTG_FER(val)
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
|
||||
#define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
|
||||
#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
|
||||
#define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
|
||||
#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
|
||||
#define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
|
||||
#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
|
||||
#define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
|
||||
#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
|
||||
#define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
|
||||
#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
|
||||
#define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
|
||||
#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
|
||||
#define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
|
||||
#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
|
||||
#define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
|
||||
#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
|
||||
#define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
|
||||
#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
|
||||
#define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
|
||||
#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
|
||||
#define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
|
||||
#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
|
||||
#define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
|
||||
#define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
|
||||
#define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
|
||||
#define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
|
||||
#define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
|
||||
#define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
|
||||
#define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
|
||||
#define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
|
||||
#define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
|
||||
#define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
|
||||
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
|
||||
#define FIO_FLAG_D PORTGIO
|
||||
#define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
|
||||
#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
|
||||
#define FIO_FLAG_C PORTGIO_CLEAR
|
||||
#define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
|
||||
#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
|
||||
#define FIO_FLAG_S PORTGIO_SET
|
||||
#define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
|
||||
#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
|
||||
#define FIO_FLAG_T PORTGIO_TOGGLE
|
||||
#define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
|
||||
#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
|
||||
#define FIO_MASKA_D PORTGIO_MASKA
|
||||
#define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
|
||||
#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
|
||||
#define FIO_MASKA_C PORTGIO_MASKA_CLEAR
|
||||
#define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
|
||||
#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
|
||||
#define FIO_MASKA_S PORTGIO_MASKA_SET
|
||||
#define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
|
||||
#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
|
||||
#define FIO_MASKA_T PORTGIO_MASKA_TOGGLE
|
||||
#define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
|
||||
#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
|
||||
#define FIO_MASKB_D PORTGIO_MASKB
|
||||
#define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
|
||||
#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
|
||||
#define FIO_MASKB_C PORTGIO_MASKB_CLEAR
|
||||
#define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
|
||||
#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
|
||||
#define FIO_MASKB_S PORTGIO_MASKB_SET
|
||||
#define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
|
||||
#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
|
||||
#define FIO_MASKB_T PORTGIO_MASKB_TOGGLE
|
||||
#define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
|
||||
#define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
|
||||
#define FIO_DIR PORTGIO_DIR
|
||||
#define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
|
||||
#define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
|
||||
#define FIO_POLAR PORTGIO_POLAR
|
||||
#define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
|
||||
#define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
|
||||
#define FIO_EDGE PORTGIO_EDGE
|
||||
#define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
|
||||
#define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
|
||||
#define FIO_BOTH PORTGIO_BOTH
|
||||
#define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
|
||||
#define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
|
||||
#define FIO_INEN PORTGIO_INEN
|
||||
|
||||
#endif
|
||||
|
||||
/* FIO USE PORT H*/
|
||||
#ifdef CONFIG_BF537_PORT_H
|
||||
#define bfin_read_PORT_FER() bfin_read_PORTH_FER()
|
||||
#define bfin_write_PORT_FER(val) bfin_write_PORTH_FER(val)
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
|
||||
#define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
|
||||
#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
|
||||
#define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
|
||||
#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
|
||||
#define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
|
||||
#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
|
||||
#define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
|
||||
#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
|
||||
#define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
|
||||
#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
|
||||
#define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
|
||||
#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
|
||||
#define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
|
||||
#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
|
||||
#define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
|
||||
#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
|
||||
#define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
|
||||
#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
|
||||
#define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
|
||||
#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
|
||||
#define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
|
||||
#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
|
||||
#define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
|
||||
#define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
|
||||
#define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
|
||||
#define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
|
||||
#define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
|
||||
#define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
|
||||
#define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
|
||||
#define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
|
||||
#define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
|
||||
#define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
|
||||
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
|
||||
#define FIO_FLAG_D PORTHIO
|
||||
#define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
|
||||
#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
|
||||
#define FIO_FLAG_C PORTHIO_CLEAR
|
||||
#define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
|
||||
#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
|
||||
#define FIO_FLAG_S PORTHIO_SET
|
||||
#define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
|
||||
#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
|
||||
#define FIO_FLAG_T PORTHIO_TOGGLE
|
||||
#define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
|
||||
#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
|
||||
#define FIO_MASKA_D PORTHIO_MASKA
|
||||
#define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
|
||||
#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
|
||||
#define FIO_MASKA_C PORTHIO_MASKA_CLEAR
|
||||
#define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
|
||||
#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
|
||||
#define FIO_MASKA_S PORTHIO_MASKA_SET
|
||||
#define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
|
||||
#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
|
||||
#define FIO_MASKA_T PORTHIO_MASKA_TOGGLE
|
||||
#define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
|
||||
#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
|
||||
#define FIO_MASKB_D PORTHIO_MASKB
|
||||
#define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
|
||||
#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
|
||||
#define FIO_MASKB_C PORTHIO_MASKB_CLEAR
|
||||
#define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
|
||||
#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
|
||||
#define FIO_MASKB_S PORTHIO_MASKB_SET
|
||||
#define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
|
||||
#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
|
||||
#define FIO_MASKB_T PORTHIO_MASKB_TOGGLE
|
||||
#define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
|
||||
#define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
|
||||
#define FIO_DIR PORTHIO_DIR
|
||||
#define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
|
||||
#define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
|
||||
#define FIO_POLAR PORTHIO_POLAR
|
||||
#define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
|
||||
#define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
|
||||
#define FIO_EDGE PORTHIO_EDGE
|
||||
#define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
|
||||
#define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
|
||||
#define FIO_BOTH PORTHIO_BOTH
|
||||
#define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
|
||||
#define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
|
||||
#define FIO_INEN PORTHIO_INEN
|
||||
|
||||
#endif
|
||||
|
||||
/* PLL_DIV Masks */
|
||||
#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
|
||||
#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
|
||||
#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
|
||||
#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
|
||||
|
||||
#endif
|
||||
1823
include/asm-blackfin/mach-bf537/cdefBF534.h
Normal file
1823
include/asm-blackfin/mach-bf537/cdefBF534.h
Normal file
File diff suppressed because it is too large
Load diff
209
include/asm-blackfin/mach-bf537/cdefBF537.h
Normal file
209
include/asm-blackfin/mach-bf537/cdefBF537.h
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf537/cdefBF537.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
* System MMR Register Map
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _CDEF_BF537_H
|
||||
#define _CDEF_BF537_H
|
||||
|
||||
/* Include MMRs Common to BF534 */
|
||||
#include "cdefBF534.h"
|
||||
|
||||
/* Include all Core registers and bit definitions */
|
||||
#include "defBF537.h"
|
||||
|
||||
/* Include Macro "Defines" For EMAC (Unique to BF536/BF537 */
|
||||
/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
|
||||
#define pEMAC_OPMODE ((volatile unsigned long *)EMAC_OPMODE)
|
||||
#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
|
||||
#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE,val)
|
||||
#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
|
||||
#define bfin_write_EMAC_ADDRLO(val) bfin_write32(EMAC_ADDRLO,val)
|
||||
#define bfin_read_EMAC_ADDRHI() bfin_read32(EMAC_ADDRHI)
|
||||
#define bfin_write_EMAC_ADDRHI(val) bfin_write32(EMAC_ADDRHI,val)
|
||||
#define bfin_read_EMAC_HASHLO() bfin_read32(EMAC_HASHLO)
|
||||
#define bfin_write_EMAC_HASHLO(val) bfin_write32(EMAC_HASHLO,val)
|
||||
#define bfin_read_EMAC_HASHHI() bfin_read32(EMAC_HASHHI)
|
||||
#define bfin_write_EMAC_HASHHI(val) bfin_write32(EMAC_HASHHI,val)
|
||||
#define bfin_read_EMAC_STAADD() bfin_read32(EMAC_STAADD)
|
||||
#define bfin_write_EMAC_STAADD(val) bfin_write32(EMAC_STAADD,val)
|
||||
#define bfin_read_EMAC_STADAT() bfin_read32(EMAC_STADAT)
|
||||
#define bfin_write_EMAC_STADAT(val) bfin_write32(EMAC_STADAT,val)
|
||||
#define bfin_read_EMAC_FLC() bfin_read32(EMAC_FLC)
|
||||
#define bfin_write_EMAC_FLC(val) bfin_write32(EMAC_FLC,val)
|
||||
#define bfin_read_EMAC_VLAN1() bfin_read32(EMAC_VLAN1)
|
||||
#define bfin_write_EMAC_VLAN1(val) bfin_write32(EMAC_VLAN1,val)
|
||||
#define bfin_read_EMAC_VLAN2() bfin_read32(EMAC_VLAN2)
|
||||
#define bfin_write_EMAC_VLAN2(val) bfin_write32(EMAC_VLAN2,val)
|
||||
#define bfin_read_EMAC_WKUP_CTL() bfin_read32(EMAC_WKUP_CTL)
|
||||
#define bfin_write_EMAC_WKUP_CTL(val) bfin_write32(EMAC_WKUP_CTL,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK0() bfin_read32(EMAC_WKUP_FFMSK0)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK0(val) bfin_write32(EMAC_WKUP_FFMSK0,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK1() bfin_read32(EMAC_WKUP_FFMSK1)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK1(val) bfin_write32(EMAC_WKUP_FFMSK1,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK2() bfin_read32(EMAC_WKUP_FFMSK2)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK2(val) bfin_write32(EMAC_WKUP_FFMSK2,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK3() bfin_read32(EMAC_WKUP_FFMSK3)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK3(val) bfin_write32(EMAC_WKUP_FFMSK3,val)
|
||||
#define bfin_read_EMAC_WKUP_FFCMD() bfin_read32(EMAC_WKUP_FFCMD)
|
||||
#define bfin_write_EMAC_WKUP_FFCMD(val) bfin_write32(EMAC_WKUP_FFCMD,val)
|
||||
#define bfin_read_EMAC_WKUP_FFOFF() bfin_read32(EMAC_WKUP_FFOFF)
|
||||
#define bfin_write_EMAC_WKUP_FFOFF(val) bfin_write32(EMAC_WKUP_FFOFF,val)
|
||||
#define bfin_read_EMAC_WKUP_FFCRC0() bfin_read32(EMAC_WKUP_FFCRC0)
|
||||
#define bfin_write_EMAC_WKUP_FFCRC0(val) bfin_write32(EMAC_WKUP_FFCRC0,val)
|
||||
#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
|
||||
#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1,val)
|
||||
|
||||
#define pEMAC_SYSCTL ((volatile unsigned long *)EMAC_SYSCTL)
|
||||
#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
|
||||
#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL,val)
|
||||
#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
|
||||
#define bfin_write_EMAC_SYSTAT(val) bfin_write32(EMAC_SYSTAT,val)
|
||||
#define bfin_read_EMAC_RX_STAT() bfin_read32(EMAC_RX_STAT)
|
||||
#define bfin_write_EMAC_RX_STAT(val) bfin_write32(EMAC_RX_STAT,val)
|
||||
#define bfin_read_EMAC_RX_STKY() bfin_read32(EMAC_RX_STKY)
|
||||
#define bfin_write_EMAC_RX_STKY(val) bfin_write32(EMAC_RX_STKY,val)
|
||||
#define bfin_read_EMAC_RX_IRQE() bfin_read32(EMAC_RX_IRQE)
|
||||
#define bfin_write_EMAC_RX_IRQE(val) bfin_write32(EMAC_RX_IRQE,val)
|
||||
#define bfin_read_EMAC_TX_STAT() bfin_read32(EMAC_TX_STAT)
|
||||
#define bfin_write_EMAC_TX_STAT(val) bfin_write32(EMAC_TX_STAT,val)
|
||||
#define bfin_read_EMAC_TX_STKY() bfin_read32(EMAC_TX_STKY)
|
||||
#define bfin_write_EMAC_TX_STKY(val) bfin_write32(EMAC_TX_STKY,val)
|
||||
#define bfin_read_EMAC_TX_IRQE() bfin_read32(EMAC_TX_IRQE)
|
||||
#define bfin_write_EMAC_TX_IRQE(val) bfin_write32(EMAC_TX_IRQE,val)
|
||||
|
||||
#define bfin_read_EMAC_MMC_CTL() bfin_read32(EMAC_MMC_CTL)
|
||||
#define bfin_write_EMAC_MMC_CTL(val) bfin_write32(EMAC_MMC_CTL,val)
|
||||
#define bfin_read_EMAC_MMC_RIRQS() bfin_read32(EMAC_MMC_RIRQS)
|
||||
#define bfin_write_EMAC_MMC_RIRQS(val) bfin_write32(EMAC_MMC_RIRQS,val)
|
||||
#define bfin_read_EMAC_MMC_RIRQE() bfin_read32(EMAC_MMC_RIRQE)
|
||||
#define bfin_write_EMAC_MMC_RIRQE(val) bfin_write32(EMAC_MMC_RIRQE,val)
|
||||
#define bfin_read_EMAC_MMC_TIRQS() bfin_read32(EMAC_MMC_TIRQS)
|
||||
#define bfin_write_EMAC_MMC_TIRQS(val) bfin_write32(EMAC_MMC_TIRQS,val)
|
||||
#define bfin_read_EMAC_MMC_TIRQE() bfin_read32(EMAC_MMC_TIRQE)
|
||||
#define bfin_write_EMAC_MMC_TIRQE(val) bfin_write32(EMAC_MMC_TIRQE,val)
|
||||
|
||||
#define bfin_read_EMAC_RXC_OK() bfin_read32(EMAC_RXC_OK)
|
||||
#define bfin_write_EMAC_RXC_OK(val) bfin_write32(EMAC_RXC_OK,val)
|
||||
#define bfin_read_EMAC_RXC_FCS() bfin_read32(EMAC_RXC_FCS)
|
||||
#define bfin_write_EMAC_RXC_FCS(val) bfin_write32(EMAC_RXC_FCS,val)
|
||||
#define bfin_read_EMAC_RXC_ALIGN() bfin_read32(EMAC_RXC_ALIGN)
|
||||
#define bfin_write_EMAC_RXC_ALIGN(val) bfin_write32(EMAC_RXC_ALIGN,val)
|
||||
#define bfin_read_EMAC_RXC_OCTET() bfin_read32(EMAC_RXC_OCTET)
|
||||
#define bfin_write_EMAC_RXC_OCTET(val) bfin_write32(EMAC_RXC_OCTET,val)
|
||||
#define bfin_read_EMAC_RXC_DMAOVF() bfin_read32(EMAC_RXC_DMAOVF)
|
||||
#define bfin_write_EMAC_RXC_DMAOVF(val) bfin_write32(EMAC_RXC_DMAOVF,val)
|
||||
#define bfin_read_EMAC_RXC_UNICST() bfin_read32(EMAC_RXC_UNICST)
|
||||
#define bfin_write_EMAC_RXC_UNICST(val) bfin_write32(EMAC_RXC_UNICST,val)
|
||||
#define bfin_read_EMAC_RXC_MULTI() bfin_read32(EMAC_RXC_MULTI)
|
||||
#define bfin_write_EMAC_RXC_MULTI(val) bfin_write32(EMAC_RXC_MULTI,val)
|
||||
#define bfin_read_EMAC_RXC_BROAD() bfin_read32(EMAC_RXC_BROAD)
|
||||
#define bfin_write_EMAC_RXC_BROAD(val) bfin_write32(EMAC_RXC_BROAD,val)
|
||||
#define bfin_read_EMAC_RXC_LNERRI() bfin_read32(EMAC_RXC_LNERRI)
|
||||
#define bfin_write_EMAC_RXC_LNERRI(val) bfin_write32(EMAC_RXC_LNERRI,val)
|
||||
#define bfin_read_EMAC_RXC_LNERRO() bfin_read32(EMAC_RXC_LNERRO)
|
||||
#define bfin_write_EMAC_RXC_LNERRO(val) bfin_write32(EMAC_RXC_LNERRO,val)
|
||||
#define bfin_read_EMAC_RXC_LONG() bfin_read32(EMAC_RXC_LONG)
|
||||
#define bfin_write_EMAC_RXC_LONG(val) bfin_write32(EMAC_RXC_LONG,val)
|
||||
#define bfin_read_EMAC_RXC_MACCTL() bfin_read32(EMAC_RXC_MACCTL)
|
||||
#define bfin_write_EMAC_RXC_MACCTL(val) bfin_write32(EMAC_RXC_MACCTL,val)
|
||||
#define bfin_read_EMAC_RXC_OPCODE() bfin_read32(EMAC_RXC_OPCODE)
|
||||
#define bfin_write_EMAC_RXC_OPCODE(val) bfin_write32(EMAC_RXC_OPCODE,val)
|
||||
#define bfin_read_EMAC_RXC_PAUSE() bfin_read32(EMAC_RXC_PAUSE)
|
||||
#define bfin_write_EMAC_RXC_PAUSE(val) bfin_write32(EMAC_RXC_PAUSE,val)
|
||||
#define bfin_read_EMAC_RXC_ALLFRM() bfin_read32(EMAC_RXC_ALLFRM)
|
||||
#define bfin_write_EMAC_RXC_ALLFRM(val) bfin_write32(EMAC_RXC_ALLFRM,val)
|
||||
#define bfin_read_EMAC_RXC_ALLOCT() bfin_read32(EMAC_RXC_ALLOCT)
|
||||
#define bfin_write_EMAC_RXC_ALLOCT(val) bfin_write32(EMAC_RXC_ALLOCT,val)
|
||||
#define bfin_read_EMAC_RXC_TYPED() bfin_read32(EMAC_RXC_TYPED)
|
||||
#define bfin_write_EMAC_RXC_TYPED(val) bfin_write32(EMAC_RXC_TYPED,val)
|
||||
#define bfin_read_EMAC_RXC_SHORT() bfin_read32(EMAC_RXC_SHORT)
|
||||
#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT,val)
|
||||
#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
|
||||
#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64,val)
|
||||
#define pEMAC_RXC_LT128 ((volatile unsigned long *)EMAC_RXC_LT128)
|
||||
#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
|
||||
#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128,val)
|
||||
#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
|
||||
#define bfin_write_EMAC_RXC_LT256(val) bfin_write32(EMAC_RXC_LT256,val)
|
||||
#define bfin_read_EMAC_RXC_LT512() bfin_read32(EMAC_RXC_LT512)
|
||||
#define bfin_write_EMAC_RXC_LT512(val) bfin_write32(EMAC_RXC_LT512,val)
|
||||
#define bfin_read_EMAC_RXC_LT1024() bfin_read32(EMAC_RXC_LT1024)
|
||||
#define bfin_write_EMAC_RXC_LT1024(val) bfin_write32(EMAC_RXC_LT1024,val)
|
||||
#define bfin_read_EMAC_RXC_GE1024() bfin_read32(EMAC_RXC_GE1024)
|
||||
#define bfin_write_EMAC_RXC_GE1024(val) bfin_write32(EMAC_RXC_GE1024,val)
|
||||
|
||||
#define bfin_read_EMAC_TXC_OK() bfin_read32(EMAC_TXC_OK)
|
||||
#define bfin_write_EMAC_TXC_OK(val) bfin_write32(EMAC_TXC_OK,val)
|
||||
#define bfin_read_EMAC_TXC_1COL() bfin_read32(EMAC_TXC_1COL)
|
||||
#define bfin_write_EMAC_TXC_1COL(val) bfin_write32(EMAC_TXC_1COL,val)
|
||||
#define bfin_read_EMAC_TXC_GT1COL() bfin_read32(EMAC_TXC_GT1COL)
|
||||
#define bfin_write_EMAC_TXC_GT1COL(val) bfin_write32(EMAC_TXC_GT1COL,val)
|
||||
#define bfin_read_EMAC_TXC_OCTET() bfin_read32(EMAC_TXC_OCTET)
|
||||
#define bfin_write_EMAC_TXC_OCTET(val) bfin_write32(EMAC_TXC_OCTET,val)
|
||||
#define bfin_read_EMAC_TXC_DEFER() bfin_read32(EMAC_TXC_DEFER)
|
||||
#define bfin_write_EMAC_TXC_DEFER(val) bfin_write32(EMAC_TXC_DEFER,val)
|
||||
#define bfin_read_EMAC_TXC_LATECL() bfin_read32(EMAC_TXC_LATECL)
|
||||
#define bfin_write_EMAC_TXC_LATECL(val) bfin_write32(EMAC_TXC_LATECL,val)
|
||||
#define bfin_read_EMAC_TXC_XS_COL() bfin_read32(EMAC_TXC_XS_COL)
|
||||
#define bfin_write_EMAC_TXC_XS_COL(val) bfin_write32(EMAC_TXC_XS_COL,val)
|
||||
#define bfin_read_EMAC_TXC_DMAUND() bfin_read32(EMAC_TXC_DMAUND)
|
||||
#define bfin_write_EMAC_TXC_DMAUND(val) bfin_write32(EMAC_TXC_DMAUND,val)
|
||||
#define bfin_read_EMAC_TXC_CRSERR() bfin_read32(EMAC_TXC_CRSERR)
|
||||
#define bfin_write_EMAC_TXC_CRSERR(val) bfin_write32(EMAC_TXC_CRSERR,val)
|
||||
#define bfin_read_EMAC_TXC_UNICST() bfin_read32(EMAC_TXC_UNICST)
|
||||
#define bfin_write_EMAC_TXC_UNICST(val) bfin_write32(EMAC_TXC_UNICST,val)
|
||||
#define bfin_read_EMAC_TXC_MULTI() bfin_read32(EMAC_TXC_MULTI)
|
||||
#define bfin_write_EMAC_TXC_MULTI(val) bfin_write32(EMAC_TXC_MULTI,val)
|
||||
#define bfin_read_EMAC_TXC_BROAD() bfin_read32(EMAC_TXC_BROAD)
|
||||
#define bfin_write_EMAC_TXC_BROAD(val) bfin_write32(EMAC_TXC_BROAD,val)
|
||||
#define bfin_read_EMAC_TXC_XS_DFR() bfin_read32(EMAC_TXC_XS_DFR)
|
||||
#define bfin_write_EMAC_TXC_XS_DFR(val) bfin_write32(EMAC_TXC_XS_DFR,val)
|
||||
#define bfin_read_EMAC_TXC_MACCTL() bfin_read32(EMAC_TXC_MACCTL)
|
||||
#define bfin_write_EMAC_TXC_MACCTL(val) bfin_write32(EMAC_TXC_MACCTL,val)
|
||||
#define bfin_read_EMAC_TXC_ALLFRM() bfin_read32(EMAC_TXC_ALLFRM)
|
||||
#define bfin_write_EMAC_TXC_ALLFRM(val) bfin_write32(EMAC_TXC_ALLFRM,val)
|
||||
#define bfin_read_EMAC_TXC_ALLOCT() bfin_read32(EMAC_TXC_ALLOCT)
|
||||
#define bfin_write_EMAC_TXC_ALLOCT(val) bfin_write32(EMAC_TXC_ALLOCT,val)
|
||||
#define bfin_read_EMAC_TXC_EQ64() bfin_read32(EMAC_TXC_EQ64)
|
||||
#define bfin_write_EMAC_TXC_EQ64(val) bfin_write32(EMAC_TXC_EQ64,val)
|
||||
#define bfin_read_EMAC_TXC_LT128() bfin_read32(EMAC_TXC_LT128)
|
||||
#define bfin_write_EMAC_TXC_LT128(val) bfin_write32(EMAC_TXC_LT128,val)
|
||||
#define bfin_read_EMAC_TXC_LT256() bfin_read32(EMAC_TXC_LT256)
|
||||
#define bfin_write_EMAC_TXC_LT256(val) bfin_write32(EMAC_TXC_LT256,val)
|
||||
#define bfin_read_EMAC_TXC_LT512() bfin_read32(EMAC_TXC_LT512)
|
||||
#define bfin_write_EMAC_TXC_LT512(val) bfin_write32(EMAC_TXC_LT512,val)
|
||||
#define bfin_read_EMAC_TXC_LT1024() bfin_read32(EMAC_TXC_LT1024)
|
||||
#define bfin_write_EMAC_TXC_LT1024(val) bfin_write32(EMAC_TXC_LT1024,val)
|
||||
#define bfin_read_EMAC_TXC_GE1024() bfin_read32(EMAC_TXC_GE1024)
|
||||
#define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024,val)
|
||||
#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
|
||||
#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT,val)
|
||||
|
||||
#endif /* _CDEF_BF537_H */
|
||||
2501
include/asm-blackfin/mach-bf537/defBF534.h
Normal file
2501
include/asm-blackfin/mach-bf537/defBF534.h
Normal file
File diff suppressed because it is too large
Load diff
404
include/asm-blackfin/mach-bf537/defBF537.h
Normal file
404
include/asm-blackfin/mach-bf537/defBF537.h
Normal file
|
|
@ -0,0 +1,404 @@
|
|||
/*
|
||||
* file: include/asm-blackfin/mach-bf537/defbf537.h
|
||||
* based on:
|
||||
* author:
|
||||
*
|
||||
* created:
|
||||
* description:
|
||||
* system mmr register map
|
||||
* rev:
|
||||
*
|
||||
* modified:
|
||||
*
|
||||
*
|
||||
* bugs: enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* this program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the gnu general public license as published by
|
||||
* the free software foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* this program is distributed in the hope that it will be useful,
|
||||
* but without any warranty; without even the implied warranty of
|
||||
* merchantability or fitness for a particular purpose. see the
|
||||
* gnu general public license for more details.
|
||||
*
|
||||
* you should have received a copy of the gnu general public license
|
||||
* along with this program; see the file copying.
|
||||
* if not, write to the free software foundation,
|
||||
* 59 temple place - suite 330, boston, ma 02111-1307, usa.
|
||||
*/
|
||||
|
||||
#ifndef _DEF_BF537_H
|
||||
#define _DEF_BF537_H
|
||||
|
||||
/*include all Core registers and bit definitions*/
|
||||
#include "defBF537.h"
|
||||
|
||||
/*include core specific register pointer definitions*/
|
||||
#include <asm/mach-common/cdef_LPBlackfin.h>
|
||||
|
||||
/************************************************************************************
|
||||
** Define EMAC Section Unique to BF536/BF537
|
||||
*************************************************************************************/
|
||||
|
||||
/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
|
||||
#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
|
||||
#define EMAC_ADDRLO 0xFFC03004 /* Address Low (32 LSBs) Register */
|
||||
#define EMAC_ADDRHI 0xFFC03008 /* Address High (16 MSBs) Register */
|
||||
#define EMAC_HASHLO 0xFFC0300C /* Multicast Hash Table Low (Bins 31-0) Register */
|
||||
#define EMAC_HASHHI 0xFFC03010 /* Multicast Hash Table High (Bins 63-32) Register */
|
||||
#define EMAC_STAADD 0xFFC03014 /* Station Management Address Register */
|
||||
#define EMAC_STADAT 0xFFC03018 /* Station Management Data Register */
|
||||
#define EMAC_FLC 0xFFC0301C /* Flow Control Register */
|
||||
#define EMAC_VLAN1 0xFFC03020 /* VLAN1 Tag Register */
|
||||
#define EMAC_VLAN2 0xFFC03024 /* VLAN2 Tag Register */
|
||||
#define EMAC_WKUP_CTL 0xFFC0302C /* Wake-Up Control/Status Register */
|
||||
#define EMAC_WKUP_FFMSK0 0xFFC03030 /* Wake-Up Frame Filter 0 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFMSK1 0xFFC03034 /* Wake-Up Frame Filter 1 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFMSK2 0xFFC03038 /* Wake-Up Frame Filter 2 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFMSK3 0xFFC0303C /* Wake-Up Frame Filter 3 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFCMD 0xFFC03040 /* Wake-Up Frame Filter Commands Register */
|
||||
#define EMAC_WKUP_FFOFF 0xFFC03044 /* Wake-Up Frame Filter Offsets Register */
|
||||
#define EMAC_WKUP_FFCRC0 0xFFC03048 /* Wake-Up Frame Filter 0,1 CRC-16 Register */
|
||||
#define EMAC_WKUP_FFCRC1 0xFFC0304C /* Wake-Up Frame Filter 2,3 CRC-16 Register */
|
||||
|
||||
#define EMAC_SYSCTL 0xFFC03060 /* EMAC System Control Register */
|
||||
#define EMAC_SYSTAT 0xFFC03064 /* EMAC System Status Register */
|
||||
#define EMAC_RX_STAT 0xFFC03068 /* RX Current Frame Status Register */
|
||||
#define EMAC_RX_STKY 0xFFC0306C /* RX Sticky Frame Status Register */
|
||||
#define EMAC_RX_IRQE 0xFFC03070 /* RX Frame Status Interrupt Enables Register */
|
||||
#define EMAC_TX_STAT 0xFFC03074 /* TX Current Frame Status Register */
|
||||
#define EMAC_TX_STKY 0xFFC03078 /* TX Sticky Frame Status Register */
|
||||
#define EMAC_TX_IRQE 0xFFC0307C /* TX Frame Status Interrupt Enables Register */
|
||||
|
||||
#define EMAC_MMC_CTL 0xFFC03080 /* MMC Counter Control Register */
|
||||
#define EMAC_MMC_RIRQS 0xFFC03084 /* MMC RX Interrupt Status Register */
|
||||
#define EMAC_MMC_RIRQE 0xFFC03088 /* MMC RX Interrupt Enables Register */
|
||||
#define EMAC_MMC_TIRQS 0xFFC0308C /* MMC TX Interrupt Status Register */
|
||||
#define EMAC_MMC_TIRQE 0xFFC03090 /* MMC TX Interrupt Enables Register */
|
||||
|
||||
#define EMAC_RXC_OK 0xFFC03100 /* RX Frame Successful Count */
|
||||
#define EMAC_RXC_FCS 0xFFC03104 /* RX Frame FCS Failure Count */
|
||||
#define EMAC_RXC_ALIGN 0xFFC03108 /* RX Alignment Error Count */
|
||||
#define EMAC_RXC_OCTET 0xFFC0310C /* RX Octets Successfully Received Count */
|
||||
#define EMAC_RXC_DMAOVF 0xFFC03110 /* Internal MAC Sublayer Error RX Frame Count */
|
||||
#define EMAC_RXC_UNICST 0xFFC03114 /* Unicast RX Frame Count */
|
||||
#define EMAC_RXC_MULTI 0xFFC03118 /* Multicast RX Frame Count */
|
||||
#define EMAC_RXC_BROAD 0xFFC0311C /* Broadcast RX Frame Count */
|
||||
#define EMAC_RXC_LNERRI 0xFFC03120 /* RX Frame In Range Error Count */
|
||||
#define EMAC_RXC_LNERRO 0xFFC03124 /* RX Frame Out Of Range Error Count */
|
||||
#define EMAC_RXC_LONG 0xFFC03128 /* RX Frame Too Long Count */
|
||||
#define EMAC_RXC_MACCTL 0xFFC0312C /* MAC Control RX Frame Count */
|
||||
#define EMAC_RXC_OPCODE 0xFFC03130 /* Unsupported Op-Code RX Frame Count */
|
||||
#define EMAC_RXC_PAUSE 0xFFC03134 /* MAC Control Pause RX Frame Count */
|
||||
#define EMAC_RXC_ALLFRM 0xFFC03138 /* Overall RX Frame Count */
|
||||
#define EMAC_RXC_ALLOCT 0xFFC0313C /* Overall RX Octet Count */
|
||||
#define EMAC_RXC_TYPED 0xFFC03140 /* Type/Length Consistent RX Frame Count */
|
||||
#define EMAC_RXC_SHORT 0xFFC03144 /* RX Frame Fragment Count - Byte Count x < 64 */
|
||||
#define EMAC_RXC_EQ64 0xFFC03148 /* Good RX Frame Count - Byte Count x = 64 */
|
||||
#define EMAC_RXC_LT128 0xFFC0314C /* Good RX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define EMAC_RXC_LT256 0xFFC03150 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define EMAC_RXC_LT512 0xFFC03154 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define EMAC_RXC_LT1024 0xFFC03158 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define EMAC_RXC_GE1024 0xFFC0315C /* Good RX Frame Count - Byte Count x >= 1024 */
|
||||
|
||||
#define EMAC_TXC_OK 0xFFC03180 /* TX Frame Successful Count */
|
||||
#define EMAC_TXC_1COL 0xFFC03184 /* TX Frames Successful After Single Collision Count */
|
||||
#define EMAC_TXC_GT1COL 0xFFC03188 /* TX Frames Successful After Multiple Collisions Count */
|
||||
#define EMAC_TXC_OCTET 0xFFC0318C /* TX Octets Successfully Received Count */
|
||||
#define EMAC_TXC_DEFER 0xFFC03190 /* TX Frame Delayed Due To Busy Count */
|
||||
#define EMAC_TXC_LATECL 0xFFC03194 /* Late TX Collisions Count */
|
||||
#define EMAC_TXC_XS_COL 0xFFC03198 /* TX Frame Failed Due To Excessive Collisions Count */
|
||||
#define EMAC_TXC_DMAUND 0xFFC0319C /* Internal MAC Sublayer Error TX Frame Count */
|
||||
#define EMAC_TXC_CRSERR 0xFFC031A0 /* Carrier Sense Deasserted During TX Frame Count */
|
||||
#define EMAC_TXC_UNICST 0xFFC031A4 /* Unicast TX Frame Count */
|
||||
#define EMAC_TXC_MULTI 0xFFC031A8 /* Multicast TX Frame Count */
|
||||
#define EMAC_TXC_BROAD 0xFFC031AC /* Broadcast TX Frame Count */
|
||||
#define EMAC_TXC_XS_DFR 0xFFC031B0 /* TX Frames With Excessive Deferral Count */
|
||||
#define EMAC_TXC_MACCTL 0xFFC031B4 /* MAC Control TX Frame Count */
|
||||
#define EMAC_TXC_ALLFRM 0xFFC031B8 /* Overall TX Frame Count */
|
||||
#define EMAC_TXC_ALLOCT 0xFFC031BC /* Overall TX Octet Count */
|
||||
#define EMAC_TXC_EQ64 0xFFC031C0 /* Good TX Frame Count - Byte Count x = 64 */
|
||||
#define EMAC_TXC_LT128 0xFFC031C4 /* Good TX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define EMAC_TXC_LT256 0xFFC031C8 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define EMAC_TXC_LT512 0xFFC031CC /* Good TX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define EMAC_TXC_LT1024 0xFFC031D0 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define EMAC_TXC_GE1024 0xFFC031D4 /* Good TX Frame Count - Byte Count x >= 1024 */
|
||||
#define EMAC_TXC_ABORT 0xFFC031D8 /* Total TX Frames Aborted Count */
|
||||
|
||||
/* Listing for IEEE-Supported Count Registers */
|
||||
#define FramesReceivedOK EMAC_RXC_OK /* RX Frame Successful Count */
|
||||
#define FrameCheckSequenceErrors EMAC_RXC_FCS /* RX Frame FCS Failure Count */
|
||||
#define AlignmentErrors EMAC_RXC_ALIGN /* RX Alignment Error Count */
|
||||
#define OctetsReceivedOK EMAC_RXC_OCTET /* RX Octets Successfully Received Count */
|
||||
#define FramesLostDueToIntMACRcvError EMAC_RXC_DMAOVF /* Internal MAC Sublayer Error RX Frame Count */
|
||||
#define UnicastFramesReceivedOK EMAC_RXC_UNICST /* Unicast RX Frame Count */
|
||||
#define MulticastFramesReceivedOK EMAC_RXC_MULTI /* Multicast RX Frame Count */
|
||||
#define BroadcastFramesReceivedOK EMAC_RXC_BROAD /* Broadcast RX Frame Count */
|
||||
#define InRangeLengthErrors EMAC_RXC_LNERRI /* RX Frame In Range Error Count */
|
||||
#define OutOfRangeLengthField EMAC_RXC_LNERRO /* RX Frame Out Of Range Error Count */
|
||||
#define FrameTooLongErrors EMAC_RXC_LONG /* RX Frame Too Long Count */
|
||||
#define MACControlFramesReceived EMAC_RXC_MACCTL /* MAC Control RX Frame Count */
|
||||
#define UnsupportedOpcodesReceived EMAC_RXC_OPCODE /* Unsupported Op-Code RX Frame Count */
|
||||
#define PAUSEMACCtrlFramesReceived EMAC_RXC_PAUSE /* MAC Control Pause RX Frame Count */
|
||||
#define FramesReceivedAll EMAC_RXC_ALLFRM /* Overall RX Frame Count */
|
||||
#define OctetsReceivedAll EMAC_RXC_ALLOCT /* Overall RX Octet Count */
|
||||
#define TypedFramesReceived EMAC_RXC_TYPED /* Type/Length Consistent RX Frame Count */
|
||||
#define FramesLenLt64Received EMAC_RXC_SHORT /* RX Frame Fragment Count - Byte Count x < 64 */
|
||||
#define FramesLenEq64Received EMAC_RXC_EQ64 /* Good RX Frame Count - Byte Count x = 64 */
|
||||
#define FramesLen65_127Received EMAC_RXC_LT128 /* Good RX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define FramesLen128_255Received EMAC_RXC_LT256 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define FramesLen256_511Received EMAC_RXC_LT512 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define FramesLen512_1023Received EMAC_RXC_LT1024 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define FramesLen1024_MaxReceived EMAC_RXC_GE1024 /* Good RX Frame Count - Byte Count x >= 1024 */
|
||||
|
||||
#define FramesTransmittedOK EMAC_TXC_OK /* TX Frame Successful Count */
|
||||
#define SingleCollisionFrames EMAC_TXC_1COL /* TX Frames Successful After Single Collision Count */
|
||||
#define MultipleCollisionFrames EMAC_TXC_GT1COL /* TX Frames Successful After Multiple Collisions Count */
|
||||
#define OctetsTransmittedOK EMAC_TXC_OCTET /* TX Octets Successfully Received Count */
|
||||
#define FramesWithDeferredXmissions EMAC_TXC_DEFER /* TX Frame Delayed Due To Busy Count */
|
||||
#define LateCollisions EMAC_TXC_LATECL /* Late TX Collisions Count */
|
||||
#define FramesAbortedDueToXSColls EMAC_TXC_XS_COL /* TX Frame Failed Due To Excessive Collisions Count */
|
||||
#define FramesLostDueToIntMacXmitError EMAC_TXC_DMAUND /* Internal MAC Sublayer Error TX Frame Count */
|
||||
#define CarrierSenseErrors EMAC_TXC_CRSERR /* Carrier Sense Deasserted During TX Frame Count */
|
||||
#define UnicastFramesXmittedOK EMAC_TXC_UNICST /* Unicast TX Frame Count */
|
||||
#define MulticastFramesXmittedOK EMAC_TXC_MULTI /* Multicast TX Frame Count */
|
||||
#define BroadcastFramesXmittedOK EMAC_TXC_BROAD /* Broadcast TX Frame Count */
|
||||
#define FramesWithExcessiveDeferral EMAC_TXC_XS_DFR /* TX Frames With Excessive Deferral Count */
|
||||
#define MACControlFramesTransmitted EMAC_TXC_MACCTL /* MAC Control TX Frame Count */
|
||||
#define FramesTransmittedAll EMAC_TXC_ALLFRM /* Overall TX Frame Count */
|
||||
#define OctetsTransmittedAll EMAC_TXC_ALLOCT /* Overall TX Octet Count */
|
||||
#define FramesLenEq64Transmitted EMAC_TXC_EQ64 /* Good TX Frame Count - Byte Count x = 64 */
|
||||
#define FramesLen65_127Transmitted EMAC_TXC_LT128 /* Good TX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define FramesLen128_255Transmitted EMAC_TXC_LT256 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define FramesLen256_511Transmitted EMAC_TXC_LT512 /* Good TX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define FramesLen512_1023Transmitted EMAC_TXC_LT1024 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define FramesLen1024_MaxTransmitted EMAC_TXC_GE1024 /* Good TX Frame Count - Byte Count x >= 1024 */
|
||||
#define TxAbortedFrames EMAC_TXC_ABORT /* Total TX Frames Aborted Count */
|
||||
|
||||
/***********************************************************************************
|
||||
** System MMR Register Bits And Macros
|
||||
**
|
||||
** Disclaimer: All macros are intended to make C and Assembly code more readable.
|
||||
** Use these macros carefully, as any that do left shifts for field
|
||||
** depositing will result in the lower order bits being destroyed. Any
|
||||
** macro that shifts left to properly position the bit-field should be
|
||||
** used as part of an OR to initialize a register and NOT as a dynamic
|
||||
** modifier UNLESS the lower order bits are saved and ORed back in when
|
||||
** the macro is used.
|
||||
*************************************************************************************/
|
||||
/************************ ETHERNET 10/100 CONTROLLER MASKS ************************/
|
||||
/* EMAC_OPMODE Masks */
|
||||
#define RE 0x00000001 /* Receiver Enable */
|
||||
#define ASTP 0x00000002 /* Enable Automatic Pad Stripping On RX Frames */
|
||||
#define HU 0x00000010 /* Hash Filter Unicast Address */
|
||||
#define HM 0x00000020 /* Hash Filter Multicast Address */
|
||||
#define PAM 0x00000040 /* Pass-All-Multicast Mode Enable */
|
||||
#define PR 0x00000080 /* Promiscuous Mode Enable */
|
||||
#define IFE 0x00000100 /* Inverse Filtering Enable */
|
||||
#define DBF 0x00000200 /* Disable Broadcast Frame Reception */
|
||||
#define PBF 0x00000400 /* Pass Bad Frames Enable */
|
||||
#define PSF 0x00000800 /* Pass Short Frames Enable */
|
||||
#define RAF 0x00001000 /* Receive-All Mode */
|
||||
#define TE 0x00010000 /* Transmitter Enable */
|
||||
#define DTXPAD 0x00020000 /* Disable Automatic TX Padding */
|
||||
#define DTXCRC 0x00040000 /* Disable Automatic TX CRC Generation */
|
||||
#define DC 0x00080000 /* Deferral Check */
|
||||
#define BOLMT 0x00300000 /* Back-Off Limit */
|
||||
#define BOLMT_10 0x00000000 /* 10-bit range */
|
||||
#define BOLMT_8 0x00100000 /* 8-bit range */
|
||||
#define BOLMT_4 0x00200000 /* 4-bit range */
|
||||
#define BOLMT_1 0x00300000 /* 1-bit range */
|
||||
#define DRTY 0x00400000 /* Disable TX Retry On Collision */
|
||||
#define LCTRE 0x00800000 /* Enable TX Retry On Late Collision */
|
||||
#define RMII 0x01000000 /* RMII/MII* Mode */
|
||||
#define RMII_10 0x02000000 /* Speed Select for RMII Port (10MBit/100MBit*) */
|
||||
#define FDMODE 0x04000000 /* Duplex Mode Enable (Full/Half*) */
|
||||
#define LB 0x08000000 /* Internal Loopback Enable */
|
||||
#define DRO 0x10000000 /* Disable Receive Own Frames (Half-Duplex Mode) */
|
||||
|
||||
/* EMAC_STAADD Masks */
|
||||
#define STABUSY 0x00000001 /* Initiate Station Mgt Reg Access / STA Busy Stat */
|
||||
#define STAOP 0x00000002 /* Station Management Operation Code (Write/Read*) */
|
||||
#define STADISPRE 0x00000004 /* Disable Preamble Generation */
|
||||
#define STAIE 0x00000008 /* Station Mgt. Transfer Done Interrupt Enable */
|
||||
#define REGAD 0x000007C0 /* STA Register Address */
|
||||
#define PHYAD 0x0000F800 /* PHY Device Address */
|
||||
|
||||
#define SET_REGAD(x) (((x)&0x1F)<< 6 ) /* Set STA Register Address */
|
||||
#define SET_PHYAD(x) (((x)&0x1F)<< 11 ) /* Set PHY Device Address */
|
||||
|
||||
/* EMAC_STADAT Mask */
|
||||
#define STADATA 0x0000FFFF /* Station Management Data */
|
||||
|
||||
/* EMAC_FLC Masks */
|
||||
#define FLCBUSY 0x00000001 /* Send Flow Ctrl Frame / Flow Ctrl Busy Status */
|
||||
#define FLCE 0x00000002 /* Flow Control Enable */
|
||||
#define PCF 0x00000004 /* Pass Control Frames */
|
||||
#define BKPRSEN 0x00000008 /* Enable Backpressure */
|
||||
#define FLCPAUSE 0xFFFF0000 /* Pause Time */
|
||||
|
||||
#define SET_FLCPAUSE(x) (((x)&0xFFFF)<< 16) /* Set Pause Time */
|
||||
|
||||
/* EMAC_WKUP_CTL Masks */
|
||||
#define CAPWKFRM 0x00000001 /* Capture Wake-Up Frames */
|
||||
#define MPKE 0x00000002 /* Magic Packet Enable */
|
||||
#define RWKE 0x00000004 /* Remote Wake-Up Frame Enable */
|
||||
#define GUWKE 0x00000008 /* Global Unicast Wake Enable */
|
||||
#define MPKS 0x00000020 /* Magic Packet Received Status */
|
||||
#define RWKS 0x00000F00 /* Wake-Up Frame Received Status, Filters 3:0 */
|
||||
|
||||
/* EMAC_WKUP_FFCMD Masks */
|
||||
#define WF0_E 0x00000001 /* Enable Wake-Up Filter 0 */
|
||||
#define WF0_T 0x00000008 /* Wake-Up Filter 0 Addr Type (Multicast/Unicast*) */
|
||||
#define WF1_E 0x00000100 /* Enable Wake-Up Filter 1 */
|
||||
#define WF1_T 0x00000800 /* Wake-Up Filter 1 Addr Type (Multicast/Unicast*) */
|
||||
#define WF2_E 0x00010000 /* Enable Wake-Up Filter 2 */
|
||||
#define WF2_T 0x00080000 /* Wake-Up Filter 2 Addr Type (Multicast/Unicast*) */
|
||||
#define WF3_E 0x01000000 /* Enable Wake-Up Filter 3 */
|
||||
#define WF3_T 0x08000000 /* Wake-Up Filter 3 Addr Type (Multicast/Unicast*) */
|
||||
|
||||
/* EMAC_WKUP_FFOFF Masks */
|
||||
#define WF0_OFF 0x000000FF /* Wake-Up Filter 0 Pattern Offset */
|
||||
#define WF1_OFF 0x0000FF00 /* Wake-Up Filter 1 Pattern Offset */
|
||||
#define WF2_OFF 0x00FF0000 /* Wake-Up Filter 2 Pattern Offset */
|
||||
#define WF3_OFF 0xFF000000 /* Wake-Up Filter 3 Pattern Offset */
|
||||
|
||||
#define SET_WF0_OFF(x) (((x)&0xFF)<< 0 ) /* Set Wake-Up Filter 0 Byte Offset */
|
||||
#define SET_WF1_OFF(x) (((x)&0xFF)<< 8 ) /* Set Wake-Up Filter 1 Byte Offset */
|
||||
#define SET_WF2_OFF(x) (((x)&0xFF)<< 16 ) /* Set Wake-Up Filter 2 Byte Offset */
|
||||
#define SET_WF3_OFF(x) (((x)&0xFF)<< 24 ) /* Set Wake-Up Filter 3 Byte Offset */
|
||||
/* Set ALL Offsets */
|
||||
#define SET_WF_OFFS(x0,x1,x2,x3) (SET_WF0_OFF((x0))|SET_WF1_OFF((x1))|SET_WF2_OFF((x2))|SET_WF3_OFF((x3)))
|
||||
|
||||
/* EMAC_WKUP_FFCRC0 Masks */
|
||||
#define WF0_CRC 0x0000FFFF /* Wake-Up Filter 0 Pattern CRC */
|
||||
#define WF1_CRC 0xFFFF0000 /* Wake-Up Filter 1 Pattern CRC */
|
||||
|
||||
#define SET_WF0_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 0 Target CRC */
|
||||
#define SET_WF1_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 1 Target CRC */
|
||||
|
||||
/* EMAC_WKUP_FFCRC1 Masks */
|
||||
#define WF2_CRC 0x0000FFFF /* Wake-Up Filter 2 Pattern CRC */
|
||||
#define WF3_CRC 0xFFFF0000 /* Wake-Up Filter 3 Pattern CRC */
|
||||
|
||||
#define SET_WF2_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 2 Target CRC */
|
||||
#define SET_WF3_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 3 Target CRC */
|
||||
|
||||
/* EMAC_SYSCTL Masks */
|
||||
#define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */
|
||||
#define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */
|
||||
#define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */
|
||||
#define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
|
||||
|
||||
#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
|
||||
|
||||
/* EMAC_SYSTAT Masks */
|
||||
#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
|
||||
#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
|
||||
#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
|
||||
#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
|
||||
#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
|
||||
#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
|
||||
#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
|
||||
#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
|
||||
|
||||
/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
|
||||
#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
|
||||
#define RX_COMP 0x00001000 /* RX Frame Complete */
|
||||
#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
|
||||
#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
|
||||
#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
|
||||
#define RX_CRC 0x00010000 /* RX Frame CRC Error */
|
||||
#define RX_LEN 0x00020000 /* RX Frame Length Error */
|
||||
#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
|
||||
#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
|
||||
#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
|
||||
#define RX_PHY 0x00200000 /* RX Frame PHY Error */
|
||||
#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
|
||||
#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
|
||||
#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
|
||||
#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
|
||||
#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
|
||||
#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
|
||||
#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
|
||||
#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
|
||||
#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
|
||||
#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
|
||||
|
||||
/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
|
||||
#define TX_COMP 0x00000001 /* TX Frame Complete */
|
||||
#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
|
||||
#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
|
||||
#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
|
||||
#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
|
||||
#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
|
||||
#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
|
||||
#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
|
||||
#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
|
||||
#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
|
||||
#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
|
||||
#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
|
||||
#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
|
||||
#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
|
||||
#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
|
||||
|
||||
/* EMAC_MMC_CTL Masks */
|
||||
#define RSTC 0x00000001 /* Reset All Counters */
|
||||
#define CROLL 0x00000002 /* Counter Roll-Over Enable */
|
||||
#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
|
||||
#define MMCE 0x00000008 /* Enable MMC Counter Operation */
|
||||
|
||||
/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
|
||||
#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
|
||||
#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
|
||||
#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
|
||||
#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
|
||||
#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
|
||||
#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
|
||||
#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
|
||||
#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
|
||||
#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
|
||||
#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
|
||||
#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
|
||||
#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
|
||||
#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
|
||||
#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
|
||||
#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
|
||||
#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
|
||||
#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
|
||||
#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
|
||||
#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
|
||||
#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
|
||||
#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
|
||||
#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
|
||||
#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
|
||||
#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
|
||||
|
||||
/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
|
||||
#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
|
||||
#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
|
||||
#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
|
||||
#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
|
||||
#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
|
||||
#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
|
||||
#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
|
||||
#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
|
||||
#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
|
||||
#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
|
||||
#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
|
||||
#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
|
||||
#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
|
||||
#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
|
||||
#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
|
||||
#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
|
||||
#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
|
||||
#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
|
||||
#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
|
||||
#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
|
||||
#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
|
||||
#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
|
||||
#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
|
||||
|
||||
#endif /* _DEF_BF537_H */
|
||||
55
include/asm-blackfin/mach-bf537/dma.h
Normal file
55
include/asm-blackfin/mach-bf537/dma.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* file: include/asm-blackfin/mach-bf537/dma.h
|
||||
* based on:
|
||||
* author:
|
||||
*
|
||||
* created:
|
||||
* description:
|
||||
* system mmr register map
|
||||
* rev:
|
||||
*
|
||||
* modified:
|
||||
*
|
||||
*
|
||||
* bugs: enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* this program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the gnu general public license as published by
|
||||
* the free software foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* this program is distributed in the hope that it will be useful,
|
||||
* but without any warranty; without even the implied warranty of
|
||||
* merchantability or fitness for a particular purpose. see the
|
||||
* gnu general public license for more details.
|
||||
*
|
||||
* you should have received a copy of the gnu general public license
|
||||
* along with this program; see the file copying.
|
||||
* if not, write to the free software foundation,
|
||||
* 59 temple place - suite 330, boston, ma 02111-1307, usa.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_DMA_H_
|
||||
#define _MACH_DMA_H_
|
||||
|
||||
#define MAX_BLACKFIN_DMA_CHANNEL 16
|
||||
|
||||
#define CH_PPI 0
|
||||
#define CH_EMAC_RX 1
|
||||
#define CH_EMAC_TX 2
|
||||
#define CH_SPORT0_RX 3
|
||||
#define CH_SPORT0_TX 4
|
||||
#define CH_SPORT1_RX 5
|
||||
#define CH_SPORT1_TX 6
|
||||
#define CH_SPI 7
|
||||
#define CH_UART0_RX 8
|
||||
#define CH_UART0_TX 9
|
||||
#define CH_UART1_RX 10
|
||||
#define CH_UART1_TX 11
|
||||
|
||||
#define CH_MEM_STREAM0_DEST 12 /* TX */
|
||||
#define CH_MEM_STREAM0_SRC 13 /* RX */
|
||||
#define CH_MEM_STREAM1_DEST 14 /* TX */
|
||||
#define CH_MEM_STREAM1_SRC 15 /* RX */
|
||||
|
||||
#endif
|
||||
219
include/asm-blackfin/mach-bf537/irq.h
Normal file
219
include/asm-blackfin/mach-bf537/irq.h
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
/*
|
||||
* file: include/asm-blackfin/mach-bf537/irq.h
|
||||
* based on:
|
||||
* author:
|
||||
*
|
||||
* created:
|
||||
* description:
|
||||
* system mmr register map
|
||||
* rev:
|
||||
*
|
||||
* modified:
|
||||
*
|
||||
*
|
||||
* bugs: enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* this program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the gnu general public license as published by
|
||||
* the free software foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* this program is distributed in the hope that it will be useful,
|
||||
* but without any warranty; without even the implied warranty of
|
||||
* merchantability or fitness for a particular purpose. see the
|
||||
* gnu general public license for more details.
|
||||
*
|
||||
* you should have received a copy of the gnu general public license
|
||||
* along with this program; see the file copying.
|
||||
* if not, write to the free software foundation,
|
||||
* 59 temple place - suite 330, boston, ma 02111-1307, usa.
|
||||
*/
|
||||
|
||||
#ifndef _BF537_IRQ_H_
|
||||
#define _BF537_IRQ_H_
|
||||
|
||||
/*
|
||||
* Interrupt source definitions
|
||||
Event Source Core Event Name
|
||||
Core Emulation **
|
||||
Events (highest priority) EMU 0
|
||||
Reset RST 1
|
||||
NMI NMI 2
|
||||
Exception EVX 3
|
||||
Reserved -- 4
|
||||
Hardware Error IVHW 5
|
||||
Core Timer IVTMR 6 *
|
||||
|
||||
.....
|
||||
|
||||
Software Interrupt 1 IVG14 31
|
||||
Software Interrupt 2 --
|
||||
(lowest priority) IVG15 32 *
|
||||
*/
|
||||
|
||||
#define SYS_IRQS 41
|
||||
#define NR_PERI_INTS 32
|
||||
|
||||
/* The ABSTRACT IRQ definitions */
|
||||
/** the first seven of the following are fixed, the rest you change if you need to **/
|
||||
#define IRQ_EMU 0 /*Emulation */
|
||||
#define IRQ_RST 1 /*reset */
|
||||
#define IRQ_NMI 2 /*Non Maskable */
|
||||
#define IRQ_EVX 3 /*Exception */
|
||||
#define IRQ_UNUSED 4 /*- unused interrupt*/
|
||||
#define IRQ_HWERR 5 /*Hardware Error */
|
||||
#define IRQ_CORETMR 6 /*Core timer */
|
||||
|
||||
#define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */
|
||||
#define IRQ_DMA_ERROR 8 /*DMA Error (general) */
|
||||
#define IRQ_GENERIC_ERROR 9 /*GENERIC Error Interrupt */
|
||||
#define IRQ_RTC 10 /*RTC Interrupt */
|
||||
#define IRQ_PPI 11 /*DMA0 Interrupt (PPI) */
|
||||
#define IRQ_SPORT0_RX 12 /*DMA3 Interrupt (SPORT0 RX) */
|
||||
#define IRQ_SPORT0_TX 13 /*DMA4 Interrupt (SPORT0 TX) */
|
||||
#define IRQ_SPORT1_RX 14 /*DMA5 Interrupt (SPORT1 RX) */
|
||||
#define IRQ_SPORT1_TX 15 /*DMA6 Interrupt (SPORT1 TX) */
|
||||
#define IRQ_TWI 16 /*TWI Interrupt */
|
||||
#define IRQ_SPI 17 /*DMA7 Interrupt (SPI) */
|
||||
#define IRQ_UART0_RX 18 /*DMA8 Interrupt (UART0 RX) */
|
||||
#define IRQ_UART0_TX 19 /*DMA9 Interrupt (UART0 TX) */
|
||||
#define IRQ_UART1_RX 20 /*DMA10 Interrupt (UART1 RX) */
|
||||
#define IRQ_UART1_TX 21 /*DMA11 Interrupt (UART1 TX) */
|
||||
#define IRQ_CAN_RX 22 /*CAN Receive Interrupt */
|
||||
#define IRQ_CAN_TX 23 /*CAN Transmit Interrupt */
|
||||
#define IRQ_MAC_RX 24 /*DMA1 (Ethernet RX) Interrupt */
|
||||
#define IRQ_MAC_TX 25 /*DMA2 (Ethernet TX) Interrupt */
|
||||
#define IRQ_TMR0 26 /*Timer 0 */
|
||||
#define IRQ_TMR1 27 /*Timer 1 */
|
||||
#define IRQ_TMR2 28 /*Timer 2 */
|
||||
#define IRQ_TMR3 29 /*Timer 3 */
|
||||
#define IRQ_TMR4 30 /*Timer 4 */
|
||||
#define IRQ_TMR5 31 /*Timer 5 */
|
||||
#define IRQ_TMR6 32 /*Timer 6 */
|
||||
#define IRQ_TMR7 33 /*Timer 7 */
|
||||
#define IRQ_PROG_INTA 34 /* PF Ports F&G (PF15:0) Interrupt A */
|
||||
#define IRQ_PORTG_INTB 35 /* PF Port G (PF15:0) Interrupt B */
|
||||
#define IRQ_MEM_DMA0 36 /*(Memory DMA Stream 0) */
|
||||
#define IRQ_MEM_DMA1 37 /*(Memory DMA Stream 1) */
|
||||
#define IRQ_PROG_INTB 38 /* PF Ports F (PF15:0) Interrupt B */
|
||||
#define IRQ_WATCH 38 /*Watch Dog Timer */
|
||||
#define IRQ_SW_INT1 40 /*Software Int 1 */
|
||||
#define IRQ_SW_INT2 41 /*Software Int 2 (reserved for SYSCALL) */
|
||||
|
||||
#define IRQ_PPI_ERROR 42 /*PPI Error Interrupt */
|
||||
#define IRQ_CAN_ERROR 43 /*CAN Error Interrupt */
|
||||
#define IRQ_MAC_ERROR 44 /*PPI Error Interrupt */
|
||||
#define IRQ_SPORT0_ERROR 45 /*SPORT0 Error Interrupt */
|
||||
#define IRQ_SPORT1_ERROR 46 /*SPORT1 Error Interrupt */
|
||||
#define IRQ_SPI_ERROR 47 /*SPI Error Interrupt */
|
||||
#define IRQ_UART0_ERROR 48 /*UART Error Interrupt */
|
||||
#define IRQ_UART1_ERROR 49 /*UART Error Interrupt */
|
||||
|
||||
#define IRQ_PF0 50
|
||||
#define IRQ_PF1 51
|
||||
#define IRQ_PF2 52
|
||||
#define IRQ_PF3 53
|
||||
#define IRQ_PF4 54
|
||||
#define IRQ_PF5 55
|
||||
#define IRQ_PF6 56
|
||||
#define IRQ_PF7 57
|
||||
#define IRQ_PF8 58
|
||||
#define IRQ_PF9 59
|
||||
#define IRQ_PF10 60
|
||||
#define IRQ_PF11 61
|
||||
#define IRQ_PF12 62
|
||||
#define IRQ_PF13 63
|
||||
#define IRQ_PF14 64
|
||||
#define IRQ_PF15 65
|
||||
|
||||
#define IRQ_PG0 66
|
||||
#define IRQ_PG1 67
|
||||
#define IRQ_PG2 68
|
||||
#define IRQ_PG3 69
|
||||
#define IRQ_PG4 70
|
||||
#define IRQ_PG5 71
|
||||
#define IRQ_PG6 72
|
||||
#define IRQ_PG7 73
|
||||
#define IRQ_PG8 74
|
||||
#define IRQ_PG9 75
|
||||
#define IRQ_PG10 76
|
||||
#define IRQ_PG11 77
|
||||
#define IRQ_PG12 78
|
||||
#define IRQ_PG13 79
|
||||
#define IRQ_PG14 80
|
||||
#define IRQ_PG15 81
|
||||
|
||||
#define IRQ_PH0 82
|
||||
#define IRQ_PH1 83
|
||||
#define IRQ_PH2 84
|
||||
#define IRQ_PH3 85
|
||||
#define IRQ_PH4 86
|
||||
#define IRQ_PH5 87
|
||||
#define IRQ_PH6 88
|
||||
#define IRQ_PH7 89
|
||||
#define IRQ_PH8 90
|
||||
#define IRQ_PH9 91
|
||||
#define IRQ_PH10 92
|
||||
#define IRQ_PH11 93
|
||||
#define IRQ_PH12 94
|
||||
#define IRQ_PH13 95
|
||||
#define IRQ_PH14 96
|
||||
#define IRQ_PH15 97
|
||||
|
||||
#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
|
||||
#define NR_IRQS (IRQ_PH15+1)
|
||||
#else
|
||||
#define NR_IRQS (IRQ_UART1_ERROR+1)
|
||||
#endif
|
||||
|
||||
#define IVG7 7
|
||||
#define IVG8 8
|
||||
#define IVG9 9
|
||||
#define IVG10 10
|
||||
#define IVG11 11
|
||||
#define IVG12 12
|
||||
#define IVG13 13
|
||||
#define IVG14 14
|
||||
#define IVG15 15
|
||||
|
||||
/* IAR0 BIT FIELDS*/
|
||||
#define IRQ_PLL_WAKEUP_POS 0
|
||||
#define IRQ_DMA_ERROR_POS 4
|
||||
#define IRQ_ERROR_POS 8
|
||||
#define IRQ_RTC_POS 12
|
||||
#define IRQ_PPI_POS 16
|
||||
#define IRQ_SPORT0_RX_POS 20
|
||||
#define IRQ_SPORT0_TX_POS 24
|
||||
#define IRQ_SPORT1_RX_POS 28
|
||||
|
||||
/* IAR1 BIT FIELDS*/
|
||||
#define IRQ_SPORT1_TX_POS 0
|
||||
#define IRQ_TWI_POS 4
|
||||
#define IRQ_SPI_POS 8
|
||||
#define IRQ_UART0_RX_POS 12
|
||||
#define IRQ_UART0_TX_POS 16
|
||||
#define IRQ_UART1_RX_POS 20
|
||||
#define IRQ_UART1_TX_POS 24
|
||||
#define IRQ_CAN_RX_POS 28
|
||||
|
||||
/* IAR2 BIT FIELDS*/
|
||||
#define IRQ_CAN_TX_POS 0
|
||||
#define IRQ_MAC_RX_POS 4
|
||||
#define IRQ_MAC_TX_POS 8
|
||||
#define IRQ_TMR0_POS 12
|
||||
#define IRQ_TMR1_POS 16
|
||||
#define IRQ_TMR2_POS 20
|
||||
#define IRQ_TMR3_POS 24
|
||||
#define IRQ_TMR4_POS 28
|
||||
|
||||
/* IAR3 BIT FIELDS*/
|
||||
#define IRQ_TMR5_POS 0
|
||||
#define IRQ_TMR6_POS 4
|
||||
#define IRQ_TMR7_POS 8
|
||||
#define IRQ_PROG_INTA_POS 12
|
||||
#define IRQ_PORTG_INTB_POS 16
|
||||
#define IRQ_MEM_DMA0_POS 20
|
||||
#define IRQ_MEM_DMA1_POS 24
|
||||
#define IRQ_WATCH_POS 28
|
||||
|
||||
#endif /* _BF537_IRQ_H_ */
|
||||
330
include/asm-blackfin/mach-bf537/mem_init.h
Normal file
330
include/asm-blackfin/mach-bf537/mem_init.h
Normal file
|
|
@ -0,0 +1,330 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf537/mem_init.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_MT48LC16M8A2TG_75 || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC32M8A2_75)
|
||||
#if (CONFIG_SCLK_HZ > 119402985)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_7
|
||||
#define SDRAM_tRAS_num 7
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_6
|
||||
#define SDRAM_tRAS_num 6
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_5
|
||||
#define SDRAM_tRAS_num 5
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_4
|
||||
#define SDRAM_tRAS_num 4
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_3
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_4
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_3
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_2
|
||||
#define SDRAM_tRAS_num 2
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ <= 29850746)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_1
|
||||
#define SDRAM_tRAS_num 1
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC16M16A2TG_75)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC16M8A2TG_75)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC32M8A2_75)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_GENERIC_BOARD)
|
||||
/*SDRAM INFORMATION: Modify this for your board */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_SIZE == 128)
|
||||
#define SDRAM_SIZE EBSZ_128
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 64)
|
||||
#define SDRAM_SIZE EBSZ_64
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 32)
|
||||
#define SDRAM_SIZE EBSZ_32
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 16)
|
||||
#define SDRAM_SIZE EBSZ_16
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 11)
|
||||
#define SDRAM_WIDTH EBCAW_11
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 10)
|
||||
#define SDRAM_WIDTH EBCAW_10
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 9)
|
||||
#define SDRAM_WIDTH EBCAW_9
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 8)
|
||||
#define SDRAM_WIDTH EBCAW_8
|
||||
#endif
|
||||
|
||||
#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE)
|
||||
|
||||
/* Equation from section 17 (p17-46) of BF533 HRM */
|
||||
#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
|
||||
|
||||
/* Enable SCLK Out */
|
||||
#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
|
||||
|
||||
#if defined CONFIG_CLKIN_HALF
|
||||
#define CLKIN_HALF 1
|
||||
#else
|
||||
#define CLKIN_HALF 0
|
||||
#endif
|
||||
|
||||
#if defined CONFIG_PLL_BYPASS
|
||||
#define PLL_BYPASS 1
|
||||
#else
|
||||
#define PLL_BYPASS 0
|
||||
#endif
|
||||
|
||||
/***************************************Currently Not Being Used *********************************/
|
||||
#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
|
||||
#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
|
||||
#if (flash_EBIU_AMBCTL_TT > 3)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT == 3)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT == 2)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT < 2)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_ST > 3)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST == 3)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST == 2)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST < 2)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_HT > 2)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 2)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 1)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_1
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_0
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_WAT > 14)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_15
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 14)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_14
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 13)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_13
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 12)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_12
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 11)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_11
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 10)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_10
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 9)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_9
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 8)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_8
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 7)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_7
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 6)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_6
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 5)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_5
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 4)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 3)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 2)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 1)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_RAT > 14)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_15
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 14)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_14
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 13)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_13
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 12)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_12
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 11)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_11
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 10)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_10
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 9)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_9
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 8)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_8
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 7)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_7
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 6)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_6
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 5)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_5
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 4)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 3)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 2)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 1)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_1
|
||||
#endif
|
||||
|
||||
#define flash_EBIU_AMBCTL0 \
|
||||
(flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
|
||||
flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
|
||||
175
include/asm-blackfin/mach-bf537/mem_map.h
Normal file
175
include/asm-blackfin/mach-bf537/mem_map.h
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
/*
|
||||
* file: include/asm-blackfin/mach-bf537/mem_map.h
|
||||
* based on:
|
||||
* author:
|
||||
*
|
||||
* created:
|
||||
* description:
|
||||
* Memory MAP Common header file for blackfin BF537/6/4 of processors.
|
||||
* rev:
|
||||
*
|
||||
* modified:
|
||||
*
|
||||
* bugs: enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* this program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the gnu general public license as published by
|
||||
* the free software foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* this program is distributed in the hope that it will be useful,
|
||||
* but without any warranty; without even the implied warranty of
|
||||
* merchantability or fitness for a particular purpose. see the
|
||||
* gnu general public license for more details.
|
||||
*
|
||||
* you should have received a copy of the gnu general public license
|
||||
* along with this program; see the file copying.
|
||||
* if not, write to the free software foundation,
|
||||
* 59 temple place - suite 330, boston, ma 02111-1307, usa.
|
||||
*/
|
||||
|
||||
#ifndef _MEM_MAP_537_H_
|
||||
#define _MEM_MAP_537_H_
|
||||
|
||||
#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
|
||||
#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
|
||||
|
||||
/* Async Memory Banks */
|
||||
#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
|
||||
#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */
|
||||
#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */
|
||||
#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
|
||||
#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */
|
||||
|
||||
/* Boot ROM Memory */
|
||||
|
||||
#define BOOT_ROM_START 0xEF000000
|
||||
|
||||
/* Level 1 Memory */
|
||||
|
||||
/* Memory Map for ADSP-BF537 processors */
|
||||
|
||||
#ifdef CONFIG_BLKFIN_CACHE
|
||||
#define BLKFIN_ICACHESIZE (16*1024)
|
||||
#else
|
||||
#define BLKFIN_ICACHESIZE (0*1024)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_BF537
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF800000
|
||||
#define L1_DATA_B_START 0xFF900000
|
||||
|
||||
#define L1_CODE_LENGTH 0xC000
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (16*1024)
|
||||
#define BLKFIN_DSUPBANKS 1
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
|
||||
#define BLKFIN_DCACHESIZE (32*1024)
|
||||
#define BLKFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x8000
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (0*1024)
|
||||
#define BLKFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BLKFIN_DCACHE*/
|
||||
|
||||
#endif /*CONFIG_BF537*/
|
||||
|
||||
/* Memory Map for ADSP-BF536 processors */
|
||||
|
||||
#ifdef CONFIG_BF536
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF804000
|
||||
#define L1_DATA_B_START 0xFF904000
|
||||
|
||||
#define L1_CODE_LENGTH 0xC000
|
||||
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x4000
|
||||
#define BLKFIN_DCACHESIZE (16*1024)
|
||||
#define BLKFIN_DSUPBANKS 1
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x4000 - 0x4000)
|
||||
#define BLKFIN_DCACHESIZE (32*1024)
|
||||
#define BLKFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x4000
|
||||
#define L1_DATA_B_LENGTH 0x4000
|
||||
#define BLKFIN_DCACHESIZE (0*1024)
|
||||
#define BLKFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BLKFIN_DCACHE*/
|
||||
|
||||
#endif
|
||||
|
||||
/* Memory Map for ADSP-BF534 processors */
|
||||
|
||||
#ifdef CONFIG_BF534
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF800000
|
||||
#define L1_DATA_B_START 0xFF900000
|
||||
|
||||
#define L1_CODE_LENGTH 0xC000
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (16*1024)
|
||||
#define BLKFIN_DSUPBANKS 1
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
|
||||
#define BLKFIN_DCACHESIZE (32*1024)
|
||||
#define BLKFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x8000
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (0*1024)
|
||||
#define BLKFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BLKFIN_DCACHE*/
|
||||
|
||||
#endif
|
||||
|
||||
/* Scratch Pad Memory */
|
||||
|
||||
#if defined(CONFIG_BF537) || defined(CONFIG_BF536) || defined(CONFIG_BF534)
|
||||
#define L1_SCRATCH_START 0xFFB00000
|
||||
#define L1_SCRATCH_LENGTH 0x1000
|
||||
#endif
|
||||
|
||||
#endif /* _MEM_MAP_537_H_ */
|
||||
184
include/asm-blackfin/mach-bf561/anomaly.h
Normal file
184
include/asm-blackfin/mach-bf561/anomaly.h
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
|
||||
/*
|
||||
* File: include/asm-blackfin/mach-bf561/anomaly.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* This file shoule be up to date with:
|
||||
* - Revision L, 10Aug2006; ADSP-BF561 Silicon Anomaly List
|
||||
*/
|
||||
|
||||
#ifndef _MACH_ANOMALY_H_
|
||||
#define _MACH_ANOMALY_H_
|
||||
|
||||
/* We do not support 0.1 or 0.4 silicon - sorry */
|
||||
#if (defined(CONFIG_BF_REV_0_1) || defined(CONFIG_BF_REV_0_2) || defined(CONFIG_BF_REV_0_4))
|
||||
#error Kernel will not work on BF561 Version 0.1, 0.2, or 0.4
|
||||
#endif
|
||||
|
||||
/* Issues that are common to 0.5 and 0.3 silicon */
|
||||
#if (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_3))
|
||||
#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
|
||||
slot1 and store of a P register in slot 2 is not
|
||||
supported */
|
||||
#define ANOMALY_05000099 /* UART Line Status Register (UART_LSR) bits are not
|
||||
updated at the same time. */
|
||||
#define ANOMALY_05000120 /* Testset instructions restricted to 32-bit aligned
|
||||
memory locations */
|
||||
#define ANOMALY_05000122 /* Rx.H cannot be used to access 16-bit System MMR
|
||||
registers */
|
||||
#define ANOMALY_05000127 /* Signbits instruction not functional under certain
|
||||
conditions */
|
||||
#define ANOMALY_05000149 /* IMDMA S1/D1 channel may stall */
|
||||
#define ANOMALY_05000166 /* PPI Data Lengths Between 8 and 16 do not zero out
|
||||
upper bits */
|
||||
#define ANOMALY_05000167 /* Turning Serial Ports on With External Frame Syncs */
|
||||
#define ANOMALY_05000180 /* PPI_DELAY not functional in PPI modes with 0 frame
|
||||
syncs */
|
||||
#define ANOMALY_05000182 /* IMDMA does not operate to full speed for 600MHz
|
||||
and higher devices */
|
||||
#define ANOMALY_05000187 /* IMDMA Corrupted Data after a Halt */
|
||||
#define ANOMALY_05000190 /* PPI not functional at core voltage < 1Volt */
|
||||
#define ANOMALY_05000208 /* VSTAT status bit in PLL_STAT register is not
|
||||
functional */
|
||||
#define ANOMALY_05000245 /* Spurious Hardware Error from an access in the
|
||||
shadow of a conditional branch */
|
||||
#define ANOMALY_05000257 /* Interrupt/Exception during short hardware loop
|
||||
may cause bad instruction fetches */
|
||||
#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
|
||||
external SPORT TX and RX clocks */
|
||||
#define ANOMALY_05000267 /* IMDMA may corrupt data under certain conditions */
|
||||
#define ANOMALY_05000269 /* High I/O activity causes output voltage of internal
|
||||
voltage regulator (VDDint) to increase */
|
||||
#define ANOMALY_05000270 /* High I/O activity causes output voltage of internal
|
||||
voltage regulator (VDDint) to decrease */
|
||||
#define ANOMALY_05000272 /* Certain data cache write through modes fail for
|
||||
VDDint <=0.9V */
|
||||
#define ANOMALY_05000274 /* Data cache write back to external synchronous memory
|
||||
may be lost */
|
||||
#define ANOMALY_05000275 /* PPI Timing and sampling informaton updates */
|
||||
#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
|
||||
registers are interrupted */
|
||||
|
||||
#endif /* (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_3)) */
|
||||
|
||||
#if (defined(CONFIG_BF_REV_0_5))
|
||||
#define ANOMALY_05000254 /* Incorrect Timer Pulse Width in Single-Shot PWM_OUT
|
||||
mode with external clock */
|
||||
#define ANOMALY_05000266 /* IMDMA destination IRQ status must be read prior to
|
||||
using IMDMA */
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_BF_REV_0_3))
|
||||
#define ANOMALY_05000156 /* Timers in PWM-Out Mode with PPI GP Receive (Input)
|
||||
Mode with 0 Frame Syncs */
|
||||
#define ANOMALY_05000168 /* SDRAM auto-refresh and subsequent Power Ups */
|
||||
#define ANOMALY_05000169 /* DATA CPLB page miss can result in lost write-through
|
||||
cache data writes */
|
||||
#define ANOMALY_05000171 /* Boot-ROM code modifies SICA_IWRx wakeup registers */
|
||||
#define ANOMALY_05000174 /* Cache Fill Buffer Data lost */
|
||||
#define ANOMALY_05000175 /* Overlapping Sequencer and Memory Stalls */
|
||||
#define ANOMALY_05000176 /* Multiplication of (-1) by (-1) followed by an
|
||||
accumulator saturation */
|
||||
#define ANOMALY_05000179 /* PPI_COUNT cannot be programmed to 0 in General
|
||||
Purpose TX or RX modes */
|
||||
#define ANOMALY_05000181 /* Disabling the PPI resets the PPI configuration
|
||||
registers */
|
||||
#define ANOMALY_05000184 /* Timer Pin limitations for PPI TX Modes with
|
||||
External Frame Syncs */
|
||||
#define ANOMALY_05000185 /* PPI TX Mode with 2 External Frame Syncs */
|
||||
#define ANOMALY_05000186 /* PPI packing with Data Length greater than 8 bits
|
||||
(not a meaningful mode) */
|
||||
#define ANOMALY_05000188 /* IMDMA Restrictions on Descriptor and Buffer
|
||||
Placement in Memory */
|
||||
#define ANOMALY_05000189 /* False Protection Exception */
|
||||
#define ANOMALY_05000193 /* False Flag Pin Interrupts on Edge Sensitive Inputs
|
||||
when polarity setting is changed */
|
||||
#define ANOMALY_05000194 /* Restarting SPORT in specific modes may cause data
|
||||
corruption */
|
||||
#define ANOMALY_05000198 /* Failing MMR accesses when stalled by preceding
|
||||
memory read */
|
||||
#define ANOMALY_05000199 /* DMA current address shows wrong value during carry
|
||||
fix */
|
||||
#define ANOMALY_05000200 /* SPORT TFS and DT are incorrectly driven during
|
||||
inactive channels in certain conditions */
|
||||
#define ANOMALY_05000202 /* Possible infinite stall with specific dual-DAG
|
||||
situation */
|
||||
#define ANOMALY_05000204 /* Incorrect data read with write-through cache and
|
||||
allocate cache lines on reads only mode */
|
||||
#define ANOMALY_05000205 /* Specific sequence that can cause DMA error or DMA
|
||||
stopping */
|
||||
#define ANOMALY_05000207 /* Recovery from "brown-out" condition */
|
||||
#define ANOMALY_05000209 /* Speed-Path in computational unit affects certain
|
||||
instructions */
|
||||
#define ANOMALY_05000215 /* UART TX Interrupt masked erroneously */
|
||||
#define ANOMALY_05000219 /* NMI event at boot time results in unpredictable
|
||||
state */
|
||||
#define ANOMALY_05000220 /* Data Corruption with Cached External Memory and
|
||||
Non-Cached On-Chip L2 Memory */
|
||||
#define ANOMALY_05000225 /* Incorrect pulse-width of UART start-bit */
|
||||
#define ANOMALY_05000227 /* Scratchpad memory bank reads may return incorrect
|
||||
data */
|
||||
#define ANOMALY_05000230 /* UART Receiver is less robust against Baudrate
|
||||
Differences in certain Conditions */
|
||||
#define ANOMALY_05000231 /* UART STB bit incorrectly affects receiver setting */
|
||||
#define ANOMALY_05000232 /* SPORT data transmit lines are incorrectly driven in
|
||||
multichannel mode */
|
||||
#define ANOMALY_05000242 /* DF bit in PLL_CTL register does not respond to
|
||||
hardware reset */
|
||||
#define ANOMALY_05000244 /* If i-cache is on, CSYNC/SSYNC/IDLE around Change of
|
||||
Control causes failures */
|
||||
#define ANOMALY_05000248 /* TESTSET operation forces stall on the other core */
|
||||
#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel
|
||||
(TDM) mode in certain conditions */
|
||||
#define ANOMALY_05000251 /* Exception not generated for MMR accesses in
|
||||
reserved region */
|
||||
#define ANOMALY_05000253 /* Maximum external clock speed for Timers */
|
||||
#define ANOMALY_05000258 /* Instruction Cache is corrupted when bits 9 and 12
|
||||
of the ICPLB Data registers differ */
|
||||
#define ANOMALY_05000260 /* ICPLB_STATUS MMR register may be corrupted */
|
||||
#define ANOMALY_05000261 /* DCPLB_FAULT_ADDR MMR register may be corrupted */
|
||||
#define ANOMALY_05000262 /* Stores to data cache may be lost */
|
||||
#define ANOMALY_05000263 /* Hardware loop corrupted when taking an ICPLB
|
||||
exception */
|
||||
#define ANOMALY_05000264 /* CSYNC/SSYNC/IDLE causes infinite stall in second
|
||||
to last instruction in hardware loop */
|
||||
#define ANOMALY_05000276 /* Timing requirements change for External Frame
|
||||
Sync PPI Modes with non-zero PPI_DELAY */
|
||||
#define ANOMALY_05000278 /* Disabling Peripherals with DMA running may cause
|
||||
DMA system instability */
|
||||
#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context is
|
||||
not restored */
|
||||
#define ANOMALY_05000283 /* An MMR write is stalled indefinitely when killed
|
||||
in a particular stage */
|
||||
#define ANOMALY_05000287 /* A read will receive incorrect data under certain
|
||||
conditions */
|
||||
#define ANOMALY_05000288 /* SPORTs may receive bad data if FIFOs fill up */
|
||||
#endif
|
||||
|
||||
#endif /* _MACH_ANOMALY_H_ */
|
||||
408
include/asm-blackfin/mach-bf561/bf561.h
Normal file
408
include/asm-blackfin/mach-bf561/bf561.h
Normal file
|
|
@ -0,0 +1,408 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf561/bf561.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF561
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef __MACH_BF561_H__
|
||||
#define __MACH_BF561_H__
|
||||
|
||||
#define SUPPORTED_REVID 0x3
|
||||
|
||||
#define OFFSET_(x) ((x) & 0x0000FFFF)
|
||||
#define L1_ISRAM 0xFFA00000
|
||||
#define L1_ISRAM_END 0xFFA04000
|
||||
#define DATA_BANKA_SRAM 0xFF800000
|
||||
#define DATA_BANKA_SRAM_END 0xFF804000
|
||||
#define DATA_BANKB_SRAM 0xFF900000
|
||||
#define DATA_BANKB_SRAM_END 0xFF904000
|
||||
#define L1_DSRAMA 0xFF800000
|
||||
#define L1_DSRAMA_END 0xFF804000
|
||||
#define L1_DSRAMB 0xFF900000
|
||||
#define L1_DSRAMB_END 0xFF904000
|
||||
#define L2_SRAM 0xFEB00000
|
||||
#define L2_SRAM_END 0xFEB20000
|
||||
#define AMB_FLASH 0x20000000
|
||||
#define AMB_FLASH_END 0x21000000
|
||||
#define AMB_FLASH_LENGTH 0x01000000
|
||||
#define L1_ISRAM_LENGTH 0x4000
|
||||
#define L1_DSRAMA_LENGTH 0x4000
|
||||
#define L1_DSRAMB_LENGTH 0x4000
|
||||
#define L2_SRAM_LENGTH 0x20000
|
||||
|
||||
/*some misc defines*/
|
||||
#define IMASK_IVG15 0x8000
|
||||
#define IMASK_IVG14 0x4000
|
||||
#define IMASK_IVG13 0x2000
|
||||
#define IMASK_IVG12 0x1000
|
||||
|
||||
#define IMASK_IVG11 0x0800
|
||||
#define IMASK_IVG10 0x0400
|
||||
#define IMASK_IVG9 0x0200
|
||||
#define IMASK_IVG8 0x0100
|
||||
|
||||
#define IMASK_IVG7 0x0080
|
||||
#define IMASK_IVGTMR 0x0040
|
||||
#define IMASK_IVGHW 0x0020
|
||||
|
||||
/***************************
|
||||
* Blackfin Cache setup
|
||||
*/
|
||||
|
||||
|
||||
#define BLKFIN_ISUBBANKS 4
|
||||
#define BLKFIN_IWAYS 4
|
||||
#define BLKFIN_ILINES 32
|
||||
|
||||
#define BLKFIN_DSUBBANKS 4
|
||||
#define BLKFIN_DWAYS 2
|
||||
#define BLKFIN_DLINES 64
|
||||
|
||||
#define WAY0_L 0x1
|
||||
#define WAY1_L 0x2
|
||||
#define WAY01_L 0x3
|
||||
#define WAY2_L 0x4
|
||||
#define WAY02_L 0x5
|
||||
#define WAY12_L 0x6
|
||||
#define WAY012_L 0x7
|
||||
|
||||
#define WAY3_L 0x8
|
||||
#define WAY03_L 0x9
|
||||
#define WAY13_L 0xA
|
||||
#define WAY013_L 0xB
|
||||
|
||||
#define WAY32_L 0xC
|
||||
#define WAY320_L 0xD
|
||||
#define WAY321_L 0xE
|
||||
#define WAYALL_L 0xF
|
||||
|
||||
#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
|
||||
|
||||
/* IAR0 BIT FIELDS */
|
||||
#define PLL_WAKEUP_BIT 0xFFFFFFFF
|
||||
#define DMA1_ERROR_BIT 0xFFFFFF0F
|
||||
#define DMA2_ERROR_BIT 0xFFFFF0FF
|
||||
#define IMDMA_ERROR_BIT 0xFFFF0FFF
|
||||
#define PPI1_ERROR_BIT 0xFFF0FFFF
|
||||
#define PPI2_ERROR_BIT 0xFF0FFFFF
|
||||
#define SPORT0_ERROR_BIT 0xF0FFFFFF
|
||||
#define SPORT1_ERROR_BIT 0x0FFFFFFF
|
||||
/* IAR1 BIT FIELDS */
|
||||
#define SPI_ERROR_BIT 0xFFFFFFFF
|
||||
#define UART_ERROR_BIT 0xFFFFFF0F
|
||||
#define RESERVED_ERROR_BIT 0xFFFFF0FF
|
||||
#define DMA1_0_BIT 0xFFFF0FFF
|
||||
#define DMA1_1_BIT 0xFFF0FFFF
|
||||
#define DMA1_2_BIT 0xFF0FFFFF
|
||||
#define DMA1_3_BIT 0xF0FFFFFF
|
||||
#define DMA1_4_BIT 0x0FFFFFFF
|
||||
/* IAR2 BIT FIELDS */
|
||||
#define DMA1_5_BIT 0xFFFFFFFF
|
||||
#define DMA1_6_BIT 0xFFFFFF0F
|
||||
#define DMA1_7_BIT 0xFFFFF0FF
|
||||
#define DMA1_8_BIT 0xFFFF0FFF
|
||||
#define DMA1_9_BIT 0xFFF0FFFF
|
||||
#define DMA1_10_BIT 0xFF0FFFFF
|
||||
#define DMA1_11_BIT 0xF0FFFFFF
|
||||
#define DMA2_0_BIT 0x0FFFFFFF
|
||||
/* IAR3 BIT FIELDS */
|
||||
#define DMA2_1_BIT 0xFFFFFFFF
|
||||
#define DMA2_2_BIT 0xFFFFFF0F
|
||||
#define DMA2_3_BIT 0xFFFFF0FF
|
||||
#define DMA2_4_BIT 0xFFFF0FFF
|
||||
#define DMA2_5_BIT 0xFFF0FFFF
|
||||
#define DMA2_6_BIT 0xFF0FFFFF
|
||||
#define DMA2_7_BIT 0xF0FFFFFF
|
||||
#define DMA2_8_BIT 0x0FFFFFFF
|
||||
/* IAR4 BIT FIELDS */
|
||||
#define DMA2_9_BIT 0xFFFFFFFF
|
||||
#define DMA2_10_BIT 0xFFFFFF0F
|
||||
#define DMA2_11_BIT 0xFFFFF0FF
|
||||
#define TIMER0_BIT 0xFFFF0FFF
|
||||
#define TIMER1_BIT 0xFFF0FFFF
|
||||
#define TIMER2_BIT 0xFF0FFFFF
|
||||
#define TIMER3_BIT 0xF0FFFFFF
|
||||
#define TIMER4_BIT 0x0FFFFFFF
|
||||
/* IAR5 BIT FIELDS */
|
||||
#define TIMER5_BIT 0xFFFFFFFF
|
||||
#define TIMER6_BIT 0xFFFFFF0F
|
||||
#define TIMER7_BIT 0xFFFFF0FF
|
||||
#define TIMER8_BIT 0xFFFF0FFF
|
||||
#define TIMER9_BIT 0xFFF0FFFF
|
||||
#define TIMER10_BIT 0xFF0FFFFF
|
||||
#define TIMER11_BIT 0xF0FFFFFF
|
||||
#define PROG0_INTA_BIT 0x0FFFFFFF
|
||||
/* IAR6 BIT FIELDS */
|
||||
#define PROG0_INTB_BIT 0xFFFFFFFF
|
||||
#define PROG1_INTA_BIT 0xFFFFFF0F
|
||||
#define PROG1_INTB_BIT 0xFFFFF0FF
|
||||
#define PROG2_INTA_BIT 0xFFFF0FFF
|
||||
#define PROG2_INTB_BIT 0xFFF0FFFF
|
||||
#define DMA1_WRRD0_BIT 0xFF0FFFFF
|
||||
#define DMA1_WRRD1_BIT 0xF0FFFFFF
|
||||
#define DMA2_WRRD0_BIT 0x0FFFFFFF
|
||||
/* IAR7 BIT FIELDS */
|
||||
#define DMA2_WRRD1_BIT 0xFFFFFFFF
|
||||
#define IMDMA_WRRD0_BIT 0xFFFFFF0F
|
||||
#define IMDMA_WRRD1_BIT 0xFFFFF0FF
|
||||
#define WATCH_BIT 0xFFFF0FFF
|
||||
#define RESERVED_1_BIT 0xFFF0FFFF
|
||||
#define RESERVED_2_BIT 0xFF0FFFFF
|
||||
#define SUPPLE_0_BIT 0xF0FFFFFF
|
||||
#define SUPPLE_1_BIT 0x0FFFFFFF
|
||||
|
||||
/* Miscellaneous Values */
|
||||
|
||||
/****************************** EBIU Settings ********************************/
|
||||
#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
|
||||
#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
|
||||
|
||||
#if defined(CONFIG_C_AMBEN_ALL)
|
||||
#define V_AMBEN AMBEN_ALL
|
||||
#elif defined(CONFIG_C_AMBEN)
|
||||
#define V_AMBEN 0x0
|
||||
#elif defined(CONFIG_C_AMBEN_B0)
|
||||
#define V_AMBEN AMBEN_B0
|
||||
#elif defined(CONFIG_C_AMBEN_B0_B1)
|
||||
#define V_AMBEN AMBEN_B0_B1
|
||||
#elif defined(CONFIG_C_AMBEN_B0_B1_B2)
|
||||
#define V_AMBEN AMBEN_B0_B1_B2
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_C_AMCKEN
|
||||
#define V_AMCKEN AMCKEN
|
||||
#else
|
||||
#define V_AMCKEN 0x0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_C_B0PEN
|
||||
#define V_B0PEN 0x10
|
||||
#else
|
||||
#define V_B0PEN 0x00
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_C_B1PEN
|
||||
#define V_B1PEN 0x20
|
||||
#else
|
||||
#define V_B1PEN 0x00
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_C_B2PEN
|
||||
#define V_B2PEN 0x40
|
||||
#else
|
||||
#define V_B2PEN 0x00
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_C_B3PEN
|
||||
#define V_B3PEN 0x80
|
||||
#else
|
||||
#define V_B3PEN 0x00
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_C_CDPRIO
|
||||
#define V_CDPRIO 0x100
|
||||
#else
|
||||
#define V_CDPRIO 0x0
|
||||
#endif
|
||||
|
||||
#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO | V_B0PEN | V_B1PEN | V_B2PEN | V_B3PEN | 0x0002)
|
||||
|
||||
#define MAX_VC 600000000
|
||||
#define MIN_VC 50000000
|
||||
|
||||
/******************************* PLL Settings ********************************/
|
||||
#ifdef CONFIG_BFIN_KERNEL_CLOCK
|
||||
#if (CONFIG_VCO_MULT < 0)
|
||||
#error "VCO Multiplier is less than 0. Please select a different value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_MULT == 0)
|
||||
#error "VCO Multiplier should be greater than 0. Please select a different value"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CLKIN_HALF
|
||||
#define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
|
||||
#else
|
||||
#define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_PLL_BYPASS
|
||||
#define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
|
||||
#define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
|
||||
#else
|
||||
#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
|
||||
#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_DIV < 1)
|
||||
#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_DIV > 15)
|
||||
#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CCLK_DIV != 1)
|
||||
#if (CONFIG_CCLK_DIV != 2)
|
||||
#if (CONFIG_CCLK_DIV != 4)
|
||||
#if (CONFIG_CCLK_DIV != 8)
|
||||
#error "CCLK DIV can be 1,2,4 or 8 only. Please select a proper value"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_VCO_HZ > MAX_VC)
|
||||
#error "VCO selected is more than maximum value. Please change the VCO multipler"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ > 133000000)
|
||||
#error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ < 27000000)
|
||||
#error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SCLK_HZ >= CONFIG_CCLK_HZ)
|
||||
#if (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ)
|
||||
#if (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
|
||||
#error "Please select sclk less than cclk"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CCLK_DIV == 1)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 2)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 4)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
|
||||
#endif
|
||||
#if (CONFIG_CCLK_DIV == 8)
|
||||
#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
|
||||
#endif
|
||||
#ifndef CONFIG_CCLK_ACT_DIV
|
||||
#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
|
||||
#endif
|
||||
|
||||
#if defined(ANOMALY_05000273) && (CONFIG_CCLK_DIV == 1)
|
||||
#error ANOMALY 05000273, please make sure CCLK is at least 2x SCLK
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_BFIN_KERNEL_CLOCK */
|
||||
|
||||
#ifdef CONFIG_BF561
|
||||
#define CPU "BF561"
|
||||
#define CPUID 0x027bb000
|
||||
#endif
|
||||
#ifndef CPU
|
||||
#define CPU "UNKNOWN"
|
||||
#define CPUID 0x0
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_SIZE % 4)
|
||||
#error "SDRAM memory size must be a multiple of 4MB!"
|
||||
#endif
|
||||
#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
|
||||
#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
|
||||
#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
|
||||
#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
|
||||
|
||||
/*Use the menuconfig cache policy here - CONFIG_BLKFIN_WT/CONFIG_BLKFIN_WB*/
|
||||
|
||||
#define ANOMALY_05000158_WORKAROUND 0x200
|
||||
#ifdef CONFIG_BLKFIN_WB /*Write Back Policy */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_DIRTY \
|
||||
| CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
|
||||
#else /*Write Through */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_DIRTY \
|
||||
| CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
|
||||
#endif
|
||||
|
||||
|
||||
#define L1_DMEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
|
||||
#define SDRAM_DNON_CHBL (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
|
||||
#define SDRAM_EBIU (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
|
||||
#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
|
||||
|
||||
#define L2_MEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
|
||||
|
||||
#define SIZE_1K 0x00000400 /* 1K */
|
||||
#define SIZE_4K 0x00001000 /* 4K */
|
||||
#define SIZE_1M 0x00100000 /* 1M */
|
||||
#define SIZE_4M 0x00400000 /* 4M */
|
||||
|
||||
#define MAX_CPLBS (16 * 2)
|
||||
|
||||
/*
|
||||
* Number of required data CPLB switchtable entries
|
||||
* MEMSIZE / 4 (we mostly install 4M page size CPLBs
|
||||
* approx 16 for smaller 1MB page size CPLBs for allignment purposes
|
||||
* 1 for L1 Data Memory
|
||||
* 1 for L2 Data Memory
|
||||
* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
|
||||
* 64 for ASYNC Memory
|
||||
*/
|
||||
|
||||
|
||||
#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1 + 64) * 2)
|
||||
|
||||
/*
|
||||
* Number of required instruction CPLB switchtable entries
|
||||
* MEMSIZE / 4 (we mostly install 4M page size CPLBs
|
||||
* approx 12 for smaller 1MB page size CPLBs for allignment purposes
|
||||
* 1 for L1 Instruction Memory
|
||||
* 1 for L2 Instruction Memory
|
||||
* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
|
||||
*/
|
||||
|
||||
#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1 + 1) * 2)
|
||||
|
||||
#if 0 /* comment by mhfan */
|
||||
/* Event Vector Table Address */
|
||||
#define EVT_EMULATION_ADDR 0xffe02000
|
||||
#define EVT_RESET_ADDR 0xffe02004
|
||||
#define EVT_NMI_ADDR 0xffe02008
|
||||
#define EVT_EXCEPTION_ADDR 0xffe0200c
|
||||
#define EVT_GLOBAL_INT_ENB_ADDR 0xffe02010
|
||||
#define EVT_HARDWARE_ERROR_ADDR 0xffe02014
|
||||
#define EVT_TIMER_ADDR 0xffe02018
|
||||
#define EVT_IVG7_ADDR 0xffe0201c
|
||||
#define EVT_IVG8_ADDR 0xffe02020
|
||||
#define EVT_IVG9_ADDR 0xffe02024
|
||||
#define EVT_IVG10_ADDR 0xffe02028
|
||||
#define EVT_IVG11_ADDR 0xffe0202c
|
||||
#define EVT_IVG12_ADDR 0xffe02030
|
||||
#define EVT_IVG13_ADDR 0xffe02034
|
||||
#define EVT_IVG14_ADDR 0xffe02038
|
||||
#define EVT_IVG15_ADDR 0xffe0203c
|
||||
#define EVT_OVERRIDE_ADDR 0xffe02100
|
||||
#endif /* comment by mhfan */
|
||||
|
||||
#endif /* __MACH_BF561_H__ */
|
||||
108
include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
Normal file
108
include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#include <linux/serial.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
#define NR_PORTS 1
|
||||
|
||||
#define OFFSET_THR 0x00 /* Transmit Holding register */
|
||||
#define OFFSET_RBR 0x00 /* Receive Buffer register */
|
||||
#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
|
||||
#define OFFSET_IER 0x04 /* Interrupt Enable Register */
|
||||
#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
|
||||
#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
|
||||
#define OFFSET_LCR 0x0C /* Line Control Register */
|
||||
#define OFFSET_MCR 0x10 /* Modem Control Register */
|
||||
#define OFFSET_LSR 0x14 /* Line Status Register */
|
||||
#define OFFSET_MSR 0x18 /* Modem Status Register */
|
||||
#define OFFSET_SCR 0x1C /* SCR Scratch Register */
|
||||
#define OFFSET_GCTL 0x24 /* Global Control Register */
|
||||
|
||||
#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
|
||||
#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
|
||||
#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
|
||||
#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
|
||||
#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
|
||||
#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
|
||||
#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
|
||||
#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
|
||||
|
||||
#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
|
||||
#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
|
||||
#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
|
||||
#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
|
||||
#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
|
||||
#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
|
||||
|
||||
#ifdef CONFIG_BFIN_UART0_CTSRTS
|
||||
# define CONFIG_SERIAL_BFIN_CTSRTS
|
||||
# ifndef CONFIG_UART0_CTS_PIN
|
||||
# define CONFIG_UART0_CTS_PIN -1
|
||||
# endif
|
||||
# ifndef CONFIG_UART0_RTS_PIN
|
||||
# define CONFIG_UART0_RTS_PIN -1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct bfin_serial_port {
|
||||
struct uart_port port;
|
||||
unsigned int old_status;
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
int tx_done;
|
||||
int tx_count;
|
||||
struct circ_buf rx_dma_buf;
|
||||
struct timer_list rx_dma_timer;
|
||||
int rx_dma_nrows;
|
||||
unsigned int tx_dma_channel;
|
||||
unsigned int rx_dma_channel;
|
||||
struct work_struct tx_dma_workqueue;
|
||||
#else
|
||||
struct work_struct cts_workqueue;
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
int cts_pin;
|
||||
int rts_pin;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bfin_serial_port bfin_serial_ports[NR_PORTS];
|
||||
struct bfin_serial_res {
|
||||
unsigned long uart_base_addr;
|
||||
int uart_irq;
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
unsigned int uart_tx_dma_channel;
|
||||
unsigned int uart_rx_dma_channel;
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
int uart_cts_pin;
|
||||
int uart_rts_pin;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct bfin_serial_res bfin_serial_resource[] = {
|
||||
0xFFC00400,
|
||||
IRQ_UART_RX,
|
||||
#ifdef CONFIG_SERIAL_BFIN_DMA
|
||||
CH_UART_TX,
|
||||
CH_UART_RX,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_UART0_CTSRTS
|
||||
CONFIG_UART0_CTS_PIN,
|
||||
CONFIG_UART0_RTS_PIN,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
int nr_ports = NR_PORTS;
|
||||
static void bfin_serial_hw_init(struct bfin_serial_port *uart)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
if (uart->cts_pin >= 0) {
|
||||
gpio_request(uart->cts_pin, NULL);
|
||||
gpio_direction_input(uart->cts_pin);
|
||||
}
|
||||
if (uart->rts_pin >= 0) {
|
||||
gpio_request(uart->rts_pin, NULL);
|
||||
gpio_direction_input(uart->rts_pin);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
52
include/asm-blackfin/mach-bf561/blackfin.h
Normal file
52
include/asm-blackfin/mach-bf561/blackfin.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf561/blackfin.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_BLACKFIN_H_
|
||||
#define _MACH_BLACKFIN_H_
|
||||
|
||||
#define BF561_FAMILY
|
||||
|
||||
#include "bf561.h"
|
||||
#include "mem_map.h"
|
||||
#include "defBF561.h"
|
||||
#include "anomaly.h"
|
||||
|
||||
#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
|
||||
#include "cdefBF561.h"
|
||||
#endif
|
||||
|
||||
#define bfin_read_FIO_FLAG_D() bfin_read_FIO0_FLAG_D()
|
||||
#define bfin_write_FIO_FLAG_D(val) bfin_write_FIO0_FLAG_D(val)
|
||||
#define bfin_read_FIO_DIR() bfin_read_FIO0_DIR()
|
||||
#define bfin_write_FIO_DIR(val) bfin_write_FIO0_DIR(val)
|
||||
#define bfin_read_FIO_INEN() bfin_read_FIO0_INEN()
|
||||
#define bfin_write_FIO_INEN(val) bfin_write_FIO0_INEN(val)
|
||||
|
||||
#endif /* _MACH_BLACKFIN_H_ */
|
||||
1543
include/asm-blackfin/mach-bf561/cdefBF561.h
Normal file
1543
include/asm-blackfin/mach-bf561/cdefBF561.h
Normal file
File diff suppressed because it is too large
Load diff
1717
include/asm-blackfin/mach-bf561/defBF561.h
Normal file
1717
include/asm-blackfin/mach-bf561/defBF561.h
Normal file
File diff suppressed because it is too large
Load diff
35
include/asm-blackfin/mach-bf561/dma.h
Normal file
35
include/asm-blackfin/mach-bf561/dma.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/*****************************************************************************
|
||||
*
|
||||
* BF-533/2/1 Specific Declarations
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _MACH_DMA_H_
|
||||
#define _MACH_DMA_H_
|
||||
|
||||
#define MAX_BLACKFIN_DMA_CHANNEL 36
|
||||
|
||||
#define CH_PPI0 0
|
||||
#define CH_PPI (CH_PPI0)
|
||||
#define CH_PPI1 1
|
||||
#define CH_SPORT0_RX 12
|
||||
#define CH_SPORT0_TX 13
|
||||
#define CH_SPORT1_RX 14
|
||||
#define CH_SPORT1_TX 15
|
||||
#define CH_SPI 16
|
||||
#define CH_UART_RX 17
|
||||
#define CH_UART_TX 18
|
||||
#define CH_MEM_STREAM0_DEST 24 /* TX */
|
||||
#define CH_MEM_STREAM0_SRC 25 /* RX */
|
||||
#define CH_MEM_STREAM1_DEST 26 /* TX */
|
||||
#define CH_MEM_STREAM1_SRC 27 /* RX */
|
||||
#define CH_MEM_STREAM2_DEST 28
|
||||
#define CH_MEM_STREAM2_SRC 29
|
||||
#define CH_MEM_STREAM3_SRC 30
|
||||
#define CH_MEM_STREAM3_DEST 31
|
||||
#define CH_IMEM_STREAM0_DEST 32
|
||||
#define CH_IMEM_STREAM0_SRC 33
|
||||
#define CH_IMEM_STREAM1_SRC 34
|
||||
#define CH_IMEM_STREAM1_DEST 35
|
||||
|
||||
#endif
|
||||
450
include/asm-blackfin/mach-bf561/irq.h
Normal file
450
include/asm-blackfin/mach-bf561/irq.h
Normal file
|
|
@ -0,0 +1,450 @@
|
|||
|
||||
/*
|
||||
* File: include/asm-blackfin/mach-bf561/irq.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _BF561_IRQ_H_
|
||||
#define _BF561_IRQ_H_
|
||||
|
||||
/***********************************************************************
|
||||
* Interrupt source definitions:
|
||||
Event Source Core Event Name IRQ No
|
||||
(highest priority)
|
||||
Emulation Events EMU 0
|
||||
Reset RST 1
|
||||
NMI NMI 2
|
||||
Exception EVX 3
|
||||
Reserved -- 4
|
||||
Hardware Error IVHW 5
|
||||
Core Timer IVTMR 6 *
|
||||
|
||||
PLL Wakeup Interrupt IVG7 7
|
||||
DMA1 Error (generic) IVG7 8
|
||||
DMA2 Error (generic) IVG7 9
|
||||
IMDMA Error (generic) IVG7 10
|
||||
PPI1 Error Interrupt IVG7 11
|
||||
PPI2 Error Interrupt IVG7 12
|
||||
SPORT0 Error Interrupt IVG7 13
|
||||
SPORT1 Error Interrupt IVG7 14
|
||||
SPI Error Interrupt IVG7 15
|
||||
UART Error Interrupt IVG7 16
|
||||
Reserved Interrupt IVG7 17
|
||||
|
||||
DMA1 0 Interrupt(PPI1) IVG8 18
|
||||
DMA1 1 Interrupt(PPI2) IVG8 19
|
||||
DMA1 2 Interrupt IVG8 20
|
||||
DMA1 3 Interrupt IVG8 21
|
||||
DMA1 4 Interrupt IVG8 22
|
||||
DMA1 5 Interrupt IVG8 23
|
||||
DMA1 6 Interrupt IVG8 24
|
||||
DMA1 7 Interrupt IVG8 25
|
||||
DMA1 8 Interrupt IVG8 26
|
||||
DMA1 9 Interrupt IVG8 27
|
||||
DMA1 10 Interrupt IVG8 28
|
||||
DMA1 11 Interrupt IVG8 29
|
||||
|
||||
DMA2 0 (SPORT0 RX) IVG9 30
|
||||
DMA2 1 (SPORT0 TX) IVG9 31
|
||||
DMA2 2 (SPORT1 RX) IVG9 32
|
||||
DMA2 3 (SPORT2 TX) IVG9 33
|
||||
DMA2 4 (SPI) IVG9 34
|
||||
DMA2 5 (UART RX) IVG9 35
|
||||
DMA2 6 (UART TX) IVG9 36
|
||||
DMA2 7 Interrupt IVG9 37
|
||||
DMA2 8 Interrupt IVG9 38
|
||||
DMA2 9 Interrupt IVG9 39
|
||||
DMA2 10 Interrupt IVG9 40
|
||||
DMA2 11 Interrupt IVG9 41
|
||||
|
||||
TIMER 0 Interrupt IVG10 42
|
||||
TIMER 1 Interrupt IVG10 43
|
||||
TIMER 2 Interrupt IVG10 44
|
||||
TIMER 3 Interrupt IVG10 45
|
||||
TIMER 4 Interrupt IVG10 46
|
||||
TIMER 5 Interrupt IVG10 47
|
||||
TIMER 6 Interrupt IVG10 48
|
||||
TIMER 7 Interrupt IVG10 49
|
||||
TIMER 8 Interrupt IVG10 50
|
||||
TIMER 9 Interrupt IVG10 51
|
||||
TIMER 10 Interrupt IVG10 52
|
||||
TIMER 11 Interrupt IVG10 53
|
||||
|
||||
Programmable Flags0 A (8) IVG11 54
|
||||
Programmable Flags0 B (8) IVG11 55
|
||||
Programmable Flags1 A (8) IVG11 56
|
||||
Programmable Flags1 B (8) IVG11 57
|
||||
Programmable Flags2 A (8) IVG11 58
|
||||
Programmable Flags2 B (8) IVG11 59
|
||||
|
||||
MDMA1 0 write/read INT IVG8 60
|
||||
MDMA1 1 write/read INT IVG8 61
|
||||
|
||||
MDMA2 0 write/read INT IVG9 62
|
||||
MDMA2 1 write/read INT IVG9 63
|
||||
|
||||
IMDMA 0 write/read INT IVG12 64
|
||||
IMDMA 1 write/read INT IVG12 65
|
||||
|
||||
Watch Dog Timer IVG13 66
|
||||
|
||||
Reserved interrupt IVG7 67
|
||||
Reserved interrupt IVG7 68
|
||||
Supplemental interrupt 0 IVG7 69
|
||||
supplemental interrupt 1 IVG7 70
|
||||
|
||||
Software Interrupt 1 IVG14 71
|
||||
Software Interrupt 2 IVG15 72 *
|
||||
(lowest priority)
|
||||
**********************************************************************/
|
||||
|
||||
#define SYS_IRQS 72
|
||||
#define NR_PERI_INTS 64
|
||||
|
||||
/*
|
||||
* The ABSTRACT IRQ definitions
|
||||
* the first seven of the following are fixed,
|
||||
* the rest you change if you need to.
|
||||
*/
|
||||
/* IVG 0-6*/
|
||||
#define IRQ_EMU 0 /* Emulation */
|
||||
#define IRQ_RST 1 /* Reset */
|
||||
#define IRQ_NMI 2 /* Non Maskable Interrupt */
|
||||
#define IRQ_EVX 3 /* Exception */
|
||||
#define IRQ_UNUSED 4 /* Reserved interrupt */
|
||||
#define IRQ_HWERR 5 /* Hardware Error */
|
||||
#define IRQ_CORETMR 6 /* Core timer */
|
||||
|
||||
#define IVG_BASE 7
|
||||
/* IVG 7 */
|
||||
#define IRQ_PLL_WAKEUP (IVG_BASE + 0) /* PLL Wakeup Interrupt */
|
||||
#define IRQ_DMA1_ERROR (IVG_BASE + 1) /* DMA1 Error (general) */
|
||||
#define IRQ_DMA_ERROR IRQ_DMA1_ERROR /* DMA1 Error (general) */
|
||||
#define IRQ_DMA2_ERROR (IVG_BASE + 2) /* DMA2 Error (general) */
|
||||
#define IRQ_IMDMA_ERROR (IVG_BASE + 3) /* IMDMA Error Interrupt */
|
||||
#define IRQ_PPI1_ERROR (IVG_BASE + 4) /* PPI1 Error Interrupt */
|
||||
#define IRQ_PPI_ERROR IRQ_PPI1_ERROR /* PPI1 Error Interrupt */
|
||||
#define IRQ_PPI2_ERROR (IVG_BASE + 5) /* PPI2 Error Interrupt */
|
||||
#define IRQ_SPORT0_ERROR (IVG_BASE + 6) /* SPORT0 Error Interrupt */
|
||||
#define IRQ_SPORT1_ERROR (IVG_BASE + 7) /* SPORT1 Error Interrupt */
|
||||
#define IRQ_SPI_ERROR (IVG_BASE + 8) /* SPI Error Interrupt */
|
||||
#define IRQ_UART_ERROR (IVG_BASE + 9) /* UART Error Interrupt */
|
||||
#define IRQ_RESERVED_ERROR (IVG_BASE + 10) /* Reversed Interrupt */
|
||||
/* IVG 8 */
|
||||
#define IRQ_DMA1_0 (IVG_BASE + 11) /* DMA1 0 Interrupt(PPI1) */
|
||||
#define IRQ_PPI IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */
|
||||
#define IRQ_PPI0 IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */
|
||||
#define IRQ_DMA1_1 (IVG_BASE + 12) /* DMA1 1 Interrupt(PPI2) */
|
||||
#define IRQ_PPI1 IRQ_DMA1_1 /* DMA1 1 Interrupt(PPI2) */
|
||||
#define IRQ_DMA1_2 (IVG_BASE + 13) /* DMA1 2 Interrupt */
|
||||
#define IRQ_DMA1_3 (IVG_BASE + 14) /* DMA1 3 Interrupt */
|
||||
#define IRQ_DMA1_4 (IVG_BASE + 15) /* DMA1 4 Interrupt */
|
||||
#define IRQ_DMA1_5 (IVG_BASE + 16) /* DMA1 5 Interrupt */
|
||||
#define IRQ_DMA1_6 (IVG_BASE + 17) /* DMA1 6 Interrupt */
|
||||
#define IRQ_DMA1_7 (IVG_BASE + 18) /* DMA1 7 Interrupt */
|
||||
#define IRQ_DMA1_8 (IVG_BASE + 19) /* DMA1 8 Interrupt */
|
||||
#define IRQ_DMA1_9 (IVG_BASE + 20) /* DMA1 9 Interrupt */
|
||||
#define IRQ_DMA1_10 (IVG_BASE + 21) /* DMA1 10 Interrupt */
|
||||
#define IRQ_DMA1_11 (IVG_BASE + 22) /* DMA1 11 Interrupt */
|
||||
/* IVG 9 */
|
||||
#define IRQ_DMA2_0 (IVG_BASE + 23) /* DMA2 0 (SPORT0 RX) */
|
||||
#define IRQ_SPORT0_RX IRQ_DMA2_0 /* DMA2 0 (SPORT0 RX) */
|
||||
#define IRQ_DMA2_1 (IVG_BASE + 24) /* DMA2 1 (SPORT0 TX) */
|
||||
#define IRQ_SPORT0_TX IRQ_DMA2_1 /* DMA2 1 (SPORT0 TX) */
|
||||
#define IRQ_DMA2_2 (IVG_BASE + 25) /* DMA2 2 (SPORT1 RX) */
|
||||
#define IRQ_SPORT1_RX IRQ_DMA2_2 /* DMA2 2 (SPORT1 RX) */
|
||||
#define IRQ_DMA2_3 (IVG_BASE + 26) /* DMA2 3 (SPORT2 TX) */
|
||||
#define IRQ_SPORT1_TX IRQ_DMA2_3 /* DMA2 3 (SPORT2 TX) */
|
||||
#define IRQ_DMA2_4 (IVG_BASE + 27) /* DMA2 4 (SPI) */
|
||||
#define IRQ_SPI IRQ_DMA2_4 /* DMA2 4 (SPI) */
|
||||
#define IRQ_DMA2_5 (IVG_BASE + 28) /* DMA2 5 (UART RX) */
|
||||
#define IRQ_UART_RX IRQ_DMA2_5 /* DMA2 5 (UART RX) */
|
||||
#define IRQ_DMA2_6 (IVG_BASE + 29) /* DMA2 6 (UART TX) */
|
||||
#define IRQ_UART_TX IRQ_DMA2_6 /* DMA2 6 (UART TX) */
|
||||
#define IRQ_DMA2_7 (IVG_BASE + 30) /* DMA2 7 Interrupt */
|
||||
#define IRQ_DMA2_8 (IVG_BASE + 31) /* DMA2 8 Interrupt */
|
||||
#define IRQ_DMA2_9 (IVG_BASE + 32) /* DMA2 9 Interrupt */
|
||||
#define IRQ_DMA2_10 (IVG_BASE + 33) /* DMA2 10 Interrupt */
|
||||
#define IRQ_DMA2_11 (IVG_BASE + 34) /* DMA2 11 Interrupt */
|
||||
/* IVG 10 */
|
||||
#define IRQ_TIMER0 (IVG_BASE + 35) /* TIMER 0 Interrupt */
|
||||
#define IRQ_TIMER1 (IVG_BASE + 36) /* TIMER 1 Interrupt */
|
||||
#define IRQ_TIMER2 (IVG_BASE + 37) /* TIMER 2 Interrupt */
|
||||
#define IRQ_TIMER3 (IVG_BASE + 38) /* TIMER 3 Interrupt */
|
||||
#define IRQ_TIMER4 (IVG_BASE + 39) /* TIMER 4 Interrupt */
|
||||
#define IRQ_TIMER5 (IVG_BASE + 40) /* TIMER 5 Interrupt */
|
||||
#define IRQ_TIMER6 (IVG_BASE + 41) /* TIMER 6 Interrupt */
|
||||
#define IRQ_TIMER7 (IVG_BASE + 42) /* TIMER 7 Interrupt */
|
||||
#define IRQ_TIMER8 (IVG_BASE + 43) /* TIMER 8 Interrupt */
|
||||
#define IRQ_TIMER9 (IVG_BASE + 44) /* TIMER 9 Interrupt */
|
||||
#define IRQ_TIMER10 (IVG_BASE + 45) /* TIMER 10 Interrupt */
|
||||
#define IRQ_TIMER11 (IVG_BASE + 46) /* TIMER 11 Interrupt */
|
||||
/* IVG 11 */
|
||||
#define IRQ_PROG0_INTA (IVG_BASE + 47) /* Programmable Flags0 A (8) */
|
||||
#define IRQ_PROG_INTA IRQ_PROG0_INTA /* Programmable Flags0 A (8) */
|
||||
#define IRQ_PROG0_INTB (IVG_BASE + 48) /* Programmable Flags0 B (8) */
|
||||
#define IRQ_PROG_INTB IRQ_PROG0_INTB /* Programmable Flags0 B (8) */
|
||||
#define IRQ_PROG1_INTA (IVG_BASE + 49) /* Programmable Flags1 A (8) */
|
||||
#define IRQ_PROG1_INTB (IVG_BASE + 50) /* Programmable Flags1 B (8) */
|
||||
#define IRQ_PROG2_INTA (IVG_BASE + 51) /* Programmable Flags2 A (8) */
|
||||
#define IRQ_PROG2_INTB (IVG_BASE + 52) /* Programmable Flags2 B (8) */
|
||||
/* IVG 8 */
|
||||
#define IRQ_DMA1_WRRD0 (IVG_BASE + 53) /* MDMA1 0 write/read INT */
|
||||
#define IRQ_DMA_WRRD0 IRQ_DMA1_WRRD0 /* MDMA1 0 write/read INT */
|
||||
#define IRQ_MEM_DMA0 IRQ_DMA1_WRRD0
|
||||
#define IRQ_DMA1_WRRD1 (IVG_BASE + 54) /* MDMA1 1 write/read INT */
|
||||
#define IRQ_DMA_WRRD1 IRQ_DMA1_WRRD1 /* MDMA1 1 write/read INT */
|
||||
#define IRQ_MEM_DMA1 IRQ_DMA1_WRRD1
|
||||
/* IVG 9 */
|
||||
#define IRQ_DMA2_WRRD0 (IVG_BASE + 55) /* MDMA2 0 write/read INT */
|
||||
#define IRQ_MEM_DMA2 IRQ_DMA2_WRRD0
|
||||
#define IRQ_DMA2_WRRD1 (IVG_BASE + 56) /* MDMA2 1 write/read INT */
|
||||
#define IRQ_MEM_DMA3 IRQ_DMA2_WRRD1
|
||||
/* IVG 12 */
|
||||
#define IRQ_IMDMA_WRRD0 (IVG_BASE + 57) /* IMDMA 0 write/read INT */
|
||||
#define IRQ_IMEM_DMA0 IRQ_IMDMA_WRRD0
|
||||
#define IRQ_IMDMA_WRRD1 (IVG_BASE + 58) /* IMDMA 1 write/read INT */
|
||||
#define IRQ_IMEM_DMA1 IRQ_IMDMA_WRRD1
|
||||
/* IVG 13 */
|
||||
#define IRQ_WATCH (IVG_BASE + 59) /* Watch Dog Timer */
|
||||
/* IVG 7 */
|
||||
#define IRQ_RESERVED_1 (IVG_BASE + 60) /* Reserved interrupt */
|
||||
#define IRQ_RESERVED_2 (IVG_BASE + 61) /* Reserved interrupt */
|
||||
#define IRQ_SUPPLE_0 (IVG_BASE + 62) /* Supplemental interrupt 0 */
|
||||
#define IRQ_SUPPLE_1 (IVG_BASE + 63) /* supplemental interrupt 1 */
|
||||
#define IRQ_SW_INT1 71 /* Software Interrupt 1 */
|
||||
#define IRQ_SW_INT2 72 /* Software Interrupt 2 */
|
||||
/* reserved for SYSCALL */
|
||||
#define IRQ_PF0 73
|
||||
#define IRQ_PF1 74
|
||||
#define IRQ_PF2 75
|
||||
#define IRQ_PF3 76
|
||||
#define IRQ_PF4 77
|
||||
#define IRQ_PF5 78
|
||||
#define IRQ_PF6 79
|
||||
#define IRQ_PF7 80
|
||||
#define IRQ_PF8 81
|
||||
#define IRQ_PF9 82
|
||||
#define IRQ_PF10 83
|
||||
#define IRQ_PF11 84
|
||||
#define IRQ_PF12 85
|
||||
#define IRQ_PF13 86
|
||||
#define IRQ_PF14 87
|
||||
#define IRQ_PF15 88
|
||||
#define IRQ_PF16 89
|
||||
#define IRQ_PF17 90
|
||||
#define IRQ_PF18 91
|
||||
#define IRQ_PF19 92
|
||||
#define IRQ_PF20 93
|
||||
#define IRQ_PF21 94
|
||||
#define IRQ_PF22 95
|
||||
#define IRQ_PF23 96
|
||||
#define IRQ_PF24 97
|
||||
#define IRQ_PF25 98
|
||||
#define IRQ_PF26 99
|
||||
#define IRQ_PF27 100
|
||||
#define IRQ_PF28 101
|
||||
#define IRQ_PF29 102
|
||||
#define IRQ_PF30 103
|
||||
#define IRQ_PF31 104
|
||||
#define IRQ_PF32 105
|
||||
#define IRQ_PF33 106
|
||||
#define IRQ_PF34 107
|
||||
#define IRQ_PF35 108
|
||||
#define IRQ_PF36 109
|
||||
#define IRQ_PF37 110
|
||||
#define IRQ_PF38 111
|
||||
#define IRQ_PF39 112
|
||||
#define IRQ_PF40 113
|
||||
#define IRQ_PF41 114
|
||||
#define IRQ_PF42 115
|
||||
#define IRQ_PF43 116
|
||||
#define IRQ_PF44 117
|
||||
#define IRQ_PF45 118
|
||||
#define IRQ_PF46 119
|
||||
#define IRQ_PF47 120
|
||||
|
||||
#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
|
||||
#define NR_IRQS (IRQ_PF47 + 1)
|
||||
#else
|
||||
#define NR_IRQS SYS_IRQS
|
||||
#endif
|
||||
|
||||
#define IVG7 7
|
||||
#define IVG8 8
|
||||
#define IVG9 9
|
||||
#define IVG10 10
|
||||
#define IVG11 11
|
||||
#define IVG12 12
|
||||
#define IVG13 13
|
||||
#define IVG14 14
|
||||
#define IVG15 15
|
||||
|
||||
/*
|
||||
* DEFAULT PRIORITIES:
|
||||
*/
|
||||
|
||||
#define CONFIG_DEF_PLL_WAKEUP 7
|
||||
#define CONFIG_DEF_DMA1_ERROR 7
|
||||
#define CONFIG_DEF_DMA2_ERROR 7
|
||||
#define CONFIG_DEF_IMDMA_ERROR 7
|
||||
#define CONFIG_DEF_PPI1_ERROR 7
|
||||
#define CONFIG_DEF_PPI2_ERROR 7
|
||||
#define CONFIG_DEF_SPORT0_ERROR 7
|
||||
#define CONFIG_DEF_SPORT1_ERROR 7
|
||||
#define CONFIG_DEF_SPI_ERROR 7
|
||||
#define CONFIG_DEF_UART_ERROR 7
|
||||
#define CONFIG_DEF_RESERVED_ERROR 7
|
||||
#define CONFIG_DEF_DMA1_0 8
|
||||
#define CONFIG_DEF_DMA1_1 8
|
||||
#define CONFIG_DEF_DMA1_2 8
|
||||
#define CONFIG_DEF_DMA1_3 8
|
||||
#define CONFIG_DEF_DMA1_4 8
|
||||
#define CONFIG_DEF_DMA1_5 8
|
||||
#define CONFIG_DEF_DMA1_6 8
|
||||
#define CONFIG_DEF_DMA1_7 8
|
||||
#define CONFIG_DEF_DMA1_8 8
|
||||
#define CONFIG_DEF_DMA1_9 8
|
||||
#define CONFIG_DEF_DMA1_10 8
|
||||
#define CONFIG_DEF_DMA1_11 8
|
||||
#define CONFIG_DEF_DMA2_0 9
|
||||
#define CONFIG_DEF_DMA2_1 9
|
||||
#define CONFIG_DEF_DMA2_2 9
|
||||
#define CONFIG_DEF_DMA2_3 9
|
||||
#define CONFIG_DEF_DMA2_4 9
|
||||
#define CONFIG_DEF_DMA2_5 9
|
||||
#define CONFIG_DEF_DMA2_6 9
|
||||
#define CONFIG_DEF_DMA2_7 9
|
||||
#define CONFIG_DEF_DMA2_8 9
|
||||
#define CONFIG_DEF_DMA2_9 9
|
||||
#define CONFIG_DEF_DMA2_10 9
|
||||
#define CONFIG_DEF_DMA2_11 9
|
||||
#define CONFIG_DEF_TIMER0 10
|
||||
#define CONFIG_DEF_TIMER1 10
|
||||
#define CONFIG_DEF_TIMER2 10
|
||||
#define CONFIG_DEF_TIMER3 10
|
||||
#define CONFIG_DEF_TIMER4 10
|
||||
#define CONFIG_DEF_TIMER5 10
|
||||
#define CONFIG_DEF_TIMER6 10
|
||||
#define CONFIG_DEF_TIMER7 10
|
||||
#define CONFIG_DEF_TIMER8 10
|
||||
#define CONFIG_DEF_TIMER9 10
|
||||
#define CONFIG_DEF_TIMER10 10
|
||||
#define CONFIG_DEF_TIMER11 10
|
||||
#define CONFIG_DEF_PROG0_INTA 11
|
||||
#define CONFIG_DEF_PROG0_INTB 11
|
||||
#define CONFIG_DEF_PROG1_INTA 11
|
||||
#define CONFIG_DEF_PROG1_INTB 11
|
||||
#define CONFIG_DEF_PROG2_INTA 11
|
||||
#define CONFIG_DEF_PROG2_INTB 11
|
||||
#define CONFIG_DEF_DMA1_WRRD0 8
|
||||
#define CONFIG_DEF_DMA1_WRRD1 8
|
||||
#define CONFIG_DEF_DMA2_WRRD0 9
|
||||
#define CONFIG_DEF_DMA2_WRRD1 9
|
||||
#define CONFIG_DEF_IMDMA_WRRD0 12
|
||||
#define CONFIG_DEF_IMDMA_WRRD1 12
|
||||
#define CONFIG_DEF_WATCH 13
|
||||
#define CONFIG_DEF_RESERVED_1 7
|
||||
#define CONFIG_DEF_RESERVED_2 7
|
||||
#define CONFIG_DEF_SUPPLE_0 7
|
||||
#define CONFIG_DEF_SUPPLE_1 7
|
||||
|
||||
/* IAR0 BIT FIELDS */
|
||||
#define IRQ_PLL_WAKEUP_POS 0
|
||||
#define IRQ_DMA1_ERROR_POS 4
|
||||
#define IRQ_DMA2_ERROR_POS 8
|
||||
#define IRQ_IMDMA_ERROR_POS 12
|
||||
#define IRQ_PPI0_ERROR_POS 16
|
||||
#define IRQ_PPI1_ERROR_POS 20
|
||||
#define IRQ_SPORT0_ERROR_POS 24
|
||||
#define IRQ_SPORT1_ERROR_POS 28
|
||||
/* IAR1 BIT FIELDS */
|
||||
#define IRQ_SPI_ERROR_POS 0
|
||||
#define IRQ_UART_ERROR_POS 4
|
||||
#define IRQ_RESERVED_ERROR_POS 8
|
||||
#define IRQ_DMA1_0_POS 12
|
||||
#define IRQ_DMA1_1_POS 16
|
||||
#define IRQ_DMA1_2_POS 20
|
||||
#define IRQ_DMA1_3_POS 24
|
||||
#define IRQ_DMA1_4_POS 28
|
||||
/* IAR2 BIT FIELDS */
|
||||
#define IRQ_DMA1_5_POS 0
|
||||
#define IRQ_DMA1_6_POS 4
|
||||
#define IRQ_DMA1_7_POS 8
|
||||
#define IRQ_DMA1_8_POS 12
|
||||
#define IRQ_DMA1_9_POS 16
|
||||
#define IRQ_DMA1_10_POS 20
|
||||
#define IRQ_DMA1_11_POS 24
|
||||
#define IRQ_DMA2_0_POS 28
|
||||
/* IAR3 BIT FIELDS */
|
||||
#define IRQ_DMA2_1_POS 0
|
||||
#define IRQ_DMA2_2_POS 4
|
||||
#define IRQ_DMA2_3_POS 8
|
||||
#define IRQ_DMA2_4_POS 12
|
||||
#define IRQ_DMA2_5_POS 16
|
||||
#define IRQ_DMA2_6_POS 20
|
||||
#define IRQ_DMA2_7_POS 24
|
||||
#define IRQ_DMA2_8_POS 28
|
||||
/* IAR4 BIT FIELDS */
|
||||
#define IRQ_DMA2_9_POS 0
|
||||
#define IRQ_DMA2_10_POS 4
|
||||
#define IRQ_DMA2_11_POS 8
|
||||
#define IRQ_TIMER0_POS 12
|
||||
#define IRQ_TIMER1_POS 16
|
||||
#define IRQ_TIMER2_POS 20
|
||||
#define IRQ_TIMER3_POS 24
|
||||
#define IRQ_TIMER4_POS 28
|
||||
/* IAR5 BIT FIELDS */
|
||||
#define IRQ_TIMER5_POS 0
|
||||
#define IRQ_TIMER6_POS 4
|
||||
#define IRQ_TIMER7_POS 8
|
||||
#define IRQ_TIMER8_POS 12
|
||||
#define IRQ_TIMER9_POS 16
|
||||
#define IRQ_TIMER10_POS 20
|
||||
#define IRQ_TIMER11_POS 24
|
||||
#define IRQ_PROG0_INTA_POS 28
|
||||
/* IAR6 BIT FIELDS */
|
||||
#define IRQ_PROG0_INTB_POS 0
|
||||
#define IRQ_PROG1_INTA_POS 4
|
||||
#define IRQ_PROG1_INTB_POS 8
|
||||
#define IRQ_PROG2_INTA_POS 12
|
||||
#define IRQ_PROG2_INTB_POS 16
|
||||
#define IRQ_DMA1_WRRD0_POS 20
|
||||
#define IRQ_DMA1_WRRD1_POS 24
|
||||
#define IRQ_DMA2_WRRD0_POS 28
|
||||
/* IAR7 BIT FIELDS */
|
||||
#define IRQ_DMA2_WRRD1_POS 0
|
||||
#define IRQ_IMDMA_WRRD0_POS 4
|
||||
#define IRQ_IMDMA_WRRD1_POS 8
|
||||
#define IRQ_WDTIMER_POS 12
|
||||
#define IRQ_RESERVED_1_POS 16
|
||||
#define IRQ_RESERVED_2_POS 20
|
||||
#define IRQ_SUPPLE_0_POS 24
|
||||
#define IRQ_SUPPLE_1_POS 28
|
||||
|
||||
#endif /* _BF561_IRQ_H_ */
|
||||
322
include/asm-blackfin/mach-bf561/mem_init.h
Normal file
322
include/asm-blackfin/mach-bf561/mem_init.h
Normal file
|
|
@ -0,0 +1,322 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-bf561/mem_init.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Rev:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC8M32B2B5_7)
|
||||
#if (CONFIG_SCLK_HZ > 119402985)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_7
|
||||
#define SDRAM_tRAS_num 7
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_6
|
||||
#define SDRAM_tRAS_num 6
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_5
|
||||
#define SDRAM_tRAS_num 5
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_4
|
||||
#define SDRAM_tRAS_num 4
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
|
||||
#define SDRAM_tRP TRP_2
|
||||
#define SDRAM_tRP_num 2
|
||||
#define SDRAM_tRAS TRAS_3
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_2
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_4
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_3
|
||||
#define SDRAM_tRAS_num 3
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_2
|
||||
#define SDRAM_tRAS_num 2
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#if (CONFIG_SCLK_HZ <= 29850746)
|
||||
#define SDRAM_tRP TRP_1
|
||||
#define SDRAM_tRP_num 1
|
||||
#define SDRAM_tRAS TRAS_1
|
||||
#define SDRAM_tRAS_num 1
|
||||
#define SDRAM_tRCD TRCD_1
|
||||
#define SDRAM_tWR TWR_2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC16M16A2TG_75)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_MT48LC8M32B2B5_7)
|
||||
/*SDRAM INFORMATION: */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_GENERIC_BOARD)
|
||||
/*SDRAM INFORMATION: Modify this for your board */
|
||||
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
|
||||
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
|
||||
#define SDRAM_CL CL_3
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MEM_SIZE == 128)
|
||||
#define SDRAM_SIZE EB0_SZ_128
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 64)
|
||||
#define SDRAM_SIZE EB0_SZ_64
|
||||
#endif
|
||||
#if ( CONFIG_MEM_SIZE == 32)
|
||||
#define SDRAM_SIZE EB0_SZ_32
|
||||
#endif
|
||||
#if (CONFIG_MEM_SIZE == 16)
|
||||
#define SDRAM_SIZE EB0_SZ_16
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 11)
|
||||
#define SDRAM_WIDTH EB0_CAW_11
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 10)
|
||||
#define SDRAM_WIDTH EB0_CAW_10
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 9)
|
||||
#define SDRAM_WIDTH EB0_CAW_9
|
||||
#endif
|
||||
#if (CONFIG_MEM_ADD_WIDTH == 8)
|
||||
#define SDRAM_WIDTH EB0_CAW_8
|
||||
#endif
|
||||
|
||||
#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EB0_E)
|
||||
|
||||
/* Equation from section 17 (p17-46) of BF533 HRM */
|
||||
#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
|
||||
|
||||
/* Enable SCLK Out */
|
||||
#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
|
||||
|
||||
#if defined CONFIG_CLKIN_HALF
|
||||
#define CLKIN_HALF 1
|
||||
#else
|
||||
#define CLKIN_HALF 0
|
||||
#endif
|
||||
|
||||
#if defined CONFIG_PLL_BYPASS
|
||||
#define PLL_BYPASS 1
|
||||
#else
|
||||
#define PLL_BYPASS 0
|
||||
#endif
|
||||
|
||||
/***************************************Currently Not Being Used *********************************/
|
||||
#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
|
||||
#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
|
||||
|
||||
#if (flash_EBIU_AMBCTL_TT > 3)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT == 3)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT == 2)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_TT < 2)
|
||||
#define flash_EBIU_AMBCTL0_TT B0TT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_ST > 3)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST == 3)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST == 2)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_ST < 2)
|
||||
#define flash_EBIU_AMBCTL0_ST B0ST_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_HT > 2)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 2)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 1)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_1
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_0
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
|
||||
#define flash_EBIU_AMBCTL0_HT B0HT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_WAT > 14)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_15
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 14)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_14
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 13)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_13
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 12)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_12
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 11)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_11
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 10)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_10
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 9)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_9
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 8)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_8
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 7)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_7
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 6)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_6
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 5)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_5
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 4)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 3)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 2)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_WAT == 1)
|
||||
#define flash_EBIU_AMBCTL0_WAT B0WAT_1
|
||||
#endif
|
||||
|
||||
#if (flash_EBIU_AMBCTL_RAT > 14)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_15
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 14)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_14
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 13)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_13
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 12)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_12
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 11)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_11
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 10)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_10
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 9)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_9
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 8)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_8
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 7)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_7
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 6)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_6
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 5)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_5
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 4)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_4
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 3)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_3
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 2)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_2
|
||||
#endif
|
||||
#if (flash_EBIU_AMBCTL_RAT == 1)
|
||||
#define flash_EBIU_AMBCTL0_RAT B0RAT_1
|
||||
#endif
|
||||
|
||||
#define flash_EBIU_AMBCTL0 \
|
||||
(flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
|
||||
flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
|
||||
75
include/asm-blackfin/mach-bf561/mem_map.h
Normal file
75
include/asm-blackfin/mach-bf561/mem_map.h
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Memory MAP
|
||||
* Common header file for blackfin BF561 of processors.
|
||||
*/
|
||||
|
||||
#ifndef _MEM_MAP_561_H_
|
||||
#define _MEM_MAP_561_H_
|
||||
|
||||
#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
|
||||
#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
|
||||
|
||||
/* Async Memory Banks */
|
||||
#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
|
||||
#define ASYNC_BANK3_SIZE 0x04000000 /* 64M */
|
||||
#define ASYNC_BANK2_BASE 0x28000000 /* Async Bank 2 */
|
||||
#define ASYNC_BANK2_SIZE 0x04000000 /* 64M */
|
||||
#define ASYNC_BANK1_BASE 0x24000000 /* Async Bank 1 */
|
||||
#define ASYNC_BANK1_SIZE 0x04000000 /* 64M */
|
||||
#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
|
||||
#define ASYNC_BANK0_SIZE 0x04000000 /* 64M */
|
||||
|
||||
/* Level 1 Memory */
|
||||
|
||||
#ifdef CONFIG_BLKFIN_CACHE
|
||||
#define BLKFIN_ICACHESIZE (16*1024)
|
||||
#else
|
||||
#define BLKFIN_ICACHESIZE (0*1024)
|
||||
#endif
|
||||
|
||||
/* Memory Map for ADSP-BF561 processors */
|
||||
|
||||
#ifdef CONFIG_BF561
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF800000
|
||||
#define L1_DATA_B_START 0xFF900000
|
||||
|
||||
#define L1_CODE_LENGTH 0x4000
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BLKFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (16*1024)
|
||||
#define BLKFIN_DSUPBANKS 1
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
|
||||
#define BLKFIN_DCACHESIZE (32*1024)
|
||||
#define BLKFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x8000
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BLKFIN_DCACHESIZE (0*1024)
|
||||
#define BLKFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BLKFIN_DCACHE*/
|
||||
#endif
|
||||
|
||||
/* Level 2 Memory */
|
||||
#define L2_START 0xFEB00000
|
||||
#define L2_LENGTH 0x20000
|
||||
|
||||
/* Scratch Pad Memory */
|
||||
|
||||
#if defined(CONFIG_BF561)
|
||||
#define L1_SCRATCH_START 0xFFB00000
|
||||
#define L1_SCRATCH_LENGTH 0x1000
|
||||
#endif
|
||||
|
||||
#endif /* _MEM_MAP_533_H_ */
|
||||
471
include/asm-blackfin/mach-common/cdef_LPBlackfin.h
Normal file
471
include/asm-blackfin/mach-common/cdef_LPBlackfin.h
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-common/cdef_LPBlackfin.h
|
||||
* Based on:
|
||||
* Author: unknown
|
||||
* COPYRIGHT 2005 Analog Devices
|
||||
* Created: ?
|
||||
* Description:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _CDEF_LPBLACKFIN_H
|
||||
#define _CDEF_LPBLACKFIN_H
|
||||
|
||||
/*#if !defined(__ADSPLPBLACKFIN__)
|
||||
#warning cdef_LPBlackfin.h should only be included for 532 compatible chips.
|
||||
#endif
|
||||
*/
|
||||
#include <asm/mach-common/def_LPBlackfin.h>
|
||||
|
||||
/*Cache & SRAM Memory*/
|
||||
#define pSRAM_BASE_ADDRESS ((volatile void **)SRAM_BASE_ADDRESS)
|
||||
#define bfin_read_SRAM_BASE_ADDRESS() bfin_read32(SRAM_BASE_ADDRESS)
|
||||
#define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val)
|
||||
#define pDMEM_CONTROL ((volatile unsigned long *)DMEM_CONTROL)
|
||||
#define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL)
|
||||
#define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val)
|
||||
#define pDCPLB_STATUS ((volatile unsigned long *)DCPLB_STATUS)
|
||||
#define bfin_read_DCPLB_STATUS() bfin_read32(DCPLB_STATUS)
|
||||
#define bfin_write_DCPLB_STATUS(val) bfin_write32(DCPLB_STATUS,val)
|
||||
#define pDCPLB_FAULT_ADDR ((volatile void **)DCPLB_FAULT_ADDR)
|
||||
#define bfin_read_DCPLB_FAULT_ADDR() bfin_read32(DCPLB_FAULT_ADDR)
|
||||
#define bfin_write_DCPLB_FAULT_ADDR(val) bfin_write32(DCPLB_FAULT_ADDR,val)
|
||||
/*
|
||||
#define MMR_TIMEOUT 0xFFE00010
|
||||
*/
|
||||
#define pDCPLB_ADDR0 ((volatile void **)DCPLB_ADDR0)
|
||||
#define bfin_read_DCPLB_ADDR0() bfin_read32(DCPLB_ADDR0)
|
||||
#define bfin_write_DCPLB_ADDR0(val) bfin_write32(DCPLB_ADDR0,val)
|
||||
#define pDCPLB_ADDR1 ((volatile void **)DCPLB_ADDR1)
|
||||
#define bfin_read_DCPLB_ADDR1() bfin_read32(DCPLB_ADDR1)
|
||||
#define bfin_write_DCPLB_ADDR1(val) bfin_write32(DCPLB_ADDR1,val)
|
||||
#define pDCPLB_ADDR2 ((volatile void **)DCPLB_ADDR2)
|
||||
#define bfin_read_DCPLB_ADDR2() bfin_read32(DCPLB_ADDR2)
|
||||
#define bfin_write_DCPLB_ADDR2(val) bfin_write32(DCPLB_ADDR2,val)
|
||||
#define pDCPLB_ADDR3 ((volatile void **)DCPLB_ADDR3)
|
||||
#define bfin_read_DCPLB_ADDR3() bfin_read32(DCPLB_ADDR3)
|
||||
#define bfin_write_DCPLB_ADDR3(val) bfin_write32(DCPLB_ADDR3,val)
|
||||
#define pDCPLB_ADDR4 ((volatile void **)DCPLB_ADDR4)
|
||||
#define bfin_read_DCPLB_ADDR4() bfin_read32(DCPLB_ADDR4)
|
||||
#define bfin_write_DCPLB_ADDR4(val) bfin_write32(DCPLB_ADDR4,val)
|
||||
#define pDCPLB_ADDR5 ((volatile void **)DCPLB_ADDR5)
|
||||
#define bfin_read_DCPLB_ADDR5() bfin_read32(DCPLB_ADDR5)
|
||||
#define bfin_write_DCPLB_ADDR5(val) bfin_write32(DCPLB_ADDR5,val)
|
||||
#define pDCPLB_ADDR6 ((volatile void **)DCPLB_ADDR6)
|
||||
#define bfin_read_DCPLB_ADDR6() bfin_read32(DCPLB_ADDR6)
|
||||
#define bfin_write_DCPLB_ADDR6(val) bfin_write32(DCPLB_ADDR6,val)
|
||||
#define pDCPLB_ADDR7 ((volatile void **)DCPLB_ADDR7)
|
||||
#define bfin_read_DCPLB_ADDR7() bfin_read32(DCPLB_ADDR7)
|
||||
#define bfin_write_DCPLB_ADDR7(val) bfin_write32(DCPLB_ADDR7,val)
|
||||
#define pDCPLB_ADDR8 ((volatile void **)DCPLB_ADDR8)
|
||||
#define bfin_read_DCPLB_ADDR8() bfin_read32(DCPLB_ADDR8)
|
||||
#define bfin_write_DCPLB_ADDR8(val) bfin_write32(DCPLB_ADDR8,val)
|
||||
#define pDCPLB_ADDR9 ((volatile void **)DCPLB_ADDR9)
|
||||
#define bfin_read_DCPLB_ADDR9() bfin_read32(DCPLB_ADDR9)
|
||||
#define bfin_write_DCPLB_ADDR9(val) bfin_write32(DCPLB_ADDR9,val)
|
||||
#define pDCPLB_ADDR10 ((volatile void **)DCPLB_ADDR10)
|
||||
#define bfin_read_DCPLB_ADDR10() bfin_read32(DCPLB_ADDR10)
|
||||
#define bfin_write_DCPLB_ADDR10(val) bfin_write32(DCPLB_ADDR10,val)
|
||||
#define pDCPLB_ADDR11 ((volatile void **)DCPLB_ADDR11)
|
||||
#define bfin_read_DCPLB_ADDR11() bfin_read32(DCPLB_ADDR11)
|
||||
#define bfin_write_DCPLB_ADDR11(val) bfin_write32(DCPLB_ADDR11,val)
|
||||
#define pDCPLB_ADDR12 ((volatile void **)DCPLB_ADDR12)
|
||||
#define bfin_read_DCPLB_ADDR12() bfin_read32(DCPLB_ADDR12)
|
||||
#define bfin_write_DCPLB_ADDR12(val) bfin_write32(DCPLB_ADDR12,val)
|
||||
#define pDCPLB_ADDR13 ((volatile void **)DCPLB_ADDR13)
|
||||
#define bfin_read_DCPLB_ADDR13() bfin_read32(DCPLB_ADDR13)
|
||||
#define bfin_write_DCPLB_ADDR13(val) bfin_write32(DCPLB_ADDR13,val)
|
||||
#define pDCPLB_ADDR14 ((volatile void **)DCPLB_ADDR14)
|
||||
#define bfin_read_DCPLB_ADDR14() bfin_read32(DCPLB_ADDR14)
|
||||
#define bfin_write_DCPLB_ADDR14(val) bfin_write32(DCPLB_ADDR14,val)
|
||||
#define pDCPLB_ADDR15 ((volatile void **)DCPLB_ADDR15)
|
||||
#define bfin_read_DCPLB_ADDR15() bfin_read32(DCPLB_ADDR15)
|
||||
#define bfin_write_DCPLB_ADDR15(val) bfin_write32(DCPLB_ADDR15,val)
|
||||
#define pDCPLB_DATA0 ((volatile unsigned long *)DCPLB_DATA0)
|
||||
#define bfin_read_DCPLB_DATA0() bfin_read32(DCPLB_DATA0)
|
||||
#define bfin_write_DCPLB_DATA0(val) bfin_write32(DCPLB_DATA0,val)
|
||||
#define pDCPLB_DATA1 ((volatile unsigned long *)DCPLB_DATA1)
|
||||
#define bfin_read_DCPLB_DATA1() bfin_read32(DCPLB_DATA1)
|
||||
#define bfin_write_DCPLB_DATA1(val) bfin_write32(DCPLB_DATA1,val)
|
||||
#define pDCPLB_DATA2 ((volatile unsigned long *)DCPLB_DATA2)
|
||||
#define bfin_read_DCPLB_DATA2() bfin_read32(DCPLB_DATA2)
|
||||
#define bfin_write_DCPLB_DATA2(val) bfin_write32(DCPLB_DATA2,val)
|
||||
#define pDCPLB_DATA3 ((volatile unsigned long *)DCPLB_DATA3)
|
||||
#define bfin_read_DCPLB_DATA3() bfin_read32(DCPLB_DATA3)
|
||||
#define bfin_write_DCPLB_DATA3(val) bfin_write32(DCPLB_DATA3,val)
|
||||
#define pDCPLB_DATA4 ((volatile unsigned long *)DCPLB_DATA4)
|
||||
#define bfin_read_DCPLB_DATA4() bfin_read32(DCPLB_DATA4)
|
||||
#define bfin_write_DCPLB_DATA4(val) bfin_write32(DCPLB_DATA4,val)
|
||||
#define pDCPLB_DATA5 ((volatile unsigned long *)DCPLB_DATA5)
|
||||
#define bfin_read_DCPLB_DATA5() bfin_read32(DCPLB_DATA5)
|
||||
#define bfin_write_DCPLB_DATA5(val) bfin_write32(DCPLB_DATA5,val)
|
||||
#define pDCPLB_DATA6 ((volatile unsigned long *)DCPLB_DATA6)
|
||||
#define bfin_read_DCPLB_DATA6() bfin_read32(DCPLB_DATA6)
|
||||
#define bfin_write_DCPLB_DATA6(val) bfin_write32(DCPLB_DATA6,val)
|
||||
#define pDCPLB_DATA7 ((volatile unsigned long *)DCPLB_DATA7)
|
||||
#define bfin_read_DCPLB_DATA7() bfin_read32(DCPLB_DATA7)
|
||||
#define bfin_write_DCPLB_DATA7(val) bfin_write32(DCPLB_DATA7,val)
|
||||
#define pDCPLB_DATA8 ((volatile unsigned long *)DCPLB_DATA8)
|
||||
#define bfin_read_DCPLB_DATA8() bfin_read32(DCPLB_DATA8)
|
||||
#define bfin_write_DCPLB_DATA8(val) bfin_write32(DCPLB_DATA8,val)
|
||||
#define pDCPLB_DATA9 ((volatile unsigned long *)DCPLB_DATA9)
|
||||
#define bfin_read_DCPLB_DATA9() bfin_read32(DCPLB_DATA9)
|
||||
#define bfin_write_DCPLB_DATA9(val) bfin_write32(DCPLB_DATA9,val)
|
||||
#define pDCPLB_DATA10 ((volatile unsigned long *)DCPLB_DATA10)
|
||||
#define bfin_read_DCPLB_DATA10() bfin_read32(DCPLB_DATA10)
|
||||
#define bfin_write_DCPLB_DATA10(val) bfin_write32(DCPLB_DATA10,val)
|
||||
#define pDCPLB_DATA11 ((volatile unsigned long *)DCPLB_DATA11)
|
||||
#define bfin_read_DCPLB_DATA11() bfin_read32(DCPLB_DATA11)
|
||||
#define bfin_write_DCPLB_DATA11(val) bfin_write32(DCPLB_DATA11,val)
|
||||
#define pDCPLB_DATA12 ((volatile unsigned long *)DCPLB_DATA12)
|
||||
#define bfin_read_DCPLB_DATA12() bfin_read32(DCPLB_DATA12)
|
||||
#define bfin_write_DCPLB_DATA12(val) bfin_write32(DCPLB_DATA12,val)
|
||||
#define pDCPLB_DATA13 ((volatile unsigned long *)DCPLB_DATA13)
|
||||
#define bfin_read_DCPLB_DATA13() bfin_read32(DCPLB_DATA13)
|
||||
#define bfin_write_DCPLB_DATA13(val) bfin_write32(DCPLB_DATA13,val)
|
||||
#define pDCPLB_DATA14 ((volatile unsigned long *)DCPLB_DATA14)
|
||||
#define bfin_read_DCPLB_DATA14() bfin_read32(DCPLB_DATA14)
|
||||
#define bfin_write_DCPLB_DATA14(val) bfin_write32(DCPLB_DATA14,val)
|
||||
#define pDCPLB_DATA15 ((volatile unsigned long *)DCPLB_DATA15)
|
||||
#define bfin_read_DCPLB_DATA15() bfin_read32(DCPLB_DATA15)
|
||||
#define bfin_write_DCPLB_DATA15(val) bfin_write32(DCPLB_DATA15,val)
|
||||
#define pDTEST_COMMAND ((volatile unsigned long *)DTEST_COMMAND)
|
||||
#define bfin_read_DTEST_COMMAND() bfin_read32(DTEST_COMMAND)
|
||||
#define bfin_write_DTEST_COMMAND(val) bfin_write32(DTEST_COMMAND,val)
|
||||
/*
|
||||
#define DTEST_INDEX 0xFFE00304
|
||||
*/
|
||||
#define pDTEST_DATA0 ((volatile unsigned long *)DTEST_DATA0)
|
||||
#define bfin_read_DTEST_DATA0() bfin_read32(DTEST_DATA0)
|
||||
#define bfin_write_DTEST_DATA0(val) bfin_write32(DTEST_DATA0,val)
|
||||
#define pDTEST_DATA1 ((volatile unsigned long *)DTEST_DATA1)
|
||||
#define bfin_read_DTEST_DATA1() bfin_read32(DTEST_DATA1)
|
||||
#define bfin_write_DTEST_DATA1(val) bfin_write32(DTEST_DATA1,val)
|
||||
/*
|
||||
#define DTEST_DATA2 0xFFE00408
|
||||
#define DTEST_DATA3 0xFFE0040C
|
||||
*/
|
||||
#define pIMEM_CONTROL ((volatile unsigned long *)IMEM_CONTROL)
|
||||
#define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL)
|
||||
#define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val)
|
||||
#define pICPLB_STATUS ((volatile unsigned long *)ICPLB_STATUS)
|
||||
#define bfin_read_ICPLB_STATUS() bfin_read32(ICPLB_STATUS)
|
||||
#define bfin_write_ICPLB_STATUS(val) bfin_write32(ICPLB_STATUS,val)
|
||||
#define pICPLB_FAULT_ADDR ((volatile void **)ICPLB_FAULT_ADDR)
|
||||
#define bfin_read_ICPLB_FAULT_ADDR() bfin_read32(ICPLB_FAULT_ADDR)
|
||||
#define bfin_write_ICPLB_FAULT_ADDR(val) bfin_write32(ICPLB_FAULT_ADDR,val)
|
||||
#define pICPLB_ADDR0 ((volatile void **)ICPLB_ADDR0)
|
||||
#define bfin_read_ICPLB_ADDR0() bfin_read32(ICPLB_ADDR0)
|
||||
#define bfin_write_ICPLB_ADDR0(val) bfin_write32(ICPLB_ADDR0,val)
|
||||
#define pICPLB_ADDR1 ((volatile void **)ICPLB_ADDR1)
|
||||
#define bfin_read_ICPLB_ADDR1() bfin_read32(ICPLB_ADDR1)
|
||||
#define bfin_write_ICPLB_ADDR1(val) bfin_write32(ICPLB_ADDR1,val)
|
||||
#define pICPLB_ADDR2 ((volatile void **)ICPLB_ADDR2)
|
||||
#define bfin_read_ICPLB_ADDR2() bfin_read32(ICPLB_ADDR2)
|
||||
#define bfin_write_ICPLB_ADDR2(val) bfin_write32(ICPLB_ADDR2,val)
|
||||
#define pICPLB_ADDR3 ((volatile void **)ICPLB_ADDR3)
|
||||
#define bfin_read_ICPLB_ADDR3() bfin_read32(ICPLB_ADDR3)
|
||||
#define bfin_write_ICPLB_ADDR3(val) bfin_write32(ICPLB_ADDR3,val)
|
||||
#define pICPLB_ADDR4 ((volatile void **)ICPLB_ADDR4)
|
||||
#define bfin_read_ICPLB_ADDR4() bfin_read32(ICPLB_ADDR4)
|
||||
#define bfin_write_ICPLB_ADDR4(val) bfin_write32(ICPLB_ADDR4,val)
|
||||
#define pICPLB_ADDR5 ((volatile void **)ICPLB_ADDR5)
|
||||
#define bfin_read_ICPLB_ADDR5() bfin_read32(ICPLB_ADDR5)
|
||||
#define bfin_write_ICPLB_ADDR5(val) bfin_write32(ICPLB_ADDR5,val)
|
||||
#define pICPLB_ADDR6 ((volatile void **)ICPLB_ADDR6)
|
||||
#define bfin_read_ICPLB_ADDR6() bfin_read32(ICPLB_ADDR6)
|
||||
#define bfin_write_ICPLB_ADDR6(val) bfin_write32(ICPLB_ADDR6,val)
|
||||
#define pICPLB_ADDR7 ((volatile void **)ICPLB_ADDR7)
|
||||
#define bfin_read_ICPLB_ADDR7() bfin_read32(ICPLB_ADDR7)
|
||||
#define bfin_write_ICPLB_ADDR7(val) bfin_write32(ICPLB_ADDR7,val)
|
||||
#define pICPLB_ADDR8 ((volatile void **)ICPLB_ADDR8)
|
||||
#define bfin_read_ICPLB_ADDR8() bfin_read32(ICPLB_ADDR8)
|
||||
#define bfin_write_ICPLB_ADDR8(val) bfin_write32(ICPLB_ADDR8,val)
|
||||
#define pICPLB_ADDR9 ((volatile void **)ICPLB_ADDR9)
|
||||
#define bfin_read_ICPLB_ADDR9() bfin_read32(ICPLB_ADDR9)
|
||||
#define bfin_write_ICPLB_ADDR9(val) bfin_write32(ICPLB_ADDR9,val)
|
||||
#define pICPLB_ADDR10 ((volatile void **)ICPLB_ADDR10)
|
||||
#define bfin_read_ICPLB_ADDR10() bfin_read32(ICPLB_ADDR10)
|
||||
#define bfin_write_ICPLB_ADDR10(val) bfin_write32(ICPLB_ADDR10,val)
|
||||
#define pICPLB_ADDR11 ((volatile void **)ICPLB_ADDR11)
|
||||
#define bfin_read_ICPLB_ADDR11() bfin_read32(ICPLB_ADDR11)
|
||||
#define bfin_write_ICPLB_ADDR11(val) bfin_write32(ICPLB_ADDR11,val)
|
||||
#define pICPLB_ADDR12 ((volatile void **)ICPLB_ADDR12)
|
||||
#define bfin_read_ICPLB_ADDR12() bfin_read32(ICPLB_ADDR12)
|
||||
#define bfin_write_ICPLB_ADDR12(val) bfin_write32(ICPLB_ADDR12,val)
|
||||
#define pICPLB_ADDR13 ((volatile void **)ICPLB_ADDR13)
|
||||
#define bfin_read_ICPLB_ADDR13() bfin_read32(ICPLB_ADDR13)
|
||||
#define bfin_write_ICPLB_ADDR13(val) bfin_write32(ICPLB_ADDR13,val)
|
||||
#define pICPLB_ADDR14 ((volatile void **)ICPLB_ADDR14)
|
||||
#define bfin_read_ICPLB_ADDR14() bfin_read32(ICPLB_ADDR14)
|
||||
#define bfin_write_ICPLB_ADDR14(val) bfin_write32(ICPLB_ADDR14,val)
|
||||
#define pICPLB_ADDR15 ((volatile void **)ICPLB_ADDR15)
|
||||
#define bfin_read_ICPLB_ADDR15() bfin_read32(ICPLB_ADDR15)
|
||||
#define bfin_write_ICPLB_ADDR15(val) bfin_write32(ICPLB_ADDR15,val)
|
||||
#define pICPLB_DATA0 ((volatile unsigned long *)ICPLB_DATA0)
|
||||
#define bfin_read_ICPLB_DATA0() bfin_read32(ICPLB_DATA0)
|
||||
#define bfin_write_ICPLB_DATA0(val) bfin_write32(ICPLB_DATA0,val)
|
||||
#define pICPLB_DATA1 ((volatile unsigned long *)ICPLB_DATA1)
|
||||
#define bfin_read_ICPLB_DATA1() bfin_read32(ICPLB_DATA1)
|
||||
#define bfin_write_ICPLB_DATA1(val) bfin_write32(ICPLB_DATA1,val)
|
||||
#define pICPLB_DATA2 ((volatile unsigned long *)ICPLB_DATA2)
|
||||
#define bfin_read_ICPLB_DATA2() bfin_read32(ICPLB_DATA2)
|
||||
#define bfin_write_ICPLB_DATA2(val) bfin_write32(ICPLB_DATA2,val)
|
||||
#define pICPLB_DATA3 ((volatile unsigned long *)ICPLB_DATA3)
|
||||
#define bfin_read_ICPLB_DATA3() bfin_read32(ICPLB_DATA3)
|
||||
#define bfin_write_ICPLB_DATA3(val) bfin_write32(ICPLB_DATA3,val)
|
||||
#define pICPLB_DATA4 ((volatile unsigned long *)ICPLB_DATA4)
|
||||
#define bfin_read_ICPLB_DATA4() bfin_read32(ICPLB_DATA4)
|
||||
#define bfin_write_ICPLB_DATA4(val) bfin_write32(ICPLB_DATA4,val)
|
||||
#define pICPLB_DATA5 ((volatile unsigned long *)ICPLB_DATA5)
|
||||
#define bfin_read_ICPLB_DATA5() bfin_read32(ICPLB_DATA5)
|
||||
#define bfin_write_ICPLB_DATA5(val) bfin_write32(ICPLB_DATA5,val)
|
||||
#define pICPLB_DATA6 ((volatile unsigned long *)ICPLB_DATA6)
|
||||
#define bfin_read_ICPLB_DATA6() bfin_read32(ICPLB_DATA6)
|
||||
#define bfin_write_ICPLB_DATA6(val) bfin_write32(ICPLB_DATA6,val)
|
||||
#define pICPLB_DATA7 ((volatile unsigned long *)ICPLB_DATA7)
|
||||
#define bfin_read_ICPLB_DATA7() bfin_read32(ICPLB_DATA7)
|
||||
#define bfin_write_ICPLB_DATA7(val) bfin_write32(ICPLB_DATA7,val)
|
||||
#define pICPLB_DATA8 ((volatile unsigned long *)ICPLB_DATA8)
|
||||
#define bfin_read_ICPLB_DATA8() bfin_read32(ICPLB_DATA8)
|
||||
#define bfin_write_ICPLB_DATA8(val) bfin_write32(ICPLB_DATA8,val)
|
||||
#define pICPLB_DATA9 ((volatile unsigned long *)ICPLB_DATA9)
|
||||
#define bfin_read_ICPLB_DATA9() bfin_read32(ICPLB_DATA9)
|
||||
#define bfin_write_ICPLB_DATA9(val) bfin_write32(ICPLB_DATA9,val)
|
||||
#define pICPLB_DATA10 ((volatile unsigned long *)ICPLB_DATA10)
|
||||
#define bfin_read_ICPLB_DATA10() bfin_read32(ICPLB_DATA10)
|
||||
#define bfin_write_ICPLB_DATA10(val) bfin_write32(ICPLB_DATA10,val)
|
||||
#define pICPLB_DATA11 ((volatile unsigned long *)ICPLB_DATA11)
|
||||
#define bfin_read_ICPLB_DATA11() bfin_read32(ICPLB_DATA11)
|
||||
#define bfin_write_ICPLB_DATA11(val) bfin_write32(ICPLB_DATA11,val)
|
||||
#define pICPLB_DATA12 ((volatile unsigned long *)ICPLB_DATA12)
|
||||
#define bfin_read_ICPLB_DATA12() bfin_read32(ICPLB_DATA12)
|
||||
#define bfin_write_ICPLB_DATA12(val) bfin_write32(ICPLB_DATA12,val)
|
||||
#define pICPLB_DATA13 ((volatile unsigned long *)ICPLB_DATA13)
|
||||
#define bfin_read_ICPLB_DATA13() bfin_read32(ICPLB_DATA13)
|
||||
#define bfin_write_ICPLB_DATA13(val) bfin_write32(ICPLB_DATA13,val)
|
||||
#define pICPLB_DATA14 ((volatile unsigned long *)ICPLB_DATA14)
|
||||
#define bfin_read_ICPLB_DATA14() bfin_read32(ICPLB_DATA14)
|
||||
#define bfin_write_ICPLB_DATA14(val) bfin_write32(ICPLB_DATA14,val)
|
||||
#define pICPLB_DATA15 ((volatile unsigned long *)ICPLB_DATA15)
|
||||
#define bfin_read_ICPLB_DATA15() bfin_read32(ICPLB_DATA15)
|
||||
#define bfin_write_ICPLB_DATA15(val) bfin_write32(ICPLB_DATA15,val)
|
||||
#define pITEST_COMMAND ((volatile unsigned long *)ITEST_COMMAND)
|
||||
#define bfin_read_ITEST_COMMAND() bfin_read32(ITEST_COMMAND)
|
||||
#define bfin_write_ITEST_COMMAND(val) bfin_write32(ITEST_COMMAND,val)
|
||||
#if 0
|
||||
#define ITEST_INDEX 0xFFE01304 /* Instruction Test Index Register */
|
||||
#endif
|
||||
#define pITEST_DATA0 ((volatile unsigned long *)ITEST_DATA0)
|
||||
#define bfin_read_ITEST_DATA0() bfin_read32(ITEST_DATA0)
|
||||
#define bfin_write_ITEST_DATA0(val) bfin_write32(ITEST_DATA0,val)
|
||||
#define pITEST_DATA1 ((volatile unsigned long *)ITEST_DATA1)
|
||||
#define bfin_read_ITEST_DATA1() bfin_read32(ITEST_DATA1)
|
||||
#define bfin_write_ITEST_DATA1(val) bfin_write32(ITEST_DATA1,val)
|
||||
|
||||
/* Event/Interrupt Registers*/
|
||||
|
||||
#define pEVT0 ((volatile void **)EVT0)
|
||||
#define bfin_read_EVT0() bfin_read32(EVT0)
|
||||
#define bfin_write_EVT0(val) bfin_write32(EVT0,val)
|
||||
#define pEVT1 ((volatile void **)EVT1)
|
||||
#define bfin_read_EVT1() bfin_read32(EVT1)
|
||||
#define bfin_write_EVT1(val) bfin_write32(EVT1,val)
|
||||
#define pEVT2 ((volatile void **)EVT2)
|
||||
#define bfin_read_EVT2() bfin_read32(EVT2)
|
||||
#define bfin_write_EVT2(val) bfin_write32(EVT2,val)
|
||||
#define pEVT3 ((volatile void **)EVT3)
|
||||
#define bfin_read_EVT3() bfin_read32(EVT3)
|
||||
#define bfin_write_EVT3(val) bfin_write32(EVT3,val)
|
||||
#define pEVT4 ((volatile void **)EVT4)
|
||||
#define bfin_read_EVT4() bfin_read32(EVT4)
|
||||
#define bfin_write_EVT4(val) bfin_write32(EVT4,val)
|
||||
#define pEVT5 ((volatile void **)EVT5)
|
||||
#define bfin_read_EVT5() bfin_read32(EVT5)
|
||||
#define bfin_write_EVT5(val) bfin_write32(EVT5,val)
|
||||
#define pEVT6 ((volatile void **)EVT6)
|
||||
#define bfin_read_EVT6() bfin_read32(EVT6)
|
||||
#define bfin_write_EVT6(val) bfin_write32(EVT6,val)
|
||||
#define pEVT7 ((volatile void **)EVT7)
|
||||
#define bfin_read_EVT7() bfin_read32(EVT7)
|
||||
#define bfin_write_EVT7(val) bfin_write32(EVT7,val)
|
||||
#define pEVT8 ((volatile void **)EVT8)
|
||||
#define bfin_read_EVT8() bfin_read32(EVT8)
|
||||
#define bfin_write_EVT8(val) bfin_write32(EVT8,val)
|
||||
#define pEVT9 ((volatile void **)EVT9)
|
||||
#define bfin_read_EVT9() bfin_read32(EVT9)
|
||||
#define bfin_write_EVT9(val) bfin_write32(EVT9,val)
|
||||
#define pEVT10 ((volatile void **)EVT10)
|
||||
#define bfin_read_EVT10() bfin_read32(EVT10)
|
||||
#define bfin_write_EVT10(val) bfin_write32(EVT10,val)
|
||||
#define pEVT11 ((volatile void **)EVT11)
|
||||
#define bfin_read_EVT11() bfin_read32(EVT11)
|
||||
#define bfin_write_EVT11(val) bfin_write32(EVT11,val)
|
||||
#define pEVT12 ((volatile void **)EVT12)
|
||||
#define bfin_read_EVT12() bfin_read32(EVT12)
|
||||
#define bfin_write_EVT12(val) bfin_write32(EVT12,val)
|
||||
#define pEVT13 ((volatile void **)EVT13)
|
||||
#define bfin_read_EVT13() bfin_read32(EVT13)
|
||||
#define bfin_write_EVT13(val) bfin_write32(EVT13,val)
|
||||
#define pEVT14 ((volatile void **)EVT14)
|
||||
#define bfin_read_EVT14() bfin_read32(EVT14)
|
||||
#define bfin_write_EVT14(val) bfin_write32(EVT14,val)
|
||||
#define pEVT15 ((volatile void **)EVT15)
|
||||
#define bfin_read_EVT15() bfin_read32(EVT15)
|
||||
#define bfin_write_EVT15(val) bfin_write32(EVT15,val)
|
||||
#define pIMASK ((volatile unsigned long *)IMASK)
|
||||
#define bfin_read_IMASK() bfin_read32(IMASK)
|
||||
#define bfin_write_IMASK(val) bfin_write32(IMASK,val)
|
||||
#define pIPEND ((volatile unsigned long *)IPEND)
|
||||
#define bfin_read_IPEND() bfin_read32(IPEND)
|
||||
#define bfin_write_IPEND(val) bfin_write32(IPEND,val)
|
||||
#define pILAT ((volatile unsigned long *)ILAT)
|
||||
#define bfin_read_ILAT() bfin_read32(ILAT)
|
||||
#define bfin_write_ILAT(val) bfin_write32(ILAT,val)
|
||||
|
||||
/*Core Timer Registers*/
|
||||
#define pTCNTL ((volatile unsigned long *)TCNTL)
|
||||
#define bfin_read_TCNTL() bfin_read32(TCNTL)
|
||||
#define bfin_write_TCNTL(val) bfin_write32(TCNTL,val)
|
||||
#define pTPERIOD ((volatile unsigned long *)TPERIOD)
|
||||
#define bfin_read_TPERIOD() bfin_read32(TPERIOD)
|
||||
#define bfin_write_TPERIOD(val) bfin_write32(TPERIOD,val)
|
||||
#define pTSCALE ((volatile unsigned long *)TSCALE)
|
||||
#define bfin_read_TSCALE() bfin_read32(TSCALE)
|
||||
#define bfin_write_TSCALE(val) bfin_write32(TSCALE,val)
|
||||
#define pTCOUNT ((volatile unsigned long *)TCOUNT)
|
||||
#define bfin_read_TCOUNT() bfin_read32(TCOUNT)
|
||||
#define bfin_write_TCOUNT(val) bfin_write32(TCOUNT,val)
|
||||
|
||||
/*Debug/MP/Emulation Registers*/
|
||||
#define pDSPID ((volatile unsigned long *)DSPID)
|
||||
#define bfin_read_DSPID() bfin_read32(DSPID)
|
||||
#define bfin_write_DSPID(val) bfin_write32(DSPID,val)
|
||||
#define pDBGCTL ((volatile unsigned long *)DBGCTL)
|
||||
#define bfin_read_DBGCTL() bfin_read32(DBGCTL)
|
||||
#define bfin_write_DBGCTL(val) bfin_write32(DBGCTL,val)
|
||||
#define pDBGSTAT ((volatile unsigned long *)DBGSTAT)
|
||||
#define bfin_read_DBGSTAT() bfin_read32(DBGSTAT)
|
||||
#define bfin_write_DBGSTAT(val) bfin_write32(DBGSTAT,val)
|
||||
#define pEMUDAT ((volatile unsigned long *)EMUDAT)
|
||||
#define bfin_read_EMUDAT() bfin_read32(EMUDAT)
|
||||
#define bfin_write_EMUDAT(val) bfin_write32(EMUDAT,val)
|
||||
|
||||
/*Trace Buffer Registers*/
|
||||
#define pTBUFCTL ((volatile unsigned long *)TBUFCTL)
|
||||
#define bfin_read_TBUFCTL() bfin_read32(TBUFCTL)
|
||||
#define bfin_write_TBUFCTL(val) bfin_write32(TBUFCTL,val)
|
||||
#define pTBUFSTAT ((volatile unsigned long *)TBUFSTAT)
|
||||
#define bfin_read_TBUFSTAT() bfin_read32(TBUFSTAT)
|
||||
#define bfin_write_TBUFSTAT(val) bfin_write32(TBUFSTAT,val)
|
||||
#define pTBUF ((volatile void **)TBUF)
|
||||
#define bfin_read_TBUF() bfin_read32(TBUF)
|
||||
#define bfin_write_TBUF(val) bfin_write32(TBUF,val)
|
||||
|
||||
/*Watch Point Control Registers*/
|
||||
#define pWPIACTL ((volatile unsigned long *)WPIACTL)
|
||||
#define bfin_read_WPIACTL() bfin_read32(WPIACTL)
|
||||
#define bfin_write_WPIACTL(val) bfin_write32(WPIACTL,val)
|
||||
#define pWPIA0 ((volatile void **)WPIA0)
|
||||
#define bfin_read_WPIA0() bfin_read32(WPIA0)
|
||||
#define bfin_write_WPIA0(val) bfin_write32(WPIA0,val)
|
||||
#define pWPIA1 ((volatile void **)WPIA1)
|
||||
#define bfin_read_WPIA1() bfin_read32(WPIA1)
|
||||
#define bfin_write_WPIA1(val) bfin_write32(WPIA1,val)
|
||||
#define pWPIA2 ((volatile void **)WPIA2)
|
||||
#define bfin_read_WPIA2() bfin_read32(WPIA2)
|
||||
#define bfin_write_WPIA2(val) bfin_write32(WPIA2,val)
|
||||
#define pWPIA3 ((volatile void **)WPIA3)
|
||||
#define bfin_read_WPIA3() bfin_read32(WPIA3)
|
||||
#define bfin_write_WPIA3(val) bfin_write32(WPIA3,val)
|
||||
#define pWPIA4 ((volatile void **)WPIA4)
|
||||
#define bfin_read_WPIA4() bfin_read32(WPIA4)
|
||||
#define bfin_write_WPIA4(val) bfin_write32(WPIA4,val)
|
||||
#define pWPIA5 ((volatile void **)WPIA5)
|
||||
#define bfin_read_WPIA5() bfin_read32(WPIA5)
|
||||
#define bfin_write_WPIA5(val) bfin_write32(WPIA5,val)
|
||||
#define pWPIACNT0 ((volatile unsigned long *)WPIACNT0)
|
||||
#define bfin_read_WPIACNT0() bfin_read32(WPIACNT0)
|
||||
#define bfin_write_WPIACNT0(val) bfin_write32(WPIACNT0,val)
|
||||
#define pWPIACNT1 ((volatile unsigned long *)WPIACNT1)
|
||||
#define bfin_read_WPIACNT1() bfin_read32(WPIACNT1)
|
||||
#define bfin_write_WPIACNT1(val) bfin_write32(WPIACNT1,val)
|
||||
#define pWPIACNT2 ((volatile unsigned long *)WPIACNT2)
|
||||
#define bfin_read_WPIACNT2() bfin_read32(WPIACNT2)
|
||||
#define bfin_write_WPIACNT2(val) bfin_write32(WPIACNT2,val)
|
||||
#define pWPIACNT3 ((volatile unsigned long *)WPIACNT3)
|
||||
#define bfin_read_WPIACNT3() bfin_read32(WPIACNT3)
|
||||
#define bfin_write_WPIACNT3(val) bfin_write32(WPIACNT3,val)
|
||||
#define pWPIACNT4 ((volatile unsigned long *)WPIACNT4)
|
||||
#define bfin_read_WPIACNT4() bfin_read32(WPIACNT4)
|
||||
#define bfin_write_WPIACNT4(val) bfin_write32(WPIACNT4,val)
|
||||
#define pWPIACNT5 ((volatile unsigned long *)WPIACNT5)
|
||||
#define bfin_read_WPIACNT5() bfin_read32(WPIACNT5)
|
||||
#define bfin_write_WPIACNT5(val) bfin_write32(WPIACNT5,val)
|
||||
#define pWPDACTL ((volatile unsigned long *)WPDACTL)
|
||||
#define bfin_read_WPDACTL() bfin_read32(WPDACTL)
|
||||
#define bfin_write_WPDACTL(val) bfin_write32(WPDACTL,val)
|
||||
#define pWPDA0 ((volatile void **)WPDA0)
|
||||
#define bfin_read_WPDA0() bfin_read32(WPDA0)
|
||||
#define bfin_write_WPDA0(val) bfin_write32(WPDA0,val)
|
||||
#define pWPDA1 ((volatile void **)WPDA1)
|
||||
#define bfin_read_WPDA1() bfin_read32(WPDA1)
|
||||
#define bfin_write_WPDA1(val) bfin_write32(WPDA1,val)
|
||||
#define pWPDACNT0 ((volatile unsigned long *)WPDACNT0)
|
||||
#define bfin_read_WPDACNT0() bfin_read32(WPDACNT0)
|
||||
#define bfin_write_WPDACNT0(val) bfin_write32(WPDACNT0,val)
|
||||
#define pWPDACNT1 ((volatile unsigned long *)WPDACNT1)
|
||||
#define bfin_read_WPDACNT1() bfin_read32(WPDACNT1)
|
||||
#define bfin_write_WPDACNT1(val) bfin_write32(WPDACNT1,val)
|
||||
#define pWPSTAT ((volatile unsigned long *)WPSTAT)
|
||||
#define bfin_read_WPSTAT() bfin_read32(WPSTAT)
|
||||
#define bfin_write_WPSTAT(val) bfin_write32(WPSTAT,val)
|
||||
|
||||
/*Performance Monitor Registers*/
|
||||
#define pPFCTL ((volatile unsigned long *)PFCTL)
|
||||
#define bfin_read_PFCTL() bfin_read32(PFCTL)
|
||||
#define bfin_write_PFCTL(val) bfin_write32(PFCTL,val)
|
||||
#define pPFCNTR0 ((volatile unsigned long *)PFCNTR0)
|
||||
#define bfin_read_PFCNTR0() bfin_read32(PFCNTR0)
|
||||
#define bfin_write_PFCNTR0(val) bfin_write32(PFCNTR0,val)
|
||||
#define pPFCNTR1 ((volatile unsigned long *)PFCNTR1)
|
||||
#define bfin_read_PFCNTR1() bfin_read32(PFCNTR1)
|
||||
#define bfin_write_PFCNTR1(val) bfin_write32(PFCNTR1,val)
|
||||
|
||||
/*
|
||||
#define IPRIO 0xFFE02110
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BFIN_ALIVE_LED)
|
||||
#define pCONFIG_BFIN_ALIVE_LED_DPORT \
|
||||
(volatile unsigned short *)CONFIG_BFIN_ALIVE_LED_DPORT
|
||||
#define pCONFIG_BFIN_ALIVE_LED_PORT \
|
||||
(volatile unsigned short *)CONFIG_BFIN_ALIVE_LED_PORT
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BFIN_IDLE_LED)
|
||||
#define pCONFIG_BFIN_IDLE_LED_DPORT \
|
||||
(volatile unsigned short *)CONFIG_BFIN_IDLE_LED_DPORT
|
||||
#define pCONFIG_BFIN_IDLE_LED_PORT \
|
||||
(volatile unsigned short *)CONFIG_BFIN_IDLE_LED_PORT
|
||||
#endif
|
||||
|
||||
#endif /* _CDEF_LPBLACKFIN_H */
|
||||
350
include/asm-blackfin/mach-common/context.S
Normal file
350
include/asm-blackfin/mach-common/context.S
Normal file
|
|
@ -0,0 +1,350 @@
|
|||
/*
|
||||
* File: arch/blackfin/kernel/context.S
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2007 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* Code to save processor context.
|
||||
* We even save the register which are preserved by a function call
|
||||
* - r4, r5, r6, r7, p3, p4, p5
|
||||
*/
|
||||
.macro save_context_with_interrupts
|
||||
[--sp] = SYSCFG;
|
||||
|
||||
[--sp] = P0; /*orig_p0*/
|
||||
[--sp] = R0; /*orig_r0*/
|
||||
|
||||
[--sp] = ( R7:0, P5:0 );
|
||||
[--sp] = fp;
|
||||
[--sp] = usp;
|
||||
|
||||
[--sp] = i0;
|
||||
[--sp] = i1;
|
||||
[--sp] = i2;
|
||||
[--sp] = i3;
|
||||
|
||||
[--sp] = m0;
|
||||
[--sp] = m1;
|
||||
[--sp] = m2;
|
||||
[--sp] = m3;
|
||||
|
||||
[--sp] = l0;
|
||||
[--sp] = l1;
|
||||
[--sp] = l2;
|
||||
[--sp] = l3;
|
||||
|
||||
[--sp] = b0;
|
||||
[--sp] = b1;
|
||||
[--sp] = b2;
|
||||
[--sp] = b3;
|
||||
[--sp] = a0.x;
|
||||
[--sp] = a0.w;
|
||||
[--sp] = a1.x;
|
||||
[--sp] = a1.w;
|
||||
|
||||
[--sp] = LC0;
|
||||
[--sp] = LC1;
|
||||
[--sp] = LT0;
|
||||
[--sp] = LT1;
|
||||
[--sp] = LB0;
|
||||
[--sp] = LB1;
|
||||
|
||||
[--sp] = ASTAT;
|
||||
|
||||
[--sp] = r0; /* Skip reserved */
|
||||
[--sp] = RETS;
|
||||
r0 = RETI;
|
||||
[--sp] = r0;
|
||||
[--sp] = RETX;
|
||||
[--sp] = RETN;
|
||||
[--sp] = RETE;
|
||||
[--sp] = SEQSTAT;
|
||||
[--sp] = r0; /* Skip IPEND as well. */
|
||||
/* Switch to other method of keeping interrupts disabled. */
|
||||
#ifdef CONFIG_DEBUG_HWERR
|
||||
r0 = 0x3f;
|
||||
sti r0;
|
||||
#else
|
||||
cli r0;
|
||||
#endif
|
||||
[--sp] = RETI; /*orig_pc*/
|
||||
/* Clear all L registers. */
|
||||
r0 = 0 (x);
|
||||
l0 = r0;
|
||||
l1 = r0;
|
||||
l2 = r0;
|
||||
l3 = r0;
|
||||
.endm
|
||||
|
||||
.macro save_context_syscall
|
||||
[--sp] = SYSCFG;
|
||||
|
||||
[--sp] = P0; /*orig_p0*/
|
||||
[--sp] = R0; /*orig_r0*/
|
||||
[--sp] = ( R7:0, P5:0 );
|
||||
[--sp] = fp;
|
||||
[--sp] = usp;
|
||||
|
||||
[--sp] = i0;
|
||||
[--sp] = i1;
|
||||
[--sp] = i2;
|
||||
[--sp] = i3;
|
||||
|
||||
[--sp] = m0;
|
||||
[--sp] = m1;
|
||||
[--sp] = m2;
|
||||
[--sp] = m3;
|
||||
|
||||
[--sp] = l0;
|
||||
[--sp] = l1;
|
||||
[--sp] = l2;
|
||||
[--sp] = l3;
|
||||
|
||||
[--sp] = b0;
|
||||
[--sp] = b1;
|
||||
[--sp] = b2;
|
||||
[--sp] = b3;
|
||||
[--sp] = a0.x;
|
||||
[--sp] = a0.w;
|
||||
[--sp] = a1.x;
|
||||
[--sp] = a1.w;
|
||||
|
||||
[--sp] = LC0;
|
||||
[--sp] = LC1;
|
||||
[--sp] = LT0;
|
||||
[--sp] = LT1;
|
||||
[--sp] = LB0;
|
||||
[--sp] = LB1;
|
||||
|
||||
[--sp] = ASTAT;
|
||||
|
||||
[--sp] = r0; /* Skip reserved */
|
||||
[--sp] = RETS;
|
||||
r0 = RETI;
|
||||
[--sp] = r0;
|
||||
[--sp] = RETX;
|
||||
[--sp] = RETN;
|
||||
[--sp] = RETE;
|
||||
[--sp] = SEQSTAT;
|
||||
[--sp] = r0; /* Skip IPEND as well. */
|
||||
[--sp] = RETI; /*orig_pc*/
|
||||
/* Clear all L registers. */
|
||||
r0 = 0 (x);
|
||||
l0 = r0;
|
||||
l1 = r0;
|
||||
l2 = r0;
|
||||
l3 = r0;
|
||||
.endm
|
||||
|
||||
.macro save_context_no_interrupts
|
||||
[--sp] = SYSCFG;
|
||||
[--sp] = P0; /* orig_p0 */
|
||||
[--sp] = R0; /* orig_r0 */
|
||||
[--sp] = ( R7:0, P5:0 );
|
||||
[--sp] = fp;
|
||||
[--sp] = usp;
|
||||
|
||||
[--sp] = i0;
|
||||
[--sp] = i1;
|
||||
[--sp] = i2;
|
||||
[--sp] = i3;
|
||||
|
||||
[--sp] = m0;
|
||||
[--sp] = m1;
|
||||
[--sp] = m2;
|
||||
[--sp] = m3;
|
||||
|
||||
[--sp] = l0;
|
||||
[--sp] = l1;
|
||||
[--sp] = l2;
|
||||
[--sp] = l3;
|
||||
|
||||
[--sp] = b0;
|
||||
[--sp] = b1;
|
||||
[--sp] = b2;
|
||||
[--sp] = b3;
|
||||
[--sp] = a0.x;
|
||||
[--sp] = a0.w;
|
||||
[--sp] = a1.x;
|
||||
[--sp] = a1.w;
|
||||
|
||||
[--sp] = LC0;
|
||||
[--sp] = LC1;
|
||||
[--sp] = LT0;
|
||||
[--sp] = LT1;
|
||||
[--sp] = LB0;
|
||||
[--sp] = LB1;
|
||||
|
||||
[--sp] = ASTAT;
|
||||
|
||||
#ifdef CONFIG_KGDB
|
||||
fp = 0(Z);
|
||||
r1 = sp;
|
||||
r1 += 60;
|
||||
r1 += 60;
|
||||
r1 += 60;
|
||||
[--sp] = r1;
|
||||
#else
|
||||
[--sp] = r0; /* Skip reserved */
|
||||
#endif
|
||||
[--sp] = RETS;
|
||||
r0 = RETI;
|
||||
[--sp] = r0;
|
||||
[--sp] = RETX;
|
||||
[--sp] = RETN;
|
||||
[--sp] = RETE;
|
||||
[--sp] = SEQSTAT;
|
||||
#ifdef CONFIG_KGDB
|
||||
r1.l = lo(IPEND);
|
||||
r1.h = hi(IPEND);
|
||||
[--sp] = r1;
|
||||
#else
|
||||
[--sp] = r0; /* Skip IPEND as well. */
|
||||
#endif
|
||||
[--sp] = r0; /*orig_pc*/
|
||||
/* Clear all L registers. */
|
||||
r0 = 0 (x);
|
||||
l0 = r0;
|
||||
l1 = r0;
|
||||
l2 = r0;
|
||||
l3 = r0;
|
||||
.endm
|
||||
|
||||
.macro restore_context_no_interrupts
|
||||
sp += 4; /* Skip orig_pc */
|
||||
sp += 4; /* Skip IPEND */
|
||||
SEQSTAT = [sp++];
|
||||
RETE = [sp++];
|
||||
RETN = [sp++];
|
||||
RETX = [sp++];
|
||||
r0 = [sp++];
|
||||
RETI = r0; /* Restore RETI indirectly when in exception */
|
||||
RETS = [sp++];
|
||||
|
||||
sp += 4; /* Skip Reserved */
|
||||
|
||||
ASTAT = [sp++];
|
||||
|
||||
LB1 = [sp++];
|
||||
LB0 = [sp++];
|
||||
LT1 = [sp++];
|
||||
LT0 = [sp++];
|
||||
LC1 = [sp++];
|
||||
LC0 = [sp++];
|
||||
|
||||
a1.w = [sp++];
|
||||
a1.x = [sp++];
|
||||
a0.w = [sp++];
|
||||
a0.x = [sp++];
|
||||
b3 = [sp++];
|
||||
b2 = [sp++];
|
||||
b1 = [sp++];
|
||||
b0 = [sp++];
|
||||
|
||||
l3 = [sp++];
|
||||
l2 = [sp++];
|
||||
l1 = [sp++];
|
||||
l0 = [sp++];
|
||||
|
||||
m3 = [sp++];
|
||||
m2 = [sp++];
|
||||
m1 = [sp++];
|
||||
m0 = [sp++];
|
||||
|
||||
i3 = [sp++];
|
||||
i2 = [sp++];
|
||||
i1 = [sp++];
|
||||
i0 = [sp++];
|
||||
|
||||
sp += 4;
|
||||
fp = [sp++];
|
||||
|
||||
( R7 : 0, P5 : 0) = [ SP ++ ];
|
||||
sp += 8; /* Skip orig_r0/orig_p0 */
|
||||
SYSCFG = [sp++];
|
||||
.endm
|
||||
|
||||
.macro restore_context_with_interrupts
|
||||
sp += 4; /* Skip orig_pc */
|
||||
sp += 4; /* Skip IPEND */
|
||||
SEQSTAT = [sp++];
|
||||
RETE = [sp++];
|
||||
RETN = [sp++];
|
||||
RETX = [sp++];
|
||||
RETI = [sp++];
|
||||
RETS = [sp++];
|
||||
|
||||
p0.h = _irq_flags;
|
||||
p0.l = _irq_flags;
|
||||
r0 = [p0];
|
||||
sti r0;
|
||||
|
||||
sp += 4; /* Skip Reserved */
|
||||
|
||||
ASTAT = [sp++];
|
||||
|
||||
LB1 = [sp++];
|
||||
LB0 = [sp++];
|
||||
LT1 = [sp++];
|
||||
LT0 = [sp++];
|
||||
LC1 = [sp++];
|
||||
LC0 = [sp++];
|
||||
|
||||
a1.w = [sp++];
|
||||
a1.x = [sp++];
|
||||
a0.w = [sp++];
|
||||
a0.x = [sp++];
|
||||
b3 = [sp++];
|
||||
b2 = [sp++];
|
||||
b1 = [sp++];
|
||||
b0 = [sp++];
|
||||
|
||||
l3 = [sp++];
|
||||
l2 = [sp++];
|
||||
l1 = [sp++];
|
||||
l0 = [sp++];
|
||||
|
||||
m3 = [sp++];
|
||||
m2 = [sp++];
|
||||
m1 = [sp++];
|
||||
m0 = [sp++];
|
||||
|
||||
i3 = [sp++];
|
||||
i2 = [sp++];
|
||||
i1 = [sp++];
|
||||
i0 = [sp++];
|
||||
|
||||
sp += 4;
|
||||
fp = [sp++];
|
||||
|
||||
( R7 : 0, P5 : 0) = [ SP ++ ];
|
||||
sp += 8; /* Skip orig_r0/orig_p0 */
|
||||
csync;
|
||||
SYSCFG = [sp++];
|
||||
csync;
|
||||
.endm
|
||||
|
||||
691
include/asm-blackfin/mach-common/def_LPBlackfin.h
Normal file
691
include/asm-blackfin/mach-common/def_LPBlackfin.h
Normal file
|
|
@ -0,0 +1,691 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mach-common/def_LPBlackfin.h
|
||||
* Based on:
|
||||
* Author: unknown
|
||||
* COPYRIGHT 2005 Analog Devices
|
||||
* Created: ?
|
||||
* Description:
|
||||
*
|
||||
* Modified:
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING.
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* LP Blackfin CORE REGISTER BIT & ADDRESS DEFINITIONS FOR ADSP-BF532/33 */
|
||||
|
||||
#ifndef _DEF_LPBLACKFIN_H
|
||||
#define _DEF_LPBLACKFIN_H
|
||||
|
||||
#include <asm/mach/anomaly.h>
|
||||
|
||||
/*#if !defined(__ADSPLPBLACKFIN__)
|
||||
#warning def_LPBlackfin.h should only be included for 532 compatible chips.
|
||||
#endif
|
||||
*/
|
||||
|
||||
#define MK_BMSK_(x) (1<<x)
|
||||
|
||||
#if defined(ANOMALY_05000198)
|
||||
|
||||
#define bfin_read16(addr) ({ unsigned __v; \
|
||||
__asm__ __volatile__ ("NOP;\n\t"\
|
||||
"%0 = w[%1] (z);\n\t"\
|
||||
: "=d"(__v) : "a"(addr)); (unsigned short)__v; })
|
||||
|
||||
#define bfin_read32(addr) ({ unsigned __v; \
|
||||
__asm__ __volatile__ ("NOP;\n\t"\
|
||||
"%0 = [%1];\n\t"\
|
||||
: "=d"(__v) : "a"(addr)); __v; })
|
||||
|
||||
#define bfin_write16(addr,val) ({\
|
||||
__asm__ __volatile__ ("NOP;\n\t"\
|
||||
"w[%0] = %1;\n\t"\
|
||||
: : "a"(addr) , "d"(val) : "memory");})
|
||||
|
||||
#define bfin_write32(addr,val) ({\
|
||||
__asm__ __volatile__ ("NOP;\n\t"\
|
||||
"[%0] = %1;\n\t"\
|
||||
: : "a"(addr) , "d"(val) : "memory");})
|
||||
|
||||
#else
|
||||
|
||||
#define bfin_read16(addr) ({ unsigned __v; \
|
||||
__asm__ __volatile__ (\
|
||||
"%0 = w[%1] (z);\n\t"\
|
||||
: "=d"(__v) : "a"(addr)); (unsigned short)__v; })
|
||||
|
||||
#define bfin_read32(addr) ({ unsigned __v; \
|
||||
__asm__ __volatile__ (\
|
||||
"%0 = [%1];\n\t"\
|
||||
: "=d"(__v) : "a"(addr)); __v; })
|
||||
|
||||
#define bfin_write16(addr,val) ({\
|
||||
__asm__ __volatile__ (\
|
||||
"w[%0] = %1;\n\t"\
|
||||
: : "a"(addr) , "d"(val) : "memory");})
|
||||
|
||||
#define bfin_write32(addr,val) ({\
|
||||
__asm__ __volatile__ (\
|
||||
"[%0] = %1;\n\t"\
|
||||
: : "a"(addr) , "d"(val) : "memory");})
|
||||
|
||||
#endif
|
||||
|
||||
/**************************************************
|
||||
* System Register Bits
|
||||
**************************************************/
|
||||
|
||||
/**************************************************
|
||||
* ASTAT register
|
||||
**************************************************/
|
||||
|
||||
/* definitions of ASTAT bit positions*/
|
||||
|
||||
/*Result of last ALU0 or shifter operation is zero*/
|
||||
#define ASTAT_AZ_P 0x00000000
|
||||
/*Result of last ALU0 or shifter operation is negative*/
|
||||
#define ASTAT_AN_P 0x00000001
|
||||
/*Condition Code, used for holding comparison results*/
|
||||
#define ASTAT_CC_P 0x00000005
|
||||
/*Quotient Bit*/
|
||||
#define ASTAT_AQ_P 0x00000006
|
||||
/*Rounding mode, set for biased, clear for unbiased*/
|
||||
#define ASTAT_RND_MOD_P 0x00000008
|
||||
/*Result of last ALU0 operation generated a carry*/
|
||||
#define ASTAT_AC0_P 0x0000000C
|
||||
/*Result of last ALU0 operation generated a carry*/
|
||||
#define ASTAT_AC0_COPY_P 0x00000002
|
||||
/*Result of last ALU1 operation generated a carry*/
|
||||
#define ASTAT_AC1_P 0x0000000D
|
||||
/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
|
||||
#define ASTAT_AV0_P 0x00000010
|
||||
/*Sticky version of ASTAT_AV0 */
|
||||
#define ASTAT_AV0S_P 0x00000011
|
||||
/*Result of last MAC1 operation overflowed, sticky for MAC*/
|
||||
#define ASTAT_AV1_P 0x00000012
|
||||
/*Sticky version of ASTAT_AV1 */
|
||||
#define ASTAT_AV1S_P 0x00000013
|
||||
/*Result of last ALU0 or MAC0 operation overflowed*/
|
||||
#define ASTAT_V_P 0x00000018
|
||||
/*Result of last ALU0 or MAC0 operation overflowed*/
|
||||
#define ASTAT_V_COPY_P 0x00000003
|
||||
/*Sticky version of ASTAT_V*/
|
||||
#define ASTAT_VS_P 0x00000019
|
||||
|
||||
/* Masks */
|
||||
|
||||
/*Result of last ALU0 or shifter operation is zero*/
|
||||
#define ASTAT_AZ MK_BMSK_(ASTAT_AZ_P)
|
||||
/*Result of last ALU0 or shifter operation is negative*/
|
||||
#define ASTAT_AN MK_BMSK_(ASTAT_AN_P)
|
||||
/*Result of last ALU0 operation generated a carry*/
|
||||
#define ASTAT_AC0 MK_BMSK_(ASTAT_AC0_P)
|
||||
/*Result of last ALU0 operation generated a carry*/
|
||||
#define ASTAT_AC0_COPY MK_BMSK_(ASTAT_AC0_COPY_P)
|
||||
/*Result of last ALU0 operation generated a carry*/
|
||||
#define ASTAT_AC1 MK_BMSK_(ASTAT_AC1_P)
|
||||
/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
|
||||
#define ASTAT_AV0 MK_BMSK_(ASTAT_AV0_P)
|
||||
/*Result of last MAC1 operation overflowed, sticky for MAC*/
|
||||
#define ASTAT_AV1 MK_BMSK_(ASTAT_AV1_P)
|
||||
/*Condition Code, used for holding comparison results*/
|
||||
#define ASTAT_CC MK_BMSK_(ASTAT_CC_P)
|
||||
/*Quotient Bit*/
|
||||
#define ASTAT_AQ MK_BMSK_(ASTAT_AQ_P)
|
||||
/*Rounding mode, set for biased, clear for unbiased*/
|
||||
#define ASTAT_RND_MOD MK_BMSK_(ASTAT_RND_MOD_P)
|
||||
/*Overflow Bit*/
|
||||
#define ASTAT_V MK_BMSK_(ASTAT_V_P)
|
||||
/*Overflow Bit*/
|
||||
#define ASTAT_V_COPY MK_BMSK_(ASTAT_V_COPY_P)
|
||||
|
||||
/**************************************************
|
||||
* SEQSTAT register
|
||||
**************************************************/
|
||||
|
||||
/* Bit Positions */
|
||||
#define SEQSTAT_EXCAUSE0_P 0x00000000 /* Last exception cause bit 0 */
|
||||
#define SEQSTAT_EXCAUSE1_P 0x00000001 /* Last exception cause bit 1 */
|
||||
#define SEQSTAT_EXCAUSE2_P 0x00000002 /* Last exception cause bit 2 */
|
||||
#define SEQSTAT_EXCAUSE3_P 0x00000003 /* Last exception cause bit 3 */
|
||||
#define SEQSTAT_EXCAUSE4_P 0x00000004 /* Last exception cause bit 4 */
|
||||
#define SEQSTAT_EXCAUSE5_P 0x00000005 /* Last exception cause bit 5 */
|
||||
#define SEQSTAT_IDLE_REQ_P 0x0000000C /* Pending idle mode request,
|
||||
* set by IDLE instruction.
|
||||
*/
|
||||
#define SEQSTAT_SFTRESET_P 0x0000000D /* Indicates whether the last
|
||||
* reset was a software reset
|
||||
* (=1)
|
||||
*/
|
||||
#define SEQSTAT_HWERRCAUSE0_P 0x0000000E /* Last hw error cause bit 0 */
|
||||
#define SEQSTAT_HWERRCAUSE1_P 0x0000000F /* Last hw error cause bit 1 */
|
||||
#define SEQSTAT_HWERRCAUSE2_P 0x00000010 /* Last hw error cause bit 2 */
|
||||
#define SEQSTAT_HWERRCAUSE3_P 0x00000011 /* Last hw error cause bit 3 */
|
||||
#define SEQSTAT_HWERRCAUSE4_P 0x00000012 /* Last hw error cause bit 4 */
|
||||
/* Masks */
|
||||
/* Exception cause */
|
||||
#define SEQSTAT_EXCAUSE (MK_BMSK_(SEQSTAT_EXCAUSE0_P) | \
|
||||
MK_BMSK_(SEQSTAT_EXCAUSE1_P) | \
|
||||
MK_BMSK_(SEQSTAT_EXCAUSE2_P) | \
|
||||
MK_BMSK_(SEQSTAT_EXCAUSE3_P) | \
|
||||
MK_BMSK_(SEQSTAT_EXCAUSE4_P) | \
|
||||
MK_BMSK_(SEQSTAT_EXCAUSE5_P) | \
|
||||
0)
|
||||
|
||||
/* Indicates whether the last reset was a software reset (=1) */
|
||||
#define SEQSTAT_SFTRESET (MK_BMSK_(SEQSTAT_SFTRESET_P))
|
||||
|
||||
/* Last hw error cause */
|
||||
#define SEQSTAT_HWERRCAUSE (MK_BMSK_(SEQSTAT_HWERRCAUSE0_P) | \
|
||||
MK_BMSK_(SEQSTAT_HWERRCAUSE1_P) | \
|
||||
MK_BMSK_(SEQSTAT_HWERRCAUSE2_P) | \
|
||||
MK_BMSK_(SEQSTAT_HWERRCAUSE3_P) | \
|
||||
MK_BMSK_(SEQSTAT_HWERRCAUSE4_P) | \
|
||||
0)
|
||||
|
||||
/* Translate bits to something useful */
|
||||
|
||||
/* Last hw error cause */
|
||||
#define SEQSTAT_HWERRCAUSE_SHIFT (14)
|
||||
#define SEQSTAT_HWERRCAUSE_SYSTEM_MMR (0x02 << SEQSTAT_HWERRCAUSE_SHIFT)
|
||||
#define SEQSTAT_HWERRCAUSE_EXTERN_ADDR (0x03 << SEQSTAT_HWERRCAUSE_SHIFT)
|
||||
#define SEQSTAT_HWERRCAUSE_PERF_FLOW (0x12 << SEQSTAT_HWERRCAUSE_SHIFT)
|
||||
#define SEQSTAT_HWERRCAUSE_RAISE_5 (0x18 << SEQSTAT_HWERRCAUSE_SHIFT)
|
||||
|
||||
/**************************************************
|
||||
* SYSCFG register
|
||||
**************************************************/
|
||||
|
||||
/* Bit Positions */
|
||||
#define SYSCFG_SSSTEP_P 0x00000000 /* Supervisor single step, when
|
||||
* set it forces an exception
|
||||
* for each instruction executed
|
||||
*/
|
||||
#define SYSCFG_CCEN_P 0x00000001 /* Enable cycle counter (=1) */
|
||||
#define SYSCFG_SNEN_P 0x00000002 /* Self nesting Interrupt Enable */
|
||||
|
||||
/* Masks */
|
||||
|
||||
/* Supervisor single step, when set it forces an exception for each
|
||||
*instruction executed
|
||||
*/
|
||||
#define SYSCFG_SSSTEP MK_BMSK_(SYSCFG_SSSTEP_P )
|
||||
/* Enable cycle counter (=1) */
|
||||
#define SYSCFG_CCEN MK_BMSK_(SYSCFG_CCEN_P )
|
||||
/* Self Nesting Interrupt Enable */
|
||||
#define SYSCFG_SNEN MK_BMSK_(SYSCFG_SNEN_P)
|
||||
/* Backward-compatibility for typos in prior releases */
|
||||
#define SYSCFG_SSSSTEP SYSCFG_SSSTEP
|
||||
#define SYSCFG_CCCEN SYSCFG_CCEN
|
||||
|
||||
/****************************************************
|
||||
* Core MMR Register Map
|
||||
****************************************************/
|
||||
|
||||
/* Data Cache & SRAM Memory (0xFFE00000 - 0xFFE00404) */
|
||||
|
||||
#define SRAM_BASE_ADDRESS 0xFFE00000 /* SRAM Base Address Register */
|
||||
#define DMEM_CONTROL 0xFFE00004 /* Data memory control */
|
||||
#define DCPLB_STATUS 0xFFE00008 /* Data Cache Programmable Look-Aside
|
||||
* Buffer Status
|
||||
*/
|
||||
#define DCPLB_FAULT_STATUS 0xFFE00008 /* "" (older define) */
|
||||
#define DCPLB_FAULT_ADDR 0xFFE0000C /* Data Cache Programmable Look-Aside
|
||||
* Buffer Fault Address
|
||||
*/
|
||||
#define DCPLB_ADDR0 0xFFE00100 /* Data Cache Protection Lookaside
|
||||
* Buffer 0
|
||||
*/
|
||||
#define DCPLB_ADDR1 0xFFE00104 /* Data Cache Protection Lookaside
|
||||
* Buffer 1
|
||||
*/
|
||||
#define DCPLB_ADDR2 0xFFE00108 /* Data Cache Protection Lookaside
|
||||
* Buffer 2
|
||||
*/
|
||||
#define DCPLB_ADDR3 0xFFE0010C /* Data Cacheability Protection
|
||||
* Lookaside Buffer 3
|
||||
*/
|
||||
#define DCPLB_ADDR4 0xFFE00110 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 4
|
||||
*/
|
||||
#define DCPLB_ADDR5 0xFFE00114 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 5
|
||||
*/
|
||||
#define DCPLB_ADDR6 0xFFE00118 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 6
|
||||
*/
|
||||
#define DCPLB_ADDR7 0xFFE0011C /* Data Cacheability Protection
|
||||
* Lookaside Buffer 7
|
||||
*/
|
||||
#define DCPLB_ADDR8 0xFFE00120 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 8
|
||||
*/
|
||||
#define DCPLB_ADDR9 0xFFE00124 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 9
|
||||
*/
|
||||
#define DCPLB_ADDR10 0xFFE00128 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 10
|
||||
*/
|
||||
#define DCPLB_ADDR11 0xFFE0012C /* Data Cacheability Protection
|
||||
* Lookaside Buffer 11
|
||||
*/
|
||||
#define DCPLB_ADDR12 0xFFE00130 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 12
|
||||
*/
|
||||
#define DCPLB_ADDR13 0xFFE00134 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 13
|
||||
*/
|
||||
#define DCPLB_ADDR14 0xFFE00138 /* Data Cacheability Protection
|
||||
* Lookaside Buffer 14
|
||||
*/
|
||||
#define DCPLB_ADDR15 0xFFE0013C /* Data Cacheability Protection
|
||||
* Lookaside Buffer 15
|
||||
*/
|
||||
#define DCPLB_DATA0 0xFFE00200 /* Data Cache 0 Status */
|
||||
#define DCPLB_DATA1 0xFFE00204 /* Data Cache 1 Status */
|
||||
#define DCPLB_DATA2 0xFFE00208 /* Data Cache 2 Status */
|
||||
#define DCPLB_DATA3 0xFFE0020C /* Data Cache 3 Status */
|
||||
#define DCPLB_DATA4 0xFFE00210 /* Data Cache 4 Status */
|
||||
#define DCPLB_DATA5 0xFFE00214 /* Data Cache 5 Status */
|
||||
#define DCPLB_DATA6 0xFFE00218 /* Data Cache 6 Status */
|
||||
#define DCPLB_DATA7 0xFFE0021C /* Data Cache 7 Status */
|
||||
#define DCPLB_DATA8 0xFFE00220 /* Data Cache 8 Status */
|
||||
#define DCPLB_DATA9 0xFFE00224 /* Data Cache 9 Status */
|
||||
#define DCPLB_DATA10 0xFFE00228 /* Data Cache 10 Status */
|
||||
#define DCPLB_DATA11 0xFFE0022C /* Data Cache 11 Status */
|
||||
#define DCPLB_DATA12 0xFFE00230 /* Data Cache 12 Status */
|
||||
#define DCPLB_DATA13 0xFFE00234 /* Data Cache 13 Status */
|
||||
#define DCPLB_DATA14 0xFFE00238 /* Data Cache 14 Status */
|
||||
#define DCPLB_DATA15 0xFFE0023C /* Data Cache 15 Status */
|
||||
#define DCPLB_DATA16 0xFFE00240 /* Extra Dummy entry */
|
||||
|
||||
#define DTEST_COMMAND 0xFFE00300 /* Data Test Command Register */
|
||||
#define DTEST_DATA0 0xFFE00400 /* Data Test Data Register */
|
||||
#define DTEST_DATA1 0xFFE00404 /* Data Test Data Register */
|
||||
|
||||
/* Instruction Cache & SRAM Memory (0xFFE01004 - 0xFFE01404) */
|
||||
|
||||
#define IMEM_CONTROL 0xFFE01004 /* Instruction Memory Control */
|
||||
#define ICPLB_STATUS 0xFFE01008 /* Instruction Cache miss status */
|
||||
#define CODE_FAULT_STATUS 0xFFE01008 /* "" (older define) */
|
||||
#define ICPLB_FAULT_ADDR 0xFFE0100C /* Instruction Cache miss address */
|
||||
#define CODE_FAULT_ADDR 0xFFE0100C /* "" (older define) */
|
||||
#define ICPLB_ADDR0 0xFFE01100 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 0
|
||||
*/
|
||||
#define ICPLB_ADDR1 0xFFE01104 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 1
|
||||
*/
|
||||
#define ICPLB_ADDR2 0xFFE01108 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 2
|
||||
*/
|
||||
#define ICPLB_ADDR3 0xFFE0110C /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 3
|
||||
*/
|
||||
#define ICPLB_ADDR4 0xFFE01110 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 4
|
||||
*/
|
||||
#define ICPLB_ADDR5 0xFFE01114 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 5
|
||||
*/
|
||||
#define ICPLB_ADDR6 0xFFE01118 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 6
|
||||
*/
|
||||
#define ICPLB_ADDR7 0xFFE0111C /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 7
|
||||
*/
|
||||
#define ICPLB_ADDR8 0xFFE01120 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 8
|
||||
*/
|
||||
#define ICPLB_ADDR9 0xFFE01124 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 9
|
||||
*/
|
||||
#define ICPLB_ADDR10 0xFFE01128 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 10
|
||||
*/
|
||||
#define ICPLB_ADDR11 0xFFE0112C /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 11
|
||||
*/
|
||||
#define ICPLB_ADDR12 0xFFE01130 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 12
|
||||
*/
|
||||
#define ICPLB_ADDR13 0xFFE01134 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 13
|
||||
*/
|
||||
#define ICPLB_ADDR14 0xFFE01138 /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 14
|
||||
*/
|
||||
#define ICPLB_ADDR15 0xFFE0113C /* Instruction Cacheability
|
||||
* Protection Lookaside Buffer 15
|
||||
*/
|
||||
#define ICPLB_DATA0 0xFFE01200 /* Instruction Cache 0 Status */
|
||||
#define ICPLB_DATA1 0xFFE01204 /* Instruction Cache 1 Status */
|
||||
#define ICPLB_DATA2 0xFFE01208 /* Instruction Cache 2 Status */
|
||||
#define ICPLB_DATA3 0xFFE0120C /* Instruction Cache 3 Status */
|
||||
#define ICPLB_DATA4 0xFFE01210 /* Instruction Cache 4 Status */
|
||||
#define ICPLB_DATA5 0xFFE01214 /* Instruction Cache 5 Status */
|
||||
#define ICPLB_DATA6 0xFFE01218 /* Instruction Cache 6 Status */
|
||||
#define ICPLB_DATA7 0xFFE0121C /* Instruction Cache 7 Status */
|
||||
#define ICPLB_DATA8 0xFFE01220 /* Instruction Cache 8 Status */
|
||||
#define ICPLB_DATA9 0xFFE01224 /* Instruction Cache 9 Status */
|
||||
#define ICPLB_DATA10 0xFFE01228 /* Instruction Cache 10 Status */
|
||||
#define ICPLB_DATA11 0xFFE0122C /* Instruction Cache 11 Status */
|
||||
#define ICPLB_DATA12 0xFFE01230 /* Instruction Cache 12 Status */
|
||||
#define ICPLB_DATA13 0xFFE01234 /* Instruction Cache 13 Status */
|
||||
#define ICPLB_DATA14 0xFFE01238 /* Instruction Cache 14 Status */
|
||||
#define ICPLB_DATA15 0xFFE0123C /* Instruction Cache 15 Status */
|
||||
#define ITEST_COMMAND 0xFFE01300 /* Instruction Test Command Register */
|
||||
#define ITEST_DATA0 0xFFE01400 /* Instruction Test Data Register */
|
||||
#define ITEST_DATA1 0xFFE01404 /* Instruction Test Data Register */
|
||||
|
||||
/* Event/Interrupt Controller Registers (0xFFE02000 - 0xFFE02110) */
|
||||
|
||||
#define EVT0 0xFFE02000 /* Event Vector 0 ESR Address */
|
||||
#define EVT1 0xFFE02004 /* Event Vector 1 ESR Address */
|
||||
#define EVT2 0xFFE02008 /* Event Vector 2 ESR Address */
|
||||
#define EVT3 0xFFE0200C /* Event Vector 3 ESR Address */
|
||||
#define EVT4 0xFFE02010 /* Event Vector 4 ESR Address */
|
||||
#define EVT5 0xFFE02014 /* Event Vector 5 ESR Address */
|
||||
#define EVT6 0xFFE02018 /* Event Vector 6 ESR Address */
|
||||
#define EVT7 0xFFE0201C /* Event Vector 7 ESR Address */
|
||||
#define EVT8 0xFFE02020 /* Event Vector 8 ESR Address */
|
||||
#define EVT9 0xFFE02024 /* Event Vector 9 ESR Address */
|
||||
#define EVT10 0xFFE02028 /* Event Vector 10 ESR Address */
|
||||
#define EVT11 0xFFE0202C /* Event Vector 11 ESR Address */
|
||||
#define EVT12 0xFFE02030 /* Event Vector 12 ESR Address */
|
||||
#define EVT13 0xFFE02034 /* Event Vector 13 ESR Address */
|
||||
#define EVT14 0xFFE02038 /* Event Vector 14 ESR Address */
|
||||
#define EVT15 0xFFE0203C /* Event Vector 15 ESR Address */
|
||||
#define IMASK 0xFFE02104 /* Interrupt Mask Register */
|
||||
#define IPEND 0xFFE02108 /* Interrupt Pending Register */
|
||||
#define ILAT 0xFFE0210C /* Interrupt Latch Register */
|
||||
#define IPRIO 0xFFE02110 /* Core Interrupt Priority Register */
|
||||
|
||||
/* Core Timer Registers (0xFFE03000 - 0xFFE0300C) */
|
||||
|
||||
#define TCNTL 0xFFE03000 /* Core Timer Control Register */
|
||||
#define TPERIOD 0xFFE03004 /* Core Timer Period Register */
|
||||
#define TSCALE 0xFFE03008 /* Core Timer Scale Register */
|
||||
#define TCOUNT 0xFFE0300C /* Core Timer Count Register */
|
||||
|
||||
/* Debug/MP/Emulation Registers (0xFFE05000 - 0xFFE05008) */
|
||||
#define DSPID 0xFFE05000 /* DSP Processor ID Register for
|
||||
* MP implementations
|
||||
*/
|
||||
|
||||
#define DBGSTAT 0xFFE05008 /* Debug Status Register */
|
||||
|
||||
/* Trace Buffer Registers (0xFFE06000 - 0xFFE06100) */
|
||||
|
||||
#define TBUFCTL 0xFFE06000 /* Trace Buffer Control Register */
|
||||
#define TBUFSTAT 0xFFE06004 /* Trace Buffer Status Register */
|
||||
#define TBUF 0xFFE06100 /* Trace Buffer */
|
||||
|
||||
/* Watchpoint Control Registers (0xFFE07000 - 0xFFE07200) */
|
||||
|
||||
/* Watchpoint Instruction Address Control Register */
|
||||
#define WPIACTL 0xFFE07000
|
||||
/* Watchpoint Instruction Address Register 0 */
|
||||
#define WPIA0 0xFFE07040
|
||||
/* Watchpoint Instruction Address Register 1 */
|
||||
#define WPIA1 0xFFE07044
|
||||
/* Watchpoint Instruction Address Register 2 */
|
||||
#define WPIA2 0xFFE07048
|
||||
/* Watchpoint Instruction Address Register 3 */
|
||||
#define WPIA3 0xFFE0704C
|
||||
/* Watchpoint Instruction Address Register 4 */
|
||||
#define WPIA4 0xFFE07050
|
||||
/* Watchpoint Instruction Address Register 5 */
|
||||
#define WPIA5 0xFFE07054
|
||||
/* Watchpoint Instruction Address Count Register 0 */
|
||||
#define WPIACNT0 0xFFE07080
|
||||
/* Watchpoint Instruction Address Count Register 1 */
|
||||
#define WPIACNT1 0xFFE07084
|
||||
/* Watchpoint Instruction Address Count Register 2 */
|
||||
#define WPIACNT2 0xFFE07088
|
||||
/* Watchpoint Instruction Address Count Register 3 */
|
||||
#define WPIACNT3 0xFFE0708C
|
||||
/* Watchpoint Instruction Address Count Register 4 */
|
||||
#define WPIACNT4 0xFFE07090
|
||||
/* Watchpoint Instruction Address Count Register 5 */
|
||||
#define WPIACNT5 0xFFE07094
|
||||
/* Watchpoint Data Address Control Register */
|
||||
#define WPDACTL 0xFFE07100
|
||||
/* Watchpoint Data Address Register 0 */
|
||||
#define WPDA0 0xFFE07140
|
||||
/* Watchpoint Data Address Register 1 */
|
||||
#define WPDA1 0xFFE07144
|
||||
/* Watchpoint Data Address Count Value Register 0 */
|
||||
#define WPDACNT0 0xFFE07180
|
||||
/* Watchpoint Data Address Count Value Register 1 */
|
||||
#define WPDACNT1 0xFFE07184
|
||||
/* Watchpoint Status Register */
|
||||
#define WPSTAT 0xFFE07200
|
||||
|
||||
/* Performance Monitor Registers (0xFFE08000 - 0xFFE08104) */
|
||||
|
||||
/* Performance Monitor Control Register */
|
||||
#define PFCTL 0xFFE08000
|
||||
/* Performance Monitor Counter Register 0 */
|
||||
#define PFCNTR0 0xFFE08100
|
||||
/* Performance Monitor Counter Register 1 */
|
||||
#define PFCNTR1 0xFFE08104
|
||||
|
||||
/****************************************************
|
||||
* Core MMR Register Bits
|
||||
****************************************************/
|
||||
|
||||
/**************************************************
|
||||
* EVT registers (ILAT, IMASK, and IPEND).
|
||||
**************************************************/
|
||||
|
||||
/* Bit Positions */
|
||||
#define EVT_EMU_P 0x00000000 /* Emulator interrupt bit position */
|
||||
#define EVT_RST_P 0x00000001 /* Reset interrupt bit position */
|
||||
#define EVT_NMI_P 0x00000002 /* Non Maskable interrupt bit position */
|
||||
#define EVT_EVX_P 0x00000003 /* Exception bit position */
|
||||
#define EVT_IRPTEN_P 0x00000004 /* Global interrupt enable bit position */
|
||||
#define EVT_IVHW_P 0x00000005 /* Hardware Error interrupt bit position */
|
||||
#define EVT_IVTMR_P 0x00000006 /* Timer interrupt bit position */
|
||||
#define EVT_IVG7_P 0x00000007 /* IVG7 interrupt bit position */
|
||||
#define EVT_IVG8_P 0x00000008 /* IVG8 interrupt bit position */
|
||||
#define EVT_IVG9_P 0x00000009 /* IVG9 interrupt bit position */
|
||||
#define EVT_IVG10_P 0x0000000a /* IVG10 interrupt bit position */
|
||||
#define EVT_IVG11_P 0x0000000b /* IVG11 interrupt bit position */
|
||||
#define EVT_IVG12_P 0x0000000c /* IVG12 interrupt bit position */
|
||||
#define EVT_IVG13_P 0x0000000d /* IVG13 interrupt bit position */
|
||||
#define EVT_IVG14_P 0x0000000e /* IVG14 interrupt bit position */
|
||||
#define EVT_IVG15_P 0x0000000f /* IVG15 interrupt bit position */
|
||||
|
||||
/* Masks */
|
||||
#define EVT_EMU MK_BMSK_(EVT_EMU_P ) /* Emulator interrupt mask */
|
||||
#define EVT_RST MK_BMSK_(EVT_RST_P ) /* Reset interrupt mask */
|
||||
#define EVT_NMI MK_BMSK_(EVT_NMI_P ) /* Non Maskable interrupt mask */
|
||||
#define EVT_EVX MK_BMSK_(EVT_EVX_P ) /* Exception mask */
|
||||
#define EVT_IRPTEN MK_BMSK_(EVT_IRPTEN_P) /* Global interrupt enable mask */
|
||||
#define EVT_IVHW MK_BMSK_(EVT_IVHW_P ) /* Hardware Error interrupt mask */
|
||||
#define EVT_IVTMR MK_BMSK_(EVT_IVTMR_P ) /* Timer interrupt mask */
|
||||
#define EVT_IVG7 MK_BMSK_(EVT_IVG7_P ) /* IVG7 interrupt mask */
|
||||
#define EVT_IVG8 MK_BMSK_(EVT_IVG8_P ) /* IVG8 interrupt mask */
|
||||
#define EVT_IVG9 MK_BMSK_(EVT_IVG9_P ) /* IVG9 interrupt mask */
|
||||
#define EVT_IVG10 MK_BMSK_(EVT_IVG10_P ) /* IVG10 interrupt mask */
|
||||
#define EVT_IVG11 MK_BMSK_(EVT_IVG11_P ) /* IVG11 interrupt mask */
|
||||
#define EVT_IVG12 MK_BMSK_(EVT_IVG12_P ) /* IVG12 interrupt mask */
|
||||
#define EVT_IVG13 MK_BMSK_(EVT_IVG13_P ) /* IVG13 interrupt mask */
|
||||
#define EVT_IVG14 MK_BMSK_(EVT_IVG14_P ) /* IVG14 interrupt mask */
|
||||
#define EVT_IVG15 MK_BMSK_(EVT_IVG15_P ) /* IVG15 interrupt mask */
|
||||
|
||||
/**************************************************
|
||||
* DMEM_CONTROL Register
|
||||
**************************************************/
|
||||
/* Bit Positions */
|
||||
#define ENDM_P 0x00 /* (doesn't really exist) Enable
|
||||
*Data Memory L1
|
||||
*/
|
||||
#define DMCTL_ENDM_P ENDM_P /* "" (older define) */
|
||||
|
||||
#define ENDCPLB_P 0x01 /* Enable DCPLBS */
|
||||
#define DMCTL_ENDCPLB_P ENDCPLB_P /* "" (older define) */
|
||||
#define DMC0_P 0x02 /* L1 Data Memory Configure bit 0 */
|
||||
#define DMCTL_DMC0_P DMC0_P /* "" (older define) */
|
||||
#define DMC1_P 0x03 /* L1 Data Memory Configure bit 1 */
|
||||
#define DMCTL_DMC1_P DMC1_P /* "" (older define) */
|
||||
#define DCBS_P 0x04 /* L1 Data Cache Bank Select */
|
||||
#define PORT_PREF0_P 0x12 /* DAG0 Port Preference */
|
||||
#define PORT_PREF1_P 0x13 /* DAG1 Port Preference */
|
||||
|
||||
/* Masks */
|
||||
#define ENDM 0x00000001 /* (doesn't really exist) Enable
|
||||
* Data Memory L1
|
||||
*/
|
||||
#define ENDCPLB 0x00000002 /* Enable DCPLB */
|
||||
#define ASRAM_BSRAM 0x00000000
|
||||
#define ACACHE_BSRAM 0x00000008
|
||||
#define ACACHE_BCACHE 0x0000000C
|
||||
#define DCBS 0x00000010 /* L1 Data Cache Bank Select */
|
||||
#define PORT_PREF0 0x00001000 /* DAG0 Port Preference */
|
||||
#define PORT_PREF1 0x00002000 /* DAG1 Port Preference */
|
||||
|
||||
/* IMEM_CONTROL Register */
|
||||
/* Bit Positions */
|
||||
#define ENIM_P 0x00 /* Enable L1 Code Memory */
|
||||
#define IMCTL_ENIM_P 0x00 /* "" (older define) */
|
||||
#define ENICPLB_P 0x01 /* Enable ICPLB */
|
||||
#define IMCTL_ENICPLB_P 0x01 /* "" (older define) */
|
||||
#define IMC_P 0x02 /* Enable */
|
||||
#define IMCTL_IMC_P 0x02 /* Configure L1 code memory as
|
||||
* cache (0=SRAM)
|
||||
*/
|
||||
#define ILOC0_P 0x03 /* Lock Way 0 */
|
||||
#define ILOC1_P 0x04 /* Lock Way 1 */
|
||||
#define ILOC2_P 0x05 /* Lock Way 2 */
|
||||
#define ILOC3_P 0x06 /* Lock Way 3 */
|
||||
#define LRUPRIORST_P 0x0D /* Least Recently Used Replacement
|
||||
* Priority
|
||||
*/
|
||||
/* Masks */
|
||||
#define ENIM 0x00000001 /* Enable L1 Code Memory */
|
||||
#define ENICPLB 0x00000002 /* Enable ICPLB */
|
||||
#define IMC 0x00000004 /* Configure L1 code memory as
|
||||
* cache (0=SRAM)
|
||||
*/
|
||||
#define ILOC0 0x00000008 /* Lock Way 0 */
|
||||
#define ILOC1 0x00000010 /* Lock Way 1 */
|
||||
#define ILOC2 0x00000020 /* Lock Way 2 */
|
||||
#define ILOC3 0x00000040 /* Lock Way 3 */
|
||||
#define LRUPRIORST 0x00002000 /* Least Recently Used Replacement
|
||||
* Priority
|
||||
*/
|
||||
|
||||
/* TCNTL Masks */
|
||||
#define TMPWR 0x00000001 /* Timer Low Power Control,
|
||||
* 0=low power mode, 1=active state
|
||||
*/
|
||||
#define TMREN 0x00000002 /* Timer enable, 0=disable, 1=enable */
|
||||
#define TAUTORLD 0x00000004 /* Timer auto reload */
|
||||
#define TINT 0x00000008 /* Timer generated interrupt 0=no
|
||||
* interrupt has been generated,
|
||||
* 1=interrupt has been generated
|
||||
* (sticky)
|
||||
*/
|
||||
|
||||
/* DCPLB_DATA and ICPLB_DATA Registers */
|
||||
/* Bit Positions */
|
||||
#define CPLB_VALID_P 0x00000000 /* 0=invalid entry, 1=valid entry */
|
||||
#define CPLB_LOCK_P 0x00000001 /* 0=entry may be replaced, 1=entry
|
||||
* locked
|
||||
*/
|
||||
#define CPLB_USER_RD_P 0x00000002 /* 0=no read access, 1=read access
|
||||
* allowed (user mode)
|
||||
*/
|
||||
/* Masks */
|
||||
#define CPLB_VALID 0x00000001 /* 0=invalid entry, 1=valid entry */
|
||||
#define CPLB_LOCK 0x00000002 /* 0=entry may be replaced, 1=entry
|
||||
* locked
|
||||
*/
|
||||
#define CPLB_USER_RD 0x00000004 /* 0=no read access, 1=read access
|
||||
* allowed (user mode)
|
||||
*/
|
||||
#define PAGE_SIZE_1KB 0x00000000 /* 1 KB page size */
|
||||
#define PAGE_SIZE_4KB 0x00010000 /* 4 KB page size */
|
||||
#define PAGE_SIZE_1MB 0x00020000 /* 1 MB page size */
|
||||
#define PAGE_SIZE_4MB 0x00030000 /* 4 MB page size */
|
||||
#define CPLB_L1SRAM 0x00000020 /* 0=SRAM mapped in L1, 0=SRAM not
|
||||
* mapped to L1
|
||||
*/
|
||||
#define CPLB_PORTPRIO 0x00000200 /* 0=low priority port, 1= high
|
||||
* priority port
|
||||
*/
|
||||
#define CPLB_L1_CHBL 0x00001000 /* 0=non-cacheable in L1, 1=cacheable
|
||||
* in L1
|
||||
*/
|
||||
/* ICPLB_DATA only */
|
||||
#define CPLB_LRUPRIO 0x00000100 /* 0=can be replaced by any line,
|
||||
* 1=priority for non-replacement
|
||||
*/
|
||||
/* DCPLB_DATA only */
|
||||
#define CPLB_USER_WR 0x00000008 /* 0=no write access, 0=write
|
||||
* access allowed (user mode)
|
||||
*/
|
||||
#define CPLB_SUPV_WR 0x00000010 /* 0=no write access, 0=write
|
||||
* access allowed (supervisor mode)
|
||||
*/
|
||||
#define CPLB_DIRTY 0x00000080 /* 1=dirty, 0=clean */
|
||||
#define CPLB_L1_AOW 0x00008000 /* 0=do not allocate cache lines on
|
||||
* write-through writes,
|
||||
* 1= allocate cache lines on
|
||||
* write-through writes.
|
||||
*/
|
||||
#define CPLB_WT 0x00004000 /* 0=write-back, 1=write-through */
|
||||
|
||||
/* TBUFCTL Masks */
|
||||
#define TBUFPWR 0x0001
|
||||
#define TBUFEN 0x0002
|
||||
#define TBUFOVF 0x0004
|
||||
#define TBUFCMPLP_SINGLE 0x0008
|
||||
#define TBUFCMPLP_DOUBLE 0x0010
|
||||
#define TBUFCMPLP (TBUFCMPLP_SINGLE | TBUFCMPLP_DOUBLE)
|
||||
|
||||
/* TBUFSTAT Masks */
|
||||
#define TBUFCNT 0x001F
|
||||
|
||||
/* ITEST_COMMAND and DTEST_COMMAND Registers */
|
||||
/* Masks */
|
||||
#define TEST_READ 0x00000000 /* Read Access */
|
||||
#define TEST_WRITE 0x00000002 /* Write Access */
|
||||
#define TEST_TAG 0x00000000 /* Access TAG */
|
||||
#define TEST_DATA 0x00000004 /* Access DATA */
|
||||
#define TEST_DW0 0x00000000 /* Select Double Word 0 */
|
||||
#define TEST_DW1 0x00000008 /* Select Double Word 1 */
|
||||
#define TEST_DW2 0x00000010 /* Select Double Word 2 */
|
||||
#define TEST_DW3 0x00000018 /* Select Double Word 3 */
|
||||
#define TEST_MB0 0x00000000 /* Select Mini-Bank 0 */
|
||||
#define TEST_MB1 0x00010000 /* Select Mini-Bank 1 */
|
||||
#define TEST_MB2 0x00020000 /* Select Mini-Bank 2 */
|
||||
#define TEST_MB3 0x00030000 /* Select Mini-Bank 3 */
|
||||
#define TEST_SET(x) ((x << 5) & 0x03E0) /* Set Index 0->31 */
|
||||
#define TEST_WAY0 0x00000000 /* Access Way0 */
|
||||
#define TEST_WAY1 0x04000000 /* Access Way1 */
|
||||
/* ITEST_COMMAND only */
|
||||
#define TEST_WAY2 0x08000000 /* Access Way2 */
|
||||
#define TEST_WAY3 0x0C000000 /* Access Way3 */
|
||||
/* DTEST_COMMAND only */
|
||||
#define TEST_BNKSELA 0x00000000 /* Access SuperBank A */
|
||||
#define TEST_BNKSELB 0x00800000 /* Access SuperBank B */
|
||||
|
||||
#endif /* _DEF_LPBLACKFIN_H */
|
||||
95
include/asm-blackfin/macros.h
Normal file
95
include/asm-blackfin/macros.h
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
/************************************************************************
|
||||
*
|
||||
* macros.h
|
||||
*
|
||||
* (c) Copyright 2001-2003 Analog Devices, Inc. All rights reserved.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
/* Defines various assembly macros. */
|
||||
|
||||
#ifndef _MACROS_H
|
||||
#define _MACROS_H
|
||||
|
||||
#define LO(con32) ((con32) & 0xFFFF)
|
||||
#define lo(con32) ((con32) & 0xFFFF)
|
||||
#define HI(con32) (((con32) >> 16) & 0xFFFF)
|
||||
#define hi(con32) (((con32) >> 16) & 0xFFFF)
|
||||
|
||||
/*
|
||||
* Set the corresponding bits in a System Register (SR);
|
||||
* All bits set in "mask" will be set in the system register
|
||||
* specified by "sys_reg" bitset_SR(sys_reg, mask), where
|
||||
* sys_reg is the system register and mask are the bits to be set.
|
||||
*/
|
||||
#define bitset_SR(sys_reg, mask)\
|
||||
[--SP] = (R7:6);\
|
||||
r7 = sys_reg;\
|
||||
r6.l = (mask) & 0xffff;\
|
||||
r6.h = (mask) >> 16;\
|
||||
r7 = r7 | r6;\
|
||||
sys_reg = r7;\
|
||||
csync;\
|
||||
(R7:6) = [SP++]
|
||||
|
||||
/*
|
||||
* Clear the corresponding bits in a System Register (SR);
|
||||
* All bits set in "mask" will be cleared in the SR
|
||||
* specified by "sys_reg" bitclr_SR(sys_reg, mask), where
|
||||
* sys_reg is the SR and mask are the bits to be cleared.
|
||||
*/
|
||||
#define bitclr_SR(sys_reg, mask)\
|
||||
[--SP] = (R7:6);\
|
||||
r7 = sys_reg;\
|
||||
r7 =~ r7;\
|
||||
r6.l = (mask) & 0xffff;\
|
||||
r6.h = (mask) >> 16;\
|
||||
r7 = r7 | r6;\
|
||||
r7 =~ r7;\
|
||||
sys_reg = r7;\
|
||||
csync;\
|
||||
(R7:6) = [SP++]
|
||||
|
||||
/*
|
||||
* Set the corresponding bits in a Memory Mapped Register (MMR);
|
||||
* All bits set in "mask" will be set in the MMR specified by "mmr_reg"
|
||||
* bitset_MMR(mmr_reg, mask), where mmr_reg is the MMR and mask are
|
||||
* the bits to be set.
|
||||
*/
|
||||
#define bitset_MMR(mmr_reg, mask)\
|
||||
[--SP] = (R7:6);\
|
||||
[--SP] = P5;\
|
||||
p5.l = mmr_reg & 0xffff;\
|
||||
p5.h = mmr_reg >> 16;\
|
||||
r7 = [p5];\
|
||||
r6.l = (mask) & 0xffff;\
|
||||
r6.h = (mask) >> 16;\
|
||||
r7 = r7 | r6;\
|
||||
[p5] = r7;\
|
||||
csync;\
|
||||
p5 = [SP++];\
|
||||
(R7:6) = [SP++]
|
||||
|
||||
/*
|
||||
* Clear the corresponding bits in a Memory Mapped Register (MMR);
|
||||
* All bits set in "mask" will be cleared in the MMR specified by "mmr_reg"
|
||||
* bitclr_MMRreg(mmr_reg, mask), where sys_reg is the MMR and mask are
|
||||
* the bits to be cleared.
|
||||
*/
|
||||
#define bitclr_MMR(mmr_reg, mask)\
|
||||
[--SP] = (R7:6);\
|
||||
[--SP] = P5;\
|
||||
p5.l = mmr_reg & 0xffff;\
|
||||
p5.h = mmr_reg >> 16;\
|
||||
r7 = [p5];\
|
||||
r7 =~ r7;\
|
||||
r6.l = (mask) & 0xffff;\
|
||||
r6.h = (mask) >> 16;\
|
||||
r7 = r7 | r6;\
|
||||
r7 =~ r7;\
|
||||
[p5] = r7;\
|
||||
csync;\
|
||||
p5 = [SP++];\
|
||||
(R7:6) = [SP++]
|
||||
|
||||
#endif /* _MACROS_H */
|
||||
12
include/asm-blackfin/mem_map.h
Normal file
12
include/asm-blackfin/mem_map.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* mem_map.h
|
||||
* Common header file for blackfin family of processors.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MEM_MAP_H_
|
||||
#define _MEM_MAP_H_
|
||||
|
||||
#include <asm/mach/mem_map.h>
|
||||
|
||||
#endif /* _MEM_MAP_H_ */
|
||||
45
include/asm-blackfin/mman.h
Normal file
45
include/asm-blackfin/mman.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef __BFIN_MMAN_H__
|
||||
#define __BFIN_MMAN_H__
|
||||
|
||||
#define PROT_READ 0x1 /* page can be read */
|
||||
#define PROT_WRITE 0x2 /* page can be written */
|
||||
#define PROT_EXEC 0x4 /* page can be executed */
|
||||
#define PROT_SEM 0x8 /* page may be used for atomic ops */
|
||||
#define PROT_NONE 0x0 /* page can not be accessed */
|
||||
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
|
||||
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
|
||||
|
||||
#define MAP_SHARED 0x01 /* Share changes */
|
||||
#define MAP_PRIVATE 0x02 /* Changes are private */
|
||||
#define MAP_TYPE 0x0f /* Mask for type of mapping */
|
||||
#define MAP_FIXED 0x10 /* Interpret addr exactly */
|
||||
#define MAP_ANONYMOUS 0x20 /* don't use a file */
|
||||
|
||||
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
|
||||
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
|
||||
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
|
||||
#define MAP_LOCKED 0x2000 /* pages are locked */
|
||||
#define MAP_NORESERVE 0x4000 /* don't check for reservations */
|
||||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
|
||||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
|
||||
#define MAP_UNINITIALIZE 0x4000000 /* For anonymous mmap, memory could
|
||||
be uninitialized. */
|
||||
|
||||
#define MS_ASYNC 1 /* sync memory asynchronously */
|
||||
#define MS_INVALIDATE 2 /* invalidate the caches */
|
||||
#define MS_SYNC 4 /* synchronous memory sync */
|
||||
|
||||
#define MCL_CURRENT 1 /* lock all current mappings */
|
||||
#define MCL_FUTURE 2 /* lock all future mappings */
|
||||
|
||||
#define MADV_NORMAL 0x0 /* default page-in behavior */
|
||||
#define MADV_RANDOM 0x1 /* page-in minimum required */
|
||||
#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
|
||||
#define MADV_WILLNEED 0x3 /* pre-fault pages */
|
||||
#define MADV_DONTNEED 0x4 /* discard these pages */
|
||||
|
||||
/* compatibility flags */
|
||||
#define MAP_ANON MAP_ANONYMOUS
|
||||
#define MAP_FILE 0
|
||||
|
||||
#endif /* __BFIN_MMAN_H__ */
|
||||
30
include/asm-blackfin/mmu.h
Normal file
30
include/asm-blackfin/mmu.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef __MMU_H
|
||||
#define __MMU_H
|
||||
|
||||
/* Copyright (C) 2002, David McCullough <[email protected]> */
|
||||
|
||||
struct sram_list_struct {
|
||||
struct sram_list_struct *next;
|
||||
void *addr;
|
||||
size_t length;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct vm_list_struct *vmlist;
|
||||
unsigned long end_brk;
|
||||
unsigned long stack_start;
|
||||
|
||||
/* Points to the location in SDRAM where the L1 stack is normally
|
||||
saved, or NULL if the stack is always in SDRAM. */
|
||||
void *l1_stack_save;
|
||||
|
||||
struct sram_list_struct *sram_list;
|
||||
|
||||
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
||||
unsigned long exec_fdpic_loadmap;
|
||||
unsigned long interp_fdpic_loadmap;
|
||||
#endif
|
||||
|
||||
} mm_context_t;
|
||||
|
||||
#endif
|
||||
129
include/asm-blackfin/mmu_context.h
Normal file
129
include/asm-blackfin/mmu_context.h
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* File: include/asm-blackfin/mmu_context.h
|
||||
* Based on:
|
||||
* Author:
|
||||
*
|
||||
* Created:
|
||||
* Description:
|
||||
*
|
||||
* Modified:
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Bugs: Enter bugs at http://blackfin.uclinux.org/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see the file COPYING, or write
|
||||
* to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef __BLACKFIN_MMU_CONTEXT_H__
|
||||
#define __BLACKFIN_MMU_CONTEXT_H__
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgalloc.h>
|
||||
|
||||
extern void *current_l1_stack_save;
|
||||
extern int nr_l1stack_tasks;
|
||||
extern void *l1_stack_base;
|
||||
extern unsigned long l1_stack_len;
|
||||
|
||||
extern int l1sram_free(const void*);
|
||||
extern void *l1sram_alloc_max(void*);
|
||||
|
||||
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
|
||||
/* Called when creating a new context during fork() or execve(). */
|
||||
static inline int
|
||||
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void free_l1stack(void)
|
||||
{
|
||||
nr_l1stack_tasks--;
|
||||
if (nr_l1stack_tasks == 0)
|
||||
l1sram_free(l1_stack_base);
|
||||
}
|
||||
static inline void destroy_context(struct mm_struct *mm)
|
||||
{
|
||||
struct sram_list_struct *tmp;
|
||||
|
||||
if (current_l1_stack_save == mm->context.l1_stack_save)
|
||||
current_l1_stack_save = 0;
|
||||
if (mm->context.l1_stack_save)
|
||||
free_l1stack();
|
||||
|
||||
while ((tmp = mm->context.sram_list)) {
|
||||
mm->context.sram_list = tmp->next;
|
||||
sram_free(tmp->addr);
|
||||
kfree(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
alloc_l1stack(unsigned long length, unsigned long *stack_base)
|
||||
{
|
||||
if (nr_l1stack_tasks == 0) {
|
||||
l1_stack_base = l1sram_alloc_max(&l1_stack_len);
|
||||
if (!l1_stack_base)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (l1_stack_len < length) {
|
||||
if (nr_l1stack_tasks == 0)
|
||||
l1sram_free(l1_stack_base);
|
||||
return 0;
|
||||
}
|
||||
*stack_base = (unsigned long)l1_stack_base;
|
||||
nr_l1stack_tasks++;
|
||||
return l1_stack_len;
|
||||
}
|
||||
|
||||
static inline int
|
||||
activate_l1stack(struct mm_struct *mm, unsigned long sp_base)
|
||||
{
|
||||
if (current_l1_stack_save)
|
||||
memcpy(current_l1_stack_save, l1_stack_base, l1_stack_len);
|
||||
mm->context.l1_stack_save = current_l1_stack_save = (void*)sp_base;
|
||||
memcpy(l1_stack_base, current_l1_stack_save, l1_stack_len);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define deactivate_mm(tsk,mm) do { } while (0)
|
||||
|
||||
static inline void activate_mm(struct mm_struct *prev_mm,
|
||||
struct mm_struct *next_mm)
|
||||
{
|
||||
if (!next_mm->context.l1_stack_save)
|
||||
return;
|
||||
if (next_mm->context.l1_stack_save == current_l1_stack_save)
|
||||
return;
|
||||
if (current_l1_stack_save) {
|
||||
memcpy(current_l1_stack_save, l1_stack_base, l1_stack_len);
|
||||
}
|
||||
current_l1_stack_save = next_mm->context.l1_stack_save;
|
||||
memcpy(l1_stack_base, current_l1_stack_save, l1_stack_len);
|
||||
}
|
||||
|
||||
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
|
||||
struct task_struct *tsk)
|
||||
{
|
||||
activate_mm(prev, next);
|
||||
}
|
||||
|
||||
#endif
|
||||
19
include/asm-blackfin/module.h
Normal file
19
include/asm-blackfin/module.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef _ASM_BFIN_MODULE_H
|
||||
#define _ASM_BFIN_MODULE_H
|
||||
|
||||
#define MODULE_SYMBOL_PREFIX "_"
|
||||
|
||||
#define Elf_Shdr Elf32_Shdr
|
||||
#define Elf_Sym Elf32_Sym
|
||||
#define Elf_Ehdr Elf32_Ehdr
|
||||
#define FLG_CODE_IN_L1 0x10
|
||||
#define FLG_DATA_IN_L1 0x20
|
||||
|
||||
struct mod_arch_specific {
|
||||
Elf_Shdr *text_l1;
|
||||
Elf_Shdr *data_a_l1;
|
||||
Elf_Shdr *bss_a_l1;
|
||||
Elf_Shdr *data_b_l1;
|
||||
Elf_Shdr *bss_b_l1;
|
||||
};
|
||||
#endif /* _ASM_BFIN_MODULE_H */
|
||||
31
include/asm-blackfin/msgbuf.h
Normal file
31
include/asm-blackfin/msgbuf.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef _BFIN_MSGBUF_H
|
||||
#define _BFIN_MSGBUF_H
|
||||
|
||||
/*
|
||||
* The msqid64_ds structure for bfin architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 64-bit time_t to solve y2038 problem
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct msqid64_ds {
|
||||
struct ipc64_perm msg_perm;
|
||||
__kernel_time_t msg_stime; /* last msgsnd time */
|
||||
unsigned long __unused1;
|
||||
__kernel_time_t msg_rtime; /* last msgrcv time */
|
||||
unsigned long __unused2;
|
||||
__kernel_time_t msg_ctime; /* last change time */
|
||||
unsigned long __unused3;
|
||||
unsigned long msg_cbytes; /* current number of bytes on queue */
|
||||
unsigned long msg_qnum; /* number of messages in queue */
|
||||
unsigned long msg_qbytes; /* max number of bytes on queue */
|
||||
__kernel_pid_t msg_lspid; /* pid of last msgsnd */
|
||||
__kernel_pid_t msg_lrpid; /* last receive pid */
|
||||
unsigned long __unused4;
|
||||
unsigned long __unused5;
|
||||
};
|
||||
|
||||
#endif /* _BFIN_MSGBUF_H */
|
||||
9
include/asm-blackfin/mutex.h
Normal file
9
include/asm-blackfin/mutex.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Pull in the generic implementation for the mutex fastpath.
|
||||
*
|
||||
* TODO: implement optimized primitives instead, or leave the generic
|
||||
* implementation in place, or pick the atomic_xchg() based generic
|
||||
* implementation. (see asm-generic/mutex-xchg.h for details)
|
||||
*/
|
||||
|
||||
#include <asm-generic/mutex-dec.h>
|
||||
19
include/asm-blackfin/namei.h
Normal file
19
include/asm-blackfin/namei.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* linux/include/asm/namei.h
|
||||
*
|
||||
* Included from linux/fs/namei.c
|
||||
*
|
||||
* Changes made by Lineo Inc. May 2001
|
||||
*/
|
||||
|
||||
#ifndef __BFIN_NAMEI_H
|
||||
#define __BFIN_NAMEI_H
|
||||
|
||||
/* This dummy routine maybe changed to something useful
|
||||
* for /usr/gnemul/ emulation stuff.
|
||||
* Look at asm-sparc/namei.h for details.
|
||||
*/
|
||||
|
||||
#define __emul_prefix() NULL
|
||||
|
||||
#endif
|
||||
89
include/asm-blackfin/page.h
Normal file
89
include/asm-blackfin/page.h
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
#ifndef _BLACKFIN_PAGE_H
|
||||
#define _BLACKFIN_PAGE_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)
|
||||
|
||||
/*
|
||||
* 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)
|
||||
|
||||
extern unsigned long memory_start;
|
||||
extern unsigned long memory_end;
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#include <asm/page_offset.h>
|
||||
#include <asm/io.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 MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
|
||||
|
||||
#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 VALID_PAGE(page) ((page - mem_map) < max_mapnr)
|
||||
|
||||
#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 pfn_valid(pfn) ((pfn) < max_mapnr)
|
||||
|
||||
#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
|
||||
((void *)(kaddr) < (void *)memory_end))
|
||||
|
||||
#include <asm-generic/page.h>
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _BLACKFIN_PAGE_H */
|
||||
6
include/asm-blackfin/page_offset.h
Normal file
6
include/asm-blackfin/page_offset.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
/* This handles the memory map.. */
|
||||
|
||||
#ifdef CONFIG_BFIN
|
||||
#define PAGE_OFFSET_RAW 0x00000000
|
||||
#endif
|
||||
22
include/asm-blackfin/param.h
Normal file
22
include/asm-blackfin/param.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef _BLACKFIN_PARAM_H
|
||||
#define _BLACKFIN_PARAM_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define HZ CONFIG_HZ
|
||||
#define USER_HZ 100
|
||||
#define CLOCKS_PER_SEC (USER_HZ)
|
||||
#endif
|
||||
|
||||
#ifndef HZ
|
||||
#define HZ 100
|
||||
#endif
|
||||
|
||||
#define EXEC_PAGESIZE 4096
|
||||
|
||||
#ifndef NOGROUP
|
||||
#define NOGROUP (-1)
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 64 /* max length of hostname */
|
||||
|
||||
#endif /* _BLACKFIN_PARAM_H */
|
||||
148
include/asm-blackfin/pci.h
Normal file
148
include/asm-blackfin/pci.h
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
/* Changed from asm-m68k version, Lineo Inc. May 2001 */
|
||||
|
||||
#ifndef _ASM_BFIN_PCI_H
|
||||
#define _ASM_BFIN_PCI_H
|
||||
|
||||
#include <asm/scatterlist.h>
|
||||
|
||||
/*
|
||||
*
|
||||
* Written by Wout Klaren.
|
||||
*/
|
||||
|
||||
/* Added by Chang Junxiao */
|
||||
#define PCIBIOS_MIN_IO 0x00001000
|
||||
#define PCIBIOS_MIN_MEM 0x10000000
|
||||
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
struct pci_ops;
|
||||
|
||||
/*
|
||||
* Structure with hardware dependent information and functions of the
|
||||
* PCI bus.
|
||||
*/
|
||||
struct pci_bus_info {
|
||||
|
||||
/*
|
||||
* Resources of the PCI bus.
|
||||
*/
|
||||
struct resource mem_space;
|
||||
struct resource io_space;
|
||||
|
||||
/*
|
||||
* System dependent functions.
|
||||
*/
|
||||
struct pci_ops *bfin_pci_ops;
|
||||
void (*fixup) (int pci_modify);
|
||||
void (*conf_device) (unsigned char bus, unsigned char device_fn);
|
||||
};
|
||||
|
||||
#define pcibios_assign_all_busses() 0
|
||||
static inline void pcibios_set_master(struct pci_dev *dev)
|
||||
{
|
||||
|
||||
/* No special bus mastering setup handling */
|
||||
}
|
||||
static inline void pcibios_penalize_isa_irq(int irq)
|
||||
{
|
||||
|
||||
/* We don't do dynamic PCI IRQ allocation */
|
||||
}
|
||||
static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
|
||||
size_t size, int direction)
|
||||
{
|
||||
if (direction == PCI_DMA_NONE)
|
||||
BUG();
|
||||
|
||||
/* return virt_to_bus(ptr); */
|
||||
return (dma_addr_t) ptr;
|
||||
}
|
||||
|
||||
/* Unmap a single streaming mode DMA translation. The dma_addr and size
|
||||
* must match what was provided for in a previous pci_map_single call. All
|
||||
* other usages are undefined.
|
||||
*
|
||||
* After this call, reads by the cpu to the buffer are guarenteed to see
|
||||
* whatever the device wrote there.
|
||||
*/
|
||||
static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
|
||||
size_t size, int direction)
|
||||
{
|
||||
if (direction == PCI_DMA_NONE)
|
||||
BUG();
|
||||
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
/* Map a set of buffers described by scatterlist in streaming
|
||||
* mode for DMA. This is the scather-gather version of the
|
||||
* above pci_map_single interface. Here the scatter gather list
|
||||
* elements are each tagged with the appropriate dma address
|
||||
* and length. They are obtained via sg_dma_{address,length}(SG).
|
||||
*
|
||||
* NOTE: An implementation may be able to use a smaller number of
|
||||
* DMA address/length pairs than there are SG table elements.
|
||||
* (for example via virtual mapping capabilities)
|
||||
* The routine returns the number of addr/length pairs actually
|
||||
* used, at most nents.
|
||||
*
|
||||
* Device ownership issues as mentioned above for pci_map_single are
|
||||
* the same here.
|
||||
*/
|
||||
static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
|
||||
int nents, int direction)
|
||||
{
|
||||
if (direction == PCI_DMA_NONE)
|
||||
BUG();
|
||||
return nents;
|
||||
}
|
||||
|
||||
/* Unmap a set of streaming mode DMA translations.
|
||||
* Again, cpu read rules concerning calls here are the same as for
|
||||
* pci_unmap_single() above.
|
||||
*/
|
||||
static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
|
||||
int nents, int direction)
|
||||
{
|
||||
if (direction == PCI_DMA_NONE)
|
||||
BUG();
|
||||
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
/* Make physical memory consistent for a single
|
||||
* streaming mode DMA translation after a transfer.
|
||||
*
|
||||
* If you perform a pci_map_single() but wish to interrogate the
|
||||
* buffer using the cpu, yet do not wish to teardown the PCI dma
|
||||
* mapping, you must call this function before doing so. At the
|
||||
* next point you give the PCI dma address back to the card, the
|
||||
* device again owns the buffer.
|
||||
*/
|
||||
static inline void pci_dma_sync_single(struct pci_dev *hwdev,
|
||||
dma_addr_t dma_handle, size_t size,
|
||||
int direction)
|
||||
{
|
||||
if (direction == PCI_DMA_NONE)
|
||||
BUG();
|
||||
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
/* Make physical memory consistent for a set of streaming
|
||||
* mode DMA translations after a transfer.
|
||||
*
|
||||
* The same as pci_dma_sync_single but for a scatter-gather list,
|
||||
* same rules and usage.
|
||||
*/
|
||||
static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
|
||||
struct scatterlist *sg, int nelems,
|
||||
int direction)
|
||||
{
|
||||
if (direction == PCI_DMA_NONE)
|
||||
BUG();
|
||||
|
||||
/* Nothing to do */
|
||||
}
|
||||
|
||||
#endif /* _ASM_BFIN_PCI_H */
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue