omap3_cairo.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /*
  2. * Configuration settings for the QUIPOS Cairo board.
  3. *
  4. * Copyright (C) DENX GmbH
  5. *
  6. * Author :
  7. * Albert ARIBAUD <albert.aribaud@3adev.fr>
  8. *
  9. * Derived from EVM code by
  10. * Manikandan Pillai <mani.pillai@ti.com>
  11. * Itself derived from Beagle Board and 3430 SDP code by
  12. * Richard Woodruff <r-woodruff2@ti.com>
  13. * Syed Mohammed Khasim <khasim@ti.com>
  14. *
  15. * Also derived from include/configs/omap3_beagle.h
  16. *
  17. * SPDX-License-Identifier: GPL-2.0+
  18. */
  19. #ifndef __OMAP3_CAIRO_CONFIG_H
  20. #define __OMAP3_CAIRO_CONFIG_H
  21. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  22. /*
  23. * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  24. * 64 bytes before this address should be set aside for u-boot.img's
  25. * header. That is 0x800FFFC0--0x80100000 should not be used for any
  26. * other needs. We use this rather than the inherited defines from
  27. * ti_armv7_common.h for backwards compatibility.
  28. */
  29. #define CONFIG_SYS_TEXT_BASE 0x80100000
  30. #define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
  31. #define CONFIG_SPL_BSS_START_ADDR 0x80000000
  32. #define CONFIG_SPL_BSS_MAX_SIZE (512 << 10) /* 512 KB */
  33. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  34. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  35. #define CONFIG_NAND
  36. #include <configs/ti_omap3_common.h>
  37. #define CONFIG_MISC_INIT_R
  38. #define CONFIG_REVISION_TAG 1
  39. #define CONFIG_ENV_OVERWRITE
  40. /* Enable Multi Bus support for I2C */
  41. #define CONFIG_I2C_MULTI_BUS 1
  42. /* Probe all devices */
  43. #define CONFIG_SYS_I2C_NOPROBES { {0x0, 0x0} }
  44. #define CONFIG_NAND
  45. /* commands to include */
  46. #define CONFIG_CMD_NAND_LOCK_UNLOCK
  47. /*
  48. * TWL4030
  49. */
  50. #define CONFIG_TWL4030_LED 1
  51. /*
  52. * Board NAND Info.
  53. */
  54. #define CONFIG_NAND_OMAP_GPMC
  55. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  56. /* devices */
  57. #define CONFIG_EXTRA_ENV_SETTINGS \
  58. "machid=ffffffff\0" \
  59. "fdt_high=0x87000000\0" \
  60. "baudrate=115200\0" \
  61. "fec_addr=00:50:C2:7E:90:F0\0" \
  62. "netmask=255.255.255.0\0" \
  63. "ipaddr=192.168.2.9\0" \
  64. "gateway=192.168.2.1\0" \
  65. "serverip=192.168.2.10\0" \
  66. "nfshost=192.168.2.10\0" \
  67. "stdin=serial\0" \
  68. "stdout=serial\0" \
  69. "stderr=serial\0" \
  70. "bootargs_mmc_ramdisk=mem=128M " \
  71. "console=ttyO1,115200n8 " \
  72. "root=/dev/ram0 rw " \
  73. "initrd=0x81600000,16M " \
  74. "mpurate=600 ramdisk_size=16384 omapfb.rotate=1 " \
  75. "omapfb.rotate_type=1 omap_vout.vid1_static_vrfb_alloc=y\0" \
  76. "mmcboot=mmc init; " \
  77. "fatload mmc 0 0x80000000 uImage; " \
  78. "fatload mmc 0 0x81600000 ramdisk.gz; " \
  79. "setenv bootargs ${bootargs_mmc_ramdisk}; " \
  80. "bootm 0x80000000\0" \
  81. "bootargs_nfs=mem=99M console=ttyO0,115200n8 noinitrd rw ip=dhcp " \
  82. "root=/dev/nfs " \
  83. "nfsroot=192.168.2.10:/home/spiid/workdir/Quipos/rootfs,nolock " \
  84. "mpurate=600 omapfb.rotate=1 omapfb.rotate_type=1 " \
  85. "omap_vout.vid1_static_vrfb_alloc=y\0" \
  86. "boot_nfs=run get_kernel; setenv bootargs ${bootargs_nfs}; " \
  87. "bootm 0x80000000\0" \
  88. "bootargs_nand=mem=128M console=ttyO1,115200n8 noinitrd " \
  89. "root=/dev/mtdblock4 rw rootfstype=jffs2 mpurate=600 " \
  90. "omap_vout.vid1_static_vrfb_alloc=y omapfb.rotate=1 " \
  91. "omapfb.rotate_type=1\0" \
  92. "boot_nand=nand read.i 0x80000000 280000 300000; setenv " \
  93. "bootargs ${bootargs_nand}; bootm 0x80000000\0" \
  94. "ledorange=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
  95. "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; " \
  96. "i2c mw 60 09 10 1; i2c mw 60 06 10 1\0" \
  97. "ledgreen=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
  98. "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; i2c " \
  99. "mw 60 09 00 1; i2c mw 60 06 10 1\0" \
  100. "ledoff=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
  101. "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; " \
  102. "i2c mw 60 09 00 1; i2c mw 60 06 0 1\0" \
  103. "ledred=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
  104. "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; " \
  105. "i2c mw 60 09 10 1; i2c mw 60 06 0 1\0" \
  106. "flash_xloader=mw.b 0x81600000 0xff 0x20000; " \
  107. "nand erase 0 20000; " \
  108. "fatload mmc 0 0x81600000 MLO; " \
  109. "nandecc hw; " \
  110. "nand write.i 0x81600000 0 20000;\0" \
  111. "flash_uboot=mw.b 0x81600000 0xff 0x40000; " \
  112. "nand erase 80000 40000; " \
  113. "fatload mmc 0 0x81600000 u-boot.bin; " \
  114. "nandecc sw; " \
  115. "nand write.i 0x81600000 80000 40000;\0" \
  116. "flash_kernel=mw.b 0x81600000 0xff 0x300000; " \
  117. "nand erase 280000 300000; " \
  118. "fatload mmc 0 0x81600000 uImage; " \
  119. "nandecc sw; " \
  120. "nand write.i 0x81600000 280000 300000;\0" \
  121. "flash_rootfs=fatload mmc 0 0x81600000 rootfs.jffs2; " \
  122. "nandecc sw; " \
  123. "nand write.jffs2 0x680000 0xFF ${filesize}; " \
  124. "nand erase 680000 ${filesize}; " \
  125. "nand write.jffs2 81600000 680000 ${filesize};\0" \
  126. "flash_scrub=nand scrub; " \
  127. "run flash_xloader; " \
  128. "run flash_uboot; " \
  129. "run flash_kernel; " \
  130. "run flash_rootfs;\0" \
  131. "flash_all=run ledred; " \
  132. "nand erase.chip; " \
  133. "run ledorange; " \
  134. "run flash_xloader; " \
  135. "run flash_uboot; " \
  136. "run flash_kernel; " \
  137. "run flash_rootfs; " \
  138. "run ledgreen; " \
  139. "run boot_nand; \0" \
  140. #define CONFIG_BOOTCOMMAND \
  141. "if fatload mmc 0 0x81600000 MLO; then run flash_all; " \
  142. "else run boot_nand; fi"
  143. /*
  144. * OMAP3 has 12 GP timers, they can be driven by the system clock
  145. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  146. * This rate is divided by a local divisor.
  147. */
  148. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  149. /*-----------------------------------------------------------------------
  150. * FLASH and environment organization
  151. */
  152. /* **** PISMO SUPPORT *** */
  153. #if defined(CONFIG_CMD_NAND)
  154. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  155. #endif
  156. /* Monitor at start of flash */
  157. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  158. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  159. #define CONFIG_ENV_IS_IN_NAND 1
  160. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
  161. #define ONENAND_ENV_OFFSET 0x260000 /* environment starts here */
  162. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  163. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  164. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  165. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  166. #define CONFIG_OMAP3_SPI
  167. /* Defines for SPL */
  168. #define CONFIG_SPL_OMAP3_ID_NAND
  169. /* NAND boot config */
  170. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  171. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  172. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  173. #define CONFIG_SYS_NAND_OOBSIZE 64
  174. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  175. #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
  176. #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
  177. 10, 11, 12, 13}
  178. #define CONFIG_SYS_NAND_ECCSIZE 512
  179. #define CONFIG_SYS_NAND_ECCBYTES 3
  180. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
  181. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  182. /* NAND: SPL falcon mode configs */
  183. #ifdef CONFIG_SPL_OS_BOOT
  184. #define CONFIG_CMD_SPL_NAND_OFS 0x240000
  185. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
  186. #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
  187. #endif
  188. /* env defaults */
  189. #define CONFIG_BOOTFILE "uImage"
  190. /* Override OMAP3 common serial console configuration from UART3
  191. * to UART2.
  192. *
  193. * Attention: for UART2, special MUX settings (MUX_DEFAULT(), MCBSP3)
  194. * are needed and peripheral clocks for UART2 must be enabled in
  195. * function per_clocks_enable().
  196. */
  197. #undef CONFIG_CONS_INDEX
  198. #define CONFIG_CONS_INDEX 2
  199. #ifdef CONFIG_SPL_BUILD
  200. #undef CONFIG_SYS_NS16550_COM3
  201. #define CONFIG_SYS_NS16550_COM2 OMAP34XX_UART2
  202. #undef CONFIG_SERIAL3
  203. #define CONFIG_SERIAL2
  204. #endif
  205. /* Provide MACH_TYPE for compatibility with non-DT kernels */
  206. #define MACH_TYPE_OMAP3_CAIRO 3063
  207. #define CONFIG_MACH_TYPE MACH_TYPE_OMAP3_CAIRO
  208. /*-----------------------------------------------------------------------
  209. * FLASH and environment organization
  210. */
  211. /* **** PISMO SUPPORT *** */
  212. #define CONFIG_SYS_MAX_FLASH_SECT 520 /* max number of sectors */
  213. /* on one chip */
  214. #define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of flash banks */
  215. /*-----------------------------------------------------------------------
  216. * CFI FLASH driver setup
  217. */
  218. /* timeout values are in ticks */
  219. #define CONFIG_SYS_FLASH_ERASE_TOUT (100 * CONFIG_SYS_HZ)
  220. #define CONFIG_SYS_FLASH_WRITE_TOUT (100 * CONFIG_SYS_HZ)
  221. /* Flash banks JFFS2 should use */
  222. #define CONFIG_SYS_MAX_MTD_BANKS (CONFIG_SYS_MAX_FLASH_BANKS + \
  223. CONFIG_SYS_MAX_NAND_DEVICE)
  224. #define CONFIG_SYS_JFFS2_MEM_NAND
  225. /* use flash_info[2] */
  226. #define CONFIG_SYS_JFFS2_FIRST_BANK CONFIG_SYS_MAX_FLASH_BANKS
  227. #define CONFIG_SYS_JFFS2_NUM_BANKS 1
  228. #endif /* __OMAP3_CAIRO_CONFIG_H */