[U-Boot] [PATCH 07/29] sata: Move drivers into new drivers/ata directory

Simon Glass sjg at chromium.org
Mon Jun 5 19:14:54 UTC 2017


At present we have the SATA and PATA drivers mixed up in the drivers/block
directory. It is better to split them out into their own place. Use
drivers/ata which is what Linux does.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/powerpc/cpu/mpc85xx/cpu_init.c   |  2 +-
 common/Makefile                       |  1 -
 drivers/Kconfig                       |  2 ++
 drivers/Makefile                      |  3 +-
 drivers/ata/Kconfig                   | 62 +++++++++++++++++++++++++++++++++++
 drivers/ata/Makefile                  | 22 +++++++++++++
 drivers/{block => ata}/ahci-uclass.c  |  0
 drivers/{block => ata}/ahci.c         |  0
 drivers/{block => ata}/dwc_ahci.c     |  0
 drivers/{block => ata}/dwc_ahsata.c   |  0
 drivers/{block => ata}/dwc_ahsata.h   |  0
 drivers/{block => ata}/fsl_sata.c     |  0
 drivers/{block => ata}/fsl_sata.h     |  0
 drivers/{block => ata}/libata.c       |  0
 drivers/{block => ata}/mvsata_ide.c   |  0
 drivers/{block => ata}/mxc_ata.c      |  0
 {common => drivers/ata}/sata.c        |  0
 drivers/{block => ata}/sata_ceva.c    |  0
 drivers/{block => ata}/sata_dwc.c     |  0
 drivers/{block => ata}/sata_dwc.h     |  0
 drivers/{block => ata}/sata_mv.c      |  0
 drivers/{block => ata}/sata_sandbox.c |  0
 drivers/{block => ata}/sata_sil.c     |  0
 drivers/{block => ata}/sata_sil.h     |  0
 drivers/{block => ata}/sata_sil3114.c |  0
 drivers/{block => ata}/sata_sil3114.h |  0
 drivers/block/Kconfig                 | 45 -------------------------
 drivers/block/Makefile                | 16 +--------
 28 files changed, 90 insertions(+), 63 deletions(-)
 create mode 100644 drivers/ata/Kconfig
 create mode 100644 drivers/ata/Makefile
 rename drivers/{block => ata}/ahci-uclass.c (100%)
 rename drivers/{block => ata}/ahci.c (100%)
 rename drivers/{block => ata}/dwc_ahci.c (100%)
 rename drivers/{block => ata}/dwc_ahsata.c (100%)
 rename drivers/{block => ata}/dwc_ahsata.h (100%)
 rename drivers/{block => ata}/fsl_sata.c (100%)
 rename drivers/{block => ata}/fsl_sata.h (100%)
 rename drivers/{block => ata}/libata.c (100%)
 rename drivers/{block => ata}/mvsata_ide.c (100%)
 rename drivers/{block => ata}/mxc_ata.c (100%)
 rename {common => drivers/ata}/sata.c (100%)
 rename drivers/{block => ata}/sata_ceva.c (100%)
 rename drivers/{block => ata}/sata_dwc.c (100%)
 rename drivers/{block => ata}/sata_dwc.h (100%)
 rename drivers/{block => ata}/sata_mv.c (100%)
 rename drivers/{block => ata}/sata_sandbox.c (100%)
 rename drivers/{block => ata}/sata_sil.c (100%)
 rename drivers/{block => ata}/sata_sil.h (100%)
 rename drivers/{block => ata}/sata_sil3114.c (100%)
 rename drivers/{block => ata}/sata_sil3114.h (100%)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 388fe2b4ef..a3076d8d71 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -48,7 +48,7 @@
 #ifndef CONFIG_ARCH_QEMU_E500
 #include <fsl_ddr.h>
 #endif
-#include "../../../../drivers/block/fsl_sata.h"
+#include "../../../../drivers/ata/fsl_sata.h"
 #ifdef CONFIG_U_QE
 #include <fsl_qe.h>
 #endif
diff --git a/common/Makefile b/common/Makefile
index ceade7c6bc..026f58211d 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -80,7 +80,6 @@ obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o
 obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
-obj-$(CONFIG_SATA) += sata.o
 obj-$(CONFIG_SCSI) += scsi.o
 obj-$(CONFIG_UPDATE_TFTP) += update.o
 obj-$(CONFIG_DFU_TFTP) += update.o
diff --git a/drivers/Kconfig b/drivers/Kconfig
index a736386a0d..63e4034c56 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -6,6 +6,8 @@ source "drivers/core/Kconfig"
 
 source "drivers/adc/Kconfig"
 
+source "drivers/ata/Kconfig"
+
 source "drivers/block/Kconfig"
 
 source "drivers/clk/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 058bccb761..9bbcc7bf9c 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -45,7 +45,7 @@ obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu/
 obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
 obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
-obj-$(CONFIG_SPL_SATA_SUPPORT) += block/
+obj-$(CONFIG_SPL_SATA_SUPPORT) += ata/
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += block/
 obj-$(CONFIG_SPL_MMC_SUPPORT) += block/
 endif
@@ -66,6 +66,7 @@ endif
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
 
 obj-y += adc/
+obj-y += ata/
 obj-$(CONFIG_DM_DEMO) += demo/
 obj-$(CONFIG_BIOSEMU) += bios_emulator/
 obj-y += block/
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
new file mode 100644
index 0000000000..6427f1b94a
--- /dev/null
+++ b/drivers/ata/Kconfig
@@ -0,0 +1,62 @@
+config AHCI
+	bool "Support SATA controllers with driver model"
+	depends on DM
+	help
+	  This enables a uclass for disk controllers in U-Boot. Various driver
+	  types can use this, such as AHCI/SATA. It does not provide any standard
+	  operations at present. The block device interface has not been converted
+	  to driver model.
+
+config SATA
+	bool "Support SATA controllers"
+	help
+	  This enables support for SATA (Serial Advanced Technology
+	  Attachment), a serial bus standard for connecting to hard drives and
+	  other storage devices.
+
+	  SATA replaces PATA (originally just ATA), which stands for Parallel AT
+	  Attachment, where AT refers to an IBM AT (Advanced Technology)
+	  computer released in 1984.
+
+	  See also CMD_SATA which provides command-line support.
+
+config SCSI
+	bool "Support SCSI controllers"
+	help
+	  This enables support for SCSI (Small Computer System Interface),
+	  a parallel interface widely used with storage peripherals such as
+	  hard drives and optical drives. The SCSI standards define physical
+	  interfaces as well as protocols for controlling devices and
+	  tranferring data.
+
+config DM_SCSI
+	bool "Support SCSI controllers with driver model"
+	depends on BLK
+	help
+	  This option enables the SCSI (Small Computer System Interface) uclass
+	  which supports SCSI and SATA HDDs. For every device configuration
+	  (IDs/LUNs) a block device is created with RAW read/write and
+	  filesystem support.
+
+menu "SATA/SCSI device support"
+
+config SATA_CEVA
+	bool "Ceva Sata controller"
+	depends on AHCI
+	depends on DM_SCSI
+	help
+	  This option enables Ceva Sata controller hard IP available on Xilinx
+	  ZynqMP. Support up to 2 external devices. Complient with SATA 3.1 and
+	  AHCI 1.3 specifications with hot-plug detect feature.
+
+
+config DWC_AHCI
+	bool "Enable Synopsys DWC AHCI driver support"
+	select SCSI_AHCI
+	select PHY
+	depends on DM_SCSI
+	help
+	  Enable this driver to support Sata devices through
+	  Synopsys DWC AHCI module.
+
+endmenu
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
new file mode 100644
index 0000000000..c48184c4c3
--- /dev/null
+++ b/drivers/ata/Makefile
@@ -0,0 +1,22 @@
+#
+# (C) Copyright 2000-2007
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-$(CONFIG_DWC_AHCI) += dwc_ahci.o
+obj-$(CONFIG_AHCI) += ahci-uclass.o
+obj-$(CONFIG_SCSI_AHCI) += ahci.o
+obj-$(CONFIG_DWC_AHSATA) += dwc_ahsata.o
+obj-$(CONFIG_FSL_SATA) += fsl_sata.o
+obj-$(CONFIG_LIBATA) += libata.o
+obj-$(CONFIG_MVSATA_IDE) += mvsata_ide.o
+obj-$(CONFIG_MX51_PATA) += mxc_ata.o
+obj-$(CONFIG_SATA) += sata.o
+obj-$(CONFIG_SATA_CEVA) += sata_ceva.o
+obj-$(CONFIG_SATA_DWC) += sata_dwc.o
+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
diff --git a/drivers/block/ahci-uclass.c b/drivers/ata/ahci-uclass.c
similarity index 100%
rename from drivers/block/ahci-uclass.c
rename to drivers/ata/ahci-uclass.c
diff --git a/drivers/block/ahci.c b/drivers/ata/ahci.c
similarity index 100%
rename from drivers/block/ahci.c
rename to drivers/ata/ahci.c
diff --git a/drivers/block/dwc_ahci.c b/drivers/ata/dwc_ahci.c
similarity index 100%
rename from drivers/block/dwc_ahci.c
rename to drivers/ata/dwc_ahci.c
diff --git a/drivers/block/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c
similarity index 100%
rename from drivers/block/dwc_ahsata.c
rename to drivers/ata/dwc_ahsata.c
diff --git a/drivers/block/dwc_ahsata.h b/drivers/ata/dwc_ahsata.h
similarity index 100%
rename from drivers/block/dwc_ahsata.h
rename to drivers/ata/dwc_ahsata.h
diff --git a/drivers/block/fsl_sata.c b/drivers/ata/fsl_sata.c
similarity index 100%
rename from drivers/block/fsl_sata.c
rename to drivers/ata/fsl_sata.c
diff --git a/drivers/block/fsl_sata.h b/drivers/ata/fsl_sata.h
similarity index 100%
rename from drivers/block/fsl_sata.h
rename to drivers/ata/fsl_sata.h
diff --git a/drivers/block/libata.c b/drivers/ata/libata.c
similarity index 100%
rename from drivers/block/libata.c
rename to drivers/ata/libata.c
diff --git a/drivers/block/mvsata_ide.c b/drivers/ata/mvsata_ide.c
similarity index 100%
rename from drivers/block/mvsata_ide.c
rename to drivers/ata/mvsata_ide.c
diff --git a/drivers/block/mxc_ata.c b/drivers/ata/mxc_ata.c
similarity index 100%
rename from drivers/block/mxc_ata.c
rename to drivers/ata/mxc_ata.c
diff --git a/common/sata.c b/drivers/ata/sata.c
similarity index 100%
rename from common/sata.c
rename to drivers/ata/sata.c
diff --git a/drivers/block/sata_ceva.c b/drivers/ata/sata_ceva.c
similarity index 100%
rename from drivers/block/sata_ceva.c
rename to drivers/ata/sata_ceva.c
diff --git a/drivers/block/sata_dwc.c b/drivers/ata/sata_dwc.c
similarity index 100%
rename from drivers/block/sata_dwc.c
rename to drivers/ata/sata_dwc.c
diff --git a/drivers/block/sata_dwc.h b/drivers/ata/sata_dwc.h
similarity index 100%
rename from drivers/block/sata_dwc.h
rename to drivers/ata/sata_dwc.h
diff --git a/drivers/block/sata_mv.c b/drivers/ata/sata_mv.c
similarity index 100%
rename from drivers/block/sata_mv.c
rename to drivers/ata/sata_mv.c
diff --git a/drivers/block/sata_sandbox.c b/drivers/ata/sata_sandbox.c
similarity index 100%
rename from drivers/block/sata_sandbox.c
rename to drivers/ata/sata_sandbox.c
diff --git a/drivers/block/sata_sil.c b/drivers/ata/sata_sil.c
similarity index 100%
rename from drivers/block/sata_sil.c
rename to drivers/ata/sata_sil.c
diff --git a/drivers/block/sata_sil.h b/drivers/ata/sata_sil.h
similarity index 100%
rename from drivers/block/sata_sil.h
rename to drivers/ata/sata_sil.h
diff --git a/drivers/block/sata_sil3114.c b/drivers/ata/sata_sil3114.c
similarity index 100%
rename from drivers/block/sata_sil3114.c
rename to drivers/ata/sata_sil3114.c
diff --git a/drivers/block/sata_sil3114.h b/drivers/ata/sata_sil3114.h
similarity index 100%
rename from drivers/block/sata_sil3114.h
rename to drivers/ata/sata_sil3114.h
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index ed7fa88bf5..1ddd6508e4 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -10,28 +10,6 @@ config BLK
 	  be partitioned into several areas, called 'partitions' in U-Boot.
 	  A filesystem can be placed in each partition.
 
-config AHCI
-	bool "Support SATA controllers with driver model"
-	depends on DM
-	help
-	  This enables a uclass for disk controllers in U-Boot. Various driver
-	  types can use this, such as AHCI/SATA. It does not provide any standard
-	  operations at present. The block device interface has not been converted
-	  to driver model.
-
-config SATA
-	bool "Support SATA controllers"
-	help
-	  This enables support for SATA (Serial Advanced Technology
-	  Attachment), a serial bus standard for connecting to hard drives and
-	  other storage devices.
-
-	  SATA replaces PATA (originally just ATA), which stands for Parallel AT
-	  Attachment, where AT refers to an IBM AT (Advanced Technology)
-	  computer released in 1984.
-
-	  See also CMD_SATA which provides command-line support.
-
 config SCSI
 	bool "Support SCSI controllers"
 	help
@@ -59,29 +37,6 @@ config BLOCK_CACHE
 	  it will prevent repeated reads from directory structures and other
 	  filesystem data structures.
 
-menu "SATA/SCSI device support"
-
-config SATA_CEVA
-	bool "Ceva Sata controller"
-	depends on AHCI
-	depends on DM_SCSI
-	help
-	  This option enables Ceva Sata controller hard IP available on Xilinx
-	  ZynqMP. Support up to 2 external devices. Complient with SATA 3.1 and
-	  AHCI 1.3 specifications with hot-plug detect feature.
-
-
-config DWC_AHCI
-	bool "Enable Synopsys DWC AHCI driver support"
-	select SCSI_AHCI
-	select PHY
-	depends on DM_SCSI
-	help
-	  Enable this driver to support Sata devices through
-	  Synopsys DWC AHCI module.
-
-endmenu
-
 config IDE
 	bool "Support IDE controllers"
 	help
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 2a4c9b8f9e..2bfcc4a683 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -11,23 +11,9 @@ ifndef CONFIG_BLK
 obj-y += blk_legacy.o
 endif
 
-obj-$(CONFIG_DWC_AHCI) += dwc_ahci.o
-obj-$(CONFIG_AHCI) += ahci-uclass.o
-obj-$(CONFIG_DM_SCSI) += scsi-uclass.o
-obj-$(CONFIG_SCSI_AHCI) += ahci.o
-obj-$(CONFIG_DWC_AHSATA) += dwc_ahsata.o
-obj-$(CONFIG_FSL_SATA) += fsl_sata.o
 obj-$(CONFIG_IDE) += ide.o
 obj-$(CONFIG_IDE_FTIDE020) += ftide020.o
-obj-$(CONFIG_LIBATA) += libata.o
-obj-$(CONFIG_MVSATA_IDE) += mvsata_ide.o
-obj-$(CONFIG_MX51_PATA) += mxc_ata.o
-obj-$(CONFIG_SATA_CEVA) += sata_ceva.o
-obj-$(CONFIG_SATA_DWC) += sata_dwc.o
-obj-$(CONFIG_SATA_MV) += sata_mv.o
-obj-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
-obj-$(CONFIG_SATA_SIL) += sata_sil.o
 obj-$(CONFIG_IDE_SIL680) += sil680.o
-obj-$(CONFIG_SANDBOX) += sandbox.o sandbox_scsi.o sata_sandbox.o
+obj-$(CONFIG_SANDBOX) += sandbox.o sandbox_scsi.o
 obj-$(CONFIG_SYSTEMACE) += systemace.o
 obj-$(CONFIG_BLOCK_CACHE) += blkcache.o
-- 
2.13.0.506.g27d5fe0cd-goog



More information about the U-Boot mailing list