br4.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * U-boot - Configuration file for BR4 Appliance
  3. *
  4. * based on bf537-stamp.h
  5. * Copyright (c) Switchfin Org. <dpn@switchfin.org>
  6. */
  7. #ifndef __CONFIG_BR4_H__
  8. #define __CONFIG_BR4_H__
  9. #include <asm/config-pre.h>
  10. /*
  11. * Processor Settings
  12. */
  13. #define CONFIG_BFIN_CPU bf537-0.3
  14. #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
  15. /*
  16. * Clock Settings
  17. * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
  18. * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
  19. */
  20. /* CONFIG_CLKIN_HZ is any value in Hz */
  21. #define CONFIG_CLKIN_HZ 25000000
  22. /* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
  23. /* 1 = CLKIN / 2 */
  24. #define CONFIG_CLKIN_HALF 0
  25. /* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
  26. /* 1 = bypass PLL */
  27. #define CONFIG_PLL_BYPASS 0
  28. /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
  29. /* Values can range from 0-63 (where 0 means 64) */
  30. #define CONFIG_VCO_MULT 24
  31. /* CCLK_DIV controls the core clock divider */
  32. /* Values can be 1, 2, 4, or 8 ONLY */
  33. #define CONFIG_CCLK_DIV 1
  34. /* SCLK_DIV controls the system clock divider */
  35. /* Values can range from 1-15 */
  36. #define CONFIG_SCLK_DIV 5
  37. /*
  38. * Memory Settings
  39. */
  40. #define CONFIG_MEM_ADD_WDTH 10
  41. #define CONFIG_MEM_SIZE 64
  42. #define CONFIG_EBIU_SDRRC_VAL 0x306
  43. #define CONFIG_EBIU_SDGCTL_VAL 0x8091998d
  44. #define CONFIG_EBIU_AMGCTL_VAL 0xFF
  45. #define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
  46. #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
  47. #define CONFIG_SYS_MONITOR_LEN (512 * 1024)
  48. #define CONFIG_SYS_MALLOC_LEN (384 * 1024)
  49. /*
  50. * Network Settings
  51. */
  52. #ifndef __ADSPBF534__
  53. #define ADI_CMDS_NETWORK 1
  54. #define CONFIG_BFIN_MAC
  55. #define CONFIG_NETCONSOLE
  56. #endif
  57. #define CONFIG_HOSTNAME br4
  58. #define CONFIG_TFTP_BLOCKSIZE 4404
  59. /* Uncomment next line to use fixed MAC address */
  60. /* #define CONFIG_ETHADDR 5c:38:1a:80:a7:00 */
  61. /*
  62. * Flash Settings
  63. */
  64. #define CONFIG_SYS_NO_FLASH /* We have no parallel FLASH */
  65. /*
  66. * SPI Settings
  67. */
  68. #define CONFIG_BFIN_SPI
  69. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  70. #define CONFIG_SF_DEFAULT_SPEED 30000000
  71. #define CONFIG_SPI_FLASH
  72. #define CONFIG_SPI_FLASH_STMICRO
  73. /*
  74. * Env Storage Settings
  75. */
  76. #define CONFIG_ENV_IS_IN_SPI_FLASH
  77. #define CONFIG_ENV_OFFSET 0x10000
  78. #define CONFIG_ENV_SIZE 0x2000
  79. #define CONFIG_ENV_SECT_SIZE 0x10000
  80. #define CONFIG_ENV_IS_EMBEDDED_IN_LDR
  81. /*
  82. * I2C Settings
  83. */
  84. #define CONFIG_BFIN_TWI_I2C
  85. #define CONFIG_HARD_I2C
  86. /*
  87. * NAND Settings
  88. */
  89. #define CONFIG_NAND_PLAT
  90. #define CONFIG_SYS_NAND_BASE 0x20000000
  91. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  92. #define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
  93. #define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
  94. #define BFIN_NAND_WRITE(addr, cmd) \
  95. do { \
  96. bfin_write8(addr, cmd); \
  97. SSYNC(); \
  98. } while (0)
  99. #define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
  100. #define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
  101. #define NAND_PLAT_GPIO_DEV_READY GPIO_PF9
  102. /*
  103. * Misc Settings
  104. */
  105. #define CONFIG_BAUDRATE 115200
  106. #define CONFIG_RTC_BFIN
  107. #define CONFIG_UART_CONSOLE 0
  108. #define CONFIG_SYS_PROMPT "br4>"
  109. #define CONFIG_BOOTCOMMAND "run nandboot"
  110. #define CONFIG_BOOTDELAY 2
  111. #define CONFIG_LOADADDR 0x2000000
  112. /*
  113. * Pull in common ADI header for remaining command/environment setup
  114. */
  115. #include <configs/bfin_adi_common.h>
  116. /*
  117. * Overwrite some settings defined in bfin_adi_common.h
  118. */
  119. #undef NAND_ENV_SETTINGS
  120. #define NAND_ENV_SETTINGS \
  121. "nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
  122. "nandboot=" \
  123. "nand read $(loadaddr) 0x0 0x900000;" \
  124. "run nandargs;" \
  125. "bootm" \
  126. "\0"
  127. #endif