[PATCH] x86: spi: Only use the fast SPI peripheral when support

Bin Meng bmeng.cn at gmail.com
Wed Mar 25 08:25:07 CET 2020


Hi Simon,

On Tue, Mar 24, 2020 at 9:45 PM Simon Glass <sjg at chromium.org> wrote:
>
> At present we query the memory map on boards which don't support it. Fix
> this by only doing it on Apollo Lake.
>

I wonder isn't this check already covered in mrccache_get_region() below:

ret = dm_spi_get_mmap(dev, &map_base, &map_size, &offset);
if (!ret) {
entry->base = map_base;
} else {
ret = dev_read_u32_array(dev, "memory-map", reg, 2);
if (ret)
return log_msg_ret("Cannot find memory map\n", ret);
entry->base = reg[0];
}

> This fixes booting on chromebook_link.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Fixes: 92842147c31 ("spi: ich: Add support for get_mmap() method")
> ---
>
>  drivers/spi/ich.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
> index a9d7715a55..9f8af45242 100644
> --- a/drivers/spi/ich.c
> +++ b/drivers/spi/ich.c
> @@ -637,7 +637,10 @@ static int ich_get_mmap(struct udevice *dev, ulong *map_basep, uint *map_sizep,
>                         uint *offsetp)
>  {
>         struct udevice *bus = dev_get_parent(dev);
> +       struct ich_spi_platdata *plat = dev_get_platdata(bus);
>
> +       if (plat->ich_version != ICHV_APL)
> +               return -ENOENT;
>         return ich_get_mmap_bus(bus, map_basep, map_sizep, offsetp);
>  }

Regards,
Bin


More information about the U-Boot mailing list