summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2023-08-23 10:40:47 -0400
committerTom Rini <[email protected]>2023-08-23 10:40:47 -0400
commit97841de680430e235f0954a188f245775cbbb962 (patch)
treec1fd8a6a66dcf3997097ef65f365c45a8cf13251 /include
parent7e6e40c572332b3835c5cb48a08e1d8d404c871c (diff)
parent8f911a7be6bc631d2f4185f7d71025bf97f260e9 (diff)
Merge branch '2023-08-22-assorted-code-cleanups' into next
- Assorted cleanups and fixes for a few tests, how we handle disks/partitions and bounce buffers.
Diffstat (limited to 'include')
-rw-r--r--include/blk.h21
-rw-r--r--include/part.h9
-rw-r--r--include/scsi.h19
3 files changed, 38 insertions, 11 deletions
diff --git a/include/blk.h b/include/blk.h
index 2c9c7985a88..b819f97c2f1 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -7,6 +7,7 @@
#ifndef BLK_H
#define BLK_H
+#include <bouncebuf.h>
#include <dm/uclass-id.h>
#include <efi.h>
@@ -260,9 +261,25 @@ struct blk_ops {
* @return 0 if OK, -ve on error
*/
int (*select_hwpart)(struct udevice *dev, int hwpart);
-};
-#define blk_get_ops(dev) ((struct blk_ops *)(dev)->driver->ops)
+#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 */
+};
/*
* These functions should take struct udevice instead of struct blk_desc,
diff --git a/include/part.h b/include/part.h
index 8e451bbdff9..be144768777 100644
--- a/include/part.h
+++ b/include/part.h
@@ -316,15 +316,6 @@ int part_get_bootable(struct blk_desc *desc);
struct udevice;
/**
- * part_create_block_devices - Create block devices for disk partitions
- *
- * Create UCLASS_PARTITION udevices for each of disk partitions in @parent
- *
- * @blk_dev: Whole disk device
- */
-int part_create_block_devices(struct udevice *blk_dev);
-
-/**
* disk_blk_read() - read blocks from a disk partition
*
* @dev: Device to read from (UCLASS_PARTITION)
diff --git a/include/scsi.h b/include/scsi.h
index 9efefea99bb..ee9d622680d 100644
--- a/include/scsi.h
+++ b/include/scsi.h
@@ -7,6 +7,7 @@
#define _SCSI_H
#include <asm/cache.h>
+#include <bouncebuf.h>
#include <linux/dma-direction.h>
/* Fix this to the maximum */
@@ -298,6 +299,24 @@ struct scsi_ops {
* @return 0 if OK, -ve on error
*/
int (*bus_reset)(struct udevice *dev);
+
+#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 */
};
#define scsi_get_ops(dev) ((struct scsi_ops *)(dev)->driver->ops)