ip04.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * U-boot - Configuration file for IP04 board (having BF532 processor)
  3. *
  4. * Copyright (c) 2006 Intratrade Ltd., Ivan Danov, idanov@gmail.com
  5. *
  6. * Copyright (c) 2005-2010 Analog Devices Inc.
  7. *
  8. * (C) Copyright 2000-2004
  9. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  10. *
  11. * Licensed under the GPL-2 or later.
  12. */
  13. #ifndef __CONFIG_IP04_H__
  14. #define __CONFIG_IP04_H__
  15. #include <asm/config-pre.h>
  16. /*
  17. * Processor Settings
  18. */
  19. #define CONFIG_BFIN_CPU bf532-0.5
  20. #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_NAND
  21. /*
  22. * Clock Settings
  23. * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
  24. * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
  25. */
  26. /* CONFIG_CLKIN_HZ is any value in Hz */
  27. #define CONFIG_CLKIN_HZ 10000000
  28. /* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
  29. /* 1 = CLKIN / 2 */
  30. #define CONFIG_CLKIN_HALF 0
  31. /* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
  32. /* 1 = bypass PLL */
  33. #define CONFIG_PLL_BYPASS 0
  34. /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
  35. /* Values can range from 0-63 (where 0 means 64) */
  36. #define CONFIG_VCO_MULT 40
  37. /* CCLK_DIV controls the core clock divider */
  38. /* Values can be 1, 2, 4, or 8 ONLY */
  39. #define CONFIG_CCLK_DIV 1
  40. /* SCLK_DIV controls the system clock divider */
  41. /* Values can range from 1-15 */
  42. #define CONFIG_SCLK_DIV 3
  43. /*
  44. * Memory Settings
  45. */
  46. #define CONFIG_MEM_ADD_WDTH 10
  47. #define CONFIG_MEM_SIZE 64
  48. #define CONFIG_EBIU_SDRRC_VAL 0x408
  49. #define CONFIG_EBIU_SDGCTL_VAL 0x9111cd
  50. #define CONFIG_EBIU_AMGCTL_VAL 0xFF
  51. #define CONFIG_EBIU_AMBCTL0_VAL 0xffc2ffc2
  52. #define CONFIG_EBIU_AMBCTL1_VAL 0xffc2ffc2
  53. #define CONFIG_SYS_MONITOR_LEN (256 * 1024)
  54. #define CONFIG_SYS_MALLOC_LEN (128 * 1024)
  55. /*
  56. * Network Settings
  57. */
  58. #define ADI_CMDS_NETWORK 1
  59. #define CONFIG_NET_MULTI 1
  60. #define CONFIG_HOSTNAME IP04
  61. #define CONFIG_DRIVER_DM9000 1
  62. #define CONFIG_DM9000_NO_SROM
  63. #define CONFIG_DM9000_BASE 0x20100000
  64. #define DM9000_IO CONFIG_DM9000_BASE
  65. #define DM9000_DATA (CONFIG_DM9000_BASE + 2)
  66. /*
  67. * Flash Settings
  68. */
  69. #define CONFIG_ENV_OVERWRITE 1
  70. #define CONFIG_SYS_NO_FLASH /* we have only NAND */
  71. /*
  72. * SPI Settings
  73. */
  74. #define CONFIG_BFIN_SPI
  75. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  76. #define CONFIG_SF_DEFAULT_SPEED 30000000
  77. #define CONFIG_SPI_FLASH
  78. #define CONFIG_SPI_FLASH_STMICRO
  79. #define CONFIG_SPI_FLASH_WINBOND
  80. /*
  81. * Env Storage Settings
  82. */
  83. #define CONFIG_ENV_IS_IN_SPI_FLASH
  84. #define CONFIG_PREBOOT "echo starting from spi flash"
  85. #define CONFIG_ENV_OFFSET 0x30000
  86. #define CONFIG_ENV_SIZE 0x10000
  87. #define CONFIG_ENV_SECT_SIZE 0x10000
  88. /*
  89. * NAND Settings
  90. */
  91. #define CONFIG_NAND_PLAT
  92. #define CONFIG_SYS_NAND_BASE 0x20000000
  93. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  94. #define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
  95. #define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
  96. #define BFIN_NAND_READY PF10
  97. #define BFIN_NAND_WRITE(addr, cmd) \
  98. do { \
  99. bfin_write8(addr, cmd); \
  100. SSYNC(); \
  101. } while (0)
  102. #define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
  103. #define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
  104. #define NAND_PLAT_DEV_READY(chip) (bfin_read_FIO_FLAG_D() & BFIN_NAND_READY)
  105. #define NAND_PLAT_INIT() \
  106. do { \
  107. bfin_write_FIO_DIR(bfin_read_FIO_DIR() & ~BFIN_NAND_READY); \
  108. bfin_write_FIO_INEN(bfin_read_FIO_INEN() | BFIN_NAND_READY); \
  109. bfin_write_FIO_EDGE(bfin_read_FIO_EDGE() & ~BFIN_NAND_READY); \
  110. bfin_write_FIO_POLAR(bfin_read_FIO_POLAR() & ~BFIN_NAND_READY); \
  111. } while (0)
  112. /*
  113. * Misc Settings
  114. */
  115. #define CONFIG_BAUDRATE 115200
  116. #define CONFIG_MISC_INIT_R /* needed for MAC address */
  117. #define CONFIG_UART_CONSOLE 0
  118. #undef CONFIG_SHOW_BOOT_PROGRESS
  119. /* Enable this if bootretry required; currently it's disabled */
  120. #define CONFIG_BOOT_RETRY_TIME -1
  121. #define CONFIG_BOOTCOMMAND "run nandboot"
  122. #define CONFIG_AUTOBOOT_PROMPT "autoboot in %d seconds\n"
  123. /*
  124. * Pull in common ADI header for remaining command/environment setup
  125. */
  126. #include <configs/bfin_adi_common.h>
  127. #endif