summaryrefslogtreecommitdiff
path: root/include/part.h
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2022-04-19 10:05:16 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-04-23 22:05:41 +0200
commit59da9d4782cd9c28d6b679e86596152b54222538 (patch)
tree623cabeec58683d04439206741fc6279456e51e0 /include/part.h
parenta3cb34e9b7506dec1e5f55279f17a12eded86c48 (diff)
dm: disk: add read/write interfaces with udevice
In include/blk.h, Simon suggested: ===> /* * These functions should take struct udevice instead of struct blk_desc, * but this is convenient for migration to driver model. Add a 'd' prefix * to the function operations, so that blk_read(), etc. can be reserved for * functions with the correct arguments. */ unsigned long blk_dread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, void *buffer); unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, const void *buffer); unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt); <=== So new interfaces are provided with this patch. They are expected to be used everywhere in U-Boot at the end. The exceptions are block device drivers, partition drivers and efi_disk which should know details of blk_desc structure. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Diffstat (limited to 'include/part.h')
-rw-r--r--include/part.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/part.h b/include/part.h
index a8db398d3ae..3a6958dcb2a 100644
--- a/include/part.h
+++ b/include/part.h
@@ -313,6 +313,13 @@ struct udevice;
*/
int part_create_block_devices(struct udevice *blk_dev);
+unsigned long dev_read(struct udevice *dev, lbaint_t start,
+ lbaint_t blkcnt, void *buffer);
+unsigned long dev_write(struct udevice *dev, lbaint_t start,
+ lbaint_t blkcnt, const void *buffer);
+unsigned long dev_erase(struct udevice *dev, lbaint_t start,
+ lbaint_t blkcnt);
+
/*
* We don't support printing partition information in SPL and only support
* getting partition information in a few cases.