config.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * config.h - setup common defines for Blackfin boards based on config.h
  3. *
  4. * Copyright (c) 2007-2009 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef __ASM_BLACKFIN_CONFIG_POST_H__
  9. #define __ASM_BLACKFIN_CONFIG_POST_H__
  10. /* Sanity check CONFIG_BFIN_CPU */
  11. #ifndef CONFIG_BFIN_CPU
  12. # error CONFIG_BFIN_CPU: your board config needs to define this
  13. #endif
  14. #ifndef CONFIG_BFIN_SCRATCH_REG
  15. # define CONFIG_BFIN_SCRATCH_REG retn
  16. #endif
  17. /* Relocation to SDRAM works on all Blackfin boards */
  18. #define CONFIG_RELOC_FIXUP_WORKS
  19. /* Make sure the structure is properly aligned */
  20. #if ((CONFIG_SYS_GBL_DATA_ADDR & -4) != CONFIG_SYS_GBL_DATA_ADDR)
  21. # error CONFIG_SYS_GBL_DATA_ADDR: must be 4 byte aligned
  22. #endif
  23. /* Set default CONFIG_VCO_HZ if need be */
  24. #if !defined(CONFIG_VCO_HZ)
  25. # if (CONFIG_CLKIN_HALF == 0)
  26. # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
  27. # else
  28. # define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / 2)
  29. # endif
  30. #endif
  31. /* Set default CONFIG_CCLK_HZ if need be */
  32. #if !defined(CONFIG_CCLK_HZ)
  33. # if (CONFIG_PLL_BYPASS == 0)
  34. # define CONFIG_CCLK_HZ (CONFIG_VCO_HZ / CONFIG_CCLK_DIV)
  35. # else
  36. # define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
  37. # endif
  38. #endif
  39. /* Set default CONFIG_SCLK_HZ if need be */
  40. #if !defined(CONFIG_SCLK_HZ)
  41. # if (CONFIG_PLL_BYPASS == 0)
  42. # define CONFIG_SCLK_HZ (CONFIG_VCO_HZ / CONFIG_SCLK_DIV)
  43. # else
  44. # define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
  45. # endif
  46. #endif
  47. /* Since we use these to program PLL registers directly,
  48. * make sure the values are sane and won't screw us up.
  49. */
  50. #if (CONFIG_VCO_MULT & 0x3F) != CONFIG_VCO_MULT
  51. # error CONFIG_VCO_MULT: Invalid value: must fit in 6 bits (0 - 63)
  52. #endif
  53. #if (CONFIG_CLKIN_HALF & 0x1) != CONFIG_CLKIN_HALF
  54. # error CONFIG_CLKIN_HALF: Invalid value: must be 0 or 1
  55. #endif
  56. #if (CONFIG_PLL_BYPASS & 0x1) != CONFIG_PLL_BYPASS
  57. # error CONFIG_PLL_BYPASS: Invalid value: must be 0 or 1
  58. #endif
  59. /* Using L1 scratch pad makes sense for everyone by default. */
  60. #ifndef CONFIG_LINUX_CMDLINE_ADDR
  61. # define CONFIG_LINUX_CMDLINE_ADDR L1_SRAM_SCRATCH
  62. #endif
  63. #ifndef CONFIG_LINUX_CMDLINE_SIZE
  64. # define CONFIG_LINUX_CMDLINE_SIZE L1_SRAM_SCRATCH_SIZE
  65. #endif
  66. /* Set default SPI flash CS to the one we boot from */
  67. #if defined(CONFIG_ENV_IS_IN_SPI_FLASH) && !defined(CONFIG_ENV_SPI_CS)
  68. # define CONFIG_ENV_SPI_CS BFIN_BOOT_SPI_SSEL
  69. #endif
  70. /* Default/common Blackfin memory layout */
  71. #ifndef CONFIG_SYS_SDRAM_BASE
  72. # define CONFIG_SYS_SDRAM_BASE 0
  73. #endif
  74. #ifndef CONFIG_SYS_MAX_RAM_SIZE
  75. # define CONFIG_SYS_MAX_RAM_SIZE (CONFIG_MEM_SIZE * 1024 * 1024)
  76. #endif
  77. #ifndef CONFIG_SYS_MONITOR_BASE
  78. # define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_MAX_RAM_SIZE - CONFIG_SYS_MONITOR_LEN)
  79. #endif
  80. #ifndef CONFIG_SYS_MALLOC_BASE
  81. # define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
  82. #endif
  83. #ifndef CONFIG_SYS_GBL_DATA_SIZE
  84. # define CONFIG_SYS_GBL_DATA_SIZE (128)
  85. #endif
  86. #ifndef CONFIG_SYS_GBL_DATA_ADDR
  87. # define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - CONFIG_SYS_GBL_DATA_SIZE)
  88. #endif
  89. #ifndef CONFIG_STACKBASE
  90. # define CONFIG_STACKBASE (CONFIG_SYS_GBL_DATA_ADDR - 4)
  91. #endif
  92. #ifndef CONFIG_SYS_MEMTEST_START
  93. # define CONFIG_SYS_MEMTEST_START 0
  94. #endif
  95. #ifndef CONFIG_SYS_MEMTEST_END
  96. # define CONFIG_SYS_MEMTEST_END (CONFIG_STACKBASE - 8192 + 4)
  97. #endif
  98. /* Check to make sure everything fits in external RAM */
  99. #if ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) > CONFIG_SYS_MAX_RAM_SIZE)
  100. # error Memory Map does not fit into configuration
  101. #endif
  102. /* Default/common Blackfin environment settings */
  103. #ifndef CONFIG_LOADADDR
  104. # define CONFIG_LOADADDR 0x1000000
  105. #endif
  106. #ifndef CONFIG_SYS_LOAD_ADDR
  107. # define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  108. #endif
  109. #ifndef CONFIG_SYS_BOOTM_LEN
  110. # define CONFIG_SYS_BOOTM_LEN 0x4000000
  111. #endif
  112. #ifndef CONFIG_SYS_PROMPT
  113. # define CONFIG_SYS_PROMPT "bfin> "
  114. #endif
  115. #ifndef CONFIG_SYS_CBSIZE
  116. # define CONFIG_SYS_CBSIZE 1024
  117. #endif
  118. #ifndef CONFIG_SYS_BARGSIZE
  119. # define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  120. #endif
  121. #ifndef CONFIG_SYS_PBSIZE
  122. # define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  123. #endif
  124. #ifndef CONFIG_SYS_MAXARGS
  125. # define CONFIG_SYS_MAXARGS 16
  126. #endif
  127. #if defined(CONFIG_SYS_HZ)
  128. # if (CONFIG_SYS_HZ != 1000)
  129. # warning "CONFIG_SYS_HZ must always be 1000"
  130. # endif
  131. # undef CONFIG_SYS_HZ
  132. #endif
  133. #define CONFIG_SYS_HZ 1000
  134. #ifndef CONFIG_SYS_BAUDRATE_TABLE
  135. # define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  136. #endif
  137. #endif