/* * Samples are documented to be available every 0.667us, so in theory * the 4 sample deep FIFO should take 2.668us to fill. However, during * thorough testing, it became apparent that filling the FIFO actually * takes closer to 12us. We then multiply by 2 in order to account for * the lack of udelay()'s reliability, suggested by Russell King.
*/ #define ST_RNG_FILL_FIFO_TIMEOUT (12 * 2)
/* Wait until FIFO is full - max 4uS*/ for (i = 0; i < ST_RNG_FILL_FIFO_TIMEOUT; i++) {
status = readl_relaxed(ddata->base + ST_RNG_STATUS_REG); if (status & ST_RNG_STATUS_FIFO_FULL) break;
udelay(1);
}
if (i == ST_RNG_FILL_FIFO_TIMEOUT) return 0;
for (i = 0; i < ST_RNG_FIFO_SIZE && i < max; i += 2)
*(u16 *)(data + i) =
readl_relaxed(ddata->base + ST_RNG_DATA_REG);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.