chiliboard.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2017 Grinn - http://grinn-global.com/
  4. */
  5. #ifndef __CONFIG_CHILIBOARD_H
  6. #define __CONFIG_CHILIBOARD_H
  7. #include <configs/ti_am335x_common.h>
  8. #ifndef CONFIG_SPL_BUILD
  9. # define CONFIG_TIMESTAMP
  10. #endif
  11. /* Clock Defines */
  12. #define V_OSCK 24000000 /* Clock output from T2 */
  13. #define V_SCLK (V_OSCK)
  14. #define NANDARGS \
  15. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  16. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
  17. "nandargs=setenv bootargs console=${console} ${optargs} " \
  18. "${mtdparts} " \
  19. "root=${nandroot} " \
  20. "rootfstype=${nandrootfstype}\0" \
  21. "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system\0" \
  22. "nandrootfstype=ubifs rootwait=1\0" \
  23. "nandboot=echo Booting from nand ...; " \
  24. "run nandargs; " \
  25. "nand read ${fdt_addr} NAND.u-boot-spl-os; " \
  26. "nand read ${loadaddr} NAND.kernel; " \
  27. "bootz ${loadaddr} - ${fdt_addr}\0"
  28. #define CONFIG_BOOTCOMMAND \
  29. "run mmcboot; " \
  30. "run nandboot; " \
  31. "run netboot"
  32. #define CONFIG_EXTRA_ENV_SETTINGS \
  33. "loadaddr=0x82000000\0" \
  34. "fdt_addr=0x87800000\0" \
  35. "boot_fdt=try\0" \
  36. "console=ttyO0,115200n8\0" \
  37. "image=zImage\0" \
  38. "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
  39. "ip_dyn=yes\0" \
  40. "optargs=\0" \
  41. "loadbootscript=" \
  42. "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
  43. "bootscript=echo Running bootscript from mmc ...; " \
  44. "source\0" \
  45. "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
  46. "${boot_dir}/${image}\0" \
  47. "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} " \
  48. "${boot_dir}/${fdt_file}\0" \
  49. "mmcdev=0\0" \
  50. "mmcpart=1\0" \
  51. "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
  52. "mmcargs=setenv bootargs console=${console},${baudrate} ${optargs} " \
  53. "${mtdparts} " \
  54. "root=${mmcroot}\0" \
  55. "mmcloados=run mmcargs; " \
  56. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  57. "if run loadfdt; then " \
  58. "bootz ${loadaddr} - ${fdt_addr}; " \
  59. "else " \
  60. "if test ${boot_fdt} = try; then " \
  61. "bootz; " \
  62. "else " \
  63. "echo WARN: Cannot load the DT; " \
  64. "fi; " \
  65. "fi; " \
  66. "else " \
  67. "bootz; " \
  68. "fi;\0" \
  69. "mmcboot=mmc dev ${mmcdev}; " \
  70. "if mmc rescan; then " \
  71. "echo SD/MMC found on device ${mmcdev};" \
  72. "if run loadimage; then " \
  73. "run mmcloados;" \
  74. "fi;" \
  75. "fi;\0" \
  76. "netargs=setenv bootargs console=${console},${baudrate} ${optargs} " \
  77. "${mtdparts} " \
  78. "root=/dev/nfs " \
  79. "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
  80. "netboot=echo Booting from net ...; " \
  81. "run netargs; " \
  82. "if test ${ip_dyn} = yes; then " \
  83. "setenv get_cmd dhcp; " \
  84. "else " \
  85. "setenv get_cmd tftp; " \
  86. "fi; " \
  87. "${get_cmd} ${image}; " \
  88. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  89. "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
  90. "bootz ${loadaddr} - ${fdt_addr}; " \
  91. "else " \
  92. "if test ${boot_fdt} = try; then " \
  93. "bootz; " \
  94. "else " \
  95. "echo WARN: Cannot load the DT; " \
  96. "fi; " \
  97. "fi; " \
  98. "else " \
  99. "bootz; " \
  100. "fi;\0" \
  101. NANDARGS
  102. /* NS16550 Configuration */
  103. #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
  104. #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
  105. #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
  106. #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
  107. #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
  108. #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
  109. /* PMIC support */
  110. #define CONFIG_POWER_TPS65217
  111. /* SPL */
  112. /* Bootcount using the RTC block */
  113. #define CONFIG_SYS_BOOTCOUNT_BE
  114. /* NAND: device related configs */
  115. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  116. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  117. CONFIG_SYS_NAND_PAGE_SIZE)
  118. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  119. #define CONFIG_SYS_NAND_OOBSIZE 64
  120. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  121. /* NAND: driver related configs */
  122. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  123. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  124. 10, 11, 12, 13, 14, 15, 16, 17, \
  125. 18, 19, 20, 21, 22, 23, 24, 25, \
  126. 26, 27, 28, 29, 30, 31, 32, 33, \
  127. 34, 35, 36, 37, 38, 39, 40, 41, \
  128. 42, 43, 44, 45, 46, 47, 48, 49, \
  129. 50, 51, 52, 53, 54, 55, 56, 57, }
  130. #define CONFIG_SYS_NAND_ECCSIZE 512
  131. #define CONFIG_SYS_NAND_ECCBYTES 14
  132. #define CONFIG_SYS_NAND_ONFI_DETECTION
  133. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
  134. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000
  135. /* NAND: SPL related configs */
  136. /* USB configuration */
  137. #define CONFIG_ARCH_MISC_INIT
  138. #define CONFIG_AM335X_USB1
  139. #define CONFIG_AM335X_USB1_MODE MUSB_HOST
  140. /*
  141. * Disable MMC DM for SPL build and can be re-enabled after adding
  142. * DM support in SPL
  143. */
  144. #ifdef CONFIG_SPL_BUILD
  145. #undef CONFIG_DM_MMC
  146. #undef CONFIG_TIMER
  147. #endif
  148. #if defined(CONFIG_ENV_IS_IN_NAND)
  149. #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  150. #else
  151. #define CONFIG_SYS_MMC_ENV_DEV 0
  152. #endif
  153. /* Network. */
  154. #define CONFIG_PHY_SMSC
  155. #endif /* ! __CONFIG_CHILIBOARD_H */