[otp_ctrl] Regenerate memory map
Signed-off-by: Michael Schaffner <msf@opentitan.org>
diff --git a/hw/ip/otp_ctrl/data/otp_ctrl.hjson b/hw/ip/otp_ctrl/data/otp_ctrl.hjson
index e35558f..3b32352 100644
--- a/hw/ip/otp_ctrl/data/otp_ctrl.hjson
+++ b/hw/ip/otp_ctrl/data/otp_ctrl.hjson
@@ -1,6 +1,13 @@
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
+//
+// HJSON with partition metadata.
+//
+// DO NOT EDIT THIS FILE DIRECTLY.
+// It has been generated with hw/ip/otp_ctrl/util/translate-mmap.py
+
+
{ name: "otp_ctrl",
clock_primary: "clk_i",
bus_device: "tlul",
@@ -47,7 +54,7 @@
{ name: "NumErrorEntries",
desc: "Number of error register entries.",
type: "int",
- default: "9", // 7 partitions + DAI/LCI
+ default: "9", // partitions + DAI/LCI
local: "true"
},
{ name: "NumDaiWords",
@@ -74,6 +81,326 @@
default: "16",
local: "true"
},
+
+ // Memory map Info
+ { name: "NumPart",
+ desc: "Number of partitions",
+ type: "int",
+ default: "7",
+ local: "true"
+ },
+ { name: "CreatorSwCfgOffset",
+ desc: "Offset of the CREATOR_SW_CFG partition",
+ type: "int",
+ default: "0",
+ local: "true"
+ },
+ { name: "CreatorSwCfgSize",
+ desc: "Size of the CREATOR_SW_CFG partition",
+ type: "int",
+ default: "768",
+ local: "true"
+ },
+ { name: "CreatorSwCfgContentOffset",
+ desc: "Offset of CREATOR_SW_CFG_CONTENT",
+ type: "int",
+ default: "0",
+ local: "true"
+ },
+ { name: "CreatorSwCfgContentSize",
+ desc: "Size of CREATOR_SW_CFG_CONTENT",
+ type: "int",
+ default: "760",
+ local: "true"
+ },
+ { name: "CreatorSwCfgDigestOffset",
+ desc: "Offset of CREATOR_SW_CFG_DIGEST",
+ type: "int",
+ default: "760",
+ local: "true"
+ },
+ { name: "CreatorSwCfgDigestSize",
+ desc: "Size of CREATOR_SW_CFG_DIGEST",
+ type: "int",
+ default: "8",
+ local: "true"
+ },
+ { name: "OwnerSwCfgOffset",
+ desc: "Offset of the OWNER_SW_CFG partition",
+ type: "int",
+ default: "768",
+ local: "true"
+ },
+ { name: "OwnerSwCfgSize",
+ desc: "Size of the OWNER_SW_CFG partition",
+ type: "int",
+ default: "768",
+ local: "true"
+ },
+ { name: "OwnerSwCfgContentOffset",
+ desc: "Offset of OWNER_SW_CFG_CONTENT",
+ type: "int",
+ default: "768",
+ local: "true"
+ },
+ { name: "OwnerSwCfgContentSize",
+ desc: "Size of OWNER_SW_CFG_CONTENT",
+ type: "int",
+ default: "760",
+ local: "true"
+ },
+ { name: "OwnerSwCfgDigestOffset",
+ desc: "Offset of OWNER_SW_CFG_DIGEST",
+ type: "int",
+ default: "1528",
+ local: "true"
+ },
+ { name: "OwnerSwCfgDigestSize",
+ desc: "Size of OWNER_SW_CFG_DIGEST",
+ type: "int",
+ default: "8",
+ local: "true"
+ },
+ { name: "HwCfgOffset",
+ desc: "Offset of the HW_CFG partition",
+ type: "int",
+ default: "1536",
+ local: "true"
+ },
+ { name: "HwCfgSize",
+ desc: "Size of the HW_CFG partition",
+ type: "int",
+ default: "176",
+ local: "true"
+ },
+ { name: "HwCfgContentOffset",
+ desc: "Offset of HW_CFG_CONTENT",
+ type: "int",
+ default: "1536",
+ local: "true"
+ },
+ { name: "HwCfgContentSize",
+ desc: "Size of HW_CFG_CONTENT",
+ type: "int",
+ default: "168",
+ local: "true"
+ },
+ { name: "HwCfgDigestOffset",
+ desc: "Offset of HW_CFG_DIGEST",
+ type: "int",
+ default: "1704",
+ local: "true"
+ },
+ { name: "HwCfgDigestSize",
+ desc: "Size of HW_CFG_DIGEST",
+ type: "int",
+ default: "8",
+ local: "true"
+ },
+ { name: "Secret0Offset",
+ desc: "Offset of the SECRET0 partition",
+ type: "int",
+ default: "1712",
+ local: "true"
+ },
+ { name: "Secret0Size",
+ desc: "Size of the SECRET0 partition",
+ type: "int",
+ default: "40",
+ local: "true"
+ },
+ { name: "TestUnlockTokenOffset",
+ desc: "Offset of TEST_UNLOCK_TOKEN",
+ type: "int",
+ default: "1712",
+ local: "true"
+ },
+ { name: "TestUnlockTokenSize",
+ desc: "Size of TEST_UNLOCK_TOKEN",
+ type: "int",
+ default: "16",
+ local: "true"
+ },
+ { name: "TestExitTokenOffset",
+ desc: "Offset of TEST_EXIT_TOKEN",
+ type: "int",
+ default: "1728",
+ local: "true"
+ },
+ { name: "TestExitTokenSize",
+ desc: "Size of TEST_EXIT_TOKEN",
+ type: "int",
+ default: "16",
+ local: "true"
+ },
+ { name: "Secret0DigestOffset",
+ desc: "Offset of SECRET0_DIGEST",
+ type: "int",
+ default: "1744",
+ local: "true"
+ },
+ { name: "Secret0DigestSize",
+ desc: "Size of SECRET0_DIGEST",
+ type: "int",
+ default: "8",
+ local: "true"
+ },
+ { name: "Secret1Offset",
+ desc: "Offset of the SECRET1 partition",
+ type: "int",
+ default: "1752",
+ local: "true"
+ },
+ { name: "Secret1Size",
+ desc: "Size of the SECRET1 partition",
+ type: "int",
+ default: "88",
+ local: "true"
+ },
+ { name: "FlashAddrKeySeedOffset",
+ desc: "Offset of FLASH_ADDR_KEY_SEED",
+ type: "int",
+ default: "1752",
+ local: "true"
+ },
+ { name: "FlashAddrKeySeedSize",
+ desc: "Size of FLASH_ADDR_KEY_SEED",
+ type: "int",
+ default: "32",
+ local: "true"
+ },
+ { name: "FlashDataKeySeedOffset",
+ desc: "Offset of FLASH_DATA_KEY_SEED",
+ type: "int",
+ default: "1784",
+ local: "true"
+ },
+ { name: "FlashDataKeySeedSize",
+ desc: "Size of FLASH_DATA_KEY_SEED",
+ type: "int",
+ default: "32",
+ local: "true"
+ },
+ { name: "SramDataKeySeedOffset",
+ desc: "Offset of SRAM_DATA_KEY_SEED",
+ type: "int",
+ default: "1816",
+ local: "true"
+ },
+ { name: "SramDataKeySeedSize",
+ desc: "Size of SRAM_DATA_KEY_SEED",
+ type: "int",
+ default: "16",
+ local: "true"
+ },
+ { name: "Secret1DigestOffset",
+ desc: "Offset of SECRET1_DIGEST",
+ type: "int",
+ default: "1832",
+ local: "true"
+ },
+ { name: "Secret1DigestSize",
+ desc: "Size of SECRET1_DIGEST",
+ type: "int",
+ default: "8",
+ local: "true"
+ },
+ { name: "Secret2Offset",
+ desc: "Offset of the SECRET2 partition",
+ type: "int",
+ default: "1840",
+ local: "true"
+ },
+ { name: "Secret2Size",
+ desc: "Size of the SECRET2 partition",
+ type: "int",
+ default: "120",
+ local: "true"
+ },
+ { name: "RmaTokenOffset",
+ desc: "Offset of RMA_TOKEN",
+ type: "int",
+ default: "1840",
+ local: "true"
+ },
+ { name: "RmaTokenSize",
+ desc: "Size of RMA_TOKEN",
+ type: "int",
+ default: "16",
+ local: "true"
+ },
+ { name: "CreatorRootKeyShare0Offset",
+ desc: "Offset of CREATOR_ROOT_KEY_SHARE0",
+ type: "int",
+ default: "1856",
+ local: "true"
+ },
+ { name: "CreatorRootKeyShare0Size",
+ desc: "Size of CREATOR_ROOT_KEY_SHARE0",
+ type: "int",
+ default: "32",
+ local: "true"
+ },
+ { name: "CreatorRootKeyShare1Offset",
+ desc: "Offset of CREATOR_ROOT_KEY_SHARE1",
+ type: "int",
+ default: "1888",
+ local: "true"
+ },
+ { name: "CreatorRootKeyShare1Size",
+ desc: "Size of CREATOR_ROOT_KEY_SHARE1",
+ type: "int",
+ default: "32",
+ local: "true"
+ },
+ { name: "Secret2DigestOffset",
+ desc: "Offset of SECRET2_DIGEST",
+ type: "int",
+ default: "1952",
+ local: "true"
+ },
+ { name: "Secret2DigestSize",
+ desc: "Size of SECRET2_DIGEST",
+ type: "int",
+ default: "8",
+ local: "true"
+ },
+ { name: "LifeCycleOffset",
+ desc: "Offset of the LIFE_CYCLE partition",
+ type: "int",
+ default: "1960",
+ local: "true"
+ },
+ { name: "LifeCycleSize",
+ desc: "Size of the LIFE_CYCLE partition",
+ type: "int",
+ default: "88",
+ local: "true"
+ },
+ { name: "LcStateOffset",
+ desc: "Offset of LC_STATE",
+ type: "int",
+ default: "1960",
+ local: "true"
+ },
+ { name: "LcStateSize",
+ desc: "Size of LC_STATE",
+ type: "int",
+ default: "24",
+ local: "true"
+ },
+ { name: "LcTransitionCntOffset",
+ desc: "Offset of LC_TRANSITION_CNT",
+ type: "int",
+ default: "1984",
+ local: "true"
+ },
+ { name: "LcTransitionCntSize",
+ desc: "Size of LC_TRANSITION_CNT",
+ type: "int",
+ default: "64",
+ local: "true"
+ },
]
/////////////////////////////
@@ -662,7 +989,7 @@
////////////////////////////////////
{ name: "CREATOR_SW_CFG_READ_LOCK",
desc: '''
- Runtime read lock for the creator software partition.
+ Runtime read lock for the CREATOR_SW_CFG partition.
''',
swaccess: "rw1c",
hwaccess: "hro",
@@ -678,7 +1005,7 @@
},
{ name: "OWNER_SW_CFG_READ_LOCK",
desc: '''
- Runtime read lock for the owner software partition.
+ Runtime read lock for the OWNER_SW_CFG partition.
''',
swaccess: "rw1c",
hwaccess: "hro",
@@ -699,7 +1026,7 @@
{ multireg: {
name: "CREATOR_SW_CFG_DIGEST",
desc: '''
- Integrity digest for the creator software config partition.
+ Integrity digest for the CREATOR_SW_CFG partition.
The integrity digest is 0 by default. Software must write this
digest value via the direct access interface in order to lock the partition.
After a reset, write access to the CREATOR_SW_CFG partition is locked and
@@ -719,7 +1046,7 @@
{ multireg: {
name: "OWNER_SW_CFG_DIGEST",
desc: '''
- Integrity digest for the owner software config partition.
+ Integrity digest for the OWNER_SW_CFG partition.
The integrity digest is 0 by default. Software must write this
digest value via the direct access interface in order to lock the partition.
After a reset, write access to the OWNER_SW_CFG partition is locked and
@@ -739,7 +1066,7 @@
{ multireg: {
name: "HW_CFG_DIGEST",
desc: '''
- Hardware config partition integrity digest.
+ Integrity digest for the HW_CFG partition.
The integrity digest is 0 by default. The digest calculation can be triggered via the !!DIRECT_ACCESS_CMD.
After a reset, the digest then becomes visible in this CSR, and the corresponding partition becomes write-locked.
''',
diff --git a/hw/ip/otp_ctrl/doc/otp_ctrl_digests.md b/hw/ip/otp_ctrl/doc/otp_ctrl_digests.md
index ceb20a7..a6822ae 100644
--- a/hw/ip/otp_ctrl/doc/otp_ctrl_digests.md
+++ b/hw/ip/otp_ctrl/doc/otp_ctrl_digests.md
@@ -1,8 +1,13 @@
-| Digest Name | Affected Partition | Calculated by HW
-|------------------------------------------|----------------------------------|-------------
-| {{< regref "CREATOR_SW_CFG_DIGEST_0" >}} | {{< regref "CREATOR_SW_CFG" >}} | no
-| {{< regref "OWNER_SW_CFG_DIGEST_0" >}} | {{< regref "OWNER_SW_CFG" >}} | no
-| {{< regref "HW_CFG_DIGEST_0" >}} | HW_CFG | yes
-| {{< regref "SECRET0_DIGEST_0" >}} | SECRET0 | yes
-| {{< regref "SECRET1_DIGEST_0" >}} | SECRET1 | yes
-| {{< regref "SECRET2_DIGEST_0" >}} | SECRET2 | yes
+<!--
+DO NOT EDIT THIS FILE DIRECTLY.
+It has been generated with hw/ip/otp_ctrl/util/translate-mmap.py
+-->
+
+| Digest Name | Affected Partition | Calculated by HW |
+|:-----------------------------------------------------:|:---------------------:|:------------------:|
+| [CREATOR_SW_CFG_DIGEST](#Reg_creator_sw_cfg_digest_0) | CREATOR_SW_CFG | no |
+| [OWNER_SW_CFG_DIGEST](#Reg_owner_sw_cfg_digest_0) | OWNER_SW_CFG | no |
+| [HW_CFG_DIGEST](#Reg_hw_cfg_digest_0) | HW_CFG | yes |
+| [SECRET0_DIGEST](#Reg_secret0_digest_0) | SECRET0 | yes |
+| [SECRET1_DIGEST](#Reg_secret1_digest_0) | SECRET1 | yes |
+| [SECRET2_DIGEST](#Reg_secret2_digest_0) | SECRET2 | yes |
\ No newline at end of file
diff --git a/hw/ip/otp_ctrl/doc/otp_ctrl_mmap.md b/hw/ip/otp_ctrl/doc/otp_ctrl_mmap.md
index 67b66d3..17587f1 100644
--- a/hw/ip/otp_ctrl/doc/otp_ctrl_mmap.md
+++ b/hw/ip/otp_ctrl/doc/otp_ctrl_mmap.md
@@ -1,21 +1,26 @@
-| Index | Partition | Size [B] | Access Granule | Item | Byte Address | Size [B]
-|-------|---------------------------------|-------------|----------------|------------------------------------------|--------------|------------
-| 0 | {{< regref "CREATOR_SW_CFG" >}} | 768 | 32bit | {{< regref "CREATOR_SW_CFG" >}} | 0x0 | 760
-| | | | | {{< regref "CREATOR_SW_CFG_DIGEST_0" >}} | 0x2F8 | 8
-| 1 | {{< regref "OWNER_SW_CFG" >}} | 768 | 32bit | {{< regref "OWNER_SW_CFG" >}} | 0x300 | 760
-| | | | | {{< regref "OWNER_SW_CFG_DIGEST_0" >}} | 0x5F8 | 8
-| 2 | HW_CFG | 176 | 32bit | **TODO: TBD** | 0x600 | 168
-| | | | | {{< regref "HW_CFG_DIGEST_0" >}} | 0x6A8 | 8
-| 3 | SECRET0 | 40 | 64bit | TEST_UNLOCK_TOKEN | 0x6B0 | 16
-| | | | | TEST_EXIT_TOKEN | 0x6C0 | 16
-| | | | | {{< regref "SECRET0_DIGEST_0" >}} | 0x6D0 | 8
-| 4 | SECRET1 | 88 | 64bit | FLASH_ADDR_KEY_SEED | 0x6D8 | 32
-| | | | | FLASH_DATA_KEY_SEED | 0x6F8 | 32
-| | | | | SRAM_DATA_KEY_SEED | 0x718 | 16
-| | | | | {{< regref "SECRET1_DIGEST_0" >}} | 0x728 | 8
-| 5 | SECRET2 | 120 | 64bit | RMA_TOKEN | 0x730 | 16
-| | | | | CREATOR_ROOT_KEY_SHARE0 | 0x740 | 32
-| | | | | CREATOR_ROOT_KEY_SHARE1 | 0x760 | 32
-| | | | | {{< regref "SECRET2_DIGEST_0" >}} | 0x7A0 | 8
-| 6 | LIFE_CYCLE | 88 | 32bit | LC_STATE | 0x7A8 | 24
-| | | | | LC_TRANSITION_CNT | 0x7C0 | 64
+<!--
+DO NOT EDIT THIS FILE DIRECTLY.
+It has been generated with hw/ip/otp_ctrl/util/translate-mmap.py
+-->
+
+| Index | Partition | Size [B] | Access Granule | Item | Byte Address | Size [B] |
+|:-------:|:--------------:|:----------:|:----------------:|:-----------------------------------------------------:|:--------------:|:----------:|
+| 0 | CREATOR_SW_CFG | 768 | 32bit | CREATOR_SW_CFG_CONTENT | 0x000 | 760 |
+| | | | | [CREATOR_SW_CFG_DIGEST](#Reg_creator_sw_cfg_digest_0) | 0x2F8 | 8 |
+| 1 | OWNER_SW_CFG | 768 | 32bit | OWNER_SW_CFG_CONTENT | 0x300 | 760 |
+| | | | | [OWNER_SW_CFG_DIGEST](#Reg_owner_sw_cfg_digest_0) | 0x5F8 | 8 |
+| 2 | HW_CFG | 176 | 32bit | HW_CFG_CONTENT | 0x600 | 168 |
+| | | | | [HW_CFG_DIGEST](#Reg_hw_cfg_digest_0) | 0x6A8 | 8 |
+| 3 | SECRET0 | 40 | 64bit | TEST_UNLOCK_TOKEN | 0x6B0 | 16 |
+| | | | | TEST_EXIT_TOKEN | 0x6C0 | 16 |
+| | | | | [SECRET0_DIGEST](#Reg_secret0_digest_0) | 0x6D0 | 8 |
+| 4 | SECRET1 | 88 | 64bit | FLASH_ADDR_KEY_SEED | 0x6D8 | 32 |
+| | | | | FLASH_DATA_KEY_SEED | 0x6F8 | 32 |
+| | | | | SRAM_DATA_KEY_SEED | 0x718 | 16 |
+| | | | | [SECRET1_DIGEST](#Reg_secret1_digest_0) | 0x728 | 8 |
+| 5 | SECRET2 | 120 | 64bit | RMA_TOKEN | 0x730 | 16 |
+| | | | | CREATOR_ROOT_KEY_SHARE0 | 0x740 | 32 |
+| | | | | CREATOR_ROOT_KEY_SHARE1 | 0x760 | 32 |
+| | | | | [SECRET2_DIGEST](#Reg_secret2_digest_0) | 0x7A0 | 8 |
+| 6 | LIFE_CYCLE | 88 | 32bit | LC_STATE | 0x7A8 | 24 |
+| | | | | LC_TRANSITION_CNT | 0x7C0 | 64 |
\ No newline at end of file
diff --git a/hw/ip/otp_ctrl/doc/otp_ctrl_partitions.md b/hw/ip/otp_ctrl/doc/otp_ctrl_partitions.md
index edeeae5..41fe0ec 100644
--- a/hw/ip/otp_ctrl/doc/otp_ctrl_partitions.md
+++ b/hw/ip/otp_ctrl/doc/otp_ctrl_partitions.md
@@ -1,9 +1,14 @@
-Partititon | Secret | Buffered | WR Lockable | RD Lockable | Description
----------------|--------|----------|--------------|--------------|----------------------------------------------------------------
-CREATOR_SW_CFG | no | no | yes (digest) | yes (CSR) | Software configuration partition for device-specific calibration data (Clock, LDO, RNG, device identity).
-OWNER_SW_CFG | no | no | yes (digest) | yes (CSR) | Software configuration partition for data that changes software behavior, specifically in the ROM. <br> E.g., enabling defensive features in ROM or selecting failure modes if verification fails.
-HW_CFG | no | yes | yes (digest) | no | Hardware configuration bits used to hardwire specific hardware functionality. <br> E.g., raw entropy accessibility or FLASH scrambling bypass range.
-SECRET0 | yes | yes | yes (digest) | yes (digest) | Test unlock tokens.
-SECRET1 | yes | yes | yes (digest) | yes (digest) | SRAM and FLASH scrambling key roots used for scrambling key derivation.
-SECRET2 | yes | yes | yes (digest) | yes (digest) | RMA unlock token and creator root key.
-LIFE_CYCLE | no | yes | no | no | [Life-cycle]({{< relref "hw/ip/lc_ctrl/doc" >}}) related bits. **Note**, this partition cannot be locked as the life cycle state needs to be able to advance to RMA in-field.
+<!--
+DO NOT EDIT THIS FILE DIRECTLY.
+It has been generated with hw/ip/otp_ctrl/util/translate-mmap.py
+-->
+
+| Partition | Secret | Buffered | WR Lockable | RD Lockable | Description |
+|:--------------:|:--------:|:----------:|:-------------:|:-------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
+| CREATOR_SW_CFG | no | no | yes (Digest) | yes (CSR) | Software configuration partition for device-specific calibration data (Clock, LDO, RNG, device identity). |
+| OWNER_SW_CFG | no | no | yes (Digest) | yes (CSR) | Software configuration partition for data that changes software behavior, specifically in the ROM. E.g., enabling defensive features in ROM or selecting failure modes if verification fails. |
+| HW_CFG | no | yes | yes (Digest) | no | Hardware configuration bits used to hardwire specific hardware functionality. E.g., raw entropy accessibility or FLASH scrambling bypass range. |
+| SECRET0 | yes | yes | yes (Digest) | yes (Digest) | Test unlock tokens. |
+| SECRET1 | yes | yes | yes (Digest) | yes (Digest) | SRAM and FLASH scrambling key roots used for scrambling key derivation. |
+| SECRET2 | yes | yes | yes (Digest) | yes (Digest) | RMA unlock token and creator root key. |
+| LIFE_CYCLE | no | yes | no | no | Life-cycle related bits. Note, this partition cannot be locked as the life cycle state needs to be able to advance to RMA in-field. |
\ No newline at end of file
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
index f0e33d4..db1fb3f 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_part_pkg.sv
@@ -11,23 +11,85 @@
import otp_ctrl_reg_pkg::*;
import otp_ctrl_pkg::*;
- // TODO: need to parse this somehow from an hjson
+
localparam part_info_t PartInfo [NumPart] = '{
- // Variant | offset | size | key_sel | scrambled | HW digest | write_lock | read_lock
// CREATOR_SW_CFG
- '{Unbuffered, 11'h0, 768, Secret0Key, 1'b0, 1'b0, 1'b1, 1'b0},
+ '{
+ variant: Unbuffered,
+ offset: 11'd0,
+ size: 768,
+ key_sel: key_sel_e'('0),
+ secret: 1'b0,
+ hw_digest: 1'b0,
+ write_lock: 1'b1,
+ read_lock: 1'b0
+ },
// OWNER_SW_CFG
- '{Unbuffered, 11'h300, 768, Secret0Key, 1'b0, 1'b0, 1'b1, 1'b0},
+ '{
+ variant: Unbuffered,
+ offset: 11'd768,
+ size: 768,
+ key_sel: key_sel_e'('0),
+ secret: 1'b0,
+ hw_digest: 1'b0,
+ write_lock: 1'b1,
+ read_lock: 1'b0
+ },
// HW_CFG
- '{Buffered, 11'h600, 176, Secret0Key, 1'b0, 1'b1, 1'b1, 1'b0},
+ '{
+ variant: Buffered,
+ offset: 11'd1536,
+ size: 176,
+ key_sel: key_sel_e'('0),
+ secret: 1'b0,
+ hw_digest: 1'b1,
+ write_lock: 1'b1,
+ read_lock: 1'b0
+ },
// SECRET0
- '{Buffered, 11'h6B0, 40, Secret0Key, 1'b1, 1'b1, 1'b1, 1'b1},
+ '{
+ variant: Buffered,
+ offset: 11'd1712,
+ size: 40,
+ key_sel: Secret0Key,
+ secret: 1'b1,
+ hw_digest: 1'b1,
+ write_lock: 1'b1,
+ read_lock: 1'b1
+ },
// SECRET1
- '{Buffered, 11'h6D8, 88, Secret1Key, 1'b1, 1'b1, 1'b1, 1'b1},
+ '{
+ variant: Buffered,
+ offset: 11'd1752,
+ size: 88,
+ key_sel: Secret1Key,
+ secret: 1'b1,
+ hw_digest: 1'b1,
+ write_lock: 1'b1,
+ read_lock: 1'b1
+ },
// SECRET2
- '{Buffered, 11'h730, 120, Secret2Key, 1'b1, 1'b1, 1'b1, 1'b1},
+ '{
+ variant: Buffered,
+ offset: 11'd1840,
+ size: 120,
+ key_sel: Secret2Key,
+ secret: 1'b1,
+ hw_digest: 1'b1,
+ write_lock: 1'b1,
+ read_lock: 1'b1
+ },
// LIFE_CYCLE
- '{LifeCycle, 11'h7A8, 88, Secret0Key, 1'b0, 1'b0, 1'b0, 1'b0}
+ '{
+ variant: LifeCycle,
+ offset: 11'd1960,
+ size: 88,
+ key_sel: key_sel_e'('0),
+ secret: 1'b0,
+ hw_digest: 1'b0,
+ write_lock: 1'b0,
+ read_lock: 1'b0
+ }
};
typedef enum {
@@ -50,4 +112,4 @@
parameter int NumAgents = int'(NumAgentsIdx);
parameter int NumHwCfgBits = PartInfo[HwCfgIdx].size*8;
-endmodule : otp_ctrl_part_pkg
+endpackage : otp_ctrl_part_pkg
diff --git a/hw/ip/otp_ctrl/rtl/otp_ctrl_reg_pkg.sv b/hw/ip/otp_ctrl/rtl/otp_ctrl_reg_pkg.sv
index 43ca5a6..11ab652 100644
--- a/hw/ip/otp_ctrl/rtl/otp_ctrl_reg_pkg.sv
+++ b/hw/ip/otp_ctrl/rtl/otp_ctrl_reg_pkg.sv
@@ -14,6 +14,59 @@
parameter int NumDigestWords = 2;
parameter int NumSwCfgWindowWords = 512;
parameter int NumDebugWindowWords = 16;
+ parameter int NumPart = 7;
+ parameter int CreatorSwCfgOffset = 0;
+ parameter int CreatorSwCfgSize = 768;
+ parameter int CreatorSwCfgContentOffset = 0;
+ parameter int CreatorSwCfgContentSize = 760;
+ parameter int CreatorSwCfgDigestOffset = 760;
+ parameter int CreatorSwCfgDigestSize = 8;
+ parameter int OwnerSwCfgOffset = 768;
+ parameter int OwnerSwCfgSize = 768;
+ parameter int OwnerSwCfgContentOffset = 768;
+ parameter int OwnerSwCfgContentSize = 760;
+ parameter int OwnerSwCfgDigestOffset = 1528;
+ parameter int OwnerSwCfgDigestSize = 8;
+ parameter int HwCfgOffset = 1536;
+ parameter int HwCfgSize = 176;
+ parameter int HwCfgContentOffset = 1536;
+ parameter int HwCfgContentSize = 168;
+ parameter int HwCfgDigestOffset = 1704;
+ parameter int HwCfgDigestSize = 8;
+ parameter int Secret0Offset = 1712;
+ parameter int Secret0Size = 40;
+ parameter int TestUnlockTokenOffset = 1712;
+ parameter int TestUnlockTokenSize = 16;
+ parameter int TestExitTokenOffset = 1728;
+ parameter int TestExitTokenSize = 16;
+ parameter int Secret0DigestOffset = 1744;
+ parameter int Secret0DigestSize = 8;
+ parameter int Secret1Offset = 1752;
+ parameter int Secret1Size = 88;
+ parameter int FlashAddrKeySeedOffset = 1752;
+ parameter int FlashAddrKeySeedSize = 32;
+ parameter int FlashDataKeySeedOffset = 1784;
+ parameter int FlashDataKeySeedSize = 32;
+ parameter int SramDataKeySeedOffset = 1816;
+ parameter int SramDataKeySeedSize = 16;
+ parameter int Secret1DigestOffset = 1832;
+ parameter int Secret1DigestSize = 8;
+ parameter int Secret2Offset = 1840;
+ parameter int Secret2Size = 120;
+ parameter int RmaTokenOffset = 1840;
+ parameter int RmaTokenSize = 16;
+ parameter int CreatorRootKeyShare0Offset = 1856;
+ parameter int CreatorRootKeyShare0Size = 32;
+ parameter int CreatorRootKeyShare1Offset = 1888;
+ parameter int CreatorRootKeyShare1Size = 32;
+ parameter int Secret2DigestOffset = 1952;
+ parameter int Secret2DigestSize = 8;
+ parameter int LifeCycleOffset = 1960;
+ parameter int LifeCycleSize = 88;
+ parameter int LcStateOffset = 1960;
+ parameter int LcStateSize = 24;
+ parameter int LcTransitionCntOffset = 1984;
+ parameter int LcTransitionCntSize = 64;
parameter int NumAlerts = 2;
////////////////////////////