X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fata%2Fdwc_ahci.c;h=029b7784f64c351f0e55682d4815e91df5c06b1a;hb=6837c58666165b7b040bf5a5b9dfebc8354f5883;hp=3f839bf9879e4ec6e7a2c7092fbb7a545f8aeb6f;hpb=f2105c61821b67bc1d572304d901518e88ee007b;p=u-boot diff --git a/drivers/ata/dwc_ahci.c b/drivers/ata/dwc_ahci.c index 3f839bf987..029b7784f6 100644 --- a/drivers/ata/dwc_ahci.c +++ b/drivers/ata/dwc_ahci.c @@ -28,7 +28,7 @@ struct dwc_ahci_priv { static int dwc_ahci_ofdata_to_platdata(struct udevice *dev) { struct dwc_ahci_priv *priv = dev_get_priv(dev); - struct scsi_platdata *plat = dev_get_platdata(dev); + struct scsi_platdata *plat = dev_get_uclass_platdata(dev); fdt_addr_t addr; plat->max_id = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), @@ -58,19 +58,19 @@ static int dwc_ahci_probe(struct udevice *dev) ret = generic_phy_get_by_name(dev, "sata-phy", &phy); if (ret) { - error("can't get the phy from DT\n"); + pr_err("can't get the phy from DT\n"); return ret; } ret = generic_phy_init(&phy); if (ret) { - error("unable to initialize the sata phy\n"); + pr_err("unable to initialize the sata phy\n"); return ret; } ret = generic_phy_power_on(&phy); if (ret) { - error("unable to power on the sata phy\n"); + pr_err("unable to power on the sata phy\n"); return ret; } @@ -81,7 +81,11 @@ static int dwc_ahci_probe(struct udevice *dev) writel(val, priv->wrapper_base + TI_SATA_SYSCONFIG); } - return ahci_init(priv->base); + ret = ahci_init_dm(dev, priv->base); + if (ret) + return ret; + + return ahci_start_ports_dm(dev); } static const struct udevice_id dwc_ahci_ids[] = { @@ -94,8 +98,8 @@ U_BOOT_DRIVER(dwc_ahci) = { .id = UCLASS_SCSI, .of_match = dwc_ahci_ids, .ofdata_to_platdata = dwc_ahci_ofdata_to_platdata, + .ops = &scsi_ops, .probe = dwc_ahci_probe, .priv_auto_alloc_size = sizeof(struct dwc_ahci_priv), - .platdata_auto_alloc_size = sizeof(struct scsi_platdata), .flags = DM_FLAG_ALLOC_PRIV_DMA, };