blackfin-config-post.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * blackfin-config-post.h - setup common defines for Blackfin boards based on config.h
  3. *
  4. * Copyright (c) 2007 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. /* Check to make sure everything fits in external RAM */
  11. #if ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) > CFG_MAX_RAM_SIZE)
  12. # error Memory Map does not fit into configuration
  13. #endif
  14. /* Sanity check CONFIG_BFIN_CPU */
  15. #ifndef CONFIG_BFIN_CPU
  16. # error CONFIG_BFIN_CPU: your board config needs to define this
  17. #endif
  18. /* Make sure the structure is properly aligned */
  19. #if ((CFG_GBL_DATA_ADDR & -4) != CFG_GBL_DATA_ADDR)
  20. # error CFG_GBL_DATA_ADDR: must be 4 byte aligned
  21. #endif
  22. /* Set default CONFIG_VCO_HZ if need be */
  23. #if !defined(CONFIG_VCO_HZ)
  24. # if (CONFIG_CLKIN_HALF == 0)
  25. # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
  26. # else
  27. # define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / 2)
  28. # endif
  29. #endif
  30. /* Set default CONFIG_CCLK_HZ if need be */
  31. #if !defined(CONFIG_CCLK_HZ)
  32. # if (CONFIG_PLL_BYPASS == 0)
  33. # define CONFIG_CCLK_HZ (CONFIG_VCO_HZ / CONFIG_CCLK_DIV)
  34. # else
  35. # define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
  36. # endif
  37. #endif
  38. /* Set default CONFIG_SCLK_HZ if need be */
  39. #if !defined(CONFIG_SCLK_HZ)
  40. # if (CONFIG_PLL_BYPASS == 0)
  41. # define CONFIG_SCLK_HZ (CONFIG_VCO_HZ / CONFIG_SCLK_DIV)
  42. # else
  43. # define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
  44. # endif
  45. #endif
  46. /* Since we use these to program PLL registers directly,
  47. * make sure the values are sane and won't screw us up.
  48. */
  49. #if (CONFIG_VCO_MULT & 0x3F) != CONFIG_VCO_MULT
  50. # error CONFIG_VCO_MULT: Invalid value: must fit in 6 bits (0 - 63)
  51. #endif
  52. #if (CONFIG_CLKIN_HALF & 0x1) != CONFIG_CLKIN_HALF
  53. # error CONFIG_CLKIN_HALF: Invalid value: must be 0 or 1
  54. #endif
  55. #if (CONFIG_PLL_BYPASS & 0x1) != CONFIG_PLL_BYPASS
  56. # error CONFIG_PLL_BYPASS: Invalid value: must be 0 or 1
  57. #endif
  58. /* Using L1 scratch pad makes sense for everyone by default. */
  59. #ifndef CMD_LINE_ADDR
  60. # define CMD_LINE_ADDR L1_SRAM_SCRATCH
  61. #endif
  62. #endif