|
|
@@ -15,6 +15,8 @@ module prod2u_6400_v1_top #(
|
|
|
output wire host_ttl_tx,
|
|
|
input wire bmc_rs232_rx,
|
|
|
output wire bmc_rs232_tx,
|
|
|
+ input wire host_i2c_scl,
|
|
|
+ inout wire host_i2c_sda,
|
|
|
output wire [23:0] ptc_pwm_out,
|
|
|
output wire [3:0] front_fan_pwm_out,
|
|
|
output wire [3:0] rear_fan_pwm_out,
|
|
|
@@ -155,11 +157,30 @@ module prod2u_6400_v1_top #(
|
|
|
wire [7:0] watchdog_remaining;
|
|
|
wire manual_mode;
|
|
|
wire hard_protect;
|
|
|
+ wire i2c_sda_drive_low;
|
|
|
+ wire i2c_write_strobe;
|
|
|
+ wire [15:0] i2c_write_address;
|
|
|
+ wire [7:0] i2c_write_data;
|
|
|
+ wire i2c_command_strobe;
|
|
|
+ wire [7:0] i2c_command_data;
|
|
|
+ wire [15:0] i2c_read_address;
|
|
|
+ wire [7:0] i2c_read_data;
|
|
|
+ wire i2c_response_valid;
|
|
|
+ wire [7:0] i2c_response_ok;
|
|
|
+ wire [7:0] i2c_response_command;
|
|
|
+ wire [7:0] i2c_response_status;
|
|
|
+ wire [7:0] i2c_response_detail;
|
|
|
+ wire [15:0] i2c_snapshot_length;
|
|
|
+ wire i2c_manual_wr_en;
|
|
|
+ wire [4:0] i2c_manual_wr_addr;
|
|
|
+ wire [7:0] i2c_manual_wr_data;
|
|
|
+ wire i2c_manual_commit;
|
|
|
wire [15:0] fault_flags = {8'd0, pwm_deadline_miss, bmc_parser_error, ct_stale,
|
|
|
bmc_stale, global_fault, |lane_fault_mask, host_rx_error, bmc_rx_error};
|
|
|
|
|
|
assign temp_scl = ct_scl_drive_low ? 1'b0 : 1'bz;
|
|
|
assign temp_sda = ct_sda_drive_low ? 1'b0 : 1'bz;
|
|
|
+ assign host_i2c_sda = i2c_sda_drive_low ? 1'b0 : 1'bz;
|
|
|
assign ptc_pwm_out = logical_bitmap[23:0];
|
|
|
|
|
|
fan_board_output_adapter #(.BOARD_INVERT_MASK(`FAN_BOARD_INVERT_MASK)) u_fan_board_adapter (
|
|
|
@@ -215,6 +236,32 @@ module prod2u_6400_v1_top #(
|
|
|
.ack_payload_data(ack_payload_data), .tx_done(host_response_done),
|
|
|
.transaction_done(host_transaction_done), .busy(host_command_busy)
|
|
|
);
|
|
|
+
|
|
|
+ host_i2c_register_slave #(.SLAVE_ADDRESS(7'h2A)) u_host_i2c_slave (
|
|
|
+ .clk(sys_clk), .rst_n(rst_n), .scl_i(host_i2c_scl), .sda_io(host_i2c_sda),
|
|
|
+ .write_strobe(i2c_write_strobe), .write_address(i2c_write_address), .write_data(i2c_write_data),
|
|
|
+ .command_strobe(i2c_command_strobe), .command_data(i2c_command_data),
|
|
|
+ .read_address(i2c_read_address), .read_data(i2c_read_data),
|
|
|
+ .response_valid(i2c_response_valid), .response_ok(i2c_response_ok),
|
|
|
+ .response_command(i2c_response_command), .response_status(i2c_response_status),
|
|
|
+ .response_detail(i2c_response_detail), .snapshot_length(i2c_snapshot_length),
|
|
|
+ .snapshot_data(8'd0), .sda_drive_low(i2c_sda_drive_low), .busy()
|
|
|
+ );
|
|
|
+ host_i2c_register_bank u_host_i2c_bank (
|
|
|
+ .clk(sys_clk), .rst_n(rst_n), .write_strobe(i2c_write_strobe),
|
|
|
+ .write_address(i2c_write_address), .write_data(i2c_write_data),
|
|
|
+ .command_strobe(i2c_command_strobe), .command_data(i2c_command_data),
|
|
|
+ .read_address(i2c_read_address), .read_data(i2c_read_data),
|
|
|
+ .response_valid(i2c_response_valid), .response_ok(i2c_response_ok),
|
|
|
+ .response_command(i2c_response_command), .response_status(i2c_response_status),
|
|
|
+ .response_detail(i2c_response_detail), .snapshot_length(i2c_snapshot_length),
|
|
|
+ .snapshot_data(8'd0), .manual_wr_en(i2c_manual_wr_en),
|
|
|
+ .manual_wr_addr(i2c_manual_wr_addr), .manual_wr_data(i2c_manual_wr_data),
|
|
|
+ .manual_commit(i2c_manual_commit), .manual_commit_done(manual_commit_done),
|
|
|
+ .manual_commit_ok(manual_commit_ok), .hard_protect(hard_protect),
|
|
|
+ .manual_active(manual_mode), .watchdog_active(watchdog_active),
|
|
|
+ .bmc_valid(&bmc_valid_mask), .bmc_stale(bmc_stale), .snapshot_valid(snapshot_locked)
|
|
|
+ );
|
|
|
assign frame_tx_payload_data = (tx_frame_type == `FB_RSP_ACK_NACK) ?
|
|
|
ack_payload_data : snapshot_payload_data;
|
|
|
frame_tx #(.PAYLOAD_IDX_BITS(8), .EXTERNAL_CRC(1), .PAYLOAD_READ_LATENCY(1)) u_frame_tx (
|
|
|
@@ -287,8 +334,10 @@ module prod2u_6400_v1_top #(
|
|
|
|
|
|
thermal_control_core #(.FAN_SAFE_DUTY(FAN_STANDBY_DUTY)) u_control (
|
|
|
.clk(sys_clk), .rst_n(rst_n), .tick_1s(tick_1s),
|
|
|
- .manual_wr_en(manual_wr_en), .manual_wr_addr(manual_wr_addr),
|
|
|
- .manual_wr_data(manual_wr_data), .manual_commit(manual_commit),
|
|
|
+ .manual_wr_en(manual_wr_en | i2c_manual_wr_en),
|
|
|
+ .manual_wr_addr(i2c_manual_wr_en ? i2c_manual_wr_addr : manual_wr_addr),
|
|
|
+ .manual_wr_data(i2c_manual_wr_en ? i2c_manual_wr_data : manual_wr_data),
|
|
|
+ .manual_commit(manual_commit | i2c_manual_commit),
|
|
|
.manual_commit_done(manual_commit_done), .manual_commit_ok(manual_commit_ok),
|
|
|
.bmc_epoch(bmc_epoch), .bmc_stale(bmc_stale), .bmc_valid_mask(bmc_valid_mask),
|
|
|
.bmc_rd_index(bmc_control_index), .bmc_rd_raw(bmc_control_raw),
|
|
|
@@ -343,7 +392,8 @@ module prod2u_6400_v1_top #(
|
|
|
bmc_poll_count, bmc_snapshot_commit, ct_snapshot_commit, ct_i2c_busy, ct_control_raw,
|
|
|
ct_control_valid, bmc_snapshot_valid, ct_snapshot_valid, output_commit,
|
|
|
pwm_boundary, pwm_boundary_advance, pwm_phase, pwm_scan_idle, host_crc_request_conflict,
|
|
|
- boot_init_complete, watchdog_active, watchdog_remaining, manual_mode, hard_protect};
|
|
|
+ boot_init_complete, watchdog_active, watchdog_remaining, manual_mode, hard_protect,
|
|
|
+ i2c_response_valid, i2c_response_ok, i2c_response_status};
|
|
|
|
|
|
`ifdef FORMAL
|
|
|
always @(posedge sys_clk) begin
|