这是indexloc提供的服务,不要输入任何密码
Skip to content

[rom] add immutable ROM_EXT section feature #23840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 29, 2024

Conversation

timothytrippel
Copy link
Contributor

This addresses #23425 by adding a feature to enable a non-mutable flash section (locked at manufacturing time via OTP fuses) to be executed in the ROM.

@timothytrippel timothytrippel requested review from cfrantz and a team as code owners June 28, 2024 00:16
@timothytrippel timothytrippel requested review from jadephilipoom, moidx and cfrantz and removed request for a team, cfrantz and jadephilipoom June 28, 2024 00:16
This adds four fields to support a immutable ROM_EXT section:
1. an enable field,
2. a starting relative offset field,
3. a length field, and
4. a SHA256 hash field.

This partially addresses lowRISC#23425.

Signed-off-by: Tim Trippel <ttrippel@google.com>
This inserts an immutable code partition into the ROM_EXT. The ROM can
optionally choose to enforce the immutability property of this region
and execute it before handing over execution to the ROM_EXT all based on
OTP configurations. This partially addresses lowRISC#23425.

Signed-off-by: Tim Trippel <ttrippel@google.com>

fix rom_ext build

Signed-off-by: Tim Trippel <ttrippel@google.com>
This adds tooling to generate the OTP data needed to embed a
non-mutable section in the ROM_EXT to be executed by the ROM.

Signed-off-by: Tim Trippel <ttrippel@google.com>
This adds E2E tests to exercise the new ROM_EXT immutable section
feature of the ROM. This partially addresses lowRISC#23425.

Signed-off-by: Tim Trippel <ttrippel@google.com>
This enhances the immutable ROM_EXT section tests by adding checks for:
1. invalid start offsets, and
2. invalid lengths.

Additionally, we now check a magic value set in retention SRAM to ensure
the non-mutable section executed during ROM execution.

Signed-off-by: Tim Trippel <ttrippel@google.com>
@timothytrippel
Copy link
Contributor Author

timothytrippel commented Jun 28, 2024

adding @vogelpi and @andreaskurth to review the OTP Creator,OwnerSwCfg partitions size changes.

@timothytrippel
Copy link
Contributor Author

The last commit of this PR adjusts the Creator,OwnerSwCfg partitions to add fixed "Reserved" fields of 32 and 128 bytes respectively. Note, both Creator and Owner configuration partitions are still set to "absorb" all remaining OTP bits equally, see here and here.

CC: @moidx

@moidx
Copy link
Contributor

moidx commented Jun 28, 2024

CHANGE AUTHORIZED: hw/ip/otp_ctrl/data/otp_ctrl.hjson
CHANGE AUTHORIZED: hw/ip/otp_ctrl/data/otp_ctrl_mmap.hjson
CHANGE AUTHORIZED: hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
CHANGE AUTHORIZED: hw/ip/otp_ctrl/rtl/otp_ctrl_reg_pkg.sv

This adds fixed reserved fields to both:
1. CreatorSwCfg (32-byte reserved field)
2. OwnerSwCfg (128-byte reserved field)

Signed-off-by: Tim Trippel <ttrippel@google.com>
@timothytrippel
Copy link
Contributor Author

CHANGE AUTHORIZED: hw/ip/otp_ctrl/data/otp_ctrl.hjson
CHANGE AUTHORIZED: hw/ip/otp_ctrl/data/otp_ctrl_mmap.hjson
CHANGE AUTHORIZED: hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
CHANGE AUTHORIZED: hw/ip/otp_ctrl/rtl/otp_ctrl_reg_pkg.sv

@timothytrippel timothytrippel merged commit b33f0bc into lowRISC:master Jun 29, 2024
32 checks passed
@timothytrippel timothytrippel deleted the add-rom-patching branch June 29, 2024 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants