summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-09-16 17:29:40 +0300
committerTom Rini <trini@konsulko.com>2021-09-16 17:29:40 +0300
commit6674edaabfd271471608146806f5b6540bc76a1b (patch)
tree574f8b5265002ad046aa1b81725a9483feb48a8d /drivers/ata
parent4f8bf67f9c7fec8c5c1ae57c6ba24d337a19c578 (diff)
parentbb92678ced0b1594b93ab2f10b2c17750c789c96 (diff)
downloadu-boot-6674edaabfd271471608146806f5b6540bc76a1b.tar.xz
Merge tag 'v2021.10-rc4' into next
Prepare v2021.10-rc4 Signed-off-by: Tom Rini <trini@konsulko.com> # gpg: Signature made Tue 14 Sep 2021 06:58:32 PM EDT # gpg: using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C # gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate] # Conflicts: # board/Arcturus/ucp1020/spl.c # cmd/mvebu/Kconfig # common/Kconfig.boot # common/image-fit.c # configs/UCP1020_defconfig # configs/sifive_unmatched_defconfig # drivers/pci/Kconfig # include/configs/UCP1020.h # include/configs/sifive-unmatched.h # lib/Makefile # scripts/config_whitelist.txt
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ahci.c55
-rw-r--r--drivers/ata/sata_mv.c14
2 files changed, 10 insertions, 59 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index d4047c04f5..2062197afc 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -170,13 +170,8 @@ int ahci_reset(void __iomem *base)
static int ahci_host_init(struct ahci_uc_priv *uc_priv)
{
#if !defined(CONFIG_SCSI_AHCI_PLAT) && !defined(CONFIG_DM_SCSI)
-# ifdef CONFIG_DM_PCI
struct udevice *dev = uc_priv->dev;
struct pci_child_plat *pplat = dev_get_parent_plat(dev);
-# else
- pci_dev_t pdev = uc_priv->dev;
- unsigned short vendor;
-# endif
u16 tmp16;
#endif
void __iomem *mmio = uc_priv->mmio_base;
@@ -200,23 +195,12 @@ static int ahci_host_init(struct ahci_uc_priv *uc_priv)
writel_with_flush(0xf, mmio + HOST_PORTS_IMPL);
#if !defined(CONFIG_SCSI_AHCI_PLAT) && !defined(CONFIG_DM_SCSI)
-# ifdef CONFIG_DM_PCI
if (pplat->vendor == PCI_VENDOR_ID_INTEL) {
u16 tmp16;
dm_pci_read_config16(dev, 0x92, &tmp16);
dm_pci_write_config16(dev, 0x92, tmp16 | 0xf);
}
-# else
- pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor);
-
- if (vendor == PCI_VENDOR_ID_INTEL) {
- u16 tmp16;
- pci_read_config_word(pdev, 0x92, &tmp16);
- tmp16 |= 0xf;
- pci_write_config_word(pdev, 0x92, tmp16);
- }
-# endif
#endif
uc_priv->cap = readl(mmio + HOST_CAP);
uc_priv->port_map = readl(mmio + HOST_PORTS_IMPL);
@@ -331,15 +315,9 @@ static int ahci_host_init(struct ahci_uc_priv *uc_priv)
debug("HOST_CTL 0x%x\n", tmp);
#if !defined(CONFIG_DM_SCSI)
#ifndef CONFIG_SCSI_AHCI_PLAT
-# ifdef CONFIG_DM_PCI
dm_pci_read_config16(dev, PCI_COMMAND, &tmp16);
tmp |= PCI_COMMAND_MASTER;
dm_pci_write_config16(dev, PCI_COMMAND, tmp16);
-# else
- pci_read_config_word(pdev, PCI_COMMAND, &tmp16);
- tmp |= PCI_COMMAND_MASTER;
- pci_write_config_word(pdev, PCI_COMMAND, tmp16);
-# endif
#endif
#endif
return 0;
@@ -349,11 +327,7 @@ static int ahci_host_init(struct ahci_uc_priv *uc_priv)
static void ahci_print_info(struct ahci_uc_priv *uc_priv)
{
#if !defined(CONFIG_SCSI_AHCI_PLAT) && !defined(CONFIG_DM_SCSI)
-# if defined(CONFIG_DM_PCI)
struct udevice *dev = uc_priv->dev;
-# else
- pci_dev_t pdev = uc_priv->dev;
-# endif
u16 cc;
#endif
void __iomem *mmio = uc_priv->mmio_base;
@@ -379,11 +353,7 @@ static void ahci_print_info(struct ahci_uc_priv *uc_priv)
#if defined(CONFIG_SCSI_AHCI_PLAT) || defined(CONFIG_DM_SCSI)
scc_s = "SATA";
#else
-# ifdef CONFIG_DM_PCI
dm_pci_read_config16(dev, 0x0a, &cc);
-# else
- pci_read_config_word(pdev, 0x0a, &cc);
-# endif
if (cc == 0x0101)
scc_s = "IDE";
else if (cc == 0x0106)
@@ -428,11 +398,7 @@ static void ahci_print_info(struct ahci_uc_priv *uc_priv)
}
#if defined(CONFIG_DM_SCSI) || !defined(CONFIG_SCSI_AHCI_PLAT)
-# if defined(CONFIG_DM_PCI) || defined(CONFIG_DM_SCSI)
static int ahci_init_one(struct ahci_uc_priv *uc_priv, struct udevice *dev)
-# else
-static int ahci_init_one(struct ahci_uc_priv *uc_priv, pci_dev_t dev)
-# endif
{
#if !defined(CONFIG_DM_SCSI)
u16 vendor;
@@ -450,7 +416,6 @@ static int ahci_init_one(struct ahci_uc_priv *uc_priv, pci_dev_t dev)
uc_priv->udma_mask = 0x7f; /*Fixme,assume to support UDMA6 */
#if !defined(CONFIG_DM_SCSI)
-#ifdef CONFIG_DM_PCI
uc_priv->mmio_base = dm_pci_map_bar(dev, PCI_BASE_ADDRESS_5,
PCI_REGION_MEM);
@@ -462,18 +427,6 @@ static int ahci_init_one(struct ahci_uc_priv *uc_priv, pci_dev_t dev)
if (vendor == 0x197b)
dm_pci_write_config8(dev, 0x41, 0xa1);
#else
- uc_priv->mmio_base = pci_map_bar(dev, PCI_BASE_ADDRESS_5,
- PCI_REGION_MEM);
-
- /* Take from kernel:
- * JMicron-specific fixup:
- * make sure we're in AHCI mode
- */
- pci_read_config_word(dev, PCI_VENDOR_ID, &vendor);
- if (vendor == 0x197b)
- pci_write_config_byte(dev, 0x41, 0xa1);
-#endif
-#else
struct scsi_plat *plat = dev_get_uclass_plat(dev);
uc_priv->mmio_base = (void *)plat->base;
#endif
@@ -1006,7 +959,6 @@ void scsi_low_level_init(int busdevfunc)
return;
}
uc_priv = probe_ent;
-# if defined(CONFIG_DM_PCI)
struct udevice *dev;
int ret;
@@ -1014,9 +966,6 @@ void scsi_low_level_init(int busdevfunc)
if (ret)
return;
ahci_init_one(uc_priv, dev);
-# else
- ahci_init_one(uc_priv, busdevfunc);
-# endif
#else
uc_priv = probe_ent;
#endif
@@ -1026,7 +975,6 @@ void scsi_low_level_init(int busdevfunc)
#endif
#ifndef CONFIG_SCSI_AHCI_PLAT
-# if defined(CONFIG_DM_PCI) || defined(CONFIG_DM_SCSI)
int ahci_init_one_dm(struct udevice *dev)
{
struct ahci_uc_priv *uc_priv = dev_get_uclass_priv(dev);
@@ -1034,7 +982,6 @@ int ahci_init_one_dm(struct udevice *dev)
return ahci_init_one(uc_priv, dev);
}
#endif
-#endif
int ahci_start_ports_dm(struct udevice *dev)
{
@@ -1196,7 +1143,6 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
return 0;
}
-#ifdef CONFIG_DM_PCI
int ahci_probe_scsi_pci(struct udevice *ahci_dev)
{
ulong base;
@@ -1221,7 +1167,6 @@ int ahci_probe_scsi_pci(struct udevice *ahci_dev)
PCI_REGION_MEM);
return ahci_probe_scsi(ahci_dev, base);
}
-#endif
struct scsi_ops scsi_ops = {
.exec = ahci_scsi_exec,
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index dadb2c7c2e..003222d47b 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1068,6 +1068,7 @@ static int sata_mv_probe(struct udevice *dev)
int nr_ports;
int ret;
int i;
+ int status = -ENODEV; /* If the probe fails to detected any SATA port */
/* Get number of ports of this SATA controller */
nr_ports = min(fdtdec_get_int(blob, node, "nr-ports", -1),
@@ -1078,7 +1079,7 @@ static int sata_mv_probe(struct udevice *dev)
IF_TYPE_SATA, -1, 512, 0, &blk);
if (ret) {
debug("Can't create device\n");
- return ret;
+ continue;
}
priv = dev_get_plat(blk);
@@ -1088,18 +1089,23 @@ static int sata_mv_probe(struct udevice *dev)
ret = sata_mv_init_sata(blk, i);
if (ret) {
debug("%s: Failed to init bus\n", __func__);
- return ret;
+ continue;
}
/* Scan SATA port */
ret = sata_mv_scan_sata(blk, i);
if (ret) {
debug("%s: Failed to scan bus\n", __func__);
- return ret;
+ continue;
}
+
+ /* If we got here, the current SATA port was probed
+ * successfully, so set the probe status to successful.
+ */
+ status = 0;
}
- return 0;
+ return status;
}
static int sata_mv_scan(struct udevice *dev)