[U-Boot] [PATCH 03/11] dm: spi: Correct status register access width
Bin Meng
bmeng.cn at gmail.com
Mon Jun 8 03:41:46 CEST 2015
Hi Simon,
On Sun, Jun 7, 2015 at 10:50 PM, Simon Glass <sjg at chromium.org> wrote:
> The status register is a single byte, so use byte access when writing to it,
> to avoid updating the control register also.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> drivers/spi/ich.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
> index 6b6cfbf..a8b4d0d 100644
> --- a/drivers/spi/ich.c
> +++ b/drivers/spi/ich.c
> @@ -477,7 +477,7 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen,
> if (ret < 0)
> return ret;
>
> - ich_writew(ctlr, SPIS_CDS | SPIS_FCERR, ctlr->status);
> + ich_writeb(ctlr, SPIS_CDS | SPIS_FCERR, ctlr->status);
But for ICH7 the status is 16-bit. Please handle both cases.
>
> spi_setup_type(trans, using_cmd ? bytes : 0);
> opcode_index = spi_setup_opcode(ctlr, trans);
> --
Regards,
Bin
More information about the U-Boot
mailing list