From 7f0fba9fb08fb7d31060848c719ffad3739e9d58 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 14 Aug 2023 01:46:48 +0200 Subject: disk: Make blk_get_ops() internal to blk uclass Move the macro into blk-uclass.c , since it is only used there. Signed-off-by: Marek Vasut Reviewed-by: Simon Glass --- include/blk.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/blk.h') diff --git a/include/blk.h b/include/blk.h index 2c9c7985a88..8986e953e5a 100644 --- a/include/blk.h +++ b/include/blk.h @@ -262,8 +262,6 @@ struct blk_ops { int (*select_hwpart)(struct udevice *dev, int hwpart); }; -#define blk_get_ops(dev) ((struct blk_ops *)(dev)->driver->ops) - /* * These functions should take struct udevice instead of struct blk_desc, * but this is convenient for migration to driver model. Add a 'd' prefix -- cgit v1.2.3 From 75191f75bce45f3b9aff607c88f17778d3805c61 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 14 Aug 2023 01:49:59 +0200 Subject: blk: Add bounce buffer support to read/write operations Some devices have limited DMA capabilities and require that the buffers passed to them fit specific properties. Add new optional callback which can be used at driver level to indicate whether a buffer alignment is suitable for the device DMA or not, and trigger use of generic bounce buffer implementation to help use of unsuitable buffers at the expense of performance degradation. Signed-off-by: Marek Vasut --- include/blk.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/blk.h') diff --git a/include/blk.h b/include/blk.h index 8986e953e5a..b819f97c2f1 100644 --- a/include/blk.h +++ b/include/blk.h @@ -7,6 +7,7 @@ #ifndef BLK_H #define BLK_H +#include #include #include @@ -260,6 +261,24 @@ struct blk_ops { * @return 0 if OK, -ve on error */ int (*select_hwpart)(struct udevice *dev, int hwpart); + +#if IS_ENABLED(CONFIG_BOUNCE_BUFFER) + /** + * buffer_aligned() - test memory alignment of block operation buffer + * + * Some devices have limited DMA capabilities and require that the + * buffers passed to them fit specific properties. This optional + * callback can be used to indicate whether a buffer alignment is + * suitable for the device DMA or not, and trigger use of generic + * bounce buffer implementation to help use of unsuitable buffers + * at the expense of performance degradation. + * + * @dev: Block device associated with the request + * @state: Bounce buffer state + * @return 1 if OK, 0 if unaligned + */ + int (*buffer_aligned)(struct udevice *dev, struct bounce_buffer *state); +#endif /* CONFIG_BOUNCE_BUFFER */ }; /* -- cgit v1.2.3 From 4fa6511e8c05f2b1bd2d4b969b5c9d6cc49228ff Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 6 Sep 2023 23:29:42 +0200 Subject: blkcache: Remove unused NEEDS_MANUAL_RELOC code bits The last user of the NEEDS_MANUAL_RELOC has been removed in commit 26af162ac8f8 ("arch: m68k: Implement relocation") Remove now unused NEEDS_MANUAL_RELOC code. Signed-off-by: Marek Vasut --- include/blk.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include/blk.h') diff --git a/include/blk.h b/include/blk.h index b819f97c2f1..95e86e2d5d1 100644 --- a/include/blk.h +++ b/include/blk.h @@ -105,12 +105,6 @@ struct blk_desc { (PAD_SIZE(size, blk_desc->blksz)) #if CONFIG_IS_ENABLED(BLOCK_CACHE) - -/** - * blkcache_init() - initialize the block cache list pointers - */ -int blkcache_init(void); - /** * blkcache_read() - attempt to read a set of blocks from cache * -- cgit v1.2.3