README.rapidio 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. RapidIO support for TI KeyStone devices
  2. =======================================
  3. This feature allows to boot a device through RapidIO using DirectIO (DIO).
  4. A new set of commands is added to U-Boot for this purpose.
  5. This feature is today designed to work with Texas Instruments KeyStone
  6. devices but may easily be extended to work on different architectures.
  7. How it works
  8. ------------
  9. This boot mechanism uses the DIO functionality which allows a remote
  10. device to directly read from and write into the device's address space
  11. (basically the DDR or any mapped memory such as MSM).
  12. The boot sequence is pretty simple. The RIO driver probe initializes the
  13. RapidIO controller. Then the remote link partner can push the various
  14. images (kernel, fdt, ... etc.) into their respective locations on the
  15. local device through DirectIO while the local U-boot is waiting for a
  16. signal that the push is done. When the local U-Boot receives such a signal
  17. it can then start the kernel normally like with any other boot mechanism.
  18. It is the link partner's responsability to push the various images into the
  19. proper location of the local device's memory.
  20. The wait/signal in the image pushing process is done by the RapidIO doorbell.
  21. Use the 'rio doorbell_rx <info>' U-Boot command to wait
  22. for a 16-bit doorbell info. The link partner has only to send the expected
  23. 16-bit doorbell info value when it has finished pushing all images.
  24. Basically the sequence should be as follows (A is the device to be booted,
  25. B is the link partner device which pushes the images to boot):
  26. [B]: board is up and booted, RapidIO controller is initialized but not the link
  27. [A]: board is powered on, entering U-Boot
  28. [A]: U-Boot probes the RapidIO device driver, configures the local RapidIO
  29. controller and hardware waits the link establishement
  30. [B]: Linux kernel starts the RapidIO link configuration and eventually the
  31. RapidIO enumeration/discovery process (see Linux kernel RapidIO subsytem
  32. driver for more information)
  33. [AB]: RapidIO link is now established between the two link partners
  34. [A]: the 'rio doorbell_rx <info>' command is called and wait for doorbell
  35. [B]: pushes the kernel image using DIO to pre-defined location
  36. [B]: pushes the dtb image using DIO to pre-defined location
  37. [B]: pushes the skern image using DIO to pre-defined location
  38. [B]: (depends on bootmode) pushes the filesystem image using DIO to
  39. pre-defined location
  40. [B]: sends doorbell to [A] to signify end of pushing images
  41. [A]: U-Boot receives the doorbell and exits the 'rio doorbell_rx' cmd
  42. [A}: issue 'rio shutdown' command to power off rapidio
  43. [A]: skern, fdt and kernel can be installed and started normally with the
  44. 'mon_install' and 'bootm' U-Boot commands
  45. RapidIO subsystem commands
  46. --------------------------
  47. - rio devices:
  48. This command is used to probe and show the RapidIO devices (with U-Boot
  49. assigned device numbers devnum) available. Corresponding drivers initialize
  50. the respective RapidIO controlller while being probed. It is not necessary
  51. to run this command in order to have the device driver probed. Following
  52. commands also triggers probes to the devices.
  53. The <devnum> in the following commands designates the RapidIO device to
  54. execute the command. If there is only one RapidIO device in the system,
  55. then the devnum must be 0.
  56. - rio doorbell_rx <devnum> <info>:
  57. Blocking wait for receiving 16-bit doorbell <info>.
  58. (<info> is implementation specific).
  59. - rio remove <devnum>:
  60. Disables the RapidIO controller.
  61. - rio r <devnum> port dst_id hopcount offset:
  62. This command allows to read the remote RapidIO configuration space by
  63. performing a maintenance read request.
  64. - rio w <devnum> port dst_id hopcount offset value:
  65. This command allows to write into the remote RapidIO configuration
  66. space by performing a maintenance write request.
  67. - rio lr <devnum> offset:
  68. This performs a local RapidIO configuration space read.
  69. - rio lw <devnum> offset value:
  70. This performs a local RapidIO configuration space write.
  71. Device support
  72. --------------
  73. The RapidIO controller of the KeyStone devices is supported through the
  74. drivers/rapidio/keystone_rio.c device driver.
  75. The RapidIO driver must conform to the rio-uclass requirements, namely,
  76. implements probe(), remove() and the APIs specified in struct rio_ops.
  77. Booting with RapidIO
  78. --------------------
  79. Example of RapidIO booting with U-Boot:
  80. => rio devices
  81. RapidIO uclass entries:
  82. devnum device driver
  83. 0 rapidio@2900000 rio_keystone
  84. => rio doorbell_rx 0 0xffff
  85. keystone_rio_doorbell_rx: waiting for dbell any ...
  86. received dbell[0] status: 0x00000001
  87. => rio remove 0
  88. => mon_install ${addr_mon}
  89. ## installed monitor, freq [200000000], status 0
  90. => bootm ${addr_kern} ${addr_uninitrd} ${addr_fdt}
  91. Kernel image @ 0x82000000 [ 0x000000 - 0x400fc0 ]
  92. ## Flattened Device Tree blob at 88000000
  93. Booting using the fdt blob at 0x88000000
  94. Loading Device Tree to 8fff4000, end 8ffff518 ... OK
  95. Starting kernel ...
  96. -----
  97. Here is an Linux example that uses the riot utility and the mport_cdev
  98. feature to boot a remote device. The remote device uses the U-Boot
  99. RapidIO booting mechanism (like the example above):
  100. ./riot -f k2hk_fs.cpio.gz -D 1 -A 0x88080000
  101. ./riot -f k2hk-evm.dtb -D 1 -A 0x88000000
  102. ./riot -f skern-k2hk.bin -D 1 -A 0x0c5f0000
  103. ./riot -f zImage -D 1 -A 0x82000000
  104. ./riot -L 0x00 -D 1
  105. where -f: image file, -D: destid, -A: remote mem addr, -L: doorbell info
  106. This will push the various images and notify U-Boot.
  107. -----
  108. Example of (local and remote) read/write commands:
  109. K2HK EVM # rio r 0 0 -1 1 0x0
  110. 00000000: b9810030 0...
  111. K2HK EVM # rio r 0 0 -1 1 0x4
  112. 00000004: 00000000 ....
  113. K2HK EVM # rio r 0 0 -1 1 0x8
  114. 00000008: 00000030 0...
  115. K2HK EVM # rio lr 0 0
  116. 00000000: b9810030 0...
  117. K2HK EVM # rio lr 0 8
  118. 00000008: 00000030 0...