Skip to contentSkip to conversation

ata: fsl_sata: Add sata DM support for Freescale powerpc

PATCH Superseded Peng Ma 1 participant 2 messages Oct 15, 2019 libata

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Peng Ma

author
#0 lore raw

PATCH 1/2 ata: fsl_sata: Add sata DM support for Freescale powerpc

T series socs

This patch is to support Freescale sata driver with dts initialized. We needed to enable CONFIG_BLK on this platform. It adds the SATA controller as AHCI device, which is strictly speaking not correct, as the controller is not AHCI compatible. But the U-Boot AHCI uclass interface enables the usage of this DM driver.
Also resolved the following problems.

===================== WARNING ======================" This board does use CONFIG_LIBATA but has CONFIG_AHCI not" enabled. Please update the storage controller driver to use" CONFIG_AHCI before the v2019.07 release."
Failure to update by the deadline may result in board removal." See doc/driver-model/MIGRATION.txt for more info." ===================================================="

---
 drivers/ata/Kconfig    |   1 +
 drivers/ata/fsl_sata.c | 296 +++++++++++++++++++++++++++++++++++--------------
 drivers/ata/fsl_sata.h |  10 ++
 3 files changed, 222 insertions(+), 85 deletions(-)
drivers/ata/Kconfig +1 -0
index 87636ae..57121f6 100644
@@ -87,6 +87,7 @@ config DWC_AHSATA_AHCI
 config FSL_SATA
 	bool "Enable Freescale SATA controller driver support"
 	select LIBATA
+	select AHCI if BLK
 	help
 	  Enable this driver to support the SATA controller found in
 	  some Freescale PowerPC SoCs.
drivers/ata/fsl_sata.c +211 -85

474 lines not on this page · raw message

drivers/ata/fsl_sata.h +10 -0
index a4ee83d..a66006c 100644
@@ -318,4 +318,14 @@ typedef struct fsl_sata {
 #define READ_CMD	0
 #define WRITE_CMD	1
 
+#if CONFIG_IS_ENABLED(BLK)
+struct fsl_ata_priv {
+	u32 base;
+	u32 flag;
+	u32 number;
+	u32 offset;
+	fsl_sata_t *fsl_sata;
+};
+#endif
+
 #endif /* __FSL_SATA_H__ */
Signature · 1 line
2.9.5
author
#1 lore raw

PATCH 2/2 ata: sata_sil: Add sata DM support for Silicon driver

This patch is to support Silicon(SIL3131 / SIL3132 / SIL3124) sata driver with dts initialized.
This changed same as fsl_sata.c some of our socs need to use this driver such as P series platforms.
Also resolved the following problems.

===================== WARNING ======================" This board does use CONFIG_LIBATA but has CONFIG_AHCI not" enabled. Please update the storage controller driver to use" CONFIG_AHCI before the v2019.07 release."
Failure to update by the deadline may result in board removal." See doc/driver-model/MIGRATION.txt for more info." ===================================================="

---
 drivers/ata/Kconfig    |   1 +
 drivers/ata/sata_sil.c | 538 +++++++++++++++++++++++++++++++------------------
 drivers/ata/sata_sil.h |  13 +-
 3 files changed, 355 insertions(+), 197 deletions(-)
drivers/ata/Kconfig +1 -0
index 57121f6..fe589d3 100644
@@ -110,6 +110,7 @@ config SATA_MV
 config SATA_SIL
 	bool "Enable Silicon Image SIL3131 / SIL3132 / SIL3124 SATA driver support"
 	select LIBATA
+	select AHCI if BLK
 	help
 	  Enable this driver to support the SIL3131, SIL3132 and SIL3124
 	  SATA controllers.
drivers/ata/sata_sil.c +343 -195

772 lines not on this page · raw message

drivers/ata/sata_sil.h +11 -2
index 8b7cbdf..769dd3d 100644
@@ -13,7 +13,7 @@
 /*
  * SATA device driver struct for each dev
  */
-struct sil_sata {
+typedef struct sil_sata {
 	char	name[12];
 	void	*port;	/* the port base address */
 	int		lba48;
@@ -24,7 +24,8 @@ struct sil_sata {
 	int		wcache;
 	int		flush;
 	int		flush_ext;
-};
+	int		id;
+} sil_sata_t;
 
 /* sata info for each controller */
 struct sata_info {
@@ -210,4 +211,12 @@ enum {
 	CMD_ERR		= 0x21,
 };
 
+#if CONFIG_IS_ENABLED(BLK)
+#define ATA_MAX_PORTS		32
+struct sil_sata_priv {
+	int		port_num;
+	sil_sata_t	*sil_sata_desc[ATA_MAX_PORTS];
+};
+#endif
+
 #endif
Signature · 1 line
2.9.5