summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-17 16:11:34 -0700
committerBin Meng <bmeng.cn@gmail.com>2016-01-24 12:09:39 +0800
commite3b5f04143a859092d4e09f61e526790836714f2 (patch)
tree6625e369c66db2fb61bbf7d1299ba3b089acc6e1 /drivers/block
parent887cba8f38e237735bb1d84b34dfbbf032e5b6b6 (diff)
downloadu-boot-imx-e3b5f04143a859092d4e09f61e526790836714f2.zip
u-boot-imx-e3b5f04143a859092d4e09f61e526790836714f2.tar.gz
u-boot-imx-e3b5f04143a859092d4e09f61e526790836714f2.tar.bz2
ahci: Add a disk-controller uclass
Add a uclass ID for a disk controller. This can be used by AHCI/SATA or other controller types. There are no operations and no interface so far, but it is possible to probe a SATA device. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/Kconfig9
-rw-r--r--drivers/block/Makefile1
-rw-r--r--drivers/block/disk-uclass.c14
3 files changed, 24 insertions, 0 deletions
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index e69de29..990f768 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -0,0 +1,9 @@
+config DISK
+ bool "Support disk controllers with driver model"
+ depends on DM
+ default y if 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.
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index eb8bda9..5eb87e0 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -5,6 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
+obj-$(CONFIG_DISK) += disk-uclass.o
obj-$(CONFIG_SCSI_AHCI) += ahci.o
obj-$(CONFIG_DWC_AHSATA) += dwc_ahsata.o
obj-$(CONFIG_FSL_SATA) += fsl_sata.o
diff --git a/drivers/block/disk-uclass.c b/drivers/block/disk-uclass.c
new file mode 100644
index 0000000..d665b35
--- /dev/null
+++ b/drivers/block/disk-uclass.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+
+UCLASS_DRIVER(disk) = {
+ .id = UCLASS_DISK,
+ .name = "disk",
+};