cm_t335.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Config file for Compulab CM-T335 board
  4. *
  5. * Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
  6. *
  7. * Author: Ilya Ledvich <ilya@compulab.co.il>
  8. */
  9. #ifndef __CONFIG_CM_T335_H
  10. #define __CONFIG_CM_T335_H
  11. #include <configs/ti_am335x_common.h>
  12. #undef CONFIG_MAX_RAM_BANK_SIZE
  13. #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* 512MB */
  14. /* Clock Defines */
  15. #define V_OSCK 25000000 /* Clock output from T2 */
  16. #define V_SCLK (V_OSCK)
  17. #ifndef CONFIG_SPL_BUILD
  18. #define MMCARGS \
  19. "mmcdev=0\0" \
  20. "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
  21. "mmcrootfstype=ext4\0" \
  22. "mmcargs=setenv bootargs console=${console} " \
  23. "root=${mmcroot} " \
  24. "rootfstype=${mmcrootfstype}\0" \
  25. "mmcboot=echo Booting from mmc ...; " \
  26. "run mmcargs; " \
  27. "bootm ${loadaddr}\0"
  28. #define NANDARGS \
  29. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  30. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
  31. "nandroot=ubi0:rootfs rw\0" \
  32. "nandrootfstype=ubifs\0" \
  33. "nandargs=setenv bootargs console=${console} " \
  34. "root=${nandroot} " \
  35. "rootfstype=${nandrootfstype} " \
  36. "ubi.mtd=${rootfs_name}\0" \
  37. "nandboot=echo Booting from nand ...; " \
  38. "run nandargs; " \
  39. "nboot ${loadaddr} nand0 900000; " \
  40. "bootm ${loadaddr}\0"
  41. #define CONFIG_EXTRA_ENV_SETTINGS \
  42. "loadaddr=82000000\0" \
  43. "console=ttyO0,115200n8\0" \
  44. "rootfs_name=rootfs\0" \
  45. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  46. "bootscript=echo Running bootscript from mmc ...; " \
  47. "source ${loadaddr}\0" \
  48. "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
  49. MMCARGS \
  50. NANDARGS
  51. #define CONFIG_BOOTCOMMAND \
  52. "mmc dev ${mmcdev}; if mmc rescan; then " \
  53. "if run loadbootscript; then " \
  54. "run bootscript; " \
  55. "else " \
  56. "if run loaduimage; then " \
  57. "run mmcboot; " \
  58. "else run nandboot; " \
  59. "fi; " \
  60. "fi; " \
  61. "else run nandboot; fi"
  62. #endif /* CONFIG_SPL_BUILD */
  63. #define CONFIG_TIMESTAMP
  64. #define CONFIG_SYS_AUTOLOAD "no"
  65. /* Serial console configuration */
  66. /* NS16550 Configuration */
  67. #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
  68. #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
  69. /* I2C Configuration */
  70. /* SPL */
  71. /* Network. */
  72. /* NAND support */
  73. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  74. 10, 11, 12, 13, 14, 15, 16, 17, \
  75. 18, 19, 20, 21, 22, 23, 24, 25, \
  76. 26, 27, 28, 29, 30, 31, 32, 33, \
  77. 34, 35, 36, 37, 38, 39, 40, 41, \
  78. 42, 43, 44, 45, 46, 47, 48, 49, \
  79. 50, 51, 52, 53, 54, 55, 56, 57, }
  80. #define CONFIG_SYS_NAND_ECCSIZE 512
  81. #define CONFIG_SYS_NAND_ECCBYTES 14
  82. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  83. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  84. #ifdef CONFIG_SPL_OS_BOOT
  85. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x500000
  86. #endif
  87. /* GPIO pin + bank to pin ID mapping */
  88. #define GPIO_PIN(_bank, _pin) ((_bank << 5) + _pin)
  89. /* Status LED */
  90. /* Status LED polarity is inversed, so init it in the "off" state */
  91. /* EEPROM */
  92. #ifndef CONFIG_SPL_BUILD
  93. /*
  94. * Enable PCA9555 at I2C0-0x26.
  95. * First select the I2C0 bus with "i2c dev 0", then use "pca953x" command.
  96. */
  97. #define CONFIG_PCA953X
  98. #define CONFIG_SYS_I2C_PCA953X_ADDR 0x26
  99. #define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x26, 16} }
  100. #endif /* CONFIG_SPL_BUILD */
  101. #endif /* __CONFIG_CM_T335_H */