Commit ab3bb080 authored by Evan Lojewski's avatar Evan Lojewski Committed by Raptor Engineering Development Team

fsi: Fix a race condition resulting in some FSI accesses being lost.

Previously, back to back FSI transactions could happen before teh FSI state machine was complete.
This ensures that the FSI master does not ahve an active transaction before starting a new one.

This could result in logs such as:
access_fsi_mem(): address 0x002820, data: 0x00000000 sta: 0x41000001
access_fsi_mem(): address 0x002804, data: 0x00000000 sta: 0x12000000
vs
access_fsi_mem(): address 0x002820, data: 0x00000000 sta: 0x41000001
access_fsi_mem(): address 0x002804, data: 0x04c04000 sta: 0x41000001

As a result, the CPU often failed to start.
parent b919089f
......@@ -61,6 +61,11 @@ static int access_fsi_mem(uint8_t slave_id, uint32_t address, fsi_data_length_t
return -1;
}
// Wait for any running operation(s) to complete
while ((read_openfsi_register(OPENFSIMASTER_BASE, FSI_MASTER_REG_STATUS) & (FSI_MASTER_CTL_CYCLE_START_MASK << FSI_MASTER_CTL_CYCLE_START_SHIFT)))
{
}
// Set up request
word = read_openfsi_register(OPENFSIMASTER_BASE, FSI_MASTER_REG_SID_ADR);
word &= ~(FSI_MASTER_SID_SLAVE_ID_MASK << FSI_MASTER_SID_SLAVE_ID_SHIFT);
......
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