[PATCH] x86: spi: Only use the fast SPI peripheral when support
Bin Meng
bmeng.cn at gmail.com
Thu Apr 23 09:36:46 CEST 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.
>
> 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);
> }
Although the check added here is correct, it is still an incomplete fix.
I don't understand why chromebook_link boot failure is caused by this
because as I mentioned before in mrccache_get_region() the call to
uclass_find_first_device(UCLASS_SPI_FLASH, &dev) already returns hence
there is no chance to execute dm_spi_get_mmap() on link.
Regards,
Bin
More information about the U-Boot
mailing list