Skip to content
Snippets Groups Projects
Commit 32e9ec1f authored by Simon Glass's avatar Simon Glass
Browse files

x86: Move link to use driver model for SCSI


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: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent 7337fcd8
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <common.h> #include <common.h>
#include <ahci.h>
#include <dm.h> #include <dm.h>
#include <fdtdec.h> #include <fdtdec.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -208,6 +209,20 @@ static void bd82x6x_sata_enable(struct udevice *dev) ...@@ -208,6 +209,20 @@ static void bd82x6x_sata_enable(struct udevice *dev)
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) static int bd82x6x_sata_probe(struct udevice *dev)
{ {
struct udevice *pch; struct udevice *pch;
...@@ -219,8 +234,12 @@ static int bd82x6x_sata_probe(struct udevice *dev) ...@@ -219,8 +234,12 @@ static int bd82x6x_sata_probe(struct udevice *dev)
if (!(gd->flags & GD_FLG_RELOC)) if (!(gd->flags & GD_FLG_RELOC))
bd82x6x_sata_enable(dev); bd82x6x_sata_enable(dev);
else else {
bd82x6x_sata_init(dev, pch); bd82x6x_sata_init(dev, pch);
ret = ahci_probe_scsi(dev);
if (ret)
return ret;
}
return 0; return 0;
} }
...@@ -234,5 +253,6 @@ U_BOOT_DRIVER(ahci_ivybridge_drv) = { ...@@ -234,5 +253,6 @@ U_BOOT_DRIVER(ahci_ivybridge_drv) = {
.name = "ahci_ivybridge", .name = "ahci_ivybridge",
.id = UCLASS_AHCI, .id = UCLASS_AHCI,
.of_match = bd82x6x_ahci_ids, .of_match = bd82x6x_ahci_ids,
.bind = bd82x6x_sata_bind,
.probe = bd82x6x_sata_probe, .probe = bd82x6x_sata_probe,
}; };
...@@ -58,6 +58,8 @@ CONFIG_SPL_REGMAP=y ...@@ -58,6 +58,8 @@ CONFIG_SPL_REGMAP=y
CONFIG_SYSCON=y CONFIG_SYSCON=y
CONFIG_SPL_SYSCON=y CONFIG_SPL_SYSCON=y
CONFIG_SCSI=y CONFIG_SCSI=y
CONFIG_DM_SCSI=y
CONFIG_BLK=y
CONFIG_CPU=y CONFIG_CPU=y
CONFIG_DM_I2C=y CONFIG_DM_I2C=y
CONFIG_SYS_I2C_INTEL=y CONFIG_SYS_I2C_INTEL=y
......
...@@ -41,6 +41,8 @@ CONFIG_OF_CONTROL=y ...@@ -41,6 +41,8 @@ CONFIG_OF_CONTROL=y
CONFIG_REGMAP=y CONFIG_REGMAP=y
CONFIG_SYSCON=y CONFIG_SYSCON=y
CONFIG_SCSI=y CONFIG_SCSI=y
CONFIG_DM_SCSI=y
CONFIG_BLK=y
CONFIG_CPU=y CONFIG_CPU=y
CONFIG_DM_I2C=y CONFIG_DM_I2C=y
CONFIG_SYS_I2C_INTEL=y CONFIG_SYS_I2C_INTEL=y
......
...@@ -37,6 +37,8 @@ CONFIG_OF_CONTROL=y ...@@ -37,6 +37,8 @@ CONFIG_OF_CONTROL=y
CONFIG_REGMAP=y CONFIG_REGMAP=y
CONFIG_SYSCON=y CONFIG_SYSCON=y
CONFIG_SCSI=y CONFIG_SCSI=y
CONFIG_DM_SCSI=y
CONFIG_BLK=y
CONFIG_CROS_EC=y CONFIG_CROS_EC=y
CONFIG_CROS_EC_LPC=y CONFIG_CROS_EC_LPC=y
CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH=y
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment