[U-Boot] [PATCH 04/11] dm: spi: Correct BIOS protection logic for ICH9

Bin Meng bmeng.cn at gmail.com
Mon Jun 8 03:55:10 CEST 2015


On Sun, Jun 7, 2015 at 10:50 PM, Simon Glass <sjg at chromium.org> wrote:
> The logic is incorrect and currently has no effect. Fix it so that we can
> write to SPI flash, since by default it is write-protected.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  drivers/spi/ich.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
> index a8b4d0d..784320f 100644
> --- a/drivers/spi/ich.c
> +++ b/drivers/spi/ich.c
> @@ -687,10 +687,10 @@ static int ich_spi_probe(struct udevice *bus)
>                 struct ich9_spi_regs *ich9_spi;
>
>                 ich9_spi = priv->base;
> -               bios_cntl = ich_readb(priv, ich9_spi->bcr);
> +               bios_cntl = readb(&ich9_spi->bcr);
>                 bios_cntl &= ~(1 << 5); /* clear Enable InSMM_STS (EISS) */
>                 bios_cntl |= 1;         /* Write Protect Disable (WPD) */
> -               ich_writeb(priv, bios_cntl, ich9_spi->bcr);
> +               writeb(bios_cntl, &ich9_spi->bcr);
>         } else {
>                 pci_read_config_byte(plat->dev, 0xdc, &bios_cntl);
>                 if (plat->ich_version == 9)
> --

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list