aspeed.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. Aspeed family boards (``ast2500-evb``, ``ast2600-evb``, ``ast2700-evb``, ``bletchley-bmc``, ``fuji-bmc``, ``fby35-bmc``, ``fp5280g2-bmc``, ``g220a-bmc``, ``palmetto-bmc``, ``qcom-dc-scm-v1-bmc``, ``qcom-firework-bmc``, ``quanta-q71l-bmc``, ``rainier-bmc``, ``romulus-bmc``, ``sonorapass-bmc``, ``supermicrox11-bmc``, ``supermicrox11spi-bmc``, ``tiogapass-bmc``, ``witherspoon-bmc``, ``yosemitev2-bmc``)
  2. ==================================================================================================================================================================================================================================================================================================================================================================================================================
  3. The QEMU Aspeed machines model BMCs of various OpenPOWER systems and
  4. Aspeed evaluation boards. They are based on different releases of the
  5. Aspeed SoC : the AST2400 integrating an ARM926EJ-S CPU (400MHz), the
  6. AST2500 with an ARM1176JZS CPU (800MHz), the AST2600
  7. with dual cores ARM Cortex-A7 CPUs (1.2GHz) and more recently the AST2700
  8. with quad cores ARM Cortex-A35 64 bits CPUs (1.6GHz)
  9. The SoC comes with RAM, Gigabit ethernet, USB, SD/MMC, USB, SPI, I2C,
  10. etc.
  11. AST2400 SoC based machines :
  12. - ``palmetto-bmc`` OpenPOWER Palmetto POWER8 BMC
  13. - ``quanta-q71l-bmc`` OpenBMC Quanta BMC
  14. - ``supermicrox11-bmc`` Supermicro X11 BMC (ARM926EJ-S)
  15. - ``supermicrox11spi-bmc`` Supermicro X11 SPI BMC (ARM1176)
  16. AST2500 SoC based machines :
  17. - ``ast2500-evb`` Aspeed AST2500 Evaluation board
  18. - ``romulus-bmc`` OpenPOWER Romulus POWER9 BMC
  19. - ``witherspoon-bmc`` OpenPOWER Witherspoon POWER9 BMC
  20. - ``sonorapass-bmc`` OCP SonoraPass BMC
  21. - ``fp5280g2-bmc`` Inspur FP5280G2 BMC
  22. - ``g220a-bmc`` Bytedance G220A BMC
  23. - ``yosemitev2-bmc`` Facebook YosemiteV2 BMC
  24. - ``tiogapass-bmc`` Facebook Tiogapass BMC
  25. AST2600 SoC based machines :
  26. - ``ast2600-evb`` Aspeed AST2600 Evaluation board (Cortex-A7)
  27. - ``rainier-bmc`` IBM Rainier POWER10 BMC
  28. - ``fuji-bmc`` Facebook Fuji BMC
  29. - ``bletchley-bmc`` Facebook Bletchley BMC
  30. - ``fby35-bmc`` Facebook fby35 BMC
  31. - ``qcom-dc-scm-v1-bmc`` Qualcomm DC-SCM V1 BMC
  32. - ``qcom-firework-bmc`` Qualcomm Firework BMC
  33. AST2700 SoC based machines :
  34. - ``ast2700-evb`` Aspeed AST2700 Evaluation board (Cortex-A35)
  35. Supported devices
  36. -----------------
  37. * SMP (for the AST2600 Cortex-A7)
  38. * Interrupt Controller (VIC)
  39. * Timer Controller
  40. * RTC Controller
  41. * I2C Controller, including the new register interface of the AST2600
  42. * System Control Unit (SCU)
  43. * SRAM mapping
  44. * X-DMA Controller (basic interface)
  45. * Static Memory Controller (SMC or FMC) - Only SPI Flash support
  46. * SPI Memory Controller
  47. * USB 2.0 Controller
  48. * SD/MMC storage controllers
  49. * SDRAM controller (dummy interface for basic settings and training)
  50. * Watchdog Controller
  51. * GPIO Controller (Master only)
  52. * UART
  53. * Ethernet controllers
  54. * Front LEDs (PCA9552 on I2C bus)
  55. * LPC Peripheral Controller (a subset of subdevices are supported)
  56. * Hash/Crypto Engine (HACE) - Hash support only. TODO: HMAC and RSA
  57. * ADC
  58. * Secure Boot Controller (AST2600)
  59. * eMMC Boot Controller (dummy)
  60. * PECI Controller (minimal)
  61. * I3C Controller
  62. * Internal Bridge Controller (SLI dummy)
  63. Missing devices
  64. ---------------
  65. * Coprocessor support
  66. * PWM and Fan Controller
  67. * Slave GPIO Controller
  68. * Super I/O Controller
  69. * PCI-Express 1 Controller
  70. * Graphic Display Controller
  71. * MCTP Controller
  72. * Mailbox Controller
  73. * Virtual UART
  74. * eSPI Controller
  75. Boot options
  76. ------------
  77. The Aspeed machines can be started using the ``-kernel`` and ``-dtb`` options
  78. to load a Linux kernel or from a firmware. Images can be downloaded from the
  79. OpenBMC jenkins :
  80. https://jenkins.openbmc.org/job/ci-openbmc/lastSuccessfulBuild/
  81. or directly from the OpenBMC GitHub release repository :
  82. https://github.com/openbmc/openbmc/releases
  83. or directly from the ASPEED Forked OpenBMC GitHub release repository :
  84. https://github.com/AspeedTech-BMC/openbmc/releases
  85. Booting from a kernel image
  86. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  87. To boot a kernel directly from a Linux build tree:
  88. .. code-block:: bash
  89. $ qemu-system-arm -M ast2600-evb -nographic \
  90. -kernel arch/arm/boot/zImage \
  91. -dtb arch/arm/boot/dts/aspeed-ast2600-evb.dtb \
  92. -initrd rootfs.cpio
  93. Booting from a flash image
  94. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  95. The machine options specific to Aspeed to boot from a flash image are :
  96. * ``execute-in-place`` which emulates the boot from the CE0 flash
  97. device by using the FMC controller to load the instructions, and
  98. not simply from RAM. This takes a little longer.
  99. * ``fmc-model`` to change the default FMC Flash model. FW needs
  100. support for the chip model to boot.
  101. * ``spi-model`` to change the default SPI Flash model.
  102. To boot the machine from the flash image, use an MTD drive :
  103. .. code-block:: bash
  104. $ qemu-system-arm -M romulus-bmc -nic user \
  105. -drive file=obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd -nographic
  106. To use other flash models, for instance a different FMC chip and a
  107. bigger (64M) SPI for the ``ast2500-evb`` machine, run :
  108. .. code-block:: bash
  109. -M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx66u51235f
  110. When more flexibility is needed to define the flash devices, to use
  111. different flash models or define all flash devices (up to 8), the
  112. ``-nodefaults`` QEMU option can be used to avoid creating the default
  113. flash devices.
  114. Flash devices should then be created from the command line and attached
  115. to a block device :
  116. .. code-block:: bash
  117. $ qemu-system-arm -M ast2600-evb \
  118. -blockdev node-name=fmc0,driver=file,filename=/path/to/fmc0.img \
  119. -device mx66u51235f,bus=ssi.0,cs=0x0,drive=fmc0 \
  120. -blockdev node-name=fmc1,driver=file,filename=/path/to/fmc1.img \
  121. -device mx66u51235f,bus=ssi.0,cs=0x1,drive=fmc1 \
  122. -blockdev node-name=spi1,driver=file,filename=/path/to/spi1.img \
  123. -device mx66u51235f,cs=0x0,bus=ssi.1,drive=spi1 \
  124. -nographic -nodefaults
  125. In that case, the machine boots fetching instructions from the FMC0
  126. device. It is slower to start but closer to what HW does. Using the
  127. machine option ``execute-in-place`` has a similar effect.
  128. Booting from an eMMC image
  129. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  130. The machine options specific to Aspeed machines to boot from an eMMC
  131. image are :
  132. * ``boot-emmc`` to set or unset boot from eMMC (AST2600).
  133. Only the ``ast2600-evb`` and ``rainier-emmc`` machines have support to
  134. boot from an eMMC device. In this case, the machine assumes that the
  135. eMMC image includes special boot partitions. Such an image can be
  136. built this way :
  137. .. code-block:: bash
  138. $ dd if=/dev/zero of=mmc-bootarea.img count=2 bs=1M
  139. $ dd if=u-boot-spl.bin of=mmc-bootarea.img conv=notrunc
  140. $ dd if=u-boot.bin of=mmc-bootarea.img conv=notrunc count=64 bs=1K
  141. $ cat mmc-bootarea.img obmc-phosphor-image.wic > mmc.img
  142. $ truncate --size 16GB mmc.img
  143. Boot the machine ``rainier-emmc`` with :
  144. .. code-block:: bash
  145. $ qemu-system-arm -M rainier-bmc \
  146. -drive file=mmc.img,format=raw,if=sd,index=2 \
  147. -nographic
  148. The ``boot-emmc`` option can be set or unset, to change the default
  149. boot mode of machine: SPI or eMMC. This can be useful to boot the
  150. ``ast2600-evb`` machine from an eMMC device (default being SPI) or to
  151. boot the ``rainier-bmc`` machine from a flash device (default being
  152. eMMC).
  153. As an example, here is how to to boot the ``rainier-bmc`` machine from
  154. the flash device with ``boot-emmc=false`` and let the machine use an
  155. eMMC image :
  156. .. code-block:: bash
  157. $ qemu-system-arm -M rainier-bmc,boot-emmc=false \
  158. -drive file=flash.img,format=raw,if=mtd \
  159. -drive file=mmc.img,format=raw,if=sd,index=2 \
  160. -nographic
  161. It should be noted that in this case the eMMC device must not have
  162. boot partitions, otherwise the contents will not be accessible to the
  163. machine. This limitation is due to the use of the ``-drive``
  164. interface.
  165. Ideally, one should be able to define the eMMC device and the
  166. associated backend directly on the command line, such as :
  167. .. code-block:: bash
  168. -blockdev node-name=emmc0,driver=file,filename=mmc.img \
  169. -device emmc,bus=sdhci-bus.2,drive=emmc0,boot-partition-size=1048576,boot-config=8
  170. This is not yet supported (as of QEMU-10.0). Work is needed to
  171. refactor the sdhci bus model.
  172. Other booting options
  173. ^^^^^^^^^^^^^^^^^^^^^
  174. Other machine options specific to Aspeed machines are :
  175. * ``bmc-console`` to change the default console device. Most of the
  176. machines use the ``UART5`` device for a boot console, which is
  177. mapped on ``/dev/ttyS4`` under Linux, but it is not always the
  178. case.
  179. To change the boot console and use device ``UART3`` (``/dev/ttyS2``
  180. under Linux), use :
  181. .. code-block:: bash
  182. -M ast2500-evb,bmc-console=uart3
  183. Booting the ast2700-evb machine
  184. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  185. Boot the AST2700 machine from the flash image, use an MTD drive :
  186. .. code-block:: bash
  187. IMGDIR=ast2700-default
  188. UBOOT_SIZE=$(stat --format=%s -L ${IMGDIR}/u-boot-nodtb.bin)
  189. $ qemu-system-aarch64 -M ast2700-evb \
  190. -device loader,force-raw=on,addr=0x400000000,file=${IMGDIR}/u-boot-nodtb.bin \
  191. -device loader,force-raw=on,addr=$((0x400000000 + ${UBOOT_SIZE})),file=${IMGDIR}/u-boot.dtb \
  192. -device loader,force-raw=on,addr=0x430000000,file=${IMGDIR}/bl31.bin \
  193. -device loader,force-raw=on,addr=0x430080000,file=${IMGDIR}/optee/tee-raw.bin \
  194. -device loader,cpu-num=0,addr=0x430000000 \
  195. -device loader,cpu-num=1,addr=0x430000000 \
  196. -device loader,cpu-num=2,addr=0x430000000 \
  197. -device loader,cpu-num=3,addr=0x430000000 \
  198. -smp 4 \
  199. -drive file=${IMGDIR}/image-bmc,format=raw,if=mtd \
  200. -nographic
  201. Aspeed minibmc family boards (``ast1030-evb``)
  202. ==================================================================
  203. The QEMU Aspeed machines model mini BMCs of various Aspeed evaluation
  204. boards. They are based on different releases of the
  205. Aspeed SoC : the AST1030 integrating an ARM Cortex M4F CPU (200MHz).
  206. The SoC comes with SRAM, SPI, I2C, etc.
  207. AST1030 SoC based machines :
  208. - ``ast1030-evb`` Aspeed AST1030 Evaluation board (Cortex-M4F)
  209. Supported devices
  210. -----------------
  211. * SMP (for the AST1030 Cortex-M4F)
  212. * Interrupt Controller (VIC)
  213. * Timer Controller
  214. * I2C Controller
  215. * System Control Unit (SCU)
  216. * SRAM mapping
  217. * Static Memory Controller (SMC or FMC) - Only SPI Flash support
  218. * SPI Memory Controller
  219. * USB 2.0 Controller
  220. * Watchdog Controller
  221. * GPIO Controller (Master only)
  222. * UART
  223. * LPC Peripheral Controller (a subset of subdevices are supported)
  224. * Hash/Crypto Engine (HACE) - Hash support only. TODO: HMAC and RSA
  225. * ADC
  226. * Secure Boot Controller
  227. * PECI Controller (minimal)
  228. Missing devices
  229. ---------------
  230. * PWM and Fan Controller
  231. * Slave GPIO Controller
  232. * Mailbox Controller
  233. * Virtual UART
  234. * eSPI Controller
  235. * I3C Controller
  236. Boot options
  237. ------------
  238. The Aspeed machines can be started using the ``-kernel`` to load a
  239. Zephyr OS or from a firmware. Images can be downloaded from the
  240. ASPEED GitHub release repository :
  241. https://github.com/AspeedTech-BMC/zephyr/releases
  242. To boot a kernel directly from a Zephyr build tree:
  243. .. code-block:: bash
  244. $ qemu-system-arm -M ast1030-evb -nographic \
  245. -kernel zephyr.elf