Skip to content

Commit 966312e

Browse files
[otp,doc] add prodc OTP image with SPX+ enabled
This adds a personalized prodc OTP image with SPX+ sigverify enabled for the purposes of splicing the latest cached bitstreams with this OTP image for validating owner firmware payloads. Additionally this adds instructions to the website to explain how to use the `universal_splice` Bazel target to splice custom bitstreams. Signed-off-by: Tim Trippel <[email protected]>
1 parent a39b4c7 commit 966312e

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

doc/getting_started/setup_fpga.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export BOARD=cw340
2626
```
2727
### Download a Pre-built Bitstream
2828

29-
If you are using the ChipWhisperer CW340 board with the Xilinx XCKU095-1FFVA1156C Kintex UltraScale or the CW310 board with the Xilinx Kintex 7 XC7K410T FPGA, you can download the latest passing [pre-built bitstream](https://storage.googleapis.com/opentitan-bitstreams/master/bitstream-latest.tar.gz).
29+
If you are using the ChipWhisperer CW340 board with the Xilinx XCKU095-1FFVA1156C Kintex UltraScale or the CW310 board with the Xilinx Kintex 7 XC7K410T FPGA, you can download the latest passing [pre-built bitstream](https://storage.googleapis.com/opentitan-bitstreams/master/bitstream-latest.tar.gz) from our public bistream cache GCS bucket.
3030

3131
For example, to download and unpack the bitstream, run the following:
3232

@@ -56,6 +56,30 @@ cp util/git/hooks/post-checkout .git/hooks/
5656

5757
### Build an FPGA bitstream
5858

59+
60+
#### Splicing a different ROM or OTP into a Cached Bitstream
61+
62+
As mentioned above, the default bitstreams cached in our public GCS bucket are built with a test version of the boot ROM and a minimally configured OTP image.
63+
If you desire a bitstream with _only_ a different combination of ROM / OTP images (say if you want to build and splice in the production mask ROM), you can do so without rebuilding the entire bitstream from scratch.
64+
Specifically, you can build the [`//hw/bitstream/universal:splice`](https://github.com/lowRISC/opentitan/blob/e439226b6c5314be12ccf5cc055f2d4b8149d0ab/hw/bitstream/universal/BUILD#L30) Bazel target and specify any combination of:
65+
1. ROM image (using the `--//hw/bitstream/universal:rom=<ROM image Bazel target>` label flag),
66+
1. OTP image (using the `--//hw/bitstream/universal:otp=<OTP image Bazel target>` label flag), and/or
67+
1. `exec_env` (using the `--//hw/bitstream/universal:env=<exec_env Bazel target>` label flag; `exec_env`s define a collection of ROM, OTP, and base bitstream targets to use).
68+
69+
For example, to splice a CW310 bitstream with the mask ROM image and a specific OTP image, you can run
70+
```sh
71+
bazel build \
72+
--//hw/bitstream/universal:otp=//hw/ip/otp_ctrl/data:img_dev \
73+
--//hw/bitstream/universal:env=//hw/top_earlgrey:fpga_cw310_rom_with_fake_keys \
74+
//hw/bitstream/universal:splice
75+
```
76+
77+
>**Note**: Splicing bitstreams will require the (free) Lab Edition of Vivado to be installed on your system, described [here](./install_vivado/README.md).
78+
>General software development on the FPGA requires this as well, since bitstreams will be spliced locally by Bazel during test builds.
79+
80+
#### From Scratch
81+
82+
If you would like to synthesize a bitstream from scratch (e.g., to test a new RTL change), you can synthesize one locally.
5983
Synthesizing a design for an FPGA board is simple with Bazel.
6084
While Bazel is the entry point for kicking off the FPGA synthesis, under the hood, it invokes FuseSoC, the hardware package manager / build system supported by OpenTitan.
6185
During the build process, the boot ROM is baked into the bitstream.
@@ -73,8 +97,7 @@ cd $REPO_TOP
7397
./bazelisk.sh build //hw/bitstream/vivado:fpga_${BOARD}_rom_with_fake_keys
7498
```
7599

76-
>**Note**: Building these bitstreams will require Vivado be installed on your system, with access to the proper licenses, described [here](./install_vivado/README.md).
77-
>For general software development on the FPGA, Vivado must still be installed, but the Lab Edition is sufficient.
100+
>**Note**: Building these bitstreams will require Vivado to be installed on your system, with access to the proper (paid) licenses, described [here](./install_vivado/README.md).
78101
79102
#### Dealing with FPGA Congestion Issues
80103

hw/ip/otp_ctrl/data/earlgrey_skus/prodc/BUILD

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ load(
1818
"//rules:otp.bzl",
1919
"otp_alert_classification",
2020
"otp_alert_digest",
21-
"otp_bytestring",
2221
"otp_hex",
2322
"otp_image",
2423
"otp_image_consts",
@@ -405,3 +404,13 @@ otp_image(
405404
src = "//hw/ip/otp_ctrl/data:otp_json_rma",
406405
overlays = MANUF_PERSONALIZED,
407406
)
407+
408+
# `MANUF_PERSONALIZED` configuration for RMA with SPHINCS+ signature verification
409+
# enabled for secure boot. Only available in secure environments.
410+
otp_image(
411+
name = "otp_img_rma_manuf_personalized_spx_enabled",
412+
src = "//hw/ip/otp_ctrl/data:otp_json_rma",
413+
overlays = MANUF_PERSONALIZED + [
414+
"//sw/device/silicon_creator/rom/e2e/sigverify_spx:otp_json_sigverify_spx_enabled_true",
415+
],
416+
)

0 commit comments

Comments
 (0)