Fix HIOMAP write data corruption in direct mode

parent 2e74b064
......@@ -549,7 +549,7 @@ void lpc_slave_isr(void)
{
if (hiomap_config.window_type == HIOMAP_WINDOW_TYPE_WRITE)
{
active_host_flash_buffer = hiomap_write_buffer;
active_host_flash_buffer = hiomap_write_buffer + (physical_flash_address - hiomap_config.window_start_address);
}
else
{
......@@ -1570,6 +1570,7 @@ static int process_host_to_bmc_ipmi_bt_transactions(void)
dword &= ~((1 & AQUILA_LPC_CTL_EN_FW_DMA_R_MASK) << AQUILA_LPC_CTL_EN_FW_DMA_R_SHIFT);
dword &= ~((1 & AQUILA_LPC_CTL_EN_FW_DMA_W_MASK) << AQUILA_LPC_CTL_EN_FW_DMA_W_SHIFT);
write_aquila_register(HOSTLPCSLAVE_BASE, AQUILA_LPC_REG_DMA_CONFIG1, dword);
#endif
// Set up any required buffers while DMA engine is disabled
if ((hiomap_use_direct_access) && (hiomap_config.window_type == HIOMAP_WINDOW_TYPE_WRITE))
......@@ -1583,6 +1584,7 @@ static int process_host_to_bmc_ipmi_bt_transactions(void)
memcpy32((uint32_t *)hiomap_write_buffer, (uint32_t *)(uintptr_t)(HOSTSPIFLASH_BASE + hiomap_config.window_start_address), (hiomap_config.window_length_bytes / 4));
}
#if (ENABLE_LPC_FW_CYCLE_DMA)
// Reconfigure LPC firmware cycle DMA ranges
if ((hiomap_use_direct_access) && (hiomap_config.window_type == HIOMAP_WINDOW_TYPE_WRITE))
{
......@@ -2577,7 +2579,7 @@ static int host_background_service_task_event_loop(void)
{
if (hiomap_config.window_type == HIOMAP_WINDOW_TYPE_WRITE)
{
active_host_flash_buffer = hiomap_write_buffer;
active_host_flash_buffer = hiomap_write_buffer + (physical_flash_address - hiomap_config.window_start_address);
}
else
{
......
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