RE: [v4 1/4] Revert "ata: fsl_ahci: Add sata DM support for Freescale powerpc socs"

2020-02-25 Thread Priyanka Jain
>-Original Message-
>From: Peng Ma 
>Sent: Monday, December 23, 2019 2:58 PM
>To: s...@chromium.org; Priyanka Jain ; Marcel Ziswiler
>; Andy Tang 
>Cc: u-boot@lists.denx.de; Peng Ma 
>Subject: [v4 1/4] Revert "ata: fsl_ahci: Add sata DM support for Freescale
>powerpc socs"
>
>This reverts commit 1ee494291880fd51ef0c5f7342e072bdb069d7ff.
>
>Commit 1ee494291880 ("ata: fsl_ahci: Add sata DM support for Freescale
>powerpc socs") introduced SCSI layer to call AHCI private API in order to 
>support
>sata operations, In DM mode, This is not necessary for non-AHCI sata. So revert
>it and have already updated the driver itself to operate sata directly.
>
>Reviewed-by: Stefan Roese 
>Signed-off-by: Peng Ma 
>---
Series applied on u-boot-mpc85xx. Awaiting upstream.

Thanks
Priyanka


[v4 1/4] Revert "ata: fsl_ahci: Add sata DM support for Freescale powerpc socs"

2019-12-23 Thread Peng Ma
This reverts commit 1ee494291880fd51ef0c5f7342e072bdb069d7ff.

Commit 1ee494291880 ("ata: fsl_ahci: Add sata DM support for Freescale
powerpc socs") introduced SCSI layer to call AHCI private API in order
to support sata operations, In DM mode, This is not necessary for
non-AHCI sata. So revert it and have already updated the driver itself
to operate sata directly.

Reviewed-by: Stefan Roese 
Signed-off-by: Peng Ma 
---
Changed for v4
- merge patch1 and patch5 to patch1

 drivers/ata/Kconfig|   10 -
 drivers/ata/Makefile   |1 -
 drivers/ata/fsl_ahci.c | 1031 
 3 files changed, 1042 deletions(-)
 delete mode 100644 drivers/ata/fsl_ahci.c

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index fe589d3aa8..d8c9756c2a 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -59,16 +59,6 @@ config DWC_AHCI
  Enable this driver to support Sata devices through
  Synopsys DWC AHCI module.
 
-config FSL_AHCI
-   bool "Enable Freescale AHCI driver support"
-   select SCSI_AHCI
-   depends on AHCI
-   depends on DM_SCSI
-   help
- Enable this driver to support Sata devices found in
- some Freescale PowerPC SoCs.
-
-
 config DWC_AHSATA
bool "Enable DWC AHSATA driver support"
select LIBATA
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index 6e03384f81..a69edb10f7 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -4,7 +4,6 @@
 # Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 
 obj-$(CONFIG_DWC_AHCI) += dwc_ahci.o
-obj-$(CONFIG_FSL_AHCI) += fsl_ahci.o
 obj-$(CONFIG_AHCI) += ahci-uclass.o
 obj-$(CONFIG_AHCI_PCI) += ahci-pci.o
 obj-$(CONFIG_SCSI_AHCI) += ahci.o
diff --git a/drivers/ata/fsl_ahci.c b/drivers/ata/fsl_ahci.c
deleted file mode 100644
index 4ccfe23593..00
--- a/drivers/ata/fsl_ahci.c
+++ /dev/null
@@ -1,1031 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * NXP PPC SATA platform driver
- *
- * (C) Copyright 2019 NXP, Inc.
- *
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "fsl_sata.h"
-
-struct fsl_ahci_priv {
-   u32 base;
-   u32 flag;
-   u32 number;
-   fsl_sata_t *fsl_sata;
-};
-
-static int fsl_ahci_bind(struct udevice *dev)
-{
-   return device_bind_driver(dev, "fsl_ahci_scsi", "fsl_ahci_scsi", NULL);
-}
-
-static int fsl_ahci_ofdata_to_platdata(struct udevice *dev)
-{
-   struct fsl_ahci_priv *priv = dev_get_priv(dev);
-
-   priv->number = dev_read_u32_default(dev, "sata-number", -1);
-   priv->flag = dev_read_u32_default(dev, "sata-fpdma", -1);
-
-   priv->base = dev_read_addr(dev);
-   if (priv->base == FDT_ADDR_T_NONE)
-   return -EINVAL;
-
-   return 0;
-}
-
-static int ata_wait_register(unsigned __iomem *addr, u32 mask,
-u32 val, u32 timeout_msec)
-{
-   int i;
-
-   for (i = 0; ((in_le32(addr) & mask) != val) && i < timeout_msec; i++)
-   mdelay(1);
-
-   return (i < timeout_msec) ? 0 : -1;
-}
-
-static void fsl_sata_dump_sfis(struct sata_fis_d2h *s)
-{
-   printf("Status FIS dump:\n\r");
-   printf("fis_type:   %02x\n\r", s->fis_type);
-   printf("pm_port_i:  %02x\n\r", s->pm_port_i);
-   printf("status: %02x\n\r", s->status);
-   printf("error:  %02x\n\r", s->error);
-   printf("lba_low:%02x\n\r", s->lba_low);
-   printf("lba_mid:%02x\n\r", s->lba_mid);
-   printf("lba_high:   %02x\n\r", s->lba_high);
-   printf("device: %02x\n\r", s->device);
-   printf("lba_low_exp:%02x\n\r", s->lba_low_exp);
-   printf("lba_mid_exp:%02x\n\r", s->lba_mid_exp);
-   printf("lba_high_exp:   %02x\n\r", s->lba_high_exp);
-   printf("res1:   %02x\n\r", s->res1);
-   printf("sector_count:   %02x\n\r", s->sector_count);
-   printf("sector_count_exp:   %02x\n\r", s->sector_count_exp);
-}
-
-static void fsl_sata_dump_regs(fsl_sata_reg_t __iomem *reg)
-{
-   printf("\n\rSATA:   %08x\n\r", (u32)reg);
-   printf("CQR:%08x\n\r", in_le32(>cqr));
-   printf("CAR:%08x\n\r", in_le32(>car));
-   printf("CCR:%08x\n\r", in_le32(>ccr));
-   printf("CER:%08x\n\r", in_le32(>cer));
-   printf("CQR:%08x\n\r", in_le32(>cqr));
-   printf("DER:%08x\n\r", in_le32(>der));
-   printf("CHBA:   %08x\n\r", in_le32(>chba));
-   printf("HStatus:%08x\n\r", in_le32(>hstatus));
-   printf("HControl:   %08x\n\r", in_le32(>hcontrol));
-   printf("CQPMP:  %08x\n\r", in_le32(>cqpmp));
-   printf("SIG:%08x\n\r", in_le32(>sig));
-   printf("ICC:%08x\n\r",