public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 0/4] ahci mvebu driver updates
@ 2018-05-25  2:06 make at marvell.com
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 1/4] ata: mvebu: move mvebu sata driver to drivers/ata directory make at marvell.com
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: make at marvell.com @ 2018-05-25  2:06 UTC (permalink / raw)
  To: u-boot

From: Ken Ma <make@marvell.com>


These patches move ahci mvebu driver to drivers/ata directory with bug
fixing and scsi supporting.

Changes in v3:
- Use the new SPDX tags.

David Sniatkiwicz (1):
  ata: ahci_mvebu: a8040 a0: remove bad port register offsets
    workarounds

Ken Ma (3):
  ata: mvebu: move mvebu sata driver to drivers/ata directory
  ata: ahci_mvebu: add scsi support
  arm64: mvebu: defconfig: enable CONFIG_AHCI_MVEBU

 MAINTAINERS                                        |  1 +
 arch/arm/mach-mvebu/Makefile                       |  1 -
 configs/mvebu_db-88f3720_defconfig                 |  1 +
 configs/mvebu_db_armada8k_defconfig                |  1 +
 configs/mvebu_espressobin-88f3720_defconfig        |  1 +
 configs/mvebu_mcbin-88f8040_defconfig              |  1 +
 drivers/ata/Kconfig                                |  9 ++++++++
 drivers/ata/Makefile                               |  1 +
 .../mach-mvebu/sata.c => drivers/ata/ahci_mvebu.c  | 24 +++++++++++++---------
 9 files changed, 29 insertions(+), 11 deletions(-)
 rename arch/arm/mach-mvebu/sata.c => drivers/ata/ahci_mvebu.c (68%)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v3 1/4] ata: mvebu: move mvebu sata driver to drivers/ata directory
  2018-05-25  2:06 [U-Boot] [PATCH v3 0/4] ahci mvebu driver updates make at marvell.com
@ 2018-05-25  2:06 ` make at marvell.com
  2018-05-25  5:43   ` Stefan Roese
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 2/4] ata: ahci_mvebu: a8040 a0: remove bad port register offsets workarounds make at marvell.com
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: make at marvell.com @ 2018-05-25  2:06 UTC (permalink / raw)
  To: u-boot

From: Ken Ma <make@marvell.com>

Currently mvebu sata driver is in arch/arm/mach_mvebu directory, this
patch moves it to drivers/ata directory with renaming "sata.c" to
"ahci_mvebu.c" which is aligned to Linux.
New ahci driver's kconfig option is added as AHCI_MVEBU which selects
DM_SCSI.

Signed-off-by: Ken Ma <make@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Use the new SPDX tags.

 MAINTAINERS                                            | 1 +
 arch/arm/mach-mvebu/Makefile                           | 1 -
 drivers/ata/Kconfig                                    | 9 +++++++++
 drivers/ata/Makefile                                   | 1 +
 arch/arm/mach-mvebu/sata.c => drivers/ata/ahci_mvebu.c | 5 +----
 5 files changed, 12 insertions(+), 5 deletions(-)
 rename arch/arm/mach-mvebu/sata.c => drivers/ata/ahci_mvebu.c (93%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 077828c..97c0752 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -134,6 +134,7 @@ S:	Maintained
 T:	git git://git.denx.de/u-boot-marvell.git
 F:	arch/arm/mach-kirkwood/
 F:	arch/arm/mach-mvebu/
+F:	drivers/ata/ahci_mvebu.c
 
 ARM MARVELL PXA
 M:	Marek Vasut <marex@denx.de>
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index d4210af..7f0d692 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -9,7 +9,6 @@ ifdef CONFIG_ARM64
 obj-$(CONFIG_ARMADA_3700) += armada3700/
 obj-$(CONFIG_ARMADA_8K) += armada8k/
 obj-y += arm64-common.o
-obj-y += sata.o
 
 else # CONFIG_ARM64
 
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 86ec628..9ef4589 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -99,4 +99,13 @@ config SATA_SIL3114
 	help
 	  Enable this driver to support the SIL3114 SATA controllers.
 
+config AHCI_MVEBU
+	bool "Marvell EBU AHCI SATA support"
+	depends on ARCH_MVEBU
+	select DM_SCSI
+	help
+	  This option enables support for the Marvell EBU SoC's
+	  onboard AHCI SATA.
+
+	  If unsure, say N.
 endmenu
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index a94c804..0254640 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_SATA_MV) += sata_mv.o
 obj-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
 obj-$(CONFIG_SATA_SIL) += sata_sil.o
 obj-$(CONFIG_SANDBOX) += sata_sandbox.o
+obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o
diff --git a/arch/arm/mach-mvebu/sata.c b/drivers/ata/ahci_mvebu.c
similarity index 93%
rename from arch/arm/mach-mvebu/sata.c
rename to drivers/ata/ahci_mvebu.c
index 5d8032b..3ae8dae 100644
--- a/arch/arm/mach-mvebu/sata.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -1,15 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2016 Stefan Roese <sr@denx.de>
- *
- * SPDX-License-Identifier:	GPL-2.0+
  */
 
 #include <common.h>
 #include <ahci.h>
 #include <dm.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /*
  * Dummy implementation that can be overwritten by a board
  * specific function
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v3 2/4] ata: ahci_mvebu: a8040 a0: remove bad port register offsets workarounds
  2018-05-25  2:06 [U-Boot] [PATCH v3 0/4] ahci mvebu driver updates make at marvell.com
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 1/4] ata: mvebu: move mvebu sata driver to drivers/ata directory make at marvell.com
@ 2018-05-25  2:06 ` make at marvell.com
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 3/4] ata: ahci_mvebu: add scsi support make at marvell.com
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 4/4] arm64: mvebu: defconfig: enable CONFIG_AHCI_MVEBU make at marvell.com
  3 siblings, 0 replies; 6+ messages in thread
From: make at marvell.com @ 2018-05-25  2:06 UTC (permalink / raw)
  To: u-boot

From: David Sniatkiwicz <davidsn@marvell.com>

This workaround was added for A8040/7040 A0.
A8040/7040 A0 is no longer supported so this workaround
can be removed.

Signed-off-by: David Sniatkiwicz <davidsn@marvell.com>
Signed-off-by: Ken Ma <make@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None

 drivers/ata/ahci_mvebu.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index 3ae8dae..c1d215f 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -16,14 +16,6 @@ __weak int board_ahci_enable(void)
 	return 0;
 }
 
-#ifdef CONFIG_ARMADA_8K
-/* CP110 has different AHCI port addresses */
-void __iomem *ahci_port_base(void __iomem *base, u32 port)
-{
-	return base + 0x10000 + (port * 0x10000);
-}
-#endif
-
 static int mvebu_ahci_probe(struct udevice *dev)
 {
 	/*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v3 3/4] ata: ahci_mvebu: add scsi support
  2018-05-25  2:06 [U-Boot] [PATCH v3 0/4] ahci mvebu driver updates make at marvell.com
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 1/4] ata: mvebu: move mvebu sata driver to drivers/ata directory make at marvell.com
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 2/4] ata: ahci_mvebu: a8040 a0: remove bad port register offsets workarounds make at marvell.com
@ 2018-05-25  2:06 ` make at marvell.com
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 4/4] arm64: mvebu: defconfig: enable CONFIG_AHCI_MVEBU make at marvell.com
  3 siblings, 0 replies; 6+ messages in thread
From: make at marvell.com @ 2018-05-25  2:06 UTC (permalink / raw)
  To: u-boot

From: Ken Ma <make@marvell.com>

Mvebu AHCI is AHCI driver which uses SCSI under the hood.
This patch adjusts AHCI setup to support SCSI by creating
a SCSI device as a child.

Signed-off-by: Ken Ma <make@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None

 drivers/ata/ahci_mvebu.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index c1d215f..6e3f17e 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -16,6 +16,20 @@ __weak int board_ahci_enable(void)
 	return 0;
 }
 
+static int mvebu_ahci_bind(struct udevice *dev)
+{
+	struct udevice *scsi_dev;
+	int ret;
+
+	ret = ahci_bind_scsi(dev, &scsi_dev);
+	if (ret) {
+		debug("%s: Failed to bind (err=%d\n)", __func__, ret);
+		return ret;
+	}
+
+	return 0;
+}
+
 static int mvebu_ahci_probe(struct udevice *dev)
 {
 	/*
@@ -24,7 +38,7 @@ static int mvebu_ahci_probe(struct udevice *dev)
 	 */
 	board_ahci_enable();
 
-	ahci_init(devfdt_get_addr_ptr(dev));
+	ahci_probe_scsi(dev, (ulong)devfdt_get_addr_ptr(dev));
 
 	return 0;
 }
@@ -39,5 +53,6 @@ U_BOOT_DRIVER(ahci_mvebu_drv) = {
 	.name		= "ahci_mvebu",
 	.id		= UCLASS_AHCI,
 	.of_match	= mvebu_ahci_ids,
+	.bind		= mvebu_ahci_bind,
 	.probe		= mvebu_ahci_probe,
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v3 4/4] arm64: mvebu: defconfig: enable CONFIG_AHCI_MVEBU
  2018-05-25  2:06 [U-Boot] [PATCH v3 0/4] ahci mvebu driver updates make at marvell.com
                   ` (2 preceding siblings ...)
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 3/4] ata: ahci_mvebu: add scsi support make at marvell.com
@ 2018-05-25  2:06 ` make at marvell.com
  3 siblings, 0 replies; 6+ messages in thread
From: make at marvell.com @ 2018-05-25  2:06 UTC (permalink / raw)
  To: u-boot

From: Ken Ma <make@marvell.com>

This patch enables the new ahci mvebu driver for marvell arm64 platform
SOCs(A3k and A8k).

Signed-off-by: Ken Ma <make@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None

 configs/mvebu_db-88f3720_defconfig          | 1 +
 configs/mvebu_db_armada8k_defconfig         | 1 +
 configs/mvebu_espressobin-88f3720_defconfig | 1 +
 configs/mvebu_mcbin-88f8040_defconfig       | 1 +
 4 files changed, 4 insertions(+)

diff --git a/configs/mvebu_db-88f3720_defconfig b/configs/mvebu_db-88f3720_defconfig
index 1d6233a..d40dd42 100644
--- a/configs/mvebu_db-88f3720_defconfig
+++ b/configs/mvebu_db-88f3720_defconfig
@@ -29,6 +29,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_MAC_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_MVEBU=y
 CONFIG_BLOCK_CACHE=y
 CONFIG_DM_GPIO=y
 # CONFIG_MVEBU_GPIO is not set
diff --git a/configs/mvebu_db_armada8k_defconfig b/configs/mvebu_db_armada8k_defconfig
index da67aad..72c86f3 100644
--- a/configs/mvebu_db_armada8k_defconfig
+++ b/configs/mvebu_db_armada8k_defconfig
@@ -30,6 +30,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_MAC_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_MVEBU=y
 CONFIG_BLOCK_CACHE=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig
index 314d405..cc41711 100644
--- a/configs/mvebu_espressobin-88f3720_defconfig
+++ b/configs/mvebu_espressobin-88f3720_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_MAC_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_MVEBU=y
 CONFIG_BLOCK_CACHE=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
diff --git a/configs/mvebu_mcbin-88f8040_defconfig b/configs/mvebu_mcbin-88f8040_defconfig
index e16a56e..dea0cd0 100644
--- a/configs/mvebu_mcbin-88f8040_defconfig
+++ b/configs/mvebu_mcbin-88f8040_defconfig
@@ -32,6 +32,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_MAC_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_MVEBU=y
 CONFIG_BLOCK_CACHE=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v3 1/4] ata: mvebu: move mvebu sata driver to drivers/ata directory
  2018-05-25  2:06 ` [U-Boot] [PATCH v3 1/4] ata: mvebu: move mvebu sata driver to drivers/ata directory make at marvell.com
@ 2018-05-25  5:43   ` Stefan Roese
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2018-05-25  5:43 UTC (permalink / raw)
  To: u-boot

On 25.05.2018 04:06, make at marvell.com wrote:
> From: Ken Ma <make@marvell.com>
> 
> Currently mvebu sata driver is in arch/arm/mach_mvebu directory, this
> patch moves it to drivers/ata directory with renaming "sata.c" to
> "ahci_mvebu.c" which is aligned to Linux.
> New ahci driver's kconfig option is added as AHCI_MVEBU which selects
> DM_SCSI.
> 
> Signed-off-by: Ken Ma <make@marvell.com>
> Reviewed-by: Stefan Roese <sr@denx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v3:
> - Use the new SPDX tags.
> 
>   MAINTAINERS                                            | 1 +
>   arch/arm/mach-mvebu/Makefile                           | 1 -
>   drivers/ata/Kconfig                                    | 9 +++++++++
>   drivers/ata/Makefile                                   | 1 +
>   arch/arm/mach-mvebu/sata.c => drivers/ata/ahci_mvebu.c | 5 +----
>   5 files changed, 12 insertions(+), 5 deletions(-)
>   rename arch/arm/mach-mvebu/sata.c => drivers/ata/ahci_mvebu.c (93%)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 077828c..97c0752 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -134,6 +134,7 @@ S:	Maintained
>   T:	git git://git.denx.de/u-boot-marvell.git
>   F:	arch/arm/mach-kirkwood/
>   F:	arch/arm/mach-mvebu/
> +F:	drivers/ata/ahci_mvebu.c
>   
>   ARM MARVELL PXA
>   M:	Marek Vasut <marex@denx.de>
> diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
> index d4210af..7f0d692 100644
> --- a/arch/arm/mach-mvebu/Makefile
> +++ b/arch/arm/mach-mvebu/Makefile
> @@ -9,7 +9,6 @@ ifdef CONFIG_ARM64
>   obj-$(CONFIG_ARMADA_3700) += armada3700/
>   obj-$(CONFIG_ARMADA_8K) += armada8k/
>   obj-y += arm64-common.o
> -obj-y += sata.o
>   
>   else # CONFIG_ARM64
>   
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 86ec628..9ef4589 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -99,4 +99,13 @@ config SATA_SIL3114
>   	help
>   	  Enable this driver to support the SIL3114 SATA controllers.
>   
> +config AHCI_MVEBU
> +	bool "Marvell EBU AHCI SATA support"
> +	depends on ARCH_MVEBU
> +	select DM_SCSI
> +	help
> +	  This option enables support for the Marvell EBU SoC's
> +	  onboard AHCI SATA.
> +
> +	  If unsure, say N.
>   endmenu
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index a94c804..0254640 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -19,3 +19,4 @@ obj-$(CONFIG_SATA_MV) += sata_mv.o
>   obj-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
>   obj-$(CONFIG_SATA_SIL) += sata_sil.o
>   obj-$(CONFIG_SANDBOX) += sata_sandbox.o
> +obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o
> diff --git a/arch/arm/mach-mvebu/sata.c b/drivers/ata/ahci_mvebu.c
> similarity index 93%
> rename from arch/arm/mach-mvebu/sata.c
> rename to drivers/ata/ahci_mvebu.c
> index 5d8032b..3ae8dae 100644
> --- a/arch/arm/mach-mvebu/sata.c
> +++ b/drivers/ata/ahci_mvebu.c
> @@ -1,15 +1,12 @@
> +// SPDX-License-Identifier: GPL-2.0+
>   /*
>    * Copyright (C) 2016 Stefan Roese <sr@denx.de>
> - *
> - * SPDX-License-Identifier:	GPL-2.0+
>    */

You should have no such changes in your new file, since you are
moving the file which already has the new SPDX tags. So please make
sure to base your patches on top of the latest mainline git version.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-25  5:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-25  2:06 [U-Boot] [PATCH v3 0/4] ahci mvebu driver updates make at marvell.com
2018-05-25  2:06 ` [U-Boot] [PATCH v3 1/4] ata: mvebu: move mvebu sata driver to drivers/ata directory make at marvell.com
2018-05-25  5:43   ` Stefan Roese
2018-05-25  2:06 ` [U-Boot] [PATCH v3 2/4] ata: ahci_mvebu: a8040 a0: remove bad port register offsets workarounds make at marvell.com
2018-05-25  2:06 ` [U-Boot] [PATCH v3 3/4] ata: ahci_mvebu: add scsi support make at marvell.com
2018-05-25  2:06 ` [U-Boot] [PATCH v3 4/4] arm64: mvebu: defconfig: enable CONFIG_AHCI_MVEBU make at marvell.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox