[kmac] Moving KDF struct to KMAC IP
Previously KeyMgr KDF interface was defined in KeyMgr IP. The interface
has been used for KeyMgr to initiate KMAC operation via side channel
interface.
As rom_ctrl and otp_ctrl plan to use KMAC as signature verification
function, KMAC needs to have more general application interface now.
This commit is to move the KDF struct into KMAC and renames it to
`app_{req/rsp}_t`.
Signed-off-by: Eunchan Kim <eunchan@opentitan.org>
diff --git a/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson b/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
index 127cacc..c61a128 100644
--- a/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
+++ b/hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
@@ -3851,15 +3851,16 @@
index: -1
}
{
- name: keymgr_kdf
- struct: kmac_data
- package: keymgr_pkg
+ name: app
+ struct: app
+ package: kmac_pkg
type: req_rsp
act: rsp
width: 1
inst_name: kmac
default: ""
- top_signame: keymgr_kmac_data
+ end_idx: -1
+ top_signame: kmac_app
index: -1
}
{
@@ -4108,15 +4109,14 @@
}
{
name: kmac_data
- struct: kmac_data
- package: keymgr_pkg
+ struct: app
+ package: kmac_pkg
type: req_rsp
act: req
width: 1
inst_name: keymgr
default: ""
- end_idx: -1
- top_signame: keymgr_kmac_data
+ top_signame: kmac_app
index: -1
}
{
@@ -5479,9 +5479,9 @@
[
kmac.keymgr_key
]
- keymgr.kmac_data:
+ kmac.app:
[
- kmac.keymgr_kdf
+ keymgr.kmac_data
]
clkmgr_aon.idle:
[
@@ -11267,15 +11267,16 @@
index: -1
}
{
- name: keymgr_kdf
- struct: kmac_data
- package: keymgr_pkg
+ name: app
+ struct: app
+ package: kmac_pkg
type: req_rsp
act: rsp
width: 1
inst_name: kmac
default: ""
- top_signame: keymgr_kmac_data
+ end_idx: -1
+ top_signame: kmac_app
index: -1
}
{
@@ -11363,15 +11364,14 @@
}
{
name: kmac_data
- struct: kmac_data
- package: keymgr_pkg
+ struct: app
+ package: kmac_pkg
type: req_rsp
act: req
width: 1
inst_name: keymgr
default: ""
- end_idx: -1
- top_signame: keymgr_kmac_data
+ top_signame: kmac_app
index: -1
}
{
@@ -13906,24 +13906,24 @@
default: ""
}
{
- package: keymgr_pkg
- struct: kmac_data_req
- signame: keymgr_kmac_data_req
+ package: kmac_pkg
+ struct: app_req
+ signame: kmac_app_req
width: 1
type: req_rsp
end_idx: -1
- act: req
+ act: rsp
suffix: req
default: ""
}
{
- package: keymgr_pkg
- struct: kmac_data_rsp
- signame: keymgr_kmac_data_rsp
+ package: kmac_pkg
+ struct: app_rsp
+ signame: kmac_app_rsp
width: 1
type: req_rsp
end_idx: -1
- act: req
+ act: rsp
suffix: rsp
default: ""
}
diff --git a/hw/top_earlgrey/data/top_earlgrey.hjson b/hw/top_earlgrey/data/top_earlgrey.hjson
index 7e65c5d..ae8b022 100755
--- a/hw/top_earlgrey/data/top_earlgrey.hjson
+++ b/hw/top_earlgrey/data/top_earlgrey.hjson
@@ -893,7 +893,10 @@
// KeyMgr Sideload & KDF function
'otp_ctrl.otp_keymgr_key' : ['keymgr.otp_key'],
'keymgr.kmac_key' : ['kmac.keymgr_key']
- 'keymgr.kmac_data' : ['kmac.keymgr_kdf']
+
+ // KMAC Application Interface
+ 'kmac.app' : ['keymgr.kmac_data']
+
// The idle connection is automatically connected through topgen.
// The user does not need to explicitly declare anything other than
// an empty list.
diff --git a/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv b/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
index 4976651..908b319 100644
--- a/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
+++ b/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
@@ -470,8 +470,8 @@
edn_pkg::edn_rsp_t [6:0] edn1_edn_rsp;
otp_ctrl_pkg::otp_keymgr_key_t otp_ctrl_otp_keymgr_key;
keymgr_pkg::hw_key_req_t keymgr_kmac_key;
- keymgr_pkg::kmac_data_req_t keymgr_kmac_data_req;
- keymgr_pkg::kmac_data_rsp_t keymgr_kmac_data_rsp;
+ kmac_pkg::app_req_t kmac_app_req;
+ kmac_pkg::app_rsp_t kmac_app_rsp;
logic [3:0] clkmgr_aon_idle;
jtag_pkg::jtag_req_t pinmux_aon_lc_jtag_req;
jtag_pkg::jtag_rsp_t pinmux_aon_lc_jtag_rsp;
@@ -1965,8 +1965,8 @@
// Inter-module signals
.keymgr_key_i(keymgr_kmac_key),
- .keymgr_kdf_i(keymgr_kmac_data_req),
- .keymgr_kdf_o(keymgr_kmac_data_rsp),
+ .app_i(kmac_app_req),
+ .app_o(kmac_app_rsp),
.entropy_o(edn0_edn_req[3]),
.entropy_i(edn0_edn_rsp[3]),
.idle_o(clkmgr_aon_idle[2]),
@@ -2010,8 +2010,8 @@
.aes_key_o(),
.hmac_key_o(),
.kmac_key_o(keymgr_kmac_key),
- .kmac_data_o(keymgr_kmac_data_req),
- .kmac_data_i(keymgr_kmac_data_rsp),
+ .kmac_data_o(kmac_app_req),
+ .kmac_data_i(kmac_app_rsp),
.otp_key_i(otp_ctrl_otp_keymgr_key),
.otp_hw_cfg_i(otp_ctrl_otp_hw_cfg),
.flash_i(flash_ctrl_keymgr),