blob: 4123f28717e8e339625d6f82a456a98a7619a902 [file] [log] [blame] [view]
Tobias Wölfel03d1cf32020-02-26 12:47:07 +01001---
2title: "OpenTitan Software"
3---
4
5This is the landing spot for software documentation within the OpenTitan project.
Tobias Wölfel03d1cf32020-02-26 12:47:07 +01006More description and information can be found within the [Reference Manual]({{< relref "doc/rm" >}}) and [User Guide]({{< relref "doc/ug" >}}) areas.
7
Sam Elliotted5086c2020-11-24 19:12:09 +00008There are three major parts to the OpenTitan software stack:
Sam Elliottb6745d32020-04-08 21:46:28 +01009
Sam Elliotted5086c2020-11-24 19:12:09 +000010* The _device_ software, which runs on the primary core within the OpenTitan platform chip.
11* The _otbn_ software, which runs on the OTBN cryptographic co-processor within the OpenTitan platform chip.
12* The _host_ software, which is run on a host device and interacts with an OpenTitan device.
Sam Elliottb6745d32020-04-08 21:46:28 +010013
Sam Elliotted5086c2020-11-24 19:12:09 +000014We use the term "image" to denote a complete, standalone executable which has been prepared for the OpenTitan platform chip.
15This is to differentiate from a "library", which is a collection of functions that are not complete enough to run on their own.
16
17# Device Software
18
19This software runs on the primary core within the OpenTitian platform chip itself.
20You can find all the device software in the `sw/device` directory of the repository.
21
22The device software is split into two parts:
23* The reference firmware images, which is the project's reference implementation of the Secure Boot system.
24 Not all OpenTitan chips will use exactly the same firmware images.
25* The firmware libraries, which can be used by any software built for the device.
26
27Device software must be written in C, Assembly, or Rust.
28
Sam Elliotted5086c2020-11-24 19:12:09 +000029# OTBN Software
30
31This software runs on the OTBN cryptographic co-processor within the OpenTitan platform chip.
32You can find all the OTBN software in the `sw/otbn` directory of the repository.
33
34This software consists of a number of hand-written assembly routines which can be run on the OTBN co-processor.
35
36Normally, this software can not be run on its own, and the main processor has to set up the data and instructions for the OTBN co-processor before it triggers the start of execution.
37
38OTBN Software must only be written in Assembly.
39
40# Host Software
41
42This software is for host-side use, either in preparing images or interacting with a running OpenTitan platform chip.
43You can find all the device software in the `sw/host` directory of the repository.
44
45Host software must be written in C++ or Rust.
46
47## Testing-only Utilities
48
49There are some host-side utilities, which are only used for testing.
50* `sw/host/spiflash` is a tool that can flash a testing image over SPI onto a chip that uses `sw/device/boot_rom` for its reset boot stage.
51
52# Other Documentation
53
54## OpenTitan Software API Documentation {#sw-api-docs}
Sam Elliottb6745d32020-04-08 21:46:28 +010055
56The [OpenTitan Software API Documentation](/sw/apis/) contains automatically generated documentation for the public software APIs.
57This includes the Device Interface Functions (DIFs).
58
59All DIFs are also documented on their respective [Hardware IP Specification]({{< relref "hw" >}})
60
Sam Elliotted5086c2020-11-24 19:12:09 +000061## Vendored in Code see [Vendor Tool User Guide]({{< relref "doc/ug/vendor_hw.md" >}})
Tobias Wölfela47a4152020-06-02 20:35:28 +020062
63* [CoreMark](https://github.com/eembc/coremark)
64* [RISC-V Compliance](https://github.com/riscv/riscv-compliance)
Sam Elliotted5086c2020-11-24 19:12:09 +000065* [GoogleTest](https://github.com/google/googletest)
Tobias Wölfela47a4152020-06-02 20:35:28 +020066* [Cryptoc](https://chromium.googlesource.com/chromiumos/third_party/cryptoc/)
Sam Elliotted5086c2020-11-24 19:12:09 +000067* [MPSSE from Chromium](https://chromium.googlesource.com/chromiumos/platform2/+/master/trunks/ftdi)
68* [LLVM's Compiler-RT Coverage Profiling Library](https://github.com/llvm/llvm-project/tree/master/compiler-rt)