Skip to content
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

[otp_ctrl] Remove entropy_src chicken switches #21118

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions hw/dv/sv/mem_bkdr_util/mem_bkdr_util__otp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ endfunction

virtual function void otp_write_hw_cfg0_partition(
bit [DeviceIdSize*8-1:0] device_id, bit [ManufStateSize*8-1:0] manuf_state,
bit [EnSramIfetchSize*8-1:0] en_sram_ifetch,
bit [EnCsrngSwAppReadSize*8-1:0] en_csrng_sw_app_read,
bit [EnEntropySrcFwReadSize*8-1:0] en_entropy_src_fw_read,
bit [EnEntropySrcFwOverSize*8-1:0] en_entropy_src_fw_over);
bit [EnSramIfetchSize*8-1:0] en_sram_ifetch);
bit [HwCfg0DigestSize*8-1:0] digest;

bit [bus_params_pkg::BUS_DW-1:0] hw_cfg0_data[$];
Expand All @@ -139,11 +137,9 @@ virtual function void otp_write_hw_cfg0_partition(
for (int i = 0; i < ManufStateSize; i += 4) begin
write32(i + ManufStateOffset, manuf_state[i*8+:32]);
end
write32(EnSramIfetchOffset,
{en_entropy_src_fw_over, en_entropy_src_fw_read, en_csrng_sw_app_read, en_sram_ifetch});
write32(EnSramIfetchOffset, {en_csrng_sw_app_read, en_sram_ifetch});

hw_cfg0_data = {<<32 {32'h0, en_entropy_src_fw_over, en_entropy_src_fw_read,
en_csrng_sw_app_read, en_sram_ifetch, manuf_state, device_id}};
hw_cfg0_data = {<<32 {32'h0, en_csrng_sw_app_read, en_sram_ifetch, manuf_state, device_id}};
digest = cal_digest(HwCfg0Idx, hw_cfg0_data);

write64(HwCfg0DigestOffset, digest);
Expand Down
1 change: 1 addition & 0 deletions hw/ip/csrng/data/csrng.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
name: "otp_en_csrng_sw_app_read"
act: "rcv"
package: "prim_mubi_pkg"
default: "prim_mubi_pkg::MuBi8True"
}
{ struct: "lc_tx"
type: "uni"
Expand Down
2 changes: 2 additions & 0 deletions hw/ip/entropy_src/data/entropy_src.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@
name: "otp_en_entropy_src_fw_read"
act: "rcv"
package: "prim_mubi_pkg"
default: "prim_mubi_pkg::MuBi8True"
}
{ struct: "mubi8"
type: "uni"
name: "otp_en_entropy_src_fw_over"
act: "rcv"
package: "prim_mubi_pkg"
default: "prim_mubi_pkg::MuBi8True"
}
{ struct: "logic"
type: "uni"
Expand Down
6 changes: 0 additions & 6 deletions hw/ip/otp_ctrl/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@ otp_json(
# Cryptolib and chip-level tests require access to the CSRNG
# software interfaces.
"EN_CSRNG_SW_APP_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW data interface.
"EN_ENTROPY_SRC_FW_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW override interface.
"EN_ENTROPY_SRC_FW_OVER": True,
},
lock = True,
),
Expand Down
6 changes: 0 additions & 6 deletions hw/ip/otp_ctrl/data/earlgrey_a0_skus/prodc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ otp_json(
# Cryptolib and chip-level tests require access to the CSRNG
# software interfaces.
"EN_CSRNG_SW_APP_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW data interface.
"EN_ENTROPY_SRC_FW_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW override interface.
"EN_ENTROPY_SRC_FW_OVER": True,
},
lock = True,
),
Expand Down
6 changes: 0 additions & 6 deletions hw/ip/otp_ctrl/data/earlgrey_a0_skus/sival/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ otp_json(
# Cryptolib and chip-level tests require access to the CSRNG
# software interfaces.
"EN_CSRNG_SW_APP_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW data interface.
"EN_ENTROPY_SRC_FW_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW override interface.
"EN_ENTROPY_SRC_FW_OVER": True,
},
lock = True,
),
Expand Down
6 changes: 0 additions & 6 deletions hw/ip/otp_ctrl/data/earlgrey_a0_skus/sival_bringup/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ otp_json(
# Cryptolib and chip-level tests require access to the CSRNG
# software interfaces.
"EN_CSRNG_SW_APP_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW data interface.
"EN_ENTROPY_SRC_FW_READ": True,
# Cryptolib and chip-level tests require access to the
# entropy_src FW override interface.
"EN_ENTROPY_SRC_FW_OVER": True,
},
lock = True,
),
Expand Down
26 changes: 0 additions & 26 deletions hw/ip/otp_ctrl/data/otp_ctrl.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -943,30 +943,6 @@
default: "1",
local: "true"
},
{ name: "EnEntropySrcFwReadOffset",
desc: "Offset of EN_ENTROPY_SRC_FW_READ",
type: "int",
default: "1730",
local: "true"
},
{ name: "EnEntropySrcFwReadSize",
desc: "Size of EN_ENTROPY_SRC_FW_READ",
type: "int",
default: "1",
local: "true"
},
{ name: "EnEntropySrcFwOverOffset",
desc: "Offset of EN_ENTROPY_SRC_FW_OVER",
type: "int",
default: "1731",
local: "true"
},
{ name: "EnEntropySrcFwOverSize",
desc: "Size of EN_ENTROPY_SRC_FW_OVER",
type: "int",
default: "1",
local: "true"
},
{ name: "HwCfg0DigestOffset",
desc: "Offset of HW_CFG0_DIGEST",
type: "int",
Expand Down Expand Up @@ -1562,8 +1538,6 @@
name: "OTP_CTRL.ENTROPY_READ"
desc: '''Firmware can read entropy from ENTROPY_SRC block by configuring following field of HW_CFG* partition.
- EN_CSRNG_SW_APP_READ
- EN_ENTROPY_SRC_FW_READ
- EN_ENTROPY_SRC_FW_OVER
'''
}
{
Expand Down
2 changes: 0 additions & 2 deletions hw/ip/otp_ctrl/data/otp_ctrl.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,6 @@ otp_size_as_uint32 = otp_size_as_bytes // 4
name: "OTP_CTRL.ENTROPY_READ"
desc: '''Firmware can read entropy from ENTROPY_SRC block by configuring following field of HW_CFG* partition.
- EN_CSRNG_SW_APP_READ
- EN_ENTROPY_SRC_FW_READ
- EN_ENTROPY_SRC_FW_OVER
'''
}
{
Expand Down
12 changes: 0 additions & 12 deletions hw/ip/otp_ctrl/data/otp_ctrl_img_hw_cfg0.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@
name: "EN_CSRNG_SW_APP_READ",
value: true,
},
{
// Cryptolib and chip-level tests require access to the
// entropy_src FW data interface.
name: "EN_ENTROPY_SRC_FW_READ",
value: true,
},
{
// Cryptolib and chip-level tests require access to the
// entropy_src FW override interface.
name: "EN_ENTROPY_SRC_FW_OVER",
value: true,
}
],
}
]
Expand Down
16 changes: 0 additions & 16 deletions hw/ip/otp_ctrl/data/otp_ctrl_mmap.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -381,18 +381,6 @@
ismubi: true,
inv_default: false
},
{
name: "EN_ENTROPY_SRC_FW_READ",
size: "1",
ismubi: true,
inv_default: false
},
{
name: "EN_ENTROPY_SRC_FW_OVER",
size: "1",
ismubi: true,
inv_default: false
},
],
desc: '''Hardware configuration 0 partition.
This contains
Expand All @@ -401,10 +389,6 @@
- EN_SRAM_IFETCH: Enable / disable execute from SRAM CSR switch.
- EN_CSRNG_SW_APP_READ: This input efuse is used to enable access
to the NIST internal state per instance.
- EN_ENTROPY_SRC_FW_READ: This input efuse is used to enable access
to the ENTROPY_DATA register directly.
- EN_ENTROPY_SRC_FW_OVER: This input efuse is used to enable access
to the firmware override FIFO and other related functions.
'''
}
{
Expand Down
2 changes: 0 additions & 2 deletions hw/ip/otp_ctrl/doc/otp_ctrl_mmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ It has been generated with ./util/design/gen-otp-mmap.py
| | | | 32bit | MANUF_STATE | 0x6A0 | 32 |
| | | | 32bit | EN_SRAM_IFETCH | 0x6C0 | 1 |
| | | | 32bit | EN_CSRNG_SW_APP_READ | 0x6C1 | 1 |
| | | | 32bit | EN_ENTROPY_SRC_FW_READ | 0x6C2 | 1 |
| | | | 32bit | EN_ENTROPY_SRC_FW_OVER | 0x6C3 | 1 |
| | | | 64bit | [HW_CFG0_DIGEST](#Reg_hw_cfg0_digest_0) | 0x6C8 | 8 |
| 4 | SECRET0 | 40 | 64bit | TEST_UNLOCK_TOKEN | 0x6D0 | 16 |
| | | | 64bit | TEST_EXIT_TOKEN | 0x6E0 | 16 |
Expand Down
4 changes: 0 additions & 4 deletions hw/ip/otp_ctrl/doc/otp_ctrl_partitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ It has been generated with ./util/design/gen-otp-mmap.py
| | | | | | | - EN_SRAM_IFETCH: Enable / disable execute from SRAM CSR switch. |
| | | | | | | - EN_CSRNG_SW_APP_READ: This input efuse is used to enable access |
| | | | | | | to the NIST internal state per instance. |
| | | | | | | - EN_ENTROPY_SRC_FW_READ: This input efuse is used to enable access |
| | | | | | | to the ENTROPY_DATA register directly. |
| | | | | | | - EN_ENTROPY_SRC_FW_OVER: This input efuse is used to enable access |
| | | | | | | to the firmware override FIFO and other related functions. |
| SECRET0 | yes | yes | yes | yes (Digest) | yes (Digest) | Secret partition 0. |
| | | | | | | This contains TEST lifecycle unlock tokens. |
| SECRET1 | yes | yes | yes | yes (Digest) | yes (Digest) | Secret partition 1. |
Expand Down
12 changes: 3 additions & 9 deletions hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ package otp_ctrl_part_pkg;
// Breakout types for easier access of individual items.
typedef struct packed {
logic [63:0] hw_cfg0_digest;
logic [31:0] unallocated;
prim_mubi_pkg::mubi8_t en_entropy_src_fw_over;
prim_mubi_pkg::mubi8_t en_entropy_src_fw_read;
logic [47:0] unallocated;
prim_mubi_pkg::mubi8_t en_csrng_sw_app_read;
prim_mubi_pkg::mubi8_t en_sram_ifetch;
logic [255:0] manuf_state;
Expand All @@ -268,9 +266,7 @@ package otp_ctrl_part_pkg;
// default value used for intermodule
parameter otp_hw_cfg0_data_t OTP_HW_CFG0_DATA_DEFAULT = '{
hw_cfg0_digest: 64'h15F164D7930C9D19,
unallocated: 32'h0,
en_entropy_src_fw_over: prim_mubi_pkg::mubi8_t'(8'h69),
en_entropy_src_fw_read: prim_mubi_pkg::mubi8_t'(8'h69),
unallocated: 48'h0,
en_csrng_sw_app_read: prim_mubi_pkg::mubi8_t'(8'h69),
en_sram_ifetch: prim_mubi_pkg::mubi8_t'(8'h69),
manuf_state: 256'hDF3888886BD10DC67ABB319BDA0529AE40119A3C6E63CDF358840E458E4029A6,
Expand Down Expand Up @@ -314,9 +310,7 @@ package otp_ctrl_part_pkg;
}),
640'({
64'h15F164D7930C9D19,
32'h0, // unallocated space
8'h69,
8'h69,
48'h0, // unallocated space
8'h69,
8'h69,
256'hDF3888886BD10DC67ABB319BDA0529AE40119A3C6E63CDF358840E458E4029A6,
Expand Down
4 changes: 0 additions & 4 deletions hw/ip/otp_ctrl/rtl/otp_ctrl_reg_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ package otp_ctrl_reg_pkg;
parameter int EnSramIfetchSize = 1;
parameter int EnCsrngSwAppReadOffset = 1729;
parameter int EnCsrngSwAppReadSize = 1;
parameter int EnEntropySrcFwReadOffset = 1730;
parameter int EnEntropySrcFwReadSize = 1;
parameter int EnEntropySrcFwOverOffset = 1731;
parameter int EnEntropySrcFwOverSize = 1;
parameter int HwCfg0DigestOffset = 1736;
parameter int HwCfg0DigestSize = 8;
parameter int Secret0Offset = 1744;
Expand Down
38 changes: 7 additions & 31 deletions hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -6651,8 +6651,8 @@
type: uni
act: rcv
width: 1
default: prim_mubi_pkg::MuBi8True
inst_name: csrng
default: ""
top_signame: csrng_otp_en_csrng_sw_app_read
index: -1
}
Expand Down Expand Up @@ -6800,9 +6800,8 @@
type: uni
act: rcv
width: 1
default: prim_mubi_pkg::MuBi8True
inst_name: entropy_src
default: ""
top_signame: entropy_src_otp_en_entropy_src_fw_read
index: -1
}
{
Expand All @@ -6812,9 +6811,8 @@
type: uni
act: rcv
width: 1
default: prim_mubi_pkg::MuBi8True
inst_name: entropy_src
default: ""
top_signame: entropy_src_otp_en_entropy_src_fw_over
index: -1
}
{
Expand Down Expand Up @@ -8650,8 +8648,6 @@
pinmux_aon.dft_jtag
otp_ctrl.otp_broadcast
csrng.otp_en_csrng_sw_app_read
entropy_src.otp_en_entropy_src_fw_read
entropy_src.otp_en_entropy_src_fw_over
lc_ctrl.otp_device_id
lc_ctrl.otp_manuf_state
keymgr.otp_device_id
Expand Down Expand Up @@ -18975,8 +18971,8 @@
type: uni
act: rcv
width: 1
default: prim_mubi_pkg::MuBi8True
inst_name: csrng
default: ""
top_signame: csrng_otp_en_csrng_sw_app_read
index: -1
}
Expand Down Expand Up @@ -19071,9 +19067,8 @@
type: uni
act: rcv
width: 1
default: prim_mubi_pkg::MuBi8True
inst_name: entropy_src
default: ""
top_signame: entropy_src_otp_en_entropy_src_fw_read
index: -1
}
{
Expand All @@ -19083,9 +19078,8 @@
type: uni
act: rcv
width: 1
default: prim_mubi_pkg::MuBi8True
inst_name: entropy_src
default: ""
top_signame: entropy_src_otp_en_entropy_src_fw_over
index: -1
}
{
Expand Down Expand Up @@ -23378,25 +23372,7 @@
width: 1
type: uni
end_idx: -1
default: ""
}
{
package: prim_mubi_pkg
struct: mubi8
signame: entropy_src_otp_en_entropy_src_fw_read
width: 1
type: uni
end_idx: -1
default: ""
}
{
package: prim_mubi_pkg
struct: mubi8
signame: entropy_src_otp_en_entropy_src_fw_over
width: 1
type: uni
end_idx: -1
default: ""
default: prim_mubi_pkg::MuBi8True
}
{
package: otp_ctrl_pkg
Expand Down
26 changes: 0 additions & 26 deletions hw/top_earlgrey/data/ip/chip_entropy_src_testplan.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,6 @@
tests: ["chip_sw_entropy_src_csrng"]
bazel: []
},
{
name: chip_sw_entropy_src_fuse_en_fw_read
desc: '''Verify the fuse input entropy_src.

- Initialize the OTP with the fuse that controls whether the SW can read the entropy src
enabled.
- Read the OTP and verify that the fuse is enabled.
- Read the entropy_data_fifo via SW and verify that it reads valid values.
- Reset the chip, but this time, initialize the OTP with the fuse disabled.
- Read the OTP and verify that fuse is disabled.
- Read the internal state via SW and verify that the entropy valid bit is zero.

Notes for silicon targets:
- The current understanding is that the en_entropy_src_fw_read OTP switch controlling the ENTROPY_SRC.ROUTE_TO_FIRMWARE feature will need to be enabled also in the PROD life-cycle state for validation and known-answer testing.
Thus, burning the en_entropy_src_fw_read OTP fuses is not advisable for silicon validation.
This particular test may be skipped in favor of chip_sw_entropy_src_known_answer_tests which also tests the ENTROPY_SRC.ROUTE_TO_FIRMWARE feature.
'''
features: [
"ENTROPY_SRC.ROUTE_TO_FIRMWARE",
]
stage: V2
si_stage: None
lc_states: ["TEST_UNLOCKED", "PROD"]
tests: ["chip_sw_entropy_src_fuse_en_fw_read_test"]
bazel: []
},
{
name: chip_sw_entropy_src_known_answer_tests
desc: '''Verify our ability to run known-answer tests in SW.
Expand Down
Loading
Loading