You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: Blackfin arch: Fix PM building on BF52x: No ROTWE on BF52x, add USBWE Blackfin arch: sram: use 'unsigned long' for irqflags Blackfin arch: let PCI depend on BROKEN Blackfin arch: move include/asm-blackfin header files to arch/blackfin Blackfin arch: fix bug - MPU crashes under stress Blackfin arch: Fix bug - when to rmmod the L1_module, it stucks and then reboot the board. Blackfin arch: dont actually need to muck with EMAC_SYSTAT for BF52x for demuxing Blackfin arch: Add MTD Partitions for MTD_DATAFLASH, increase max SPI SCLK
This commit is contained in:
@@ -1 +0,0 @@
|
||||
+mach
|
||||
@@ -1,3 +0,0 @@
|
||||
include include/asm-generic/Kbuild.asm
|
||||
|
||||
unifdef-y += fixed_code.h
|
||||
@@ -1,19 +0,0 @@
|
||||
#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)
|
||||
|
||||
#endif /* __BFIN_A_OUT_H__ */
|
||||
@@ -1,144 +0,0 @@
|
||||
#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 __ */
|
||||
@@ -1,4 +0,0 @@
|
||||
#ifndef __ASMBFIN_AUXVEC_H
|
||||
#define __ASMBFIN_AUXVEC_H
|
||||
|
||||
#endif
|
||||
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* 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_4M)
|
||||
# define DMA_UNCACHED_REGION (4 * 1024 * 1024)
|
||||
#elif 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 unsigned long sclk_to_usecs(unsigned long sclk);
|
||||
extern unsigned long usecs_to_sclk(unsigned long usecs);
|
||||
|
||||
extern void dump_bfin_process(struct pt_regs *regs);
|
||||
extern void dump_bfin_mem(struct pt_regs *regs);
|
||||
extern void dump_bfin_trace_buffer(void);
|
||||
|
||||
/* init functions only */
|
||||
extern int init_arch_irq(void);
|
||||
extern void bfin_icache_init(void);
|
||||
extern void bfin_dcache_init(void);
|
||||
extern void init_exception_vectors(void);
|
||||
extern void program_IAR(void);
|
||||
|
||||
extern void bfin_reset(void);
|
||||
extern asmlinkage void lower_to_irq14(void);
|
||||
extern asmlinkage void bfin_return_from_exception(void);
|
||||
extern asmlinkage void evt14_softirq(void);
|
||||
extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
|
||||
extern int bfin_internal_set_wake(unsigned int irq, unsigned int state);
|
||||
|
||||
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 void *l2_sram_alloc(size_t);
|
||||
extern void *l2_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 l2_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
|
||||
#define L2_SRAM 0x00000008
|
||||
extern void *sram_alloc_with_lsl(size_t, unsigned long);
|
||||
extern int sram_free_with_lsl(const void*);
|
||||
|
||||
extern const char bfin_board_name[];
|
||||
|
||||
extern unsigned long bfin_sic_iwr[];
|
||||
extern unsigned vr_wakeup;
|
||||
extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
|
||||
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[],
|
||||
_stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
|
||||
_ebss_l2[], _l2_lma_start[];
|
||||
|
||||
/* only used when CONFIG_MTD_UCLINUX */
|
||||
extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
|
||||
|
||||
#ifdef CONFIG_BFIN_ICACHE_LOCK
|
||||
extern void cache_grab_lock(int way);
|
||||
extern void cache_lock(int way);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _BLACKFIN_H_ */
|
||||
@@ -1,137 +0,0 @@
|
||||
/************************************************************
|
||||
|
||||
* Copyright (C) 2006-2008, 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 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 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
|
||||
|
||||
#define CMD_SPI_SET_BAUDRATE 2
|
||||
#define CMD_SPI_GET_SYSTEMCLOCK 25
|
||||
#define CMD_SPI_SET_WRITECONTINUOUS 26
|
||||
|
||||
/* device.platform_data for SSP controller devices */
|
||||
struct bfin5xx_spi_master {
|
||||
u16 num_chipselect;
|
||||
u8 enable_dma;
|
||||
u16 pin_req[4];
|
||||
};
|
||||
|
||||
/* 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;
|
||||
u16 cs_chg_udelay; /* Some devices require 16-bit delays */
|
||||
};
|
||||
|
||||
#endif /* _SPI_CHANNEL_H_ */
|
||||
@@ -1,13 +0,0 @@
|
||||
#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
|
||||
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
* 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__*/
|
||||
@@ -1,218 +0,0 @@
|
||||
#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__
|
||||
|
||||
#ifndef _LINUX_BITOPS_H
|
||||
#error only <linux/bitops.h> can be included directly
|
||||
#endif
|
||||
|
||||
#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/lock.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 */
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Common header file for blackfin family of processors.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BLACKFIN_H_
|
||||
#define _BLACKFIN_H_
|
||||
|
||||
#define LO(con32) ((con32) & 0xFFFF)
|
||||
#define lo(con32) ((con32) & 0xFFFF)
|
||||
#define HI(con32) (((con32) >> 16) & 0xFFFF)
|
||||
#define hi(con32) (((con32) >> 16) & 0xFFFF)
|
||||
|
||||
#include <asm/mach/anomaly.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* SSYNC implementation for C file */
|
||||
static inline void SSYNC(void)
|
||||
{
|
||||
int _tmp;
|
||||
if (ANOMALY_05000312)
|
||||
__asm__ __volatile__(
|
||||
"cli %0;"
|
||||
"nop;"
|
||||
"nop;"
|
||||
"ssync;"
|
||||
"sti %0;"
|
||||
: "=d" (_tmp)
|
||||
);
|
||||
else if (ANOMALY_05000244)
|
||||
__asm__ __volatile__(
|
||||
"nop;"
|
||||
"nop;"
|
||||
"nop;"
|
||||
"ssync;"
|
||||
);
|
||||
else
|
||||
__asm__ __volatile__("ssync;");
|
||||
}
|
||||
|
||||
/* CSYNC implementation for C file */
|
||||
static inline void CSYNC(void)
|
||||
{
|
||||
int _tmp;
|
||||
if (ANOMALY_05000312)
|
||||
__asm__ __volatile__(
|
||||
"cli %0;"
|
||||
"nop;"
|
||||
"nop;"
|
||||
"csync;"
|
||||
"sti %0;"
|
||||
: "=d" (_tmp)
|
||||
);
|
||||
else if (ANOMALY_05000244)
|
||||
__asm__ __volatile__(
|
||||
"nop;"
|
||||
"nop;"
|
||||
"nop;"
|
||||
"csync;"
|
||||
);
|
||||
else
|
||||
__asm__ __volatile__("csync;");
|
||||
}
|
||||
|
||||
#else /* __ASSEMBLY__ */
|
||||
|
||||
/* SSYNC & CSYNC implementations for assembly files */
|
||||
|
||||
#define ssync(x) SSYNC(x)
|
||||
#define csync(x) CSYNC(x)
|
||||
|
||||
#if ANOMALY_05000312
|
||||
#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
|
||||
#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
|
||||
|
||||
#elif ANOMALY_05000244
|
||||
#define SSYNC(scratch) nop; nop; nop; SSYNC;
|
||||
#define CSYNC(scratch) nop; nop; nop; CSYNC;
|
||||
|
||||
#else
|
||||
#define SSYNC(scratch) SSYNC;
|
||||
#define CSYNC(scratch) CSYNC;
|
||||
|
||||
#endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#include <asm/mach/blackfin.h>
|
||||
#include <asm/bfin-global.h>
|
||||
|
||||
#endif /* _BLACKFIN_H_ */
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef _BLACKFIN_BUG_H
|
||||
#define _BLACKFIN_BUG_H
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#define HAVE_ARCH_BUG
|
||||
|
||||
#define BUG() do { \
|
||||
dump_bfin_trace_buffer(); \
|
||||
printk(KERN_EMERG "BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
|
||||
panic("BUG!"); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#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 */
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* 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_BFIN_DCACHE) && defined(CONFIG_BFIN_ICACHE)
|
||||
|
||||
# if defined(CONFIG_BFIN_WT)
|
||||
blackfin_icache_flush_range((start), (end));
|
||||
# else
|
||||
blackfin_icache_dcache_flush_range((start), (end));
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
# if defined(CONFIG_BFIN_ICACHE)
|
||||
blackfin_icache_flush_range((start), (end));
|
||||
# endif
|
||||
# if defined(CONFIG_BFIN_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_BFIN_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_BFIN_DCACHE) && defined(CONFIG_BFIN_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_ICACHEFLUSH_H */
|
||||
@@ -1,100 +0,0 @@
|
||||
#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
|
||||
*/
|
||||
__wsum csum_partial(const void *buff, int len, __wsum 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
|
||||
*/
|
||||
|
||||
__wsum csum_partial_copy(const void *src, void *dst,
|
||||
int len, __wsum 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 __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *csum_err);
|
||||
|
||||
#define csum_partial_copy_nocheck(src, dst, len, sum) \
|
||||
csum_partial_copy((src), (dst), (len), (sum))
|
||||
|
||||
__sum16 ip_fast_csum(unsigned char *iph, unsigned int ihl);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline __sum16 csum_fold(__wsum 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 __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum 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 __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum 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 __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
#endif /* _BFIN_CHECKSUM_H */
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
#ifndef __ASM_BFIN_CPLB_MPU_H
|
||||
#define __ASM_BFIN_CPLB_MPU_H
|
||||
|
||||
struct cplb_entry {
|
||||
unsigned long data, addr;
|
||||
};
|
||||
|
||||
struct mem_region {
|
||||
unsigned long start, end;
|
||||
unsigned long dcplb_data;
|
||||
unsigned long icplb_data;
|
||||
};
|
||||
|
||||
extern struct cplb_entry dcplb_tbl[MAX_CPLBS];
|
||||
extern struct cplb_entry icplb_tbl[MAX_CPLBS];
|
||||
extern int first_switched_icplb;
|
||||
extern int first_mask_dcplb;
|
||||
extern int first_switched_dcplb;
|
||||
|
||||
extern int nr_dcplb_miss, nr_icplb_miss, nr_icplb_supv_miss, nr_dcplb_prot;
|
||||
extern int nr_cplb_flush;
|
||||
|
||||
extern int page_mask_order;
|
||||
extern int page_mask_nelts;
|
||||
|
||||
extern unsigned long *current_rwx_mask;
|
||||
|
||||
extern void flush_switched_cplbs(void);
|
||||
extern void set_mask_dcplbs(unsigned long *);
|
||||
|
||||
extern void __noreturn panic_cplb_error(int seqstat, struct pt_regs *);
|
||||
|
||||
#endif /* __ASM_BFIN_CPLB_MPU_H */
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* File: include/asm-blackfin/cplb.h
|
||||
* Based on: include/asm-blackfin/mach-bf537/bf537.h
|
||||
* Author: Robin Getz <rgetz@blackfin.uclinux.org>
|
||||
*
|
||||
* Created: 2000
|
||||
* Description: Common CPLB definitions for CPLB init
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef _CPLB_H
|
||||
#define _CPLB_H
|
||||
|
||||
#include <asm/blackfin.h>
|
||||
#include <asm/mach/anomaly.h>
|
||||
|
||||
#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_BFIN_WT/CONFIG_BFIN_WB*/
|
||||
|
||||
#if ANOMALY_05000158
|
||||
#define ANOMALY_05000158_WORKAROUND 0x200
|
||||
#else
|
||||
#define ANOMALY_05000158_WORKAROUND 0x0
|
||||
#endif
|
||||
|
||||
#define CPLB_COMMON (CPLB_DIRTY | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
|
||||
|
||||
#ifdef CONFIG_BFIN_WB /*Write Back Policy */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_COMMON)
|
||||
#else /*Write Through */
|
||||
#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_COMMON)
|
||||
#endif
|
||||
|
||||
#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON)
|
||||
#define L2_MEMORY (CPLB_COMMON)
|
||||
#define SDRAM_DNON_CHBL (CPLB_COMMON)
|
||||
#define SDRAM_EBIU (CPLB_COMMON)
|
||||
#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 */
|
||||
|
||||
#ifdef CONFIG_MPU
|
||||
#define MAX_CPLBS 16
|
||||
#else
|
||||
#define MAX_CPLBS (16 * 2)
|
||||
#endif
|
||||
|
||||
#define ASYNC_MEMORY_CPLB_COVERAGE ((ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \
|
||||
ASYNC_BANK2_SIZE + ASYNC_BANK3_SIZE) / SIZE_4M)
|
||||
|
||||
#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_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 */
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef __ASM_CPLBINIT_H__
|
||||
#define __ASM_CPLBINIT_H__
|
||||
|
||||
#include <asm/blackfin.h>
|
||||
#include <asm/cplb.h>
|
||||
|
||||
#ifdef CONFIG_MPU
|
||||
|
||||
#include <asm/cplb-mpu.h>
|
||||
|
||||
#else
|
||||
|
||||
#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;
|
||||
};
|
||||
|
||||
extern u_long icplb_table[];
|
||||
extern u_long dcplb_table[];
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
extern u_long ipdt_table[];
|
||||
extern u_long dpdt_table[];
|
||||
#ifdef CONFIG_CPLB_INFO
|
||||
extern u_long ipdt_swapcount_table[];
|
||||
extern u_long dpdt_swapcount_table[];
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_MPU */
|
||||
|
||||
extern unsigned long reserved_mem_dcache_on;
|
||||
extern unsigned long reserved_mem_icache_on;
|
||||
|
||||
extern void generate_cpl_tables(void);
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user