memory.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* Memory.h - Memory mappings and remapping functions declarations */
  2. /* Copyright - Galileo technology. */
  3. #ifndef __INCmemoryh
  4. #define __INCmemoryh
  5. /* includes */
  6. #include "core.h"
  7. /* defines */
  8. #define DONT_MODIFY     0xffffffff
  9. #define PARITY_SUPPORT  0x40000000
  10. #define _8BIT           0x00000000
  11. #define _16BIT          0x00010000
  12. #define _32BIT          0x00020000
  13. #define _64BIT          0x00030000
  14. /* typedefs */
  15. typedef enum __memBank{BANK0,BANK1,BANK2,BANK3} MEMORY_BANK;
  16. typedef enum __device{DEVICE0,DEVICE1,DEVICE2,DEVICE3,BOOT_DEVICE} DEVICE;
  17. unsigned int   getMemoryBankBaseAddress(MEMORY_BANK bank);
  18. unsigned int   getDeviceBaseAddress(DEVICE device);
  19. unsigned int   getMemoryBankSize(MEMORY_BANK bank);
  20. unsigned int   getDeviceSize(DEVICE device);
  21. unsigned int   getDeviceWidth(DEVICE device);
  22. bool mapMemoryBanks0and1(unsigned int bank0Base,unsigned int bank0Length,
  23.                          unsigned int bank1Base,unsigned int bank1Length);
  24. bool mapMemoryBanks2and3(unsigned int bank2Base,unsigned int bank2Length,
  25.                          unsigned int bank3Base,unsigned int bank3Length);
  26. bool mapDevices0_1and2MemorySpace(unsigned int device0Base,
  27.                                   unsigned int device0Length,
  28.                                   unsigned int device1Base,
  29.                                   unsigned int device1Length,
  30.                                   unsigned int device2Base,
  31.                                   unsigned int device2Length);
  32. bool mapDevices3andBootMemorySpace(unsigned int device3Base,
  33.                                    unsigned int device3Length,
  34.                                    unsigned int bootDeviceBase,
  35.                                    unsigned int bootDeviceLength);
  36. bool mapInternalRegistersMemorySpace(unsigned int internalRegBase);
  37. bool modifyDeviceParameters(DEVICE device,unsigned int TurnOff,
  38.                             unsigned int AccToFirst,unsigned int AccToNext,
  39.                             unsigned int ALEtoWr, unsigned int WrActive,
  40.                             unsigned int WrHigh,unsigned int Width,
  41.                             bool ParitySupport);
  42. bool remapAddress(unsigned int remapReg, unsigned int remapValue);
  43. #endif /* __INCmemoryh */