[RFC PATCH] mtd: spi: Drop redundent SPI flash driver

Simon Glass sjg at chromium.org
Mon May 25 19:04:01 CEST 2020


Hi Jagan,

On Thu, 14 May 2020 at 07:19, Jagan Teki <jagan at amarulasolutions.com> wrote:
>
> UCLASS_SPI_FLASH driver at driver/mtd/spi is a generic
> spi flash driver to probe jedec,spi-nor flash chips.
>
> Technically a probe call in U_BOOT_DRIVER is local to that
> driver and not applicable to use it another driver or in
> another code.
>
> The apollolake SPL code using the generic probe by adding
> extra SPI flash driver, which make more confusion in terms
> of code readability and driver model structure.
>
> The fact that apollolake SPL requires a separate SPI flash
> driver to handle of-platdata via bind call, so move the
> bind call in the generic flash driver and drop the driver
> from apollolake code.
>
> I hope this wouldn't break generic code usage flash chips
> otherwise, we can handle this via driver data or a separate
> spi driver in drivers/mtd/spi.
>
> Cc: Bin Meng <bmeng.cn at gmail.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Vignesh R <vigneshr at ti.com>
> Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> ---
>  arch/x86/cpu/apollolake/spl.c | 60 -----------------------------------
>  drivers/mtd/spi/sf_probe.c    | 29 ++++++++++++++++-
>  include/spi_flash.h           | 12 -------
>  3 files changed, 28 insertions(+), 73 deletions(-)

Unfortunately this stops TPL from booting.

Could you expose the 'read' method properly, perhaps?

Regards,
Simon


More information about the U-Boot mailing list