summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-08-18 18:24:36 -0400
committerTom Rini <trini@konsulko.com>2017-08-18 18:24:36 -0400
commit1fdafb2e3dfecdc4129a8062ad25b1adb32b0efb (patch)
tree6c6a74d4cb4e8a19bfd47510ade9fdcc3d08cb01 /include
parenta6dd10c70be9be863488d9d7afede057a4d99823 (diff)
parenta191ccaf12fb4fadedcd3c76df6327e2bb0f182b (diff)
Merge branch 'master' of git://git.denx.de/u-boot-mmc
Diffstat (limited to 'include')
-rw-r--r--include/ahci.h54
-rw-r--r--include/blk.h20
-rw-r--r--include/configs/am335x_evm.h1
-rw-r--r--include/configs/am335x_shc.h1
-rw-r--r--include/configs/chiliboard.h1
-rw-r--r--include/configs/omap3_logic.h1
-rw-r--r--include/dm/device-internal.h2
-rw-r--r--include/dwc_ahsata.h16
-rw-r--r--include/dwmmc.h2
-rw-r--r--include/mmc.h10
-rw-r--r--include/sata.h5
-rw-r--r--include/sdhci.h2
12 files changed, 104 insertions, 11 deletions
diff --git a/include/ahci.h b/include/ahci.h
index 29f4ba1d13..33171b7ffd 100644
--- a/include/ahci.h
+++ b/include/ahci.h
@@ -176,6 +176,60 @@ struct ahci_uc_priv {
u32 link_port_map; /*linkup port map*/
};
+struct ahci_ops {
+ /**
+ * reset() - reset the controller
+ *
+ * @dev: Controller to reset
+ * @return 0 if OK, -ve on error
+ */
+ int (*reset)(struct udevice *dev);
+
+ /**
+ * port_status() - get the status of a SATA port
+ *
+ * @dev: Controller to reset
+ * @port: Port number to check (0 for first)
+ * @return 0 if detected, -ENXIO if nothing on port, other -ve on error
+ */
+ int (*port_status)(struct udevice *dev, int port);
+
+ /**
+ * scan() - scan SATA ports
+ *
+ * @dev: Controller to scan
+ * @return 0 if OK, -ve on error
+ */
+ int (*scan)(struct udevice *dev);
+};
+
+#define ahci_get_ops(dev) ((struct ahci_ops *)(dev)->driver->ops)
+
+/**
+ * sata_reset() - reset the controller
+ *
+ * @dev: Controller to reset
+ * @return 0 if OK, -ve on error
+ */
+int sata_reset(struct udevice *dev);
+
+/**
+ * sata_port_status() - get the status of a SATA port
+ *
+ * @dev: Controller to reset
+ * @port: Port number to check (0 for first)
+ * @return 0 if detected, -ENXIO if nothin on port, other -ve on error
+ */
+int sata_dm_port_status(struct udevice *dev, int port);
+
+/**
+ * sata_scan() - scan SATA ports
+ *
+ * @dev: Controller to scan
+ * @return 0 if OK, -ve on error
+ */
+int sata_scan(struct udevice *dev);
+
int ahci_init(void __iomem *base);
int ahci_reset(void __iomem *base);
diff --git a/include/blk.h b/include/blk.h
index 61b56281b3..a106f9ca0e 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -624,4 +624,24 @@ ulong blk_write_devnum(enum if_type if_type, int devnum, lbaint_t start,
*/
int blk_select_hwpart_devnum(enum if_type if_type, int devnum, int hwpart);
+/**
+ * blk_get_if_type_name() - Get the name of an interface type
+ *
+ * @if_type: Interface type to check
+ * @return name of interface, or NULL if none
+ */
+const char *blk_get_if_type_name(enum if_type if_type);
+
+/**
+ * blk_common_cmd() - handle common commands with block devices
+ *
+ * @args: Number of arguments to the command (argv[0] is the command itself)
+ * @argv: Command arguments
+ * @if_type: Interface type
+ * @cur_devnump: Current device number for this interface type
+ * @return 0 if OK, CMD_RET_ERROR on error
+ */
+int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
+ int *cur_devnump);
+
#endif
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index c9420b2d73..973f63f891 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -282,7 +282,6 @@
*/
#ifdef CONFIG_SPL_BUILD
#undef CONFIG_DM_MMC
-#undef CONFIG_DM_MMC_OPS
#undef CONFIG_TIMER
#undef CONFIG_DM_USB
#endif
diff --git a/include/configs/am335x_shc.h b/include/configs/am335x_shc.h
index 62ab2d7227..3fdbfdcdc6 100644
--- a/include/configs/am335x_shc.h
+++ b/include/configs/am335x_shc.h
@@ -256,7 +256,6 @@
*/
#ifdef CONFIG_SPL_BUILD
#undef CONFIG_DM_MMC
-#undef CONFIG_DM_MMC_OPS
#undef CONFIG_TIMER
#endif
diff --git a/include/configs/chiliboard.h b/include/configs/chiliboard.h
index fb3e67466e..20075915fd 100644
--- a/include/configs/chiliboard.h
+++ b/include/configs/chiliboard.h
@@ -183,7 +183,6 @@
*/
#ifdef CONFIG_SPL_BUILD
#undef CONFIG_DM_MMC
-#undef CONFIG_DM_MMC_OPS
#undef CONFIG_TIMER
#undef CONFIG_DM_USB
#endif
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index 5490fc945a..b4311ab13b 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -23,7 +23,6 @@
* DM support in SPL
*/
#undef CONFIG_DM_MMC
-#undef CONFIG_DM_MMC_OPS
#undef OMAP_HSMMC_USE_GPIO
/* select serial console configuration for SPL */
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 81ab893b60..eaeadd48d2 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -98,7 +98,7 @@ int device_probe(struct udevice *dev);
* children are deactivated first.
*
* @dev: Pointer to device to remove
- * @flags: Flags for selective device removal
+ * @flags: Flags for selective device removal (DM_REMOVE_...)
* @return 0 if OK, -ve on error (an error here is normally a very bad thing)
*/
#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE)
diff --git a/include/dwc_ahsata.h b/include/dwc_ahsata.h
new file mode 100644
index 0000000000..cae275fe75
--- /dev/null
+++ b/include/dwc_ahsata.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2017 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __DWC_AHSATA_H__
+#define __DWC_AHSATA_H__
+
+int dwc_ahsata_bus_reset(struct udevice *dev);
+int dwc_ahsata_probe(struct udevice *dev);
+int dwc_ahsata_scan(struct udevice *dev);
+int dwc_ahsata_port_status(struct udevice *dev, int port);
+
+#endif
diff --git a/include/dwmmc.h b/include/dwmmc.h
index 4dda0091ce..a9058824e0 100644
--- a/include/dwmmc.h
+++ b/include/dwmmc.h
@@ -291,7 +291,7 @@ int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg);
int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk);
#endif /* !CONFIG_BLK */
-#ifdef CONFIG_DM_MMC_OPS
+#ifdef CONFIG_DM_MMC
/* Export the operations to drivers */
int dwmci_probe(struct udevice *dev);
extern const struct dm_mmc_ops dm_dwmci_ops;
diff --git a/include/mmc.h b/include/mmc.h
index cb8bf6a971..010ebe048c 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -221,6 +221,10 @@
#define EXT_CSD_BOOT_PART_NUM(x) (x << 3)
#define EXT_CSD_PARTITION_ACCESS(x) (x << 0)
+#define EXT_CSD_EXTRACT_BOOT_ACK(x) (((x) >> 6) & 0x1)
+#define EXT_CSD_EXTRACT_BOOT_PART(x) (((x) >> 3) & 0x7)
+#define EXT_CSD_EXTRACT_PARTITION_ACCESS(x) ((x) & 0x7)
+
#define EXT_CSD_BOOT_BUS_WIDTH_MODE(x) (x << 3)
#define EXT_CSD_BOOT_BUS_WIDTH_RESET(x) (x << 2)
#define EXT_CSD_BOOT_BUS_WIDTH_WIDTH(x) (x)
@@ -321,7 +325,7 @@ struct mmc_data {
/* forward decl. */
struct mmc;
-#if CONFIG_IS_ENABLED(DM_MMC_OPS)
+#if CONFIG_IS_ENABLED(DM_MMC)
struct dm_mmc_ops {
/**
* send_cmd() - Send a command to the MMC device
@@ -385,7 +389,7 @@ struct mmc_ops {
struct mmc_config {
const char *name;
-#if !CONFIG_IS_ENABLED(DM_MMC_OPS)
+#if !CONFIG_IS_ENABLED(DM_MMC)
const struct mmc_ops *ops;
#endif
uint host_caps;
@@ -519,7 +523,7 @@ int mmc_switch_part(struct mmc *mmc, unsigned int part_num);
int mmc_hwpart_config(struct mmc *mmc, const struct mmc_hwpart_conf *conf,
enum mmc_hwpart_conf_mode mode);
-#if !CONFIG_IS_ENABLED(DM_MMC_OPS)
+#if !CONFIG_IS_ENABLED(DM_MMC)
int mmc_getcd(struct mmc *mmc);
int board_mmc_getcd(struct mmc *mmc);
int mmc_getwp(struct mmc *mmc);
diff --git a/include/sata.h b/include/sata.h
index d18cc9aa87..d89f7a8a29 100644
--- a/include/sata.h
+++ b/include/sata.h
@@ -2,7 +2,7 @@
#define __SATA_H__
#include <part.h>
-#if !defined(CONFIG_DM_SCSI)
+#if !defined(CONFIG_DM_SCSI) && !defined(CONFIG_AHCI)
int init_sata(int dev);
int reset_sata(int dev);
int scan_sata(int dev);
@@ -18,4 +18,7 @@ int sata_port_status(int dev, int port);
extern struct blk_desc sata_dev_desc[];
#endif
+int sata_probe(int devnum);
+int sata_remove(int devnum);
+
#endif
diff --git a/include/sdhci.h b/include/sdhci.h
index 6a43271e96..7e84012f60 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -410,7 +410,7 @@ int sdhci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg);
int add_sdhci(struct sdhci_host *host, u32 f_max, u32 f_min);
#endif /* !CONFIG_BLK */
-#ifdef CONFIG_DM_MMC_OPS
+#ifdef CONFIG_DM_MMC
/* Export the operations to drivers */
int sdhci_probe(struct udevice *dev);
extern const struct dm_mmc_ops sdhci_ops;