k2g_evm.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * Configuration header file for TI's k2g-evm
  3. *
  4. * (C) Copyright 2015
  5. * Texas Instruments Incorporated, <www.ti.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __CONFIG_K2G_EVM_H
  10. #define __CONFIG_K2G_EVM_H
  11. #include <environment/ti/mmc.h>
  12. /* Platform type */
  13. #define CONFIG_SOC_K2G
  14. #define CONFIG_BOARD_LATE_INIT
  15. #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  16. /* U-Boot general configuration */
  17. #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS \
  18. DEFAULT_MMC_TI_ARGS \
  19. DEFAULT_PMMC_BOOT_ENV \
  20. DEFAULT_FW_INITRAMFS_BOOT_ENV \
  21. DEFAULT_FIT_TI_ARGS \
  22. "boot=mmc\0" \
  23. "console=ttyS0,115200n8\0" \
  24. "bootpart=0:2\0" \
  25. "bootdir=/boot\0" \
  26. "rd_spec=-\0" \
  27. "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs " \
  28. "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0" \
  29. "findfdt="\
  30. "if test $board_name = 66AK2GGP; then " \
  31. "setenv name_fdt keystone-k2g-evm.dtb; " \
  32. "else if test $board_name = 66AK2GG1; then " \
  33. "setenv name_fdt keystone-k2g-evm.dtb; " \
  34. "else if test $board_name = 66AK2GIC; then " \
  35. "setenv name_fdt keystone-k2g-ice.dtb; " \
  36. "else if test $name_fdt = undefined; then " \
  37. "echo WARNING: Could not determine device tree to use;"\
  38. "fi;fi;fi;fi; setenv fdtfile ${name_fdt}\0" \
  39. "name_mon=skern-k2g.bin\0" \
  40. "name_ubi=k2g-evm-ubifs.ubi\0" \
  41. "name_uboot=u-boot-spi-k2g-evm.gph\0" \
  42. "init_mmc=run args_all args_mmc\0" \
  43. "init_fw_rd_mmc=load mmc ${bootpart} ${rdaddr} " \
  44. "${bootdir}/${name_fw_rd}; run set_rd_spec\0" \
  45. "soc_variant=k2g\0" \
  46. "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0"\
  47. "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
  48. "${bootdir}/${name_kern}\0" \
  49. "get_mon_mmc=load mmc ${bootpart} ${addr_mon} ${bootdir}/${name_mon}\0"\
  50. "name_fs=arago-base-tisdk-image-k2g-evm.cpio\0"
  51. #ifndef CONFIG_TI_SECURE_DEVICE
  52. #define CONFIG_BOOTCOMMAND \
  53. "run findfdt; " \
  54. "run envboot; " \
  55. "run init_${boot}; " \
  56. "run get_mon_${boot} run_mon; " \
  57. "run set_name_pmmc get_pmmc_${boot} run_pmmc; " \
  58. "run get_kern_${boot}; " \
  59. "run init_fw_rd_${boot}; " \
  60. "run get_fdt_${boot}; " \
  61. "run run_kern"
  62. #else
  63. #define CONFIG_BOOTCOMMAND \
  64. "run findfdt; " \
  65. "run envboot; " \
  66. "run run_mon_hs; " \
  67. "run init_${boot}; " \
  68. "run get_fit_${boot}; " \
  69. "bootm ${fit_loadaddr}#${name_fdt}"
  70. #endif
  71. #include <configs/ti_armv7_keystone2.h>
  72. /* SPL SPI Loader Configuration */
  73. #define CONFIG_SPL_TEXT_BASE 0x0c080000
  74. /* Network */
  75. #define CONFIG_KSNET_NETCP_V1_5
  76. #define CONFIG_KSNET_CPSW_NUM_PORTS 2
  77. #define CONFIG_KSNET_MDIO_PHY_CONFIG_ENABLE
  78. #define CONFIG_PHY_MICREL
  79. #define PHY_ANEG_TIMEOUT 10000 /* PHY needs longer aneg time */
  80. /* MMC/SD */
  81. #define CONFIG_GENERIC_MMC
  82. #define CONFIG_OMAP_HSMMC
  83. #undef CONFIG_ENV_IS_IN_NAND
  84. #define CONFIG_ENV_IS_IN_FAT
  85. #define FAT_ENV_INTERFACE "mmc"
  86. #define FAT_ENV_DEVICE_AND_PART "0:1"
  87. #define FAT_ENV_FILE "uboot.env"
  88. #define CONFIG_SF_DEFAULT_BUS 1
  89. #define CONFIG_SF_DEFAULT_CS 0
  90. #ifndef CONFIG_SPL_BUILD
  91. #define CONFIG_CADENCE_QSPI
  92. #define CONFIG_CQSPI_REF_CLK 384000000
  93. #define CONFIG_CQSPI_DECODER 0x0
  94. #define CONFIG_BOUNCE_BUFFER
  95. #endif
  96. /* NAND */
  97. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  98. #define CONFIG_MTD_DEVICE /* Required for mtdparts */
  99. #define CONFIG_CMD_MTDPARTS
  100. /* NAND: device related configs - Micron MT29F2G16ABAFAWP */
  101. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  102. #define CONFIG_SYS_NAND_OOBSIZE 224
  103. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  104. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  105. CONFIG_SYS_NAND_PAGE_SIZE)
  106. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  107. /* NAND: driver related configs */
  108. #define TI_GPMC_BASE KS2_GPMC_BASE
  109. #define CONFIG_NAND_OMAP_GPMC
  110. #define CONFIG_SYS_NAND_BASE 0x30000000
  111. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
  112. #define CONFIG_NAND_OMAP_ELM
  113. #define ELM_BASE 0x021c8000
  114. #define CONFIG_SYS_NAND_ONFI_DETECTION
  115. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW
  116. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  117. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  118. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \
  119. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \
  120. 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  121. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \
  122. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \
  123. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \
  124. 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \
  125. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \
  126. 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \
  127. 100, 101, 102, 103, 104, 105, 106, 107, 108, \
  128. 109, 110, 111, 112, 113, 114, 115, 116, 117, \
  129. 118, 119, 120, 121, 122, 123, 124, 125, 126, \
  130. 127, 128, 129, 130, 131, 132, 133, 134, 135, \
  131. 136, 137, 138, 139, 140, 141, 142, 143, 144, \
  132. 145, 146, 147, 148, 149, 150, 151, 152, 153, \
  133. 154, 155, 156, 157, 158, 159, 160, 161, 162, \
  134. 163, 164, 165, 166, 167, 168, 169, 170, 171, \
  135. 172, 173, 174, 175, 176, 177, 178, 179, 180, \
  136. 181, 182, 183, 184, 185, 186, 187, 188, 189, \
  137. 190, 191, 192, 193, 194, 195, 196, 197, 198, \
  138. 199, 200, 201, 202, 203, 204, 205, 206, 207, \
  139. 208, 209, \
  140. }
  141. #define CONFIG_SYS_NAND_ECCSIZE 512
  142. #define CONFIG_SYS_NAND_ECCBYTES 26
  143. #define CONFIG_PHY_TI
  144. #endif /* __CONFIG_K2G_EVM_H */