Advertisement
Guest User

Untitled

a guest
Aug 14th, 2018
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.83 KB | None | 0 0
  1. RapidIO Support for NVIDIA Jetson TK1
  2. To enable RapidIO support to NVIDIA Jetson TK1 development board users have to patch and rebuild
  3. board’s standard Linux kernel image using set of provided patches. This set of patches backports most
  4. recent existing RapidIO functionality (as for mainline Linux kernel v3.17) to Linux kernel version currently
  5. provided by NVIDIA for Jetson boards - v3.10.x.
  6. Steps to build and install a customized Linux kernel image on Jetson board are well described on NVIDIA
  7. embedded developers forum. For full details and discussions please follow the link belo:
  8. https://devtalk.nvidia.com/default/topic/762653/embedded-systems/-howto-build-own-kernel-for-
  9. jetson-tk1/1/ (Windows Explorer does not display the page properly, use Chrome to view this page)
  10. For user convenience text from the HowTo guide referenced by the link is included into this document
  11. with added specifics of enabling RapidIO support.
  12. I. Update and rebuild Linux kernel
  13. Before patching the kernel source code tree please unpack the latest available package
  14. jetson_srio_kernel_patches_<release_date>.tbz2 into user home directory. For this example we will use
  15. default user ubuntu as configured on fresh “out of the box” Jetson board.
  16. ubuntu@jetson:~$ tar –xvf Jetson_srio_kernel_patches.tbz2
  17. Follow the instructions below (steps added for RapidIO are highlighted in italic):
  18. This method is for fastboot mode. If you use U-boot look to linuxdev post on this thread.
  19. 1. On Jetson-TK1
  20. a) Install dependencies:
  21. 1. sudo apt-add-repository universe
  22. 2. sudo apt-get update
  23. 3. sudo apt-get install libncurses5-dev
  24. b) Switch to root account:
  25. 1. sudo suc) Download, unpack & configure kernel source:
  26. 1. cd /usr/src/
  27. 2. wget
  28. https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T
  29. /kernel_src.tbz2
  30. 3. tar -xvf kernel_src.tbz2
  31. 4. cd kernel
  32. 5. Apply patches from your home directory in their numbering order:
  33. “patch –p1 < /home/ubuntu/SRIO_PATCHES/0001-rapidio-add-RapidIO...
  34. “patch –p1 < /home/ubuntu/SRIO_PATCHES/0002-... and so on until the last
  35. one.
  36. 6. Copy config file: cp /home/ubuntu/SRIO_PATCHES/.config .config
  37. 7. make menuconfig (if you want your own build options, by default all
  38. RapidIO drivers will be built as loadable modules)
  39. Go to: "General setup -> Local version" and set your version name eg.: -SRIO
  40. After customize kernel options, save & exit. You should look "configuration written to .config"
  41. d) Compile your kernel (about 10minutes)
  42. 1. make -j4
  43. 2. make modules
  44. 3. make modules_install
  45. Please note that kernel re-flashing procedure may be changed over time and
  46. apply steps specific for your specific version of Linux kernel package
  47. provided by NVIDIA.
  48. One of the nodes in a RapidIO network has to act as a network enumerator. To
  49. enable this function kernel boot command line parameter “rapidio.hdi=x” where
  50. x is number in 0 to 254 range should be added. See section 2d below.
  51. e) Check modules was installed
  52. 1. ls /lib/modules/
  53. You should look -SRIO modules directory:
  54. 3.10.24-gf455cd4 3.10.24-SRIO
  55. f) Copy kernel zImage to USB or FTP from arch/arm/boot/ directory
  56. -rwxr-xr-x 1 root 5721960 Jul 20 18:32 arch/arm/boot/zImageg) Turn off Jetson TK1, connect via USB cable to PC-host and turn Jetson in RECOVERY mode.
  57. 2. On PC host
  58. a) On PC-Host you should look device 0955:7140:
  59. 1. lsusb
  60. 2. Bus 006 Device 010: ID 0955:7140 NVidia Corp.
  61. b) Download L4T if you haven't yet:
  62. 1. wget
  63. https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T
  64. /Tegra124_Linux_R19.3.0_armhf.tbz2
  65. 2. tar -xvf Tegra124_Linux_R19.3.0_armhf.tbz2
  66. 3. cd Linux_for_Tegra
  67. c) Replace zImage in "kernel/" in your zImage file compiled before (1.f)
  68. d) Flash kernel
  69. 1. sudo ./flash.sh -k 6 –C rapidio.hdid=1 jetson-tk1 mmcblk0p1 (enumerator)
  70. 2. sudo ./flash.sh -k 6 jetson-tk1 mmcblk0p1 (non-enumerating nodes)
  71. You should look:
  72. 1. copying dtbfile(/root/Linux_for_Tegra/kernel/dtb/tegra124-pm375.dtb) to
  73. tegra124-pm375.dtb... done.
  74. 2. Just updating kernel and boot device.
  75. 3. copying
  76. bootloader(/root/Linux_for_Tegra/bootloader/ardbeg/fastboot.bin)...
  77. done.
  78. 4. Bootloader(/root/Linux_for_Tegra/bootloader/ardbeg/fastboot.bin) used as
  79. flasher.
  80. 5. Existing flash application(/root/Linux_for_Tegra/bootloader/nvflash)
  81. reused.
  82. 6. making zero initrd...
  83. 7. done.
  84. 8. Making Boot image... done
  85. 9. *** Flashing kernel update started. ***
  86. 10. Nvflash 4.13.0000 started
  87. 11. chip uid from BR is: 0x340010017408f044100000000a020440
  88. 12. rcm version 0X400001
  89. 13. System Information:
  90. 14.
  91. chip name: unknown
  92. 15.
  93. chip id: 0x40 major: 1 minor: 116.
  94. chip sku: 0x81
  95. 17.
  96. chip uid: 0x000000017408f044100000000a020440
  97. 18.
  98. macrovision: disabled
  99. 19.
  100. hdcp: enabled
  101. 20.
  102. jtag: enabled
  103. 21.
  104. sbk burned: false
  105. 22.
  106. board id: 375
  107. 23.
  108. warranty fuse: 0
  109. 24.
  110. dk burned: true
  111. 25.
  112. boot device: emmc
  113. 26.
  114. operating mode: 3
  115. 27.
  116. device config strap: 0
  117. 28.
  118. device config fuse: 0
  119. 29.
  120. sdram config strap: 3
  121. 30.
  122. 31. RCM communication completed
  123. 32. downloading bootloader -- load address: 0x80108000 entry point:
  124. 0x80108000
  125. 33. sending file: fastboot.bin
  126. 34. - 900492/900492 bytes sent
  127. 35. fastboot.bin sent successfully
  128. 36. waiting for bootloader to initialize
  129. 37. bootloader downloaded successfully
  130. 38. sending file: boot.img
  131. 39. \ 5724160/5724160 bytes sent
  132. 40. boot.img sent successfully
  133. 41. Time taken for flashing 3 Secs
  134. 42. *** The kernel has been updated successfully. ***
  135. IF FLASH FAILED and message is: "mapping system.img to loop device failed." edit flash.sh on line 284:
  136. 1. losetup /dev/loop0 system.img > /dev/null 2>&1
  137. replace to:
  138. 1. losetup --find --show system.img
  139. thanks linuxdev - more info
  140. e) Reset Jetson (power off-on)
  141. 3. On Jetson-TK1
  142. a) Check kernel version
  143. 1. uname -a1. Linux tegra-ubuntu 3.10.24-SRIO #1 SMP PREEMPT Sun Jul 20 18:31:40 CEST
  144. 2014 armv7l armv7l armv7l GNU/Linux
  145. b) Copy extra modules from NVIDIA kernel
  146. 1. sudo cp -rv /lib/modules/3.10.24-gf455cd4/extra /lib/modules/`uname -r`/
  147. 2. sudo depmod -a
  148. Well done. You have own kernel!
  149. II. Build and Run Test Applications
  150. To install provided sample test programs unpack a provided package jetson_srio_tests_<date>.tbz2 into
  151. user’s home directory:
  152. ubuntu@jetson:~$ tar –xvf jetson_srio_tests.tbz2
  153. These tests will be unpacked into mcd_base directory and already include pre-built executable binary
  154. files. To rebuild test programs do following steps:
  155. 1. cd mcd_base
  156. 2. make clean
  157. 3. make KDIR=/usr/src/kernel (if kernel source code directory path is set as in section I above).
  158. Before running test applications make sure that RapidIO subsystem is initialized and all drivers are
  159. loaded (See section III below).
  160. Because test applications access to RapidIO specific device drivers, user must acquire the root privileges
  161. before running them (“sudo su”).
  162. DMA test application report data transfer performance number. To achieve better performance
  163. numbers please make sure that RapidIO subsystem debug messages are disabled in kernel configuration
  164. options. By default, the config file provided in the patch package enables RapidIO debug messages to
  165. allow new users to verify their RapidIO system operations.
  166. 1. RapidIO Subsystem Initialization
  167. To initialize RapidIO network in your Jetson cluster setup, first power up all participating nodes and
  168. RapidIO switch(es) connecting them.
  169. Identify enumerating node (one that was flashed with kernel boot command line parameter
  170. “rapidio.hdid=” in the section I).Load RapidIO modules using following steps:
  171. 1.
  172. 2.
  173. 3.
  174. 4.
  175. sudo su
  176. modprobe rio-scan scan=1
  177. modprobe rio_mport_cdev
  178. modprobe rio_cm
  179. To check result of RapidIO network enumeration you can do “ls /sys/bus/rapidio/devices” which will list
  180. attached RapidIO devices (local node not shown). Example of such operation for system with two nodes
  181. and one switch is shown below.
  182. After RapidIO initialization steps have been performed on the enumerator node, steps listed above can
  183. be performed on remaining nodes in a RapidIO network. As result each node should create list of
  184. attached RapidIO devices (with different local nodes absent on each node) and create character device
  185. files /dev/rio_cm and /dev/rio_mportN [N=0...(number_of_ local_SRIO_ports - 1)].2. Running Test Programs
  186. To run test program a user must have root priveleges.
  187. All programs are printing their usage information if started with “-h” option.
  188. The “riodp_test_misc –q” can be used to check SRIO link/port status before running data transfer tests.
  189. The program riodp_test_dma has two roles – it can act as a passive remote memory target or as active
  190. DMA user that performs writes and reads to/from remote target memory. To run a DMA test between
  191. two RapidIO nodes the remote target memory has to be initiated first and DMA transfers started after
  192. that. An example below assumes that RapidIO network has two nodes with destination IDs 0 and 1 and
  193. user selects a node with destID 1 to be an active DMA requester:
  194. 1. Initiate target memory space on the node with destID=0: “riodp_test_dma –i” will allocate
  195. kernel space contiguous buffer and map it into RapidIO address (using default settings: buffer
  196. size = 2MB and RapidIO base address = 0).
  197. 2. On the node with destID=1 start the DMA requestor: “riodp_test_dma –D0 –S0x200000” will
  198. perform single DMA data exchange cycle (write data to remote memory, read them back and
  199. compare). NOTES: A) Data transfer size must be equal or less than size of remote target
  200. memory. B) “-k” option uses contiguous kernel space buffers and therefore allows to have
  201. better data transfer performance compared to user space buffers that may require large
  202. number of memory pages to be used.
  203. The RapidIO messaging test performs messaging exchange using channelized message exchange similar
  204. to sockets and is provided in classic form of client and server applications. The server application
  205. riodp_test_server has to be started first followed by the client: riodp_test_client.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement