xref: /openbmc/qemu/docs/system/riscv/shakti-c.rst (revision 0924a423)
1*0924a423SVijai Kumar KShakti C Reference Platform (``shakti_c``)
2*0924a423SVijai Kumar K==========================================
3*0924a423SVijai Kumar K
4*0924a423SVijai Kumar KShakti C Reference Platform is a reference platform based on arty a7 100t
5*0924a423SVijai Kumar Kfor the Shakti SoC.
6*0924a423SVijai Kumar K
7*0924a423SVijai Kumar KShakti SoC is a SoC based on the Shakti C-class processor core. Shakti C
8*0924a423SVijai Kumar Kis a 64bit RV64GCSUN processor core.
9*0924a423SVijai Kumar K
10*0924a423SVijai Kumar KFor more details on Shakti SoC, please see:
11*0924a423SVijai Kumar Khttps://gitlab.com/shaktiproject/cores/shakti-soc/-/blob/master/fpga/boards/artya7-100t/c-class/README.rst
12*0924a423SVijai Kumar K
13*0924a423SVijai Kumar KFor more info on the Shakti C-class core, please see:
14*0924a423SVijai Kumar Khttps://c-class.readthedocs.io/en/latest/
15*0924a423SVijai Kumar K
16*0924a423SVijai Kumar KSupported devices
17*0924a423SVijai Kumar K-----------------
18*0924a423SVijai Kumar K
19*0924a423SVijai Kumar KThe ``shakti_c`` machine supports the following devices:
20*0924a423SVijai Kumar K
21*0924a423SVijai Kumar K * 1 C-class core
22*0924a423SVijai Kumar K * Core Level Interruptor (CLINT)
23*0924a423SVijai Kumar K * Platform-Level Interrupt Controller (PLIC)
24*0924a423SVijai Kumar K * 1 UART
25*0924a423SVijai Kumar K
26*0924a423SVijai Kumar KBoot options
27*0924a423SVijai Kumar K------------
28*0924a423SVijai Kumar K
29*0924a423SVijai Kumar KThe ``shakti_c`` machine can start using the standard -bios
30*0924a423SVijai Kumar Kfunctionality for loading the baremetal application or opensbi.
31*0924a423SVijai Kumar K
32*0924a423SVijai Kumar KBoot the machine
33*0924a423SVijai Kumar K----------------
34*0924a423SVijai Kumar K
35*0924a423SVijai Kumar KShakti SDK
36*0924a423SVijai Kumar K~~~~~~~~~~
37*0924a423SVijai Kumar KShakti SDK can be used to generate the baremetal example UART applications.
38*0924a423SVijai Kumar K
39*0924a423SVijai Kumar K.. code-block:: bash
40*0924a423SVijai Kumar K
41*0924a423SVijai Kumar K   $ git clone https://gitlab.com/behindbytes/shakti-sdk.git
42*0924a423SVijai Kumar K   $ cd shakti-sdk
43*0924a423SVijai Kumar K   $ make software PROGRAM=loopback TARGET=artix7_100t
44*0924a423SVijai Kumar K
45*0924a423SVijai Kumar KBinary would be generated in:
46*0924a423SVijai Kumar K  software/examples/uart_applns/loopback/output/loopback.shakti
47*0924a423SVijai Kumar K
48*0924a423SVijai Kumar KYou could also download the precompiled example applicatons using below
49*0924a423SVijai Kumar Kcommands.
50*0924a423SVijai Kumar K
51*0924a423SVijai Kumar K.. code-block:: bash
52*0924a423SVijai Kumar K
53*0924a423SVijai Kumar K   $ wget -c https://gitlab.com/behindbytes/shakti-binaries/-/raw/master/sdk/shakti_sdk_qemu.zip
54*0924a423SVijai Kumar K   $ unzip shakti_sdk_qemu.zip
55*0924a423SVijai Kumar K
56*0924a423SVijai Kumar KThen we can run the UART example using:
57*0924a423SVijai Kumar K
58*0924a423SVijai Kumar K.. code-block:: bash
59*0924a423SVijai Kumar K
60*0924a423SVijai Kumar K   $ qemu-system-riscv64 -M shakti_c -nographic \
61*0924a423SVijai Kumar K      -bios path/to/shakti_sdk_qemu/loopback.shakti
62*0924a423SVijai Kumar K
63*0924a423SVijai Kumar KOpenSBI
64*0924a423SVijai Kumar K~~~~~~~
65*0924a423SVijai Kumar KWe can also run OpenSBI with Test Payload.
66*0924a423SVijai Kumar K
67*0924a423SVijai Kumar K.. code-block:: bash
68*0924a423SVijai Kumar K
69*0924a423SVijai Kumar K   $ git clone https://github.com/riscv/opensbi.git -b v0.9
70*0924a423SVijai Kumar K   $ cd opensbi
71*0924a423SVijai Kumar K   $ wget -c https://gitlab.com/behindbytes/shakti-binaries/-/raw/master/dts/shakti.dtb
72*0924a423SVijai Kumar K   $ export CROSS_COMPILE=riscv64-unknown-elf-
73*0924a423SVijai Kumar K   $ export FW_FDT_PATH=./shakti.dtb
74*0924a423SVijai Kumar K   $ make PLATFORM=generic
75*0924a423SVijai Kumar K
76*0924a423SVijai Kumar Kfw_payload.elf would be generated in build/platform/generic/firmware/fw_payload.elf.
77*0924a423SVijai Kumar KBoot it using the below qemu command.
78*0924a423SVijai Kumar K
79*0924a423SVijai Kumar K.. code-block:: bash
80*0924a423SVijai Kumar K
81*0924a423SVijai Kumar K   $ qemu-system-riscv64 -M shakti_c -nographic \
82*0924a423SVijai Kumar K      -bios path/to/fw_payload.elf
83