As a demonstration of how to use SCSI with driver model, move link over
to use this. This patch needs more work, but illustrates the concept.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
#include <dm.h>
#include <fdtdec.h>
#include <asm/io.h>
#include <dm.h>
#include <fdtdec.h>
#include <asm/io.h>
dm_pci_write_config16(dev, 0x90, map);
}
dm_pci_write_config16(dev, 0x90, map);
}
+static int bd82x6x_sata_bind(struct udevice *dev)
+{
+ struct udevice *scsi_dev;
+ int ret;
+
+ if (gd->flags & GD_FLG_RELOC) {
+ ret = ahci_bind_scsi(dev, &scsi_dev);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
static int bd82x6x_sata_probe(struct udevice *dev)
{
struct udevice *pch;
static int bd82x6x_sata_probe(struct udevice *dev)
{
struct udevice *pch;
if (!(gd->flags & GD_FLG_RELOC))
bd82x6x_sata_enable(dev);
if (!(gd->flags & GD_FLG_RELOC))
bd82x6x_sata_enable(dev);
bd82x6x_sata_init(dev, pch);
bd82x6x_sata_init(dev, pch);
+ ret = ahci_probe_scsi(dev);
+ if (ret)
+ return ret;
+ }
.name = "ahci_ivybridge",
.id = UCLASS_AHCI,
.of_match = bd82x6x_ahci_ids,
.name = "ahci_ivybridge",
.id = UCLASS_AHCI,
.of_match = bd82x6x_ahci_ids,
+ .bind = bd82x6x_sata_bind,
.probe = bd82x6x_sata_probe,
};
.probe = bd82x6x_sata_probe,
};
CONFIG_SYSCON=y
CONFIG_SPL_SYSCON=y
CONFIG_SCSI=y
CONFIG_SYSCON=y
CONFIG_SPL_SYSCON=y
CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_BLK=y
CONFIG_CPU=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_INTEL=y
CONFIG_CPU=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_INTEL=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_SCSI=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_BLK=y
CONFIG_CPU=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_INTEL=y
CONFIG_CPU=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_INTEL=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_SCSI=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_BLK=y
CONFIG_CROS_EC=y
CONFIG_CROS_EC_LPC=y
CONFIG_SPI_FLASH=y
CONFIG_CROS_EC=y
CONFIG_CROS_EC_LPC=y
CONFIG_SPI_FLASH=y