controlcenterdc.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2014 Stefan Roese <sr@denx.de>
  4. * Copyright (C) 2016 Mario Six <mario.six@gdsys.cc>
  5. */
  6. #ifndef _CONFIG_CONTROLCENTERDC_H
  7. #define _CONFIG_CONTROLCENTERDC_H
  8. /*
  9. * High Level Configuration Options (easy to change)
  10. */
  11. #define CONFIG_CUSTOMER_BOARD_SUPPORT
  12. #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
  13. /*
  14. * TEXT_BASE needs to be below 16MiB, since this area is scrubbed
  15. * for DDR ECC byte filling in the SPL before loading the main
  16. * U-Boot into it.
  17. */
  18. #define CONFIG_LOADADDR 1000000
  19. /*
  20. * SATA/SCSI/AHCI configuration
  21. */
  22. #define CONFIG_SCSI_AHCI_PLAT
  23. #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
  24. #define CONFIG_SYS_SCSI_MAX_LUN 1
  25. #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
  26. CONFIG_SYS_SCSI_MAX_LUN)
  27. /* USB/EHCI configuration */
  28. #define CONFIG_EHCI_IS_TDI
  29. /* Environment in SPI NOR flash */
  30. #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
  31. /* PCIe support */
  32. #ifndef CONFIG_SPL_BUILD
  33. #define CONFIG_PCI_SCAN_SHOW
  34. #endif
  35. /*
  36. * Software (bit-bang) MII driver configuration
  37. */
  38. #define CONFIG_BITBANGMII_MULTI
  39. /* SPL */
  40. /*
  41. * Select the boot device here
  42. *
  43. * Currently supported are:
  44. * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash
  45. * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1)
  46. */
  47. #define SPL_BOOT_SPI_NOR_FLASH 1
  48. #define SPL_BOOT_SDIO_MMC_CARD 2
  49. #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH
  50. /* Defines for SPL */
  51. #define CONFIG_SPL_SIZE (160 << 10)
  52. #if defined(CONFIG_SECURED_MODE_IMAGE)
  53. #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x2614)
  54. #else
  55. #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x30)
  56. #endif
  57. #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
  58. #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
  59. #ifdef CONFIG_SPL_BUILD
  60. #define CONFIG_SYS_MALLOC_SIMPLE
  61. #endif
  62. #define CONFIG_SPL_STACK (0x40000000 + ((212 - 16) << 10))
  63. #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
  64. #define CONFIG_SPL_LIBCOMMON_SUPPORT
  65. #define CONFIG_SPL_LIBGENERIC_SUPPORT
  66. #define CONFIG_SPL_I2C
  67. #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
  68. /* SPL related MMC defines */
  69. #define CONFIG_SPL_MMC_SUPPORT
  70. #ifdef CONFIG_SPL_BUILD
  71. #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */
  72. #endif
  73. #endif
  74. /*
  75. * Environment Configuration
  76. */
  77. #define CONFIG_HOSTNAME "ccdc"
  78. #define CONFIG_ROOTPATH "/opt/nfsroot"
  79. #define CONFIG_BOOTFILE "ccdc.img"
  80. #define CONFIG_EXTRA_ENV_SETTINGS \
  81. "netdev=eth1\0" \
  82. "consoledev=ttyS1\0" \
  83. "u-boot=u-boot.bin\0" \
  84. "bootfile_addr=1000000\0" \
  85. "keyprogram_addr=3000000\0" \
  86. "keyprogram_file=keyprogram.img\0" \
  87. "fdtfile=controlcenterdc.dtb\0" \
  88. "load=tftpboot ${loadaddr} ${u-boot}\0" \
  89. "mmcdev=0:2\0" \
  90. "update=sf probe 1:0;" \
  91. " sf erase 0 +${filesize};" \
  92. " sf write ${fileaddr} 0 ${filesize}\0" \
  93. "upd=run load update\0" \
  94. "fdt_high=0x10000000\0" \
  95. "initrd_high=0x10000000\0" \
  96. "loadkeyprogram=tpm flush_keys;" \
  97. " mmc rescan;" \
  98. " ext4load mmc ${mmcdev} ${keyprogram_addr} ${keyprogram_file};"\
  99. " source ${keyprogram_addr}:script@1\0" \
  100. "gpio1=gpio@22_25\0" \
  101. "gpio2=A29\0" \
  102. "blinkseq='0 0 0 0 2 0 2 2 3 1 3 1 0 0 2 2 3 1 3 3 2 0 2 2 3 1 1 1 " \
  103. "2 0 2 2 3 1 3 1 0 0 2 0 3 3 3 1 2 0 0 0 3 1 1 1 0 0 0 0'\0" \
  104. "bootfail=for i in ${blinkseq}; do" \
  105. " if test $i -eq 0; then" \
  106. " gpio clear ${gpio1}; gpio set ${gpio2};" \
  107. " elif test $i -eq 1; then" \
  108. " gpio clear ${gpio1}; gpio clear ${gpio2};" \
  109. " elif test $i -eq 2; then" \
  110. " gpio set ${gpio1}; gpio set ${gpio2};" \
  111. " else;" \
  112. " gpio clear ${gpio1}; gpio set ${gpio2};" \
  113. " fi; sleep 0.12; done\0"
  114. #define CONFIG_NFSBOOTCOMMAND \
  115. "setenv bootargs root=/dev/nfs rw " \
  116. "nfsroot=${serverip}:${rootpath} " \
  117. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off " \
  118. "console=${consoledev},${baudrate} ${othbootargs}; " \
  119. "tftpboot ${bootfile_addr} ${bootfile}; " \
  120. "bootm ${bootfile_addr}"
  121. #define CONFIG_MMCBOOTCOMMAND \
  122. "setenv bootargs root=/dev/mmcblk0p3 rw rootwait " \
  123. "console=${consoledev},${baudrate} ${othbootargs}; " \
  124. "ext2load mmc 0:2 ${bootfile_addr} ${bootfile}; " \
  125. "bootm ${bootfile_addr}"
  126. #define CONFIG_BOOTCOMMAND \
  127. "if env exists keyprogram; then;" \
  128. " setenv keyprogram; run nfsboot;" \
  129. " fi;" \
  130. " run dobootfail"
  131. /*
  132. * mv-common.h should be defined after CMD configs since it used them
  133. * to enable certain macros
  134. */
  135. #include "mv-common.h"
  136. #endif /* _CONFIG_CONTROLCENTERDC_H */