memory.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #ifndef _CFG_MEMORY_H_
  2. #define _CFG_MEMORY_H_
  3. /*
  4. * Copyright (C) 2004 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  23. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. *
  34. */
  35. /*!
  36. * $Log: memory.h,v $
  37. * Revision 1.1 2004/08/25 10:56:10 haraldkipp
  38. * More general memory layout definitions moved from cfg/bankmem.h to cfg/memory.h.
  39. *
  40. */
  41. /*!
  42. * \file cfg/memory.h
  43. * \brief Default memory layout.
  44. *
  45. * Values can be changed by the configurator.
  46. */
  47. #ifndef NUTMEM_SIZE
  48. /*!
  49. * \brief Number of bytes available in fast data memory.
  50. *
  51. * On most platforms this value specifies the total number of bytes
  52. * available in RAM.
  53. *
  54. * On Harvard architectures this value specifies the size of the data
  55. * memory. It will be occupied by global variables and static data.
  56. * Any remaining space will be added to the Nut/OS heap during system
  57. * initialization.
  58. *
  59. */
  60. #define NUTMEM_SIZE 4096
  61. #endif
  62. #ifndef NUTMEM_START
  63. /*!
  64. * \brief First address of fast data memory.
  65. */
  66. #define NUTMEM_START 0x100
  67. #endif
  68. #ifndef NUTMEM_RESERVED
  69. /*!
  70. * \brief Number of bytes reserved for special purposes.
  71. *
  72. * Right now this is used with the AVR platform only. The specified
  73. * number of bytes may be used by a device driver when the external
  74. * memory interface is disabled.
  75. */
  76. #define NUTMEM_RESERVED 64
  77. #endif
  78. #ifndef NUTXMEM_SIZE
  79. /*!
  80. * \brief Number of bytes available in extended data memory.
  81. */
  82. #define NUTXMEM_SIZE 28416
  83. #endif
  84. #ifndef NUTXMEM_START
  85. /*
  86. * \brief First address of extended data memory.
  87. */
  88. #define NUTXMEM_START 0x1100
  89. #endif
  90. #ifndef NUTBANK_COUNT
  91. /*!
  92. * \brief Number of memory banks.
  93. *
  94. * For systems without banked memory this is set to zero.
  95. * Ethernut 2 has 30 memory banks.
  96. */
  97. #define NUTBANK_COUNT 0
  98. #endif
  99. #ifndef NUTBANK_START
  100. /*!
  101. * \brief Start address of memory banks.
  102. *
  103. * For systems without banked memory this is ignored.
  104. */
  105. #define NUTBANK_START 0x8000
  106. #endif
  107. #ifndef NUTBANK_SIZE
  108. /*!
  109. * \brief Size of a single memory bank.
  110. *
  111. * For systems without banked memory this is ignored.
  112. */
  113. #define NUTBANK_SIZE 0x4000
  114. #endif
  115. #ifndef NUTBANK_SR
  116. /*!
  117. * \brief Address of the bank select register.
  118. *
  119. * For systems without banked memory this is ignored.
  120. */
  121. #define NUTBANK_SR 0xFF00
  122. #endif
  123. #endif