diff --git a/src/recovery/recovery_executor.sv b/src/recovery/recovery_executor.sv index 5361fd8..a9ec417 100644 --- a/src/recovery/recovery_executor.sv +++ b/src/recovery/recovery_executor.sv @@ -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 @@ -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 diff --git a/src/recovery/recovery_handler.sv b/src/recovery/recovery_handler.sv index 810a714..6211253 100644 --- a/src/recovery/recovery_handler.sv +++ b/src/recovery/recovery_handler.sv @@ -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 #( @@ -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) );