spi_engine_offload: Start offload when DMA is ready

main
Istvan Csomortani 2020-09-14 17:45:50 +01:00 committed by István Csomortáni
parent 121ac2e97a
commit 85aeb915b4
1 changed files with 6 additions and 4 deletions

View File

@ -175,10 +175,10 @@ end
assign cmd = (cmd_int_s[15:8] == 8'h30) ? {cmd_int_s[15:8], spi_sync_id_counter} : cmd_int_s; assign cmd = (cmd_int_s[15:8] == 8'h30) ? {cmd_int_s[15:8], spi_sync_id_counter} : cmd_int_s;
/* /*
* Forwarded SYNC interface, this can be used to monitor the state of the * Forwarded SYNC interface, this can be used to monitor the state of the
* offload command sequence through SPI Engine regmap * offload command sequence through SPI Engine regmap
*/ */
assign status_sync_data = sync_data; assign status_sync_data = sync_data;
assign status_sync_valid = sync_valid; assign status_sync_valid = sync_valid;
@ -256,7 +256,9 @@ always @(posedge spi_clk) begin
spi_active <= 1'b0; spi_active <= 1'b0;
end else begin end else begin
if (spi_active == 1'b0) begin if (spi_active == 1'b0) begin
if (trigger_s == 1'b1 && spi_enable == 1'b1) // start offload when we have a valid trigger, offload is enabled and
// the DMA is enabled
if (trigger_s == 1'b1 && spi_enable == 1'b1 && offload_sdi_ready == 1'b1)
spi_active <= 1'b1; spi_active <= 1'b1;
end else if (cmd_ready == 1'b1 && spi_cmd_rd_addr_next == ctrl_cmd_wr_addr) begin end else if (cmd_ready == 1'b1 && spi_cmd_rd_addr_next == ctrl_cmd_wr_addr) begin
spi_active <= 1'b0; spi_active <= 1'b0;