br4.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. /*
  60. * Flash Settings
  61. */
  62. #define CONFIG_SYS_NO_FLASH /* We have no parallel FLASH */
  63. /*
  64. * SPI Settings
  65. */
  66. #define CONFIG_BFIN_SPI
  67. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  68. #define CONFIG_SF_DEFAULT_SPEED 30000000
  69. /*
  70. * Env Storage Settings
  71. */
  72. #define CONFIG_ENV_IS_IN_SPI_FLASH
  73. #define CONFIG_ENV_OFFSET 0x10000
  74. #define CONFIG_ENV_SIZE 0x2000
  75. #define CONFIG_ENV_SECT_SIZE 0x10000
  76. #define CONFIG_ENV_IS_EMBEDDED_IN_LDR
  77. /*
  78. * I2C Settings
  79. */
  80. #define CONFIG_SYS_I2C
  81. #define CONFIG_SYS_I2C_ADI
  82. /*
  83. * NAND Settings
  84. */
  85. #define CONFIG_NAND_PLAT
  86. #define CONFIG_SYS_NAND_BASE 0x20000000
  87. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  88. #define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
  89. #define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
  90. #define BFIN_NAND_WRITE(addr, cmd) \
  91. do { \
  92. bfin_write8(addr, cmd); \
  93. SSYNC(); \
  94. } while (0)
  95. #define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
  96. #define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
  97. #define NAND_PLAT_GPIO_DEV_READY GPIO_PF9
  98. /*
  99. * Misc Settings
  100. */
  101. #define CONFIG_BAUDRATE 115200
  102. #define CONFIG_RTC_BFIN
  103. #define CONFIG_UART_CONSOLE 0
  104. #define CONFIG_BOOTCOMMAND "run nandboot"
  105. #define CONFIG_LOADADDR 0x2000000
  106. /*
  107. * Pull in common ADI header for remaining command/environment setup
  108. */
  109. #include <configs/bfin_adi_common.h>
  110. /*
  111. * Overwrite some settings defined in bfin_adi_common.h
  112. */
  113. #undef NAND_ENV_SETTINGS
  114. #define NAND_ENV_SETTINGS \
  115. "nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
  116. "nandboot=" \
  117. "nand read $(loadaddr) 0x0 0x900000;" \
  118. "run nandargs;" \
  119. "bootm" \
  120. "\0"
  121. #endif