mirror of
https://github.com/xboot/xfel.git
synced 2024-11-30 13:13:37 +08:00
[f1c100s]change spi xfer buffer, speed up!
This commit is contained in:
parent
e056815773
commit
af00cdd8dd
@ -546,25 +546,25 @@ static int chip_spi_xfer(struct xfel_ctx_t * ctx, void * txbuf, uint32_t txlen,
|
||||
fel_write(ctx, 0x00008800, (void *)&payload[0], sizeof(payload));
|
||||
while(txlen > 0)
|
||||
{
|
||||
n = txlen > 256 ? 256 : txlen;
|
||||
param[0] = cpu_to_le32(ctx->version.scratchpad);
|
||||
n = txlen > 4096 ? 4096 : txlen;
|
||||
param[0] = cpu_to_le32(0x00009800);
|
||||
param[1] = 0;
|
||||
param[2] = n;
|
||||
fel_write(ctx, 0x00008800 + 0x4, (void *)¶m, sizeof(param));
|
||||
fel_write(ctx, ctx->version.scratchpad, txbuf, n);
|
||||
fel_write(ctx, 0x00009800, txbuf, n);
|
||||
fel_exec(ctx, 0x00008800);
|
||||
txbuf += n;
|
||||
txlen -= n;
|
||||
}
|
||||
while(rxlen > 0)
|
||||
{
|
||||
n = rxlen > 256 ? 256 : rxlen;
|
||||
n = rxlen > 4096 ? 4096 : rxlen;
|
||||
param[0] = 0;
|
||||
param[1] = cpu_to_le32(ctx->version.scratchpad);
|
||||
param[1] = cpu_to_le32(0x00009800);
|
||||
param[2] = n;
|
||||
fel_write(ctx, 0x00008800 + 0x4, (void *)¶m, sizeof(param));
|
||||
fel_exec(ctx, 0x00008800);
|
||||
fel_read(ctx, ctx->version.scratchpad, rxbuf, n);
|
||||
fel_read(ctx, 0x00009800, rxbuf, n);
|
||||
rxbuf += n;
|
||||
rxlen -= n;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user