[U-Boot] [PATCH v7 77/77] x86: Drop using spi_flash_dm_ops

Bin Meng bmeng.cn at gmail.com
Wed Feb 17 10:07:18 CET 2016


Hi Jagan,

On Wed, Feb 17, 2016 at 4:27 PM, Jagan Teki <jteki at openedev.com> wrote:
> spi_flash_erase_dm
> spi_flash_write_dm
>
> These spi_flash_dm_ops never no longer available on new
> spi-nor changes, so use spi_flash_erase/write ops with
> mtd uclass changes.
>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Bin Meng <bmeng.cn at gmail.com>
> Signed-off-by: Jagan Teki <jteki at openedev.com>
> ---
> Changes for v7:
>         - newly added patch
>
> This patch is on top of spi-nor core changes, will send this
> again with the series.

Yes, you need squash this patch somewhere in the middle of your whole
series, otherwise buildman will complain.

>
>  arch/x86/lib/mrccache.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/lib/mrccache.c b/arch/x86/lib/mrccache.c
> index 8c08c14..dca3d84 100644
> --- a/arch/x86/lib/mrccache.c
> +++ b/arch/x86/lib/mrccache.c
> @@ -109,6 +109,7 @@ static struct mrc_data_container *find_next_mrc_cache(struct mrc_region *entry,
>  int mrccache_update(struct udevice *sf, struct mrc_region *entry,
>                     struct mrc_data_container *cur)
>  {
> +       struct mtd_info *mtd = dev_get_uclass_priv(sf);
>         struct mrc_data_container *cache;
>         ulong offset;
>         ulong base_addr;
> @@ -139,7 +140,7 @@ int mrccache_update(struct udevice *sf, struct mrc_region *entry,
>                 debug("Erasing the MRC cache region of %x bytes at %x\n",
>                       entry->length, entry->offset);
>
> -               ret = spi_flash_erase_dm(sf, entry->offset, entry->length);
> +               ret = spi_flash_erase(mtd, entry->offset, entry->length);
>                 if (ret) {
>                         debug("Failed to erase flash region\n");
>                         return ret;
> @@ -150,8 +151,7 @@ int mrccache_update(struct udevice *sf, struct mrc_region *entry,
>         /* Write the data out */
>         offset = (ulong)cache - base_addr + entry->offset;
>         debug("Write MRC cache update to flash at %lx\n", offset);
> -       ret = spi_flash_write_dm(sf, offset, cur->data_size + sizeof(*cur),
> -                                cur);
> +       ret = spi_flash_write(mtd, offset, cur->data_size + sizeof(*cur), cur);
>         if (ret) {
>                 debug("Failed to write to SPI flash\n");
>                 return ret;
> --

I confirm this fixed the build error.

Regards,
Bin


More information about the U-Boot mailing list