summaryrefslogtreecommitdiff
path: root/include/cache.h
diff options
context:
space:
mode:
authorRick Chen <rick@andestech.com>2019-08-28 13:46:04 +0300
committerAndes <uboot@andestech.com>2019-09-03 04:31:03 +0300
commit4d0140ee1aa02c702846f47fe986a19ecc4318a6 (patch)
tree3c0c5ac104f2e1c137dabf2064cf041fb545051b /include/cache.h
parentd58b0a6ee10710b259412fdeaf0eb24474af8401 (diff)
downloadu-boot-4d0140ee1aa02c702846f47fe986a19ecc4318a6.tar.xz
dm: cache: Add enable and disable ops for cache uclass
Add cache enable/disable ops to the DM cache uclass driver Signed-off-by: Rick Chen <rick@andestech.com> Cc: KC Lin <kclin@andestech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/cache.h')
-rw-r--r--include/cache.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/cache.h b/include/cache.h
index c6334ca27f..32f59fd8f7 100644
--- a/include/cache.h
+++ b/include/cache.h
@@ -22,6 +22,22 @@ struct cache_ops {
* @return 0 if OK, -ve on error
*/
int (*get_info)(struct udevice *dev, struct cache_info *info);
+
+ /**
+ * enable() - Enable cache
+ *
+ * @dev: Device to check (UCLASS_CACHE)
+ * @return 0 if OK, -ve on error
+ */
+ int (*enable)(struct udevice *dev);
+
+ /**
+ * disable() - Flush and disable cache
+ *
+ * @dev: Device to check (UCLASS_CACHE)
+ * @return 0 if OK, -ve on error
+ */
+ int (*disable)(struct udevice *dev);
};
#define cache_get_ops(dev) ((struct cache_ops *)(dev)->driver->ops)
@@ -35,4 +51,19 @@ struct cache_ops {
*/
int cache_get_info(struct udevice *dev, struct cache_info *info);
+/**
+ * cache_enable() - Enable cache
+ *
+ * @dev: Device to check (UCLASS_CACHE)
+ * @return 0 if OK, -ve on error
+ */
+int cache_enable(struct udevice *dev);
+
+/**
+ * cache_disable() - Flush and disable cache
+ *
+ * @dev: Device to check (UCLASS_CACHE)
+ * @return 0 if OK, -ve on error
+ */
+int cache_disable(struct udevice *dev);
#endif