Skip to content

Commit

Permalink
Add logic servicing payload_available and image_activated signals.
Browse files Browse the repository at this point in the history
Internal-tag: [#68034]
Signed-off-by: Maciej Kurc <[email protected]>
  • Loading branch information
mkurc-ant committed Oct 29, 2024
1 parent ae27dac commit be4b34d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/recovery/recovery_executor.sv
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module recovery_executor

input logic host_abort_i,

// Recovery image activation signal
output logic image_activated_o,

// Recovery CSR interface
input I3CCSR_pkg::I3CCSR__I3C_EC__SecFwRecoveryIf__out_t hwif_rec_i,
output I3CCSR_pkg::I3CCSR__I3C_EC__SecFwRecoveryIf__in_t hwif_rec_o
Expand Down Expand Up @@ -382,4 +385,17 @@ module recovery_executor
default: res_dlast_o <= '0;
endcase

// ....................................................

// Image activation logic.
// When 0xF is written to byte 2 of RECOVERY_CTRL CSR latch the signal that
// triggers recovery image activation. To clear the latch the device must
// exit the recovery mode (this module will be reset then).
always_ff @(posedge clk_i or negedge rst_ni)
if (!rst_ni)
image_activated_o <= '0;
else if (hwif_rec_o.RECOVERY_CTRL.PLACEHOLDER.we &&
hwif_rec_o.RECOVERY_CTRL.PLACEHOLDER.next[27:24] == 4'hF)
image_activated_o <= 1'b1;

endmodule
5 changes: 5 additions & 0 deletions src/recovery/recovery_handler.sv
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ module recovery_handler
.tx_reg_rst_data_o(tti_tx_data_queue_reg_rst_next)
);

// Recovery data available signal.
assign payload_available_o = recovery_enable & !tti_rx_data_queue_empty;

// IBI
write_queue #(

Expand Down Expand Up @@ -863,6 +866,8 @@ module recovery_handler

.host_abort_i(ctl_tti_tx_host_nack_i | ctl_bus_stop_i),

.image_activated_o (image_activated_o),

.hwif_rec_i(hwif_rec_i),
.hwif_rec_o(hwif_rec_o)
);
Expand Down

0 comments on commit be4b34d

Please sign in to comment.