SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
LSC operates on a single frame or continuously, depending on the firmware programming.
Upon power-on reset (POR), the 2D-LSC module is disabled and input pixels are copied to the output, thus bypassing any shading operation.
When enabling or disabling the 2D-LSC, caution must be taken on the timing of register modifications. To avoid causing a prefetch error or other unexpected behavior, the following safeguards must be implemented:
If the ENABLE bit is disabled before the ISIF_2DLSCIRQST[3] SOF status flag is set, the ISIF_2DLSCIRQST[1] PREFETCH_ERROR flag is set and the state of the 2D-LSC module may lead to unexpected errors. Therefore, the ENABLE bit must not be disabled until after the ISIF_2DLSCIRQST[3] SOF status flag is set.
To provide a mechanism for firmware to recover from the LSC module waiting indefinitely for the input image, if the LSC_ENABLE bit is set to 0 after it has started gain/offset map prefetching, but before the LSC gets to the next active region, the LSC operation is aborted and turned idle, and any prefetched gain/offset entries are discarded. This can happen before or after the next start-of-frame.
Therefore, because of the constraints set in point 3, the ENABLE bit must be disabled only after the ISIF_2DLSCIRQST[3] SOF status flag is set and before the ISIF_2DLSCIRQST[0] DONE status flag is set for that same frame.
It is suggested that when the 2D-LSC or the whole ISIF must be disabled for switching modes, the ISIF_2DLSCIRQST[3] SOF interrupt be enabled so that software knows when it is safe to disable the 2D-LSC. Then the ISIF can be disabled after the ISIF_2DLSCIRQST[0] DONE status signal is set for that frame.
The LSC_ENABLE bit, once set to 1, must not be cleared until at least one vpi_clk clock cycle after start-of-frame, to ensure correct processing.