riscv64.rst 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. Openpiton RISC-V SoC
  3. ====================
  4. OpenPiton is an open source, manycore processor and research platform. It is a
  5. tiled manycore framework scalable from one to 1/2 billion cores. It supports a
  6. number of ISAs including RISC-V with its P-Mesh cache coherence protocol and
  7. networks on chip. It is highly configurable in both core and uncore components.
  8. OpenPiton has been verified in both ASIC and multiple Xilinx FPGA prototypes
  9. running full-stack Debian linux.
  10. RISC-V Standard Bootflow
  11. -------------------------
  12. Currently, OpenPiton implements RISC-V standard bootflow in the following steps
  13. mover.S -> u-boot-spl -> opensbi -> u-boot -> Linux
  14. This board supports S-mode u-boot as well as M-mode SPL
  15. Building OpenPition
  16. ---------------------
  17. If you'd like to build OpenPiton, please go to OpenPiton github repo
  18. (at https://github.com/PrincetonUniversity/openpiton) to build from the latest
  19. changes
  20. Building Images
  21. ---------------
  22. SPL
  23. ~~~
  24. 1. Add the RISC-V toolchain to your PATH.
  25. 2. Setup ARCH & cross compilation environment variable:
  26. .. code-block:: none
  27. export CROSS_COMPILE=<riscv64 toolchain prefix>
  28. export ARCH=riscv
  29. 3. make openpiton_riscv64_spl_defconfig
  30. 4. make
  31. U-Boot
  32. ~~~~~~
  33. 1. Add the RISC-V toolchain to your PATH.
  34. 2. Setup ARCH & cross compilation environment variable:
  35. .. code-block:: none
  36. export CROSS_COMPILE=<riscv64 toolchain prefix>
  37. export ARCH=riscv
  38. 3. make openpiton_riscv64_defconfig
  39. 4. make
  40. opensbi
  41. ~~~~~~~
  42. 1. Add the RISC-V toolchain to your PATH.
  43. 2. Setup ARCH & cross compilation environment variable:
  44. .. code-block:: none
  45. export CROSS_COMPILE=<riscv64 toolchain prefix>
  46. export ARCH=riscv
  47. 3. Go to OpenSBI directory
  48. 4. make PLATFORM=fpga/openpiton FW_PAYLOAD_PATH=<path to u-boot-nodtb.bin>
  49. Using fw_payload.bin with Linux
  50. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  51. Put the generated fw_payload.bin into the /boot directory on the root filesystem,
  52. plug in the SD card, then flash the bitstream. Linux will boot automatically.
  53. Booting
  54. -------
  55. Once you plugin the sdcard and power up, you should see the U-Boot prompt.
  56. Sample Dual-core Debian boot log from OpenPiton
  57. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. .. code-block:: none
  59. Trying to boot from MMC1
  60. OpenSBI v0.9-5-gd06cb61
  61. ____ _____ ____ _____
  62. / __ \ / ____| _ \_ _|
  63. | | | |_ __ ___ _ __ | (___ | |_) || |
  64. | | | | '_ \ / _ \ '_ \ \___ \| _ < | |
  65. | |__| | |_) | __/ | | |____) | |_) || |_
  66. \____/| .__/ \___|_| |_|_____/|____/_____|
  67. | |
  68. |_|
  69. Platform Name : OPENPITON RISC-V
  70. Platform Features : timer,mfdeleg
  71. Platform HART Count : 3
  72. Firmware Base : 0x80000000
  73. Firmware Size : 104 KB
  74. Runtime SBI Version : 0.2
  75. Domain0 Name : root
  76. Domain0 Boot HART : 0
  77. Domain0 HARTs : 0*,1*,2*
  78. Domain0 Region00 : 0x0000000080000000-0x000000008001ffff ()
  79. Domain0 Region01 : 0x0000000000000000-0xffffffffffffffff (R,W,X)
  80. Domain0 Next Address : 0x0000000080200000
  81. Domain0 Next Arg1 : 0x0000000082200000
  82. Domain0 Next Mode : S-mode
  83. Domain0 SysReset : yes
  84. Boot HART ID : 0
  85. Boot HART Domain : root
  86. Boot HART ISA : rv64imafdcsu
  87. Boot HART Features : scounteren,mcounteren
  88. Boot HART PMP Count : 0
  89. Boot HART PMP Granularity : 0
  90. Boot HART PMP Address Bits: 0
  91. Boot HART MHPM Count : 0
  92. Boot HART MHPM Count : 0
  93. Boot HART MIDELEG : 0x0000000000000222
  94. Boot HART MEDELEG : 0x000000000000b109
  95. U-Boot 2021.01+ (Jun 12 2021 - 10:31:34 +0800)
  96. DRAM: 1 GiB
  97. MMC: sdhci@f000000000: 0 (eMMC)
  98. In: uart@fff0c2c000
  99. Out: uart@fff0c2c000
  100. Err: uart@fff0c2c000
  101. Hit any key to stop autoboot: 0
  102. 6492992 bytes read in 5310 ms (1.2 MiB/s)
  103. ## Flattened Device Tree blob at 86000000
  104. Booting using the fdt blob at 0x86000000
  105. Loading Device Tree to 00000000bfffa000, end 00000000bffff007 ... OK
  106. Starting kernel ...
  107. [ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
  108. [ 0.000000] Linux version 5.6.0-rc4-gb9d34f7e294d-dirty
  109. [ 0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
  110. [ 0.000000] printk: bootconsole [sbi0] enabled
  111. [ 0.000000] Zone ranges:
  112. [ 0.000000] DMA32 [mem 0x0000000080200000-0x00000000bfffffff]
  113. [ 0.000000] Normal empty
  114. [ 0.000000] Movable zone start for each node
  115. [ 0.000000] Early memory node ranges
  116. [ 0.000000] node 0: [mem 0x0000000080200000-0x00000000bfffffff]
  117. [ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x00000000bfffffff]
  118. [ 0.000000] On node 0 totalpages: 261632
  119. [ 0.000000] DMA32 zone: 4088 pages used for memmap
  120. [ 0.000000] DMA32 zone: 0 pages reserved
  121. [ 0.000000] DMA32 zone: 261632 pages, LIFO batch:63
  122. [ 0.000000] software IO TLB: mapped [mem 0xbaffa000-0xbeffa000] (64MB)
  123. [ 0.000000] SBI specification v0.2 detected
  124. [ 0.000000] SBI implementation ID=0x1 Version=0x9
  125. [ 0.000000] SBI v0.2 TIME extension detected
  126. [ 0.000000] SBI v0.2 IPI extension detected
  127. [ 0.000000] SBI v0.2 RFENCE extension detected
  128. [ 0.000000] SBI v0.2 HSM extension detected
  129. [ 0.000000] elf_hwcap is 0x112d
  130. [ 0.000000] percpu: Embedded 16 pages/cpu s25368 r8192 d31976 u65536
  131. [ 0.000000] pcpu-alloc: s25368 r8192 d31976 u65536 alloc=16*4096
  132. [ 0.000000] pcpu-alloc: [0] 0
  133. [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 257544
  134. [ 0.000000] Kernel command line: earlycon=sbi root=/dev/piton_sd1
  135. [ 0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
  136. [ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
  137. [ 0.000000] Sorting __ex_table...
  138. [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
  139. [ 0.000000] Memory: 956252K/1046528K available (4357K kernel code, 286K rwdata, 1200K rodata, 168K init, 311K bss, 90276K re)
  140. [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
  141. [ 0.000000] rcu: Hierarchical RCU implementation.
  142. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
  143. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
  144. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
  145. [ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
  146. [ 0.000000] plic: mapped 2 interrupts with 1 handlers for 2 contexts.
  147. [ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
  148. [ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1ec037a6a, max_idle_ns: 7052723236599 ns
  149. [ 0.000138] sched_clock: 64 bits at 520kHz, resolution 1919ns, wraps every 4398046510738ns
  150. [ 0.009429] printk: console [hvc0] enabled
  151. [ 0.009429] printk: console [hvc0] enabled
  152. [ 0.017850] printk: bootconsole [sbi0] disabled
  153. [ 0.017850] printk: bootconsole [sbi0] disabled
  154. [ 0.028029] Calibrating delay loop (skipped), value calculated using timer frequency.. 1.04 BogoMIPS (lpj=5208)
  155. [ 0.038753] pid_max: default: 32768 minimum: 301
  156. [ 0.050248] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
  157. [ 0.058661] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
  158. [ 0.069359] *** VALIDATE tmpfs ***
  159. [ 0.089093] *** VALIDATE proc ***
  160. [ 0.101135] *** VALIDATE cgroup ***
  161. [ 0.105019] *** VALIDATE cgroup2 ***
  162. [ 0.144310] rcu: Hierarchical SRCU implementation.
  163. [ 0.162836] smp: Bringing up secondary CPUs ...
  164. [ 0.167736] smp: Brought up 1 node, 1 CPU
  165. [ 0.185982] devtmpfs: initialized
  166. [ 0.216237] random: get_random_u32 called from bucket_table_alloc.isra.25+0x4e/0x15c with crng_init=0
  167. [ 0.236026] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
  168. [ 0.246916] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
  169. [ 0.266994] NET: Registered protocol family 16
  170. [ 0.763362] clocksource: Switched to clocksource riscv_clocksource
  171. [ 0.770122] *** VALIDATE bpf ***
  172. [ 0.782837] *** VALIDATE ramfs ***
  173. [ 0.829997] NET: Registered protocol family 2
  174. [ 0.853577] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
  175. [ 0.864085] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
  176. [ 0.875373] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
  177. [ 0.887958] TCP: Hash tables configured (established 8192 bind 8192)
  178. [ 0.902149] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
  179. [ 0.909904] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
  180. [ 0.924809] NET: Registered protocol family 1
  181. [ 0.948605] RPC: Registered named UNIX socket transport module.
  182. [ 0.956003] RPC: Registered udp transport module.
  183. [ 0.961565] RPC: Registered tcp transport module.
  184. [ 0.966432] RPC: Registered tcp NFSv4.1 backchannel transport module.
  185. [ 0.987180] Initialise system trusted keyrings
  186. [ 0.998953] workingset: timestamp_bits=46 max_order=18 bucket_order=0
  187. [ 1.323977] *** VALIDATE nfs ***
  188. [ 1.328520] *** VALIDATE nfs4 ***
  189. [ 1.334422] NFS: Registering the id_resolver key type
  190. [ 1.340148] Key type id_resolver registered
  191. [ 1.345280] Key type id_legacy registered
  192. [ 1.349820] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
  193. [ 1.357610] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
  194. [ 1.866909] Key type asymmetric registered
  195. [ 1.872460] Asymmetric key parser 'x509' registered
  196. [ 1.878750] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
  197. [ 1.887480] io scheduler mq-deadline registered
  198. [ 1.892864] io scheduler kyber registered
  199. [ 3.905595] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
  200. [ 3.954332] fff0c2c000.uart: ttyS0 at MMIO 0xfff0c2c000 (irq = 1, base_baud = 4166687) is a 16550
  201. [ 4.254794] loop: module loaded
  202. [ 4.258269] piton_sd:v1.0 Apr 26, 2019
  203. [ 4.258269]
  204. [ 4.265170] gpt partition table header:
  205. [ 4.265283] signature: 5452415020494645
  206. [ 4.269258] revision: 10000
  207. [ 4.273746] size: 5c
  208. [ 4.276659] crc_header: 26b42404
  209. [ 4.278911] reserved: 0
  210. [ 4.282730] current lba: 1
  211. [ 4.285311] backup lda: 3b723ff
  212. [ 4.288093] partition entries lba: 2
  213. [ 4.291835] number partition entries: 80
  214. [ 4.295529] size partition entries: 80
  215. [ 9.473253] piton_sd: piton_sd1
  216. [ 10.099676] libphy: Fixed MDIO Bus: probed
  217. [ 10.148782] NET: Registered protocol family 10
  218. [ 10.183418] Segment Routing with IPv6
  219. [ 10.189384] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
  220. [ 10.214449] NET: Registered protocol family 17
  221. [ 10.227413] Key type dns_resolver registered
  222. [ 10.240561] Loading compiled-in X.509 certificates
  223. [ 10.465264] EXT4-fs (piton_sd1): mounted filesystem with ordered data mode. Opts: (null)
  224. [ 10.475922] VFS: Mounted root (ext4 filesystem) readonly on device 254:1.
  225. [ 10.551865] devtmpfs: mounted
  226. [ 10.562744] Freeing unused kernel memory: 168K
  227. [ 10.567450] This architecture does not have kernel memory protection.
  228. [ 10.574688] Run /sbin/init as init process
  229. [ 10.578916] with arguments:
  230. [ 10.582489] /sbin/init
  231. [ 10.585312] with environment:
  232. [ 10.588518] HOME=/
  233. [ 10.591459] TERM=linux
  234. [ 18.154373] systemd[1]: System time before build time, advancing clock.
  235. [ 18.565415] systemd[1]: systemd 238 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIB)
  236. [ 18.596359] systemd[1]: Detected architecture riscv64.
  237. Welcome to Debian GNU/Linux buster/sid!
  238. [ 18.797150] systemd[1]: Set hostname to <openpiton>.
  239. [ 31.609244] random: systemd: uninitialized urandom read (16 bytes read)
  240. [ 31.630366] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
  241. [ OK ] Listening on /dev/initctl Compatibility Named Pipe.
  242. [ 31.674820] random: systemd: uninitialized urandom read (16 bytes read)
  243. [ 31.806800] systemd[1]: Created slice system-serial\x2dgetty.slice.
  244. [ OK ] Created slice system-serial\x2dgetty.slice.
  245. [ 31.839855] random: systemd: uninitialized urandom read (16 bytes read)
  246. [ 31.850670] systemd[1]: Reached target Slices.
  247. [ OK ] Reached target Slices.
  248. [ 32.128005] systemd[1]: Reached target Swap.
  249. [ OK ] Reached target Swap.
  250. [ 32.180337] systemd[1]: Listening on Journal Socket.
  251. [ OK ] Listening on Journal Socket.
  252. [ 32.416448] systemd[1]: Mounting Kernel Debug File System...
  253. Mounting Kernel Debug File System...
  254. [ 32.937934] systemd[1]: Starting Remount Root and Kernel File Systems...
  255. Starting Remount Root and Kernel File Systems...
  256. [ 33.117472] urandom_read: 4 callbacks suppressed
  257. [ 33.117645] random: systemd: uninitialized urandom read (16 bytes read)
  258. [ 33.214868] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
  259. [ OK ] Started Forward Password Requests to Wall Directory Watch.
  260. [ 33.366745] random: systemd: uninitialized urandom read (16 bytes read)
  261. [ 33.453262] systemd[1]: Listening on Journal Socket (/dev/log).
  262. [ OK ] Listening on Journal Socket (/dev/log).
  263. [ 33.627020] random: systemd: uninitialized urandom read (16 bytes read)
  264. [ 34.029973] systemd[1]: Starting Load Kernel Modules...
  265. Starting Load Kernel Modules...
  266. [ OK ] Created slice system-getty.slice.
  267. [ OK ] Started Dispatch Password Requests to Console Directory Watch.
  268. [ OK ] Reached target Local Encrypted Volumes.
  269. [ OK ] Reached target Paths.
  270. [ OK ] Reached target Remote File Systems.
  271. [ OK ] Listening on udev Kernel Socket.
  272. [ OK ] Listening on udev Control Socket.
  273. [ OK ] Reached target Sockets.
  274. Starting udev Coldplug all Devices...
  275. Starting Journal Service...
  276. [ 37.108761] systemd[1]: Starting Create Static Device Nodes in /dev...
  277. Starting Create Static Device Nodes in /dev...
  278. [ 37.941929] systemd[1]: Mounted Kernel Debug File System.
  279. [ OK ] Mounted Kernel Debug File System.
  280. [ 38.463855] systemd[1]: Started Remount Root and Kernel File Systems.
  281. [ OK ] Started Remount Root and Kernel File Systems.
  282. [ 39.614728] systemd[1]: Started Load Kernel Modules.
  283. [ OK ] Started Load Kernel Modules.
  284. [ 40.794332] systemd[1]: Starting Apply Kernel Variables...
  285. Starting Apply Kernel Variables...
  286. [ 41.928338] systemd[1]: Starting Load/Save Random Seed...
  287. Starting Load/Save Random Seed...
  288. [ 43.494757] systemd[1]: Started Create Static Device Nodes in /dev.
  289. [ OK ] Started Create Static Device Nodes in /dev.
  290. [ 44.795372] systemd[1]: Starting udev Kernel Device Manager...
  291. Starting udev Kernel Device Manager...
  292. [ 45.043065] systemd[1]: Reached target Local File Systems (Pre).
  293. [ OK ] Reached target Local File Systems (Pre).
  294. [ 45.224716] systemd[1]: Reached target Local File Systems.
  295. [ OK ] Reached target Local File Systems.
  296. [ 46.036491] systemd[1]: Started Apply Kernel Variables.
  297. [ OK ] Started Apply Kernel Variables.
  298. [ 46.947879] systemd[1]: Started Load/Save Random Seed.
  299. [ OK ] Started Load/Save Random Seed.
  300. [ 47.910242] systemd[1]: Starting Raise network interfaces...
  301. Starting Raise network interfaces...
  302. [ 48.119915] systemd[1]: Started Journal Service.
  303. [ OK ] Started Journal Service.
  304. Starting Flush Journal to Persistent Storage...
  305. [ OK ] Started udev Kernel Device Manager.
  306. [ 55.369915] systemd-journald[88]: Received request to flush runtime journal from PID 1
  307. [ OK ] Started Flush Journal to Persistent Storage.
  308. Starting Create Volatile Files and Directories...
  309. [ OK ] Started Raise network interfaces.
  310. [ OK ] Reached target Network.
  311. [FAILED] Failed to start Create Volatile Files and Directories.
  312. See 'systemctl status systemd-tmpfiles-setup.service' for details.
  313. Starting Update UTMP about System Boot/Shutdown...
  314. [FAILED] Failed to start Network Time Synchronization.
  315. See 'systemctl status systemd-timesyncd.service' for details.
  316. [ OK ] Reached target System Time Synchronized.
  317. [ OK ] Stopped Network Time Synchronization.
  318. [ OK ] Started udev Coldplug all Devices.
  319. [ OK ] Found device /dev/hvc0.
  320. [ OK ] Reached target System Initialization.
  321. [ OK ] Reached target Basic System.
  322. [ OK ] Started Regular background program processing daemon.
  323. [ OK ] Started Daily Cleanup of Temporary Directories.
  324. Starting Permit User Sessions...
  325. [ OK ] Started Daily apt download activities.
  326. [ OK ] Started Daily apt upgrade and clean activities.
  327. [ OK ] Reached target Timers.
  328. [ OK ] Started Permit User Sessions.
  329. [ OK ] Started Serial Getty on hvc0.
  330. [ OK ] Reached target Login Prompts.
  331. [ OK ] Reached target Multi-User System.
  332. [ OK ] Reached target Graphical Interface.
  333. Debian GNU/Linux buster/sid openpiton hvc0
  334. openpiton login: