⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memory.h

📁 linux下三星4510的BSP驱动程序!已经试验成功
💻 H
字号:
/********************************************************************/
/*                                                                  */
/*      Timer Header for KS32C5000                                  */
/*------------------------------------------------------------------*/
/*      Copyright (C) 1998 Samsung Electronics.                     */
/*------------------------------------------------------------------*/
/*      Modified, programmed by Young-sun Kim                       */
/*                                                                  */
/*      Description : 1998-02-03 first edited                       */
/********************************************************************/

#ifndef _MEM_TEST_
#define _MEM_TEST_

#define MemTestOk	1
#define MemTestFail	0

// Memory Copy Address
//#define MemTestSize     0x0010000
#define MemCopySrc      0x1100000
//#define MemCopyDest     0x1200000
#define MemTestLoop     5           //default memory test counter
#define TestPattern     0x5a5a5a5a

#define HEAPEND 0x13EE7CC
#define AllocNonCacheAreaBase 0x53EE7D0
#define AllocNonCacheAreaEnd 0x53FE7CC

// Define For External I/O Bank
#define EXTIOBASE 	( (REFEXTCON & 0x3FF) << 16 )

// External I/O Bank 0 Control
#define TCOS0	(0x111 << 0) 
#define TACS0	(0x110 << 3) 
#define TCOH0	(0x010 << 6) 
#define TACC0	(0x111 << 9) 

// External I/O Bank 1 Control
#define TCOS1	(0x111 << 16) 
#define TACS1	(0x110 << 19) 
#define TCOH1	(0x010 << 22) 
#define TACC1	(0x111 << 25) 

// External I/O Bank 2 Control
#define TCOS2	(0x111 << 0) 
#define TACS2	(0x110 << 3) 
#define TCOH2	(0x010 << 6) 
#define TACC2	(0x111 << 9) 

// External I/O Bank 3 Control
#define TCOS3	(0x111 << 16) 
#define TACS3	(0x110 << 19) 
#define TCOH3	(0x010 << 22) 
#define TACC3	(0x111 << 25) 

extern void MemoryPartTest(void) ;
/*
 * Memory Test Select Function
 */


extern void MemoryTest(void);
/*
 * DRAM Memory test top module.
 * word,halfword,byte test will be made at this function.
 * Memory source address is 0x1100000, destination address
 * is 0x1200000. Test Pattern & test repeat times are changed
 * above Define variable.
 */

extern int MemTest(U32 * /*src*/,U32 * /*dest*/,int /*size*/,int /*repeat*/);
/*
 * Memory word, halfword, byte copy & compare test program
 * source address is src, destination address is dest, test memory size size
 * test repeat times is repeat.
 */

extern void MemoryDump(void);
/* 
 *  DRAM Memory dump test program.
 *  Memory dump initial address is 0x1000000
 *                  end address is 0x1000100
 */

extern void MemDump(U32 * /*start address*/,U32 * /*End address*/);
/*
 * Memory dump function
 */

extern void MemClear(U32 *startaddr, U32 *endaddr) ;
/* 
 *  Memory Clear
 *  ~~~~~~~~~~~~~~~~~~~
 */

extern void MemPatternFill(void) ;
/* 
 *  Memory Pattern Fill
 *  ~~~~~~~~~~~~~~~~~~~
 */

extern void MemPatternSearch(void) ;
/* 
 *  Memory Pattern Search
 *  ~~~~~~~~~~~~~~~~~~~~~
 */

extern void MemTestInit(U32 * /*src addr */,int /*size*/);
/*
 * Initialize memory with TestPattern from MemCopySrc address 
 * until reach to zero count value.
 * 
 * Where initial test pattern is 0x5a5a5a5a
 *       Source Address,MemCopySrc is 0x1100000
 *       count is memory test size(0x0010000)
 */


extern int ByteCopyTest(U32 * /*Dest*/,U32 * /*Src*/,int /*TestSize*/);
/*
 *  DRAM memory Copy & compare test program.
 *  (Byte Test)
 *  Copy memory area is from  MemCopySrc to MemCopyDest with 
 *  size of MemTestSize.
 */

extern int SWordCopyTest(U32 * /*Dest*/,U32 * /*Src*/,int /*TestSize*/);
/*
 *  DRAM memory Copy & compare test program.
 *  (Halfword Test)
 */

extern int WordCopyTest(U32 * /*Dest*/,U32 * /*Src*/,int /*TestSize*/);
/*
 *  DRAM memory Copy & compare test program.
 *  (Word Test)
 */


extern void bcopy(void * /*dstp*/, void * /*srcp*/, int /*count*/) ;
extern void scopy(void * /*dstp*/, void * /*srcp*/, int /*count*/);
extern void wcopy(void * /*dstp*/, void * /*srcp*/, int /*count*/);
/*
 *  Function for byte copy from srcp to dstp with count times
 *  (bcopy: Byte copy & compare, scopy: Halfword, wcopy: word)
 *
 *  Where dstp is destination address,
 *        srcp is soruce address
 *        count is memory test size
 */

extern void ExtIOBankTest(void) ;
/*
 *  Function for External I/O Bank Test
 */



extern int bcomp(void * /*dstp*/, void * /*srcp*/, int /*count*/) ;
extern int scomp(void * /*dstp*/, void * /*srcp*/, int /*count*/) ;
extern int wcomp(void * /*dstp*/, void * /*srcp*/, int /*count*/) ;
/*
 * Memory data compare test functions
 */

extern int  PatternGen(unsigned int /*seed*/);
extern void PrintMemTestStatus(int);


// Allocation For NonCacheable Area
extern void *nmalloc(unsigned nbyte) ;
extern void nmfree(void *pt) ;

// Allocation For Cacheable Area
extern void *malloc(unsigned nbyte) ;
extern void free(void *pt) ;

#endif /* _MEM_TEST_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -