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

@ -256,7 +256,9 @@ always @(posedge spi_clk) begin
spi_active <= 1'b0;
end else 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;
end else if (cmd_ready == 1'b1 && spi_cmd_rd_addr_next == ctrl_cmd_wr_addr) begin
spi_active <= 1'b0;