Skip to content

Commit

Permalink
i3c_controller: Fix I2C RX Stop
Browse files Browse the repository at this point in the history
I2C RX transfers should stop with last ACK-bit as a NACK and then a
stop, previously, the controller would ACK all bytes and then stop.

Signed-off-by: Jorge Marques <[email protected]>
  • Loading branch information
gastmaier committed Dec 10, 2024
1 parent 9bc31a9 commit 0691edf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions library/i3c_controller/i3c_controller_core/i3c_controller_word.v
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,13 @@ module i3c_controller_word (
// In I2C, the peripheral cannot stop the SM_TRANSFER.
cmd_r <= `MOD_BIT_CMD_WRITE_;
if (sdi_ready) begin
cmd_wr <= 1'b0; // ACK
end else begin
cmd_wr <= 1'b1; // NACK
if (cmdw_header == `CMDW_STOP_OD) begin
// Peek next command to see if the controller wishes to
// end the SM_TRANSFER.
cmd_wr <= 1'b1; // NACK
end else begin
cmd_wr <= 1'b0; // ACK
end
end
end else begin
// SDI
Expand Down

0 comments on commit 0691edf

Please sign in to comment.