controlcenterdc.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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_SYS_TCLK 250000000 /* 250MHz */
  19. #define CONFIG_LOADADDR 1000000
  20. /*
  21. * SDIO/MMC Card Configuration
  22. */
  23. #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE
  24. /*
  25. * SATA/SCSI/AHCI configuration
  26. */
  27. #define CONFIG_SCSI_AHCI_PLAT
  28. #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
  29. #define CONFIG_SYS_SCSI_MAX_LUN 1
  30. #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
  31. CONFIG_SYS_SCSI_MAX_LUN)
  32. /* USB/EHCI configuration */
  33. #define CONFIG_EHCI_IS_TDI
  34. /* Environment in SPI NOR flash */
  35. #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
  36. /* PCIe support */
  37. #ifndef CONFIG_SPL_BUILD
  38. #define CONFIG_PCI_SCAN_SHOW
  39. #endif
  40. /*
  41. * Software (bit-bang) MII driver configuration
  42. */
  43. #define CONFIG_BITBANGMII_MULTI
  44. /* SPL */
  45. /*
  46. * Select the boot device here
  47. *
  48. * Currently supported are:
  49. * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash
  50. * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1)
  51. */
  52. #define SPL_BOOT_SPI_NOR_FLASH 1
  53. #define SPL_BOOT_SDIO_MMC_CARD 2
  54. #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH
  55. /* Defines for SPL */
  56. #define CONFIG_SPL_SIZE (160 << 10)
  57. #if defined(CONFIG_SECURED_MODE_IMAGE)
  58. #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x2614)
  59. #else
  60. #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x30)
  61. #endif
  62. #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
  63. #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
  64. #ifdef CONFIG_SPL_BUILD
  65. #define CONFIG_SYS_MALLOC_SIMPLE
  66. #endif
  67. #define CONFIG_SPL_STACK (0x40000000 + ((212 - 16) << 10))
  68. #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
  69. #define CONFIG_SPL_LIBCOMMON_SUPPORT
  70. #define CONFIG_SPL_LIBGENERIC_SUPPORT
  71. #define CONFIG_SPL_I2C_SUPPORT
  72. #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH
  73. /* SPL related SPI defines */
  74. #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS
  75. #endif
  76. #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
  77. /* SPL related MMC defines */
  78. #define CONFIG_SPL_MMC_SUPPORT
  79. #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 1
  80. #define CONFIG_SYS_MMC_U_BOOT_OFFS (168 << 10)
  81. #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS
  82. #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_SYS_U_BOOT_OFFS / 512)
  83. #ifdef CONFIG_SPL_BUILD
  84. #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */
  85. #endif
  86. #endif
  87. /*
  88. * Environment Configuration
  89. */
  90. #define CONFIG_HOSTNAME "ccdc"
  91. #define CONFIG_ROOTPATH "/opt/nfsroot"
  92. #define CONFIG_BOOTFILE "ccdc.img"
  93. #define CONFIG_EXTRA_ENV_SETTINGS \
  94. "netdev=eth1\0" \
  95. "consoledev=ttyS1\0" \
  96. "u-boot=u-boot.bin\0" \
  97. "bootfile_addr=1000000\0" \
  98. "keyprogram_addr=3000000\0" \
  99. "keyprogram_file=keyprogram.img\0" \
  100. "fdtfile=controlcenterdc.dtb\0" \
  101. "load=tftpboot ${loadaddr} ${u-boot}\0" \
  102. "mmcdev=0:2\0" \
  103. "update=sf probe 1:0;" \
  104. " sf erase 0 +${filesize};" \
  105. " sf write ${fileaddr} 0 ${filesize}\0" \
  106. "upd=run load update\0" \
  107. "fdt_high=0x10000000\0" \
  108. "initrd_high=0x10000000\0" \
  109. "loadkeyprogram=tpm flush_keys;" \
  110. " mmc rescan;" \
  111. " ext4load mmc ${mmcdev} ${keyprogram_addr} ${keyprogram_file};"\
  112. " source ${keyprogram_addr}:script@1\0" \
  113. "gpio1=gpio@22_25\0" \
  114. "gpio2=A29\0" \
  115. "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 " \
  116. "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" \
  117. "bootfail=for i in ${blinkseq}; do" \
  118. " if test $i -eq 0; then" \
  119. " gpio clear ${gpio1}; gpio set ${gpio2};" \
  120. " elif test $i -eq 1; then" \
  121. " gpio clear ${gpio1}; gpio clear ${gpio2};" \
  122. " elif test $i -eq 2; then" \
  123. " gpio set ${gpio1}; gpio set ${gpio2};" \
  124. " else;" \
  125. " gpio clear ${gpio1}; gpio set ${gpio2};" \
  126. " fi; sleep 0.12; done\0"
  127. #define CONFIG_NFSBOOTCOMMAND \
  128. "setenv bootargs root=/dev/nfs rw " \
  129. "nfsroot=${serverip}:${rootpath} " \
  130. "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off " \
  131. "console=${consoledev},${baudrate} ${othbootargs}; " \
  132. "tftpboot ${bootfile_addr} ${bootfile}; " \
  133. "bootm ${bootfile_addr}"
  134. #define CONFIG_MMCBOOTCOMMAND \
  135. "setenv bootargs root=/dev/mmcblk0p3 rw rootwait " \
  136. "console=${consoledev},${baudrate} ${othbootargs}; " \
  137. "ext2load mmc 0:2 ${bootfile_addr} ${bootfile}; " \
  138. "bootm ${bootfile_addr}"
  139. #define CONFIG_BOOTCOMMAND \
  140. "if env exists keyprogram; then;" \
  141. " setenv keyprogram; run nfsboot;" \
  142. " fi;" \
  143. " run dobootfail"
  144. /*
  145. * mv-common.h should be defined after CMD configs since it used them
  146. * to enable certain macros
  147. */
  148. #include "mv-common.h"
  149. #endif /* _CONFIG_CONTROLCENTERDC_H */