Skip to content

Commit b9ba283

Browse files
committed
Handle ENEC/DISEC broadcast and clear enec/disec signals
This commit improves handling of the enec/disec broadcast CCCs. It also adds logic to clear 'enec_*' and 'disec_*' control registers after ENEC/DISEC command completion. Signed-off-by: Maciej Dudek <[email protected]>
1 parent 11c30a0 commit b9ba283

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ctrl/ccc.sv

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,12 @@ module ccc
944944
disec_hj <= '0;
945945
rst_action_valid <= 1'b0;
946946
end else begin
947+
enec_ibi <= '0;
948+
enec_crr <= '0;
949+
enec_hj <= '0;
950+
disec_ibi <= '0;
951+
disec_crr <= '0;
952+
disec_hj <= '0;
947953
case (command_code)
948954
// setmwl
949955
`I3C_DIRECT_SETMWL, `I3C_BCAST_SETMWL: begin
@@ -979,7 +985,7 @@ module ccc
979985
end
980986
// enec
981987
`I3C_DIRECT_ENEC, `I3C_BCAST_ENEC: begin
982-
if (state_q == RxDataTbit && bus_rx_done_i && ~is_byte_rsvd_addr) begin
988+
if (state_q == RxDataTbit && bus_rx_done_i && (~is_byte_rsvd_addr || command_code == `I3C_BCAST_ENEC)) begin
983989
if (rx_data_count == 8'd0) begin
984990
enec_ibi <= rx_data[0];
985991
enec_crr <= rx_data[1];
@@ -989,7 +995,7 @@ module ccc
989995
end
990996
// disec
991997
`I3C_DIRECT_DISEC, `I3C_BCAST_DISEC: begin
992-
if (state_q == RxDataTbit && bus_rx_done_i && ~is_byte_rsvd_addr) begin
998+
if (state_q == RxDataTbit && bus_rx_done_i && (~is_byte_rsvd_addr || command_code == `I3C_BCAST_DISEC)) begin
993999
if (rx_data_count == 8'd0) begin
9941000
disec_ibi <= rx_data[0];
9951001
disec_crr <= rx_data[1];

0 commit comments

Comments
 (0)