diff mbox

[U-Boot,2/7] scsi: add children devices binding

Message ID 1490261347-11896-3-git-send-email-make@marvell.com
State Deferred
Delegated to: Simon Glass
Headers show

Commit Message

Ken Ma March 23, 2017, 9:29 a.m. UTC
From: Ken Ma <make@marvell.com>

- When scsi controller acts as a bus, we need to bind its children
  scsi devices(scsi hdd, cd, dvd, scanner) to their drivers as spi
  controller binds spi flashes, so scsi-uclass's post bind function
  calls dm_scan_fdt_dev() to bind scsi subnode devices;
- When scsi controller is a Serial Attached SCSI, it can also work as
  a pure controller as an on-board component on the motherboard, it may
  has no subnodes in fdt, then dm_scan_fdt_dev() does nothing and has
  no effect.

Signed-off-by: Ken Ma <make@marvell.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/35425
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Omri Itach <omrii@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
---
 drivers/block/scsi-uclass.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Simon Glass April 1, 2017, 4:21 a.m. UTC | #1
On 23 March 2017 at 03:29,  <make@marvell.com> wrote:
> From: Ken Ma <make@marvell.com>
>
> - When scsi controller acts as a bus, we need to bind its children
>   scsi devices(scsi hdd, cd, dvd, scanner) to their drivers as spi
>   controller binds spi flashes, so scsi-uclass's post bind function
>   calls dm_scan_fdt_dev() to bind scsi subnode devices;
> - When scsi controller is a Serial Attached SCSI, it can also work as
>   a pure controller as an on-board component on the motherboard, it may
>   has no subnodes in fdt, then dm_scan_fdt_dev() does nothing and has
>   no effect.
>
> Signed-off-by: Ken Ma <make@marvell.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/35425
> Tested-by: iSoC Platform CI <ykjenk@marvell.com>
> Reviewed-by: Omri Itach <omrii@marvell.com>
> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
> ---
>  drivers/block/scsi-uclass.c | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/drivers/block/scsi-uclass.c b/drivers/block/scsi-uclass.c
index 3bf026b..86eddfc 100644
--- a/drivers/block/scsi-uclass.c
+++ b/drivers/block/scsi-uclass.c
@@ -45,6 +45,9 @@  static int scsi_post_bind(struct udevice *dev)
 {
 	/* Get uclass plat data from fdt */
 	scsi_ofdata_to_uclass_platdata(dev);
+
+	/* bind subnode devices */
+	return dm_scan_fdt_dev(dev);
 }
 
 UCLASS_DRIVER(scsi) = {