dpconfig.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:5k
源码类别:

VxWorks

开发平台:

C/C++

  1. /*
  2. **  File:   dpconfig.h  
  3. **  
  4. **  Description:
  5. **  This file contains configuration information which needs to be ported
  6. **  to new platforms running the netrom demo code.  Sections requiring
  7. **  porting are marked with:
  8. ** *** PORT THIS SECTION ***
  9. **
  10. **      Copyright (c) 1996 Applied Microsystems Corp.
  11. **                          All Rights Reserved
  12. **
  13. ** Redistribution and use in source and binary forms are permitted 
  14. ** provided that the above copyright notice and this paragraph are 
  15. ** duplicated in all such forms and that any documentation,
  16. ** advertising materials, and other materials related to such
  17. ** distribution and use acknowledge that the software was developed 
  18. ** by Applied Microsystems Corp. (the Company).  The name of the 
  19. ** Company may not be used to endorse or promote products derived
  20. ** from this software without specific prior written permission. 
  21. ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 
  22. ** IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  23. ** WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
  24. **
  25. **  Modification History:
  26. */
  27. #ifndef _dpconfig_h
  28. #define _dpconfig_h
  29. /* Sizes of common rom types */
  30. #define RS_27C010 (128 * 1024L)
  31. #define RS_27C020 (256 * 1024L)
  32. #define RS_27C040 (512 * 1024L)
  33. /* Generic macros */
  34. #define True 1
  35. #define False 0
  36. /* 
  37.  * This section contains configuration information for the dualport protocols.
  38.  * These parameters essentially become inputs to the config_dpram() call
  39.  * which initializes the target side of the protocols.  The semantics of 
  40.  * these parameters are:
  41.  *
  42.  *  ROM_START      is the 32-bit target address of the start of the ROM
  43.  *                 words containing dualport memory.  This is *not*
  44.  *                 the address of dualport memory itself, but is the base
  45.  *                 address of the rom word containing pod 0.
  46.  * 
  47.  *  ROMWORDWIDTH   is the number of bytes making up a 'word'.  The
  48.  *                 value describes the memory sybsystem of the target,
  49.  *                 not the word size of the CPU.  For example,
  50.  *                 if ROM memory is organized as an array of 16 bit
  51.  *                 words, this number is two.  If the processor has a
  52.  *                 32-bit architecture, but only one 8-bit ROM is
  53.  *                 used to provide ROM memory, this value is 1.
  54.  *
  55.  *  POD_0_INDEX    is the index within a rom word of pod 0.  This number
  56.  *                 reflects the ROM byte emulated by pod 0.  The following
  57.  *                 table shows what value to use for common word sizes
  58.  *                 and podorder environment variable:
  59.  *                      
  60.  *
  61.  *                          Word size      podorder        POD_0_INDEX
  62.  *                          --------       --------        -----------
  63.  *                           8-bits     (any podorder)         0
  64.  *                          16-bits     podorder == 0:1        0
  65.  *                                      podorder == 1:0        1
  66.  *                          32-bits     podorder == 0:1:2:3    0
  67.  *                                      podorder == 3:2:1:0    3
  68.  *
  69.  *  NUMACCESSES    is the number of accesses the target processor makes
  70.  *                 to pod 0 in the course of reading a single 8-bit
  71.  *                 value from the pod.
  72.  *
  73.  *  ROMSIZE        is the number of bytes in an individual ROM.  This
  74.  *                 number should agree with NetROM's romtype environment
  75.  *                 variable.
  76.  *
  77.  *  DP_BASE        is the 32-bit target address of the first byte of dualport
  78.  *                 memory.  Dualport memory is always in pod 0.  The default
  79.  *                 location is 2K from the end of pod 0.  The formula below
  80.  *                 is correct for this default location.  If you have moved
  81.  *                 dualport RAM, you must adjust the formula to give the
  82.  *                 correct address.  This define should be the first argument
  83.  *                 in your call to config_dpram().
  84.  *
  85.  * Consult the NetROM user's manual for more information on the readaddress
  86.  * protocol and on the parameters to config_dpram().
  87.  *
  88.  */
  89. /* *** PORT THIS SECTION ***
  90.  */
  91. #if 0
  92. #define ROM_START  0x00000000L 
  93. #define ROMWORDWIDTH     2
  94. #define POD_0_INDEX  0
  95. #define NUMACCESSES  1
  96. #define ROMSIZE  RS_27C020
  97. /* The following formula is correct ONLY if dualport is at the default 
  98.    location, at the top of pod 0 */
  99. #define DP_BASE (ROM_START + ((ROMSIZE - DUALPORT_SIZE) * ROMWORDWIDTH))
  100. #endif
  101. #define HASCACHE  False 
  102. #define READONLY_TARGET 
  103. /* #define READWRITE_TARGET */
  104. #define VETHER
  105. #define USE_MSGS
  106. #endif /* _dpconfig_h */