omap3_overo.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. /*
  2. * Configuration settings for the Gumstix Overo board.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  17. * MA 02111-1307 USA
  18. */
  19. #ifndef __CONFIG_H
  20. #define __CONFIG_H
  21. #include <asm/sizes.h>
  22. /*
  23. * High Level Configuration Options
  24. */
  25. #define CONFIG_ARMCORTEXA8 1 /* This is an ARM V7 CPU core */
  26. #define CONFIG_OMAP 1 /* in a TI OMAP core */
  27. #define CONFIG_OMAP34XX 1 /* which is a 34XX */
  28. #define CONFIG_OMAP3430 1 /* which is in a 3430 */
  29. #define CONFIG_OMAP3_OVERO 1 /* working with overo */
  30. #include <asm/arch/cpu.h> /* get chip and board defs */
  31. #include <asm/arch/omap3.h>
  32. /* Clock Defines */
  33. #define V_OSCK 26000000 /* Clock output from T2 */
  34. #define V_SCLK (V_OSCK >> 1)
  35. #undef CONFIG_USE_IRQ /* no support for IRQs */
  36. #define CONFIG_MISC_INIT_R
  37. #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
  38. #define CONFIG_SETUP_MEMORY_TAGS 1
  39. #define CONFIG_INITRD_TAG 1
  40. #define CONFIG_REVISION_TAG 1
  41. /*
  42. * Size of malloc() pool
  43. */
  44. #define CONFIG_ENV_SIZE SZ_128K /* Total Size Environment */
  45. /* Sector */
  46. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_128K)
  47. #define CONFIG_SYS_GBL_DATA_SIZE 128 /* bytes reserved for */
  48. /* initial data */
  49. /*
  50. * Hardware drivers
  51. */
  52. /*
  53. * NS16550 Configuration
  54. */
  55. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  56. #define CONFIG_SYS_NS16550
  57. #define CONFIG_SYS_NS16550_SERIAL
  58. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  59. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  60. /*
  61. * select serial console configuration
  62. */
  63. #define CONFIG_CONS_INDEX 3
  64. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  65. #define CONFIG_SERIAL3 3
  66. /* allow to overwrite serial and ethaddr */
  67. #define CONFIG_ENV_OVERWRITE
  68. #define CONFIG_BAUDRATE 115200
  69. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, \
  70. 115200}
  71. #define CONFIG_MMC 1
  72. #define CONFIG_OMAP3_MMC 1
  73. #define CONFIG_DOS_PARTITION 1
  74. /* commands to include */
  75. #include <config_cmd_default.h>
  76. #define CONFIG_CMD_EXT2 /* EXT2 Support */
  77. #define CONFIG_CMD_FAT /* FAT support */
  78. #define CONFIG_CMD_JFFS2 /* JFFS2 Support */
  79. #define CONFIG_CMD_I2C /* I2C serial bus support */
  80. #define CONFIG_CMD_MMC /* MMC support */
  81. #define CONFIG_CMD_NAND /* NAND support */
  82. #undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
  83. #undef CONFIG_CMD_FPGA /* FPGA configuration Support */
  84. #undef CONFIG_CMD_IMI /* iminfo */
  85. #undef CONFIG_CMD_IMLS /* List all found images */
  86. #undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
  87. #undef CONFIG_CMD_NFS /* NFS support */
  88. #define CONFIG_SYS_NO_FLASH
  89. #define CONFIG_SYS_I2C_SPEED 100000
  90. #define CONFIG_SYS_I2C_SLAVE 1
  91. #define CONFIG_SYS_I2C_BUS 0
  92. #define CONFIG_SYS_I2C_BUS_SELECT 1
  93. #define CONFIG_DRIVER_OMAP34XX_I2C 1
  94. /*
  95. * Board NAND Info.
  96. */
  97. #define CONFIG_NAND_OMAP_GPMC
  98. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  99. /* to access nand */
  100. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  101. /* to access nand */
  102. /* at CS0 */
  103. #define GPMC_NAND_ECC_LP_x16_LAYOUT 1
  104. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  105. /* devices */
  106. #define SECTORSIZE 512
  107. #define NAND_ALLOW_ERASE_ALL
  108. #define ADDR_COLUMN 1
  109. #define ADDR_PAGE 2
  110. #define ADDR_COLUMN_PAGE 3
  111. #define NAND_ChipID_UNKNOWN 0x00
  112. #define NAND_MAX_FLOORS 1
  113. #define NAND_MAX_CHIPS 1
  114. #define NAND_NO_RB 1
  115. #define CONFIG_SYS_NAND_WP
  116. #define CONFIG_JFFS2_NAND
  117. /* nand device jffs2 lives on */
  118. #define CONFIG_JFFS2_DEV "nand0"
  119. /* start of jffs2 partition */
  120. #define CONFIG_JFFS2_PART_OFFSET 0x680000
  121. #define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */
  122. /* partition */
  123. /* Environment information */
  124. #define CONFIG_BOOTDELAY 5
  125. #define CONFIG_EXTRA_ENV_SETTINGS \
  126. "loadaddr=0x82000000\0" \
  127. "console=ttyS2,115200n8\0" \
  128. "videomode=1024x768@60,vxres=1024,vyres=768\0" \
  129. "videospec=omapfb:vram:2M,vram:4M\0" \
  130. "mmcargs=setenv bootargs console=${console} " \
  131. "video=${videospec},mode:${videomode} " \
  132. "root=/dev/mmcblk0p2 rw " \
  133. "rootfstype=ext3 rootwait\0" \
  134. "nandargs=setenv bootargs console=${console} " \
  135. "video=${videospec},mode:${videomode} " \
  136. "root=/dev/mtdblock4 rw " \
  137. "rootfstype=jffs2\0" \
  138. "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
  139. "bootscript=echo Running bootscript from mmc ...; " \
  140. "autoscr ${loadaddr}\0" \
  141. "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
  142. "mmcboot=echo Booting from mmc ...; " \
  143. "run mmcargs; " \
  144. "bootm ${loadaddr}\0" \
  145. "nandboot=echo Booting from nand ...; " \
  146. "run nandargs; " \
  147. "nand read ${loadaddr} 280000 400000; " \
  148. "bootm ${loadaddr}\0" \
  149. #define CONFIG_BOOTCOMMAND \
  150. "if mmcinit; then " \
  151. "if run loadbootscript; then " \
  152. "run bootscript; " \
  153. "else " \
  154. "if run loaduimage; then " \
  155. "run mmcboot; " \
  156. "else run nandboot; " \
  157. "fi; " \
  158. "fi; " \
  159. "else run nandboot; fi"
  160. #define CONFIG_AUTO_COMPLETE 1
  161. /*
  162. * Miscellaneous configurable options
  163. */
  164. #define V_PROMPT "Overo # "
  165. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  166. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  167. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  168. #define CONFIG_SYS_PROMPT V_PROMPT
  169. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  170. /* Print Buffer Size */
  171. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  172. sizeof(CONFIG_SYS_PROMPT) + 16)
  173. #define CONFIG_SYS_MAXARGS 16 /* max number of command */
  174. /* args */
  175. /* Boot Argument Buffer Size */
  176. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  177. /* memtest works on */
  178. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  179. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  180. 0x01F00000) /* 31MB */
  181. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load */
  182. /* address */
  183. /*
  184. * 2430 has 12 GP timers, they can be driven by the SysClk (12/13/19.2) or by
  185. * 32KHz clk, or from external sig. This rate is divided by a local divisor.
  186. */
  187. #define V_PVT 7
  188. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  189. #define CONFIG_SYS_PVT V_PVT /* 2^(pvt+1) */
  190. #define CONFIG_SYS_HZ ((V_SCLK) / (2 << CONFIG_SYS_PVT))
  191. /*-----------------------------------------------------------------------
  192. * Stack sizes
  193. *
  194. * The stack sizes are set up in start.S using the settings below
  195. */
  196. #define CONFIG_STACKSIZE SZ_128K /* regular stack */
  197. #ifdef CONFIG_USE_IRQ
  198. #define CONFIG_STACKSIZE_IRQ SZ_4K /* IRQ stack */
  199. #define CONFIG_STACKSIZE_FIQ SZ_4K /* FIQ stack */
  200. #endif
  201. /*-----------------------------------------------------------------------
  202. * Physical Memory Map
  203. */
  204. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  205. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  206. #define PHYS_SDRAM_1_SIZE SZ_32M /* at least 32 meg */
  207. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  208. /* SDRAM Bank Allocation method */
  209. #define SDRC_R_B_C 1
  210. /*-----------------------------------------------------------------------
  211. * FLASH and environment organization
  212. */
  213. /* **** PISMO SUPPORT *** */
  214. /* Configure the PISMO */
  215. #define PISMO1_NAND_SIZE GPMC_SIZE_128M
  216. #define PISMO1_ONEN_SIZE GPMC_SIZE_128M
  217. #define CONFIG_SYS_MAX_FLASH_SECT 520 /* max number of sectors on */
  218. /* one chip */
  219. #define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of flash banks */
  220. #define CONFIG_SYS_MONITOR_LEN SZ_256K /* Reserve 2 sectors */
  221. #define CONFIG_SYS_FLASH_BASE boot_flash_base
  222. /* Monitor at start of flash */
  223. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  224. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  225. #define CONFIG_ENV_IS_IN_NAND 1
  226. #define ONENAND_ENV_OFFSET 0x240000 /* environment starts here */
  227. #define SMNAND_ENV_OFFSET 0x240000 /* environment starts here */
  228. #define CONFIG_SYS_ENV_SECT_SIZE boot_flash_sec
  229. #define CONFIG_ENV_OFFSET boot_flash_off
  230. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  231. /*-----------------------------------------------------------------------
  232. * CFI FLASH driver setup
  233. */
  234. /* timeout values are in ticks */
  235. #define CONFIG_SYS_FLASH_ERASE_TOUT (100 * CONFIG_SYS_HZ)
  236. #define CONFIG_SYS_FLASH_WRITE_TOUT (100 * CONFIG_SYS_HZ)
  237. /* Flash banks JFFS2 should use */
  238. #define CONFIG_SYS_MAX_MTD_BANKS (CONFIG_SYS_MAX_FLASH_BANKS + \
  239. CONFIG_SYS_MAX_NAND_DEVICE)
  240. #define CONFIG_SYS_JFFS2_MEM_NAND
  241. /* use flash_info[2] */
  242. #define CONFIG_SYS_JFFS2_FIRST_BANK CONFIG_SYS_MAX_FLASH_BANKS
  243. #define CONFIG_SYS_JFFS2_NUM_BANKS 1
  244. #ifndef __ASSEMBLY__
  245. extern gpmc_csx_t *nand_cs_base;
  246. extern gpmc_t *gpmc_cfg_base;
  247. extern unsigned int boot_flash_base;
  248. extern volatile unsigned int boot_flash_env_addr;
  249. extern unsigned int boot_flash_off;
  250. extern unsigned int boot_flash_sec;
  251. extern unsigned int boot_flash_type;
  252. #endif
  253. #define WRITE_NAND_COMMAND(d, adr)\
  254. writel(d, &nand_cs_base->nand_cmd)
  255. #define WRITE_NAND_ADDRESS(d, adr)\
  256. writel(d, &nand_cs_base->nand_adr)
  257. #define WRITE_NAND(d, adr) writew(d, &nand_cs_base->nand_dat)
  258. #define READ_NAND(adr) readl(&nand_cs_base->nand_dat)
  259. /* Other NAND Access APIs */
  260. #define NAND_WP_OFF() do {readl(&gpmc_cfg_base->config) |= GPMC_CONFIG_WP; } \
  261. while (0)
  262. #define NAND_WP_ON() do {readl(&gpmc_cfg_base->config) &= ~GPMC_CONFIG_WP; } \
  263. while (0)
  264. #define NAND_DISABLE_CE(nand)
  265. #define NAND_ENABLE_CE(nand)
  266. #define NAND_WAIT_READY(nand) udelay(10)
  267. #endif /* __CONFIG_H */