📄 xscale.h
字号:
/***************************************************************************
*
* Copyright (C) 2004-2005 SMSC
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
***************************************************************************
* File: xscale.h
*/#ifndef USING_LINT#include <asm/hardware.h>#include <asm/arch/mainstone.h>#endif //not USING_LINT
#ifndef USE_XSCALE
#error need to define USE_XSCALE
#endiftypedef struct _PLATFORM_DATA { DWORD dwIdRev; DWORD dwIrq; void *dev_id;} PLATFORM_DATA, *PPLATFORM_DATA;/* for register access */ typedef volatile unsigned char Reg8;typedef volatile unsigned short Reg16;typedef volatile DWORD Reg32;typedef volatile unsigned char * pReg8;typedef volatile unsigned short * pReg16;typedef volatile unsigned long * pReg32;// Base address (Virtual Address)#define LAN_CSBASE MST_EXP_BASE#define LAN_IRQ MAINSTONE_nExBRD_IRQ#define LAN_DMACH (0UL)// cache organization parameters#define CACHE_SIZE_KB 32UL#define CACHE_WAYS 32UL#define CACHE_LINE_BYTES 32UL#define CACHE_ALIGN_MASK (~(CACHE_LINE_BYTES - 1UL))#define CACHE_BYTES_PER_WAY ((CACHE_SIZE_KB * 1024UL) / CACHE_WAYS)#define PLATFORM_CACHE_LINE_BYTES (CACHE_LINE_BYTES)#define PLATFORM_IRQ_POL (0UL)#define PLATFORM_IRQ_TYPE (0UL)#define PLATFORM_INT_DEAS (0x0FUL)#define PLATFORM_DMA_THRESHOLD (200)#define PLATFORM_IRQ (198)#define PLATFORM_RX_DMA (1)#define PLATFORM_TX_DMA (2)
#define PLATFORM_NAME "XScale"
#ifdef USING_LINTvoid CleanCacheLine(DWORD addr);void DrainWriteBuffers(void);#else //not USING_LINTstatic inline void CleanCacheLine(DWORD addr){ addr = addr; // let lint be happy :-) __asm("mov r0, %0" : : "r" (addr): "r0"); __asm("mcr p15, 0, r0, c7, c10, 1"); __asm("mcr p15, 0, r0, c7, c6, 1");}static inline void DrainWriteBuffers(void){ __asm("mcr p15, 0, r0, c7, c10, 4");}#endif //not USING_LINT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -