Skip to contentSkip to conversation

ARM: imx: cm_fx6: Drop ad-hoc SATA binding

PATCH New Marek Vasut 2 participants 3 messages May 12, 2019 – Jun 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: cm_fx6: Drop ad-hoc SATA binding

Drop the ad-hoc AHCI binding code, this is superseded by CONFIG_DWC_AHSATA_AHCI=y resp. drivers/ata/dwc_ahsata.c

Cc Christopher Spinrath <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Nikita Kiryanov <[email protected]>
Cc Stefano Babic <[email protected]>
---
 board/compulab/cm_fx6/cm_fx6.c | 63 ----------------------------------
 configs/cm_fx6_defconfig       |  1 -
 2 files changed, 64 deletions(-)
board/compulab/cm_fx6/cm_fx6.c +0 -63
index d42f57d4b7..b8f15cf3ab 100644
@@ -724,66 +724,3 @@ U_BOOT_DEVICE(cm_fx6_serial) = {
 	.name	= "serial_mxc",
 	.platdata = &cm_fx6_mxc_serial_plat,
 };
-
-#if CONFIG_IS_ENABLED(AHCI)
-static int sata_imx_probe(struct udevice *dev)
-{
-	int i, err;
-
-	/* Make sure this gpio has logical 0 value */
-	gpio_direction_output(CM_FX6_SATA_PWLOSS_INT, 0);
-	udelay(100);
-	cm_fx6_sata_power(1);
-
-	for (i = 0; i < CM_FX6_SATA_INIT_RETRIES; i++) {
-		err = setup_sata();
-		if (err) {
-			printf("SATA setup failed: %d\n", err);
-			return err;
-		}
-
-		udelay(100);
-
-		err = dwc_ahsata_probe(dev);
-		if (!err)
-			break;
-
-		/* There is no device on the SATA port */
-		if (sata_dm_port_status(0, 0) == 0)
-			break;
-
-		/* There's a device, but link not established. Retry */
-		device_remove(dev, DM_REMOVE_NORMAL);
-	}
-
-	return 0;
-}
-
-static int sata_imx_remove(struct udevice *dev)
-{
-	cm_fx6_sata_power(0);
-	mdelay(250);
-
-	return 0;
-}
-
-struct ahci_ops sata_imx_ops = {
-	.port_status = dwc_ahsata_port_status,
-	.reset	= dwc_ahsata_bus_reset,
-	.scan	= dwc_ahsata_scan,
-};
-
-static const struct udevice_id sata_imx_ids[] = {
-	{ .compatible = "fsl,imx6q-ahci" },
-	{ }
-};
-
-U_BOOT_DRIVER(sata_imx) = {
-	.name		= "dwc_ahci",
-	.id		= UCLASS_AHCI,
-	.of_match	= sata_imx_ids,
-	.ops		= &sata_imx_ops,
-	.probe		= sata_imx_probe,
-	.remove		= sata_imx_remove,  /* reset bus to stop it */
-};
-#endif /* AHCI */
configs/cm_fx6_defconfig +0 -1
index ce3f9de3f9..e928cbc948 100644
@@ -52,7 +52,6 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6q-cm-fx6"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DWC_AHSATA=y
-# CONFIG_DWC_AHSATA_AHCI is not set
 CONFIG_DM_KEYBOARD=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 ARM: imx: cm_fx6: Drop ad-hoc SATA binding

Hi Marek,

Quoted 22 lines · Marek Vasut

Drop the ad-hoc AHCI binding code, this is superseded by CONFIG_DWC_AHSATA_AHCI=y resp. drivers/ata/dwc_ahsata.c

Cc Christopher Spinrath <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Nikita Kiryanov <[email protected]>
Cc Stefano Babic <[email protected]>
---
 board/compulab/cm_fx6/cm_fx6.c | 63 ----------------------------------
 configs/cm_fx6_defconfig       |  1 -
 2 files changed, 64 deletions(-)
board/compulab/cm_fx6/cm_fx6.c +0 -0
index d42f57d4b7..b8f15cf3ab 100644
@@ -724,66 +724,3 @@ U_BOOT_DEVICE(cm_fx6_serial) = {
 	.name	= "serial_mxc",
 	.platdata = &cm_fx6_mxc_serial_plat,
 };

board/compulab/cm_fx6/cm_fx6.c U_BOOT_DEVICE(cm_fx6_serial) = { · line 736

Quoted 10 lines
board/compulab/cm_fx6/cm_fx6.c +0 -10
-
-#if CONFIG_IS_ENABLED(AHCI)
-static int sata_imx_probe(struct udevice *dev)
-{
-	int i, err;
-
-	/* Make sure this gpio has logical 0 value */
-	gpio_direction_output(CM_FX6_SATA_PWLOSS_INT, 0);
-	udelay(100);
-	cm_fx6_sata_power(1);

cm_fx6_sata_power() is still defined and not used in the board, this raises at least a warning (apart of Christopher's comments).

Stefano

Quoted 66 lines
board/compulab/cm_fx6/cm_fx6.c +0 -53
-
-	for (i = 0; i < CM_FX6_SATA_INIT_RETRIES; i++) {
-		err = setup_sata();
-		if (err) {
-			printf("SATA setup failed: %d\n", err);
-			return err;
-		}
-
-		udelay(100);
-
-		err = dwc_ahsata_probe(dev);
-		if (!err)
-			break;
-
-		/* There is no device on the SATA port */
-		if (sata_dm_port_status(0, 0) == 0)
-			break;
-
-		/* There's a device, but link not established. Retry */
-		device_remove(dev, DM_REMOVE_NORMAL);
-	}
-
-	return 0;
-}
-
-static int sata_imx_remove(struct udevice *dev)
-{
-	cm_fx6_sata_power(0);
-	mdelay(250);
-
-	return 0;
-}
-
-struct ahci_ops sata_imx_ops = {
-	.port_status = dwc_ahsata_port_status,
-	.reset	= dwc_ahsata_bus_reset,
-	.scan	= dwc_ahsata_scan,
-};
-
-static const struct udevice_id sata_imx_ids[] = {
-	{ .compatible = "fsl,imx6q-ahci" },
-	{ }
-};
-
-U_BOOT_DRIVER(sata_imx) = {
-	.name		= "dwc_ahci",
-	.id		= UCLASS_AHCI,
-	.of_match	= sata_imx_ids,
-	.ops		= &sata_imx_ops,
-	.probe		= sata_imx_probe,
-	.remove		= sata_imx_remove,  /* reset bus to stop it */
-};
-#endif /* AHCI */
configs/cm_fx6_defconfig +0 -1
index ce3f9de3f9..e928cbc948 100644
@@ -52,7 +52,6 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6q-cm-fx6"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DWC_AHSATA=y
-# CONFIG_DWC_AHSATA_AHCI is not set
 CONFIG_DM_KEYBOARD=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#2 lore raw

PATCH 1/1 ARM: imx: cm_fx6: Drop ad-hoc SATA binding

Quoted 30 lines · Stefano Babic

Hi Marek,

Quoted 27 lines · Marek Vasut

Drop the ad-hoc AHCI binding code, this is superseded by CONFIG_DWC_AHSATA_AHCI=y resp. drivers/ata/dwc_ahsata.c

Cc Christopher Spinrath <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Igor Grinberg <[email protected]>
Cc Nikita Kiryanov <[email protected]>
Cc Stefano Babic <[email protected]>
---
 board/compulab/cm_fx6/cm_fx6.c | 63 ----------------------------------
 configs/cm_fx6_defconfig       |  1 -
 2 files changed, 64 deletions(-)
board/compulab/cm_fx6/cm_fx6.c +0 -5
index d42f57d4b7..b8f15cf3ab 100644
@@ -724,66 +724,3 @@ U_BOOT_DEVICE(cm_fx6_serial) = {
 	.name	= "serial_mxc",
 	.platdata = &cm_fx6_mxc_serial_plat,
 };
-
-#if CONFIG_IS_ENABLED(AHCI)
-static int sata_imx_probe(struct udevice *dev)
-{
-	int i, err;
Quoted 9 lines

board/compulab/cm_fx6/cm_fx6.c U_BOOT_DEVICE(cm_fx6_serial) = { · line 736

Quoted 5 lines
board/compulab/cm_fx6/cm_fx6.c +0 -5
-
-	/* Make sure this gpio has logical 0 value */
-	gpio_direction_output(CM_FX6_SATA_PWLOSS_INT, 0);
-	udelay(100);
-	cm_fx6_sata_power(1);

cm_fx6_sata_power() is still defined and not used in the board, this raises at least a warning (apart of Christopher's comments).

AFAIR Christopher will be fixing this patch, so drop it.

Signature · 2 lines
Best regards,
Marek Vasut