mirror of
https://github.com/xboot/xfel.git
synced 2024-11-23 17:53:31 +08:00
[spinor]update spinor_wait_for_busy
This commit is contained in:
parent
db2b792fbd
commit
ae33a7e188
11
spinor.c
11
spinor.c
@ -321,12 +321,13 @@ static inline void spinor_address_4byte(struct xfel_ctx_t * ctx, struct spinor_p
|
||||
|
||||
static inline void spinor_wait_for_busy(struct xfel_ctx_t * ctx, struct spinor_pdata_t * pdat)
|
||||
{
|
||||
uint8_t tx = OPCODE_RDSR;
|
||||
uint8_t rx = 0;
|
||||
uint8_t cmdbuf[4];
|
||||
|
||||
do {
|
||||
fel_spi_xfer(ctx, pdat->swapbuf, pdat->swaplen, &tx, 1, &rx, 1);
|
||||
} while((rx & 0x1) == 0x1);
|
||||
cmdbuf[0] = SPI_CMD_SELECT;
|
||||
cmdbuf[1] = SPI_CMD_SPINOR_WAIT;
|
||||
cmdbuf[2] = SPI_CMD_DESELECT;
|
||||
cmdbuf[3] = SPI_CMD_END;
|
||||
fel_chip_spi_run(ctx, cmdbuf, sizeof(cmdbuf));
|
||||
}
|
||||
|
||||
static int spinor_helper_init(struct xfel_ctx_t * ctx, struct spinor_pdata_t * pdat)
|
||||
|
Loading…
Reference in New Issue
Block a user