dig297.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. /*
  2. * (C) Copyright 2011 Comelit Group SpA
  3. * Luca Ceresoli <luca.ceresoli@comelit.it>
  4. *
  5. * Based on omap3_beagle.h:
  6. * (C) Copyright 2006-2008
  7. * Texas Instruments.
  8. * Richard Woodruff <r-woodruff2@ti.com>
  9. * Syed Mohammed Khasim <x0khasim@ti.com>
  10. *
  11. * Configuration settings for the Comelit DIG297 board.
  12. *
  13. * See file CREDITS for list of people who contributed to this
  14. * project.
  15. *
  16. * This program is free software; you can redistribute it and/or
  17. * modify it under the terms of the GNU General Public License as
  18. * published by the Free Software Foundation; either version 2 of
  19. * the License, or (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  29. * MA 02111-1307 USA
  30. */
  31. #ifndef __CONFIG_H
  32. #define __CONFIG_H
  33. #include <asm/mach-types.h>
  34. #ifdef MACH_TYPE_OMAP3_CPS
  35. #error "MACH_TYPE_OMAP3_CPS has been defined properly, please remove this."
  36. #else
  37. #define MACH_TYPE_OMAP3_CPS 2751
  38. #endif
  39. #define CONFIG_MACH_TYPE MACH_TYPE_OMAP3_CPS
  40. /*
  41. * High Level Configuration Options
  42. */
  43. #define CONFIG_OMAP /* in a TI OMAP core */
  44. #define CONFIG_OMAP34XX /* which is a 34XX */
  45. #define CONFIG_OMAP_GPIO
  46. #define CONFIG_SYS_TEXT_BASE 0x80008000
  47. #define CONFIG_SDRC /* The chip has SDRC controller */
  48. #include <asm/arch/cpu.h> /* get chip and board defs */
  49. #include <asm/arch/omap3.h>
  50. /*
  51. * Display CPU and Board information
  52. */
  53. #define CONFIG_DISPLAY_CPUINFO
  54. #define CONFIG_DISPLAY_BOARDINFO
  55. /* Clock Defines */
  56. #define V_OSCK 26000000 /* Clock output from T2 */
  57. #define V_SCLK (V_OSCK >> 1)
  58. #define CONFIG_MISC_INIT_R
  59. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  60. #define CONFIG_SETUP_MEMORY_TAGS
  61. #define CONFIG_INITRD_TAG
  62. #define CONFIG_REVISION_TAG
  63. /*
  64. * Size of malloc() pool
  65. */
  66. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
  67. /* Sector */
  68. #define CONFIG_SYS_MALLOC_LEN (1024 << 10) /* UBI needs >= 512 kB */
  69. /*
  70. * Hardware drivers
  71. */
  72. /*
  73. * NS16550 Configuration
  74. */
  75. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  76. #define CONFIG_SYS_NS16550
  77. #define CONFIG_SYS_NS16550_SERIAL
  78. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  79. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  80. /*
  81. * select serial console configuration: UART3 (ttyO2)
  82. */
  83. #define CONFIG_CONS_INDEX 3
  84. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  85. #define CONFIG_SERIAL3 3
  86. /* allow to overwrite serial and ethaddr */
  87. #define CONFIG_ENV_OVERWRITE
  88. #define CONFIG_BAUDRATE 115200
  89. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
  90. 115200}
  91. #define CONFIG_GENERIC_MMC 1
  92. #define CONFIG_MMC 1
  93. #define CONFIG_OMAP_HSMMC 1
  94. #define CONFIG_DOS_PARTITION
  95. /* library portions to compile in */
  96. #define CONFIG_RBTREE
  97. #define CONFIG_MTD_PARTITIONS
  98. #define CONFIG_LZO
  99. /* commands to include */
  100. #include <config_cmd_default.h>
  101. #define CONFIG_CMD_FAT /* FAT support */
  102. #define CONFIG_CMD_UBI /* UBI Support */
  103. #define CONFIG_CMD_UBIFS /* UBIFS Support */
  104. #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */
  105. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  106. #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  107. #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:896k(uboot),"\
  108. "128k(uboot-env),3m(kernel),252m(ubi)"
  109. #define CONFIG_CMD_I2C /* I2C serial bus support */
  110. #define CONFIG_CMD_MMC /* MMC support */
  111. #define CONFIG_CMD_NAND /* NAND support */
  112. #undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
  113. #undef CONFIG_CMD_FPGA /* FPGA configuration Support */
  114. #undef CONFIG_CMD_IMI /* iminfo */
  115. #undef CONFIG_CMD_IMLS /* List all found images */
  116. #define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
  117. #undef CONFIG_CMD_NFS /* NFS support */
  118. #define CONFIG_SYS_NO_FLASH
  119. #define CONFIG_HARD_I2C
  120. #define CONFIG_SYS_I2C_SPEED 100000
  121. #define CONFIG_SYS_I2C_SLAVE 1
  122. #define CONFIG_SYS_I2C_BUS 0
  123. #define CONFIG_SYS_I2C_BUS_SELECT 1
  124. #define CONFIG_DRIVER_OMAP34XX_I2C 1
  125. /*
  126. * TWL4030
  127. */
  128. #define CONFIG_TWL4030_POWER
  129. #define CONFIG_TWL4030_LED
  130. /*
  131. * Board NAND Info.
  132. */
  133. #define CONFIG_NAND_OMAP_GPMC
  134. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  135. /* to access nand */
  136. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  137. /* to access nand at */
  138. /* CS0 */
  139. #define GPMC_NAND_ECC_LP_x16_LAYOUT
  140. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  141. #if defined(CONFIG_CMD_NET)
  142. /*
  143. * SMSC9220 Ethernet
  144. */
  145. #define CONFIG_SMC911X
  146. #define CONFIG_SMC911X_32_BIT
  147. #define CONFIG_SMC911X_BASE 0x2C000000
  148. #endif /* (CONFIG_CMD_NET) */
  149. /* Environment information */
  150. #define CONFIG_BOOTDELAY 1
  151. #define CONFIG_EXTRA_ENV_SETTINGS \
  152. "loadaddr=0x82000000\0" \
  153. "console=ttyO2,115200n8\0" \
  154. "mtdids=" MTDIDS_DEFAULT "\0" \
  155. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  156. "partition=nand0,3\0"\
  157. "mmcroot=/dev/mmcblk0p2 rw\0" \
  158. "mmcrootfstype=ext3 rootwait\0" \
  159. "nandroot=ubi0:rootfs ro\0" \
  160. "nandrootfstype=ubifs\0" \
  161. "nfspath=/srv/nfs\0" \
  162. "tftpfilename=uImage\0" \
  163. "gatewayip=0.0.0.0\0" \
  164. "mmcargs=setenv bootargs console=${console} " \
  165. "${mtdparts} " \
  166. "root=${mmcroot} " \
  167. "rootfstype=${mmcrootfstype} " \
  168. "ip=${ipaddr}:${serverip}:${gatewayip}:" \
  169. "${netmask}:${hostname}::off\0" \
  170. "nandargs=setenv bootargs console=${console} " \
  171. "${mtdparts} " \
  172. "ubi.mtd=3 " \
  173. "root=${nandroot} " \
  174. "rootfstype=${nandrootfstype} " \
  175. "ip=${ipaddr}:${serverip}:${gatewayip}:" \
  176. "${netmask}:${hostname}::off\0" \
  177. "netargs=setenv bootargs console=${console} " \
  178. "${mtdparts} " \
  179. "root=/dev/nfs rw " \
  180. "nfsroot=${serverip}:${nfspath} " \
  181. "ip=${ipaddr}:${serverip}:${gatewayip}:" \
  182. "${netmask}:${hostname}::off\0" \
  183. "mmcboot=echo Booting from mmc ...; " \
  184. "run mmcargs; " \
  185. "bootm ${loadaddr}\0" \
  186. "nandboot=echo Booting from nand ...; " \
  187. "run nandargs; " \
  188. "nand read ${loadaddr} 100000 300000; " \
  189. "bootm ${loadaddr}\0" \
  190. "netboot=echo Booting from network ...; " \
  191. "run netargs; " \
  192. "tftp ${loadaddr} ${serverip}:${tftpfilename}; " \
  193. "bootm ${loadaddr}\0" \
  194. "resetenv=nand erase e0000 20000\0"\
  195. #define CONFIG_BOOTCOMMAND \
  196. "run nandboot"
  197. #define CONFIG_AUTO_COMPLETE
  198. /*
  199. * Miscellaneous configurable options
  200. */
  201. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  202. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  203. #define CONFIG_SYS_PROMPT "DIG297# "
  204. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  205. /* Print Buffer Size */
  206. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  207. sizeof(CONFIG_SYS_PROMPT) + 16)
  208. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  209. /* Boot Argument Buffer Size */
  210. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  211. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest */
  212. /* works on */
  213. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  214. 0x01F00000) /* 31MB */
  215. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default */
  216. /* load address */
  217. /*
  218. * OMAP3 has 12 GP timers, they can be driven by the system clock
  219. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  220. * This rate is divided by a local divisor.
  221. */
  222. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  223. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  224. #define CONFIG_SYS_HZ 1000
  225. /*-----------------------------------------------------------------------
  226. * Physical Memory Map
  227. */
  228. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  229. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  230. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  231. /*-----------------------------------------------------------------------
  232. * FLASH and environment organization
  233. */
  234. /* **** PISMO SUPPORT *** */
  235. /* Configure the PISMO */
  236. #define PISMO1_NAND_SIZE GPMC_SIZE_128M
  237. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  238. #define CONFIG_SYS_FLASH_BASE boot_flash_base
  239. /* Monitor at start of flash */
  240. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  241. #define CONFIG_ENV_IS_IN_NAND
  242. #define SMNAND_ENV_OFFSET 0x0E0000 /* environment starts here */
  243. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  244. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  245. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  246. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  247. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  248. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  249. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  250. CONFIG_SYS_INIT_RAM_SIZE - \
  251. GENERATED_GBL_DATA_SIZE)
  252. #endif /* __CONFIG_H */