Tobias Wölfel | 03d1cf3 | 2020-02-26 12:47:07 +0100 | [diff] [blame] | 1 | --- |
| 2 | title: "OpenTitan Software" |
| 3 | --- |
| 4 | |
| 5 | This is the landing spot for software documentation within the OpenTitan project. |
Tobias Wölfel | 03d1cf3 | 2020-02-26 12:47:07 +0100 | [diff] [blame] | 6 | More description and information can be found within the [Reference Manual]({{< relref "doc/rm" >}}) and [User Guide]({{< relref "doc/ug" >}}) areas. |
| 7 | |
Sam Elliott | ed5086c | 2020-11-24 19:12:09 +0000 | [diff] [blame] | 8 | There are three major parts to the OpenTitan software stack: |
Sam Elliott | b6745d3 | 2020-04-08 21:46:28 +0100 | [diff] [blame] | 9 | |
Sam Elliott | ed5086c | 2020-11-24 19:12:09 +0000 | [diff] [blame] | 10 | * 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 Elliott | b6745d3 | 2020-04-08 21:46:28 +0100 | [diff] [blame] | 13 | |
Sam Elliott | ed5086c | 2020-11-24 19:12:09 +0000 | [diff] [blame] | 14 | We use the term "image" to denote a complete, standalone executable which has been prepared for the OpenTitan platform chip. |
| 15 | This 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 | |
| 19 | This software runs on the primary core within the OpenTitian platform chip itself. |
| 20 | You can find all the device software in the `sw/device` directory of the repository. |
| 21 | |
| 22 | The 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 | |
| 27 | Device software must be written in C, Assembly, or Rust. |
| 28 | |
Sam Elliott | ed5086c | 2020-11-24 19:12:09 +0000 | [diff] [blame] | 29 | # OTBN Software |
| 30 | |
| 31 | This software runs on the OTBN cryptographic co-processor within the OpenTitan platform chip. |
| 32 | You can find all the OTBN software in the `sw/otbn` directory of the repository. |
| 33 | |
| 34 | This software consists of a number of hand-written assembly routines which can be run on the OTBN co-processor. |
| 35 | |
| 36 | Normally, 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 | |
| 38 | OTBN Software must only be written in Assembly. |
| 39 | |
| 40 | # Host Software |
| 41 | |
| 42 | This software is for host-side use, either in preparing images or interacting with a running OpenTitan platform chip. |
| 43 | You can find all the device software in the `sw/host` directory of the repository. |
| 44 | |
| 45 | Host software must be written in C++ or Rust. |
| 46 | |
| 47 | ## Testing-only Utilities |
| 48 | |
| 49 | There 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 Elliott | b6745d3 | 2020-04-08 21:46:28 +0100 | [diff] [blame] | 55 | |
| 56 | The [OpenTitan Software API Documentation](/sw/apis/) contains automatically generated documentation for the public software APIs. |
| 57 | This includes the Device Interface Functions (DIFs). |
| 58 | |
| 59 | All DIFs are also documented on their respective [Hardware IP Specification]({{< relref "hw" >}}) |
| 60 | |
Sam Elliott | ed5086c | 2020-11-24 19:12:09 +0000 | [diff] [blame] | 61 | ## Vendored in Code see [Vendor Tool User Guide]({{< relref "doc/ug/vendor_hw.md" >}}) |
Tobias Wölfel | a47a415 | 2020-06-02 20:35:28 +0200 | [diff] [blame] | 62 | |
| 63 | * [CoreMark](https://github.com/eembc/coremark) |
| 64 | * [RISC-V Compliance](https://github.com/riscv/riscv-compliance) |
Sam Elliott | ed5086c | 2020-11-24 19:12:09 +0000 | [diff] [blame] | 65 | * [GoogleTest](https://github.com/google/googletest) |
Tobias Wölfel | a47a415 | 2020-06-02 20:35:28 +0200 | [diff] [blame] | 66 | * [Cryptoc](https://chromium.googlesource.com/chromiumos/third_party/cryptoc/) |
Sam Elliott | ed5086c | 2020-11-24 19:12:09 +0000 | [diff] [blame] | 67 | * [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) |