Add IPMI BT IRQ support

parent 54a6e9be
......@@ -74,6 +74,7 @@ module ipmi_bt_slave_interface(
reg host_to_bmc_ctl_attn_req_cont_reg = 0;
reg bmc_to_host_ctl_attn_ack_cont_reg = 0;
reg irq_ack_cont_reg = 0;
reg irq_bmc_reset_cont_reg = 0;
reg irq_req_reg = 0;
......@@ -92,6 +93,7 @@ module ipmi_bt_slave_interface(
assign host_to_bmc_ctl_attn_req_cont = host_to_bmc_ctl_attn_req_cont_reg;
assign bmc_to_host_ctl_attn_ack_cont = bmc_to_host_ctl_attn_ack_cont_reg;
assign irq_ack_cont = irq_ack_cont_reg;
assign irq_bmc_reset_cont = irq_bmc_reset_cont_reg;
assign irq_req = irq_req_reg;
......@@ -324,6 +326,7 @@ module ipmi_bt_slave_interface(
reg [1:0] hiomap_window_type = HIOMAP_WINDOW_TYPE_READ;
reg host_to_bmc_ctl_attn_req_prev = 0;
reg bmc_to_host_ctl_attn_req_prev = 0;
assign debug_port = ipmi_transfer_state;
......@@ -1902,6 +1905,26 @@ module ipmi_bt_slave_interface(
end
endcase
// IRQ handler
if (irq_ack) begin
irq_req_reg <= 0;
irq_ack_cont_reg <= 1;
end else begin
if (!irq_ack_cont_reg) begin
if (!irq_ack_cont_reg && !bmc_to_host_ctl_attn_req_prev && bmc_to_host_ctl_attn_req) begin
irq_req_reg <= 1;
end
end else begin
irq_ack_cont_reg <= 0;
end
end
if (!irq_ack_cont_reg) begin
// Wait for prior IRQ line handshake to complete before sampling the B2H_ATN line
// This ensures that the IRQ is still fired if the continue signal is asserted while
// B2H_ATN transitions from inactive to active.
bmc_to_host_ctl_attn_req_prev <= bmc_to_host_ctl_attn_req;
end
host_to_bmc_ctl_attn_req_prev <= host_to_bmc_ctl_attn_req;
end
......
......@@ -110,12 +110,14 @@ module lpc_bridge_top(
parameter DEBUG_PORT_ADDRESS_HIGH = 16'h0081;
parameter DEBUG_PORT_ADDRESS_LOW = 16'h0082;
parameter IPMI_BT_PORT_BASE_ADDRESS = 16'h00e4;
parameter IPMI_BT_IRQ = 10;
parameter HOST_UART_BASE_ADDRESS = 16'h03f8;
parameter HOST_UART_IRQ = 4;
`else
parameter DEBUG_PORT_ADDRESS_HIGH = 16'h0083;
parameter DEBUG_PORT_ADDRESS_LOW = 16'h0084;
parameter IPMI_BT_PORT_BASE_ADDRESS = 16'h00d4;
parameter IPMI_BT_IRQ = 11;
parameter HOST_UART_BASE_ADDRESS = 16'h02f8;
parameter HOST_UART_IRQ = 3;
`endif
......@@ -2207,7 +2209,8 @@ module lpc_bridge_top(
`ifdef ENABLE_SERIAL_IRQ_SUPPORT
// Handle IRQ lines
// WARNING: This works for continous mode only!
// For quiet mode, each assert / deassert needs to be specifically handled by strobing lpc_slave_irq_tx_ready on IRQ status change
// For quiet mode, each assert / deassert needs to be specifically handled by strobing ipmi_bt_irq_req / lpc_slave_irq_tx_ready on IRQ status change
lpc_slave_irq_request[IPMI_BT_IRQ] = ipmi_bt_irq_req;
lpc_slave_irq_request[HOST_UART_IRQ] = host_uart_3f8_irq;
`endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment