[U-Boot] [PATCH v4 20/29] dm: Convert spi_flash_probe() and 'sf probe' to use driver model
Simon Glass
sjg at chromium.org
Thu Oct 23 05:04:38 CEST 2014
On 13 October 2014 23:42, Simon Glass <sjg at chromium.org> wrote:
> We want the SPI flash probing feature to operate as a standard driver.
> Add a driver for the basic probing feature used by most boards. This
> will be activated by device_probe() as with any other driver.
>
> The 'sf probe' command currently keeps track of the SPI slave that it
> last used. This doesn't work with driver model, since some other driver
> or system may have probed the device and have access to it too. On the
> other hand, if we try to probe a device twice the second probe is a nop
> with driver model.
>
> Fix this by searching for the matching device, removing it, and then
> probing it again. This should work as expected regardless of other device
> activity.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki at gmail.com>
> ---
>
> Changes in v4: None
> Changes in v3:
> - Add a debug() in the probe method
> - Make sure the old device is both removed and unbound in 'sf probe'
>
> Changes in v2: None
>
> common/cmd_sf.c | 25 ++++++++++++++++++
> drivers/mtd/spi/sf_probe.c | 66 ++++++++++++++++++++++++++++++++++++++++++++--
> 2 files changed, 89 insertions(+), 2 deletions(-)
>
Applied to u-boot-dm/master.
More information about the U-Boot
mailing list