Skip to content

Commit 3ed4201

Browse files
kedjenksnasahlpa
authored andcommitted
Add MCU MBOX Tests and Fix MBOX Lock Clearing Detection (#181)
* -Fix mailbox release detection to be based on valid SW write and data being 0 (instead of value edge detect). -Update MBOX clearing to explicitly call out writing 0 to EXECUTE register. * -Add MCU MBOX smoke test with MCU and Caliptra both acquiring and reading/writing MBOX. -Add MCU MBOX lock return one during zeroize test. -Update MCU MBOX zeroize smoke test for new infra. -Add MCU MBOX tests to L0. * -Add MBOX CSRs are zero after lock release test. -Fix mbox_status CSR to reset on MBOX lock release.
1 parent 4040173 commit 3ed4201

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/integration/test_suites/smoke_test_mcu_mbox/smoke_test_mcu_mbox.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,27 +157,29 @@ void main (void) {
157157
char *argv[1];
158158
enum boot_fsm_state_e boot_fsm_ps;
159159
const uint32_t mbox_dlen = 16*4;
160-
uint32_t mbox_num = 0;
161160
uint32_t mbox_resp_dlen;
162161
uint32_t mbox_resp_data;
163162
uint32_t mci_boot_fsm_go;
164163
uint32_t sram_data;
165164

166165

167-
VPRINTF(LOW, "=================\nMCU Configure MCI mailboxes\n=================\n\n");
166+
VPRINTF(LOW, "=================\nMCU Configure MCI mailboxes\n=================\n\n")
167+
// MBOX: Setup valid AXI
168+
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_VALID_AXI_USER_0, 0x32);
169+
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_VALID_AXI_USER_1, 0x33);
170+
171+
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_AXI_USER_LOCK_0, MCI_REG_MBOX0_AXI_USER_LOCK_0_LOCK_MASK);
172+
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_AXI_USER_LOCK_1, MCI_REG_MBOX0_AXI_USER_LOCK_1_LOCK_MASK);
168173

169174
VPRINTF(LOW, "MCU: Configured MBOX Valid AXI USER\n");
170175

171176
mcu_mci_boot_go();
172177

173-
VPRINTF(LOW, "MCU: Caliptra bringup\n");
174-
178+
VPRINTF(LOW, "MCU: Caliptra bringup\n")
175179

176-
// Setting Caliptra to DEFAULT user
177-
mcu_cptra_fuse_init_axi_user(0xFFFFFFFF);
180+
mcu_cptra_fuse_init();
178181

179-
180-
mcu_mbox_clear_lock_out_of_reset(mbox_num);
182+
mcu_mbox_clear_lock_out_of_reset();
181183

182184
////////////////////////////////////
183185
// Mailbox command test
@@ -192,6 +194,9 @@ void main (void) {
192194
// Set execute
193195
mcu_mbox0_send_data_no_wait_status();
194196

197+
// Wait for status complete
198+
mcu_mbox0_wait_status_complete();
199+
195200
mcu_mbox0_clear_execute();
196201

197202
VPRINTF(LOW, "MCU: Sequence complete\n");

0 commit comments

Comments
 (0)