From 646deed40b8ffe9aa9c10b86f1addbb4a9788e91 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 25 Apr 2023 10:54:35 -0600 Subject: ide: Correct use of ATAPI The use of atapi_read() was incorrect dropped. Fix this so that it will be used when needed. Use a udevice for the first argument of atapi_read() so it is consistent with ide_read(). This requires much of the ATAPI code to be brought out from behind the existing #ifdef. It will still be removed by the compiler if it is not needed. Add an atapi flag to struct blk_desc so the information can be retained. Fixes: 145df842b44 ("dm: ide: Add support for driver-model block devices") Fixes: d0075059e4d ("ide: Drop non-DM code for BLK") Reviewed-by: Mattijs Korpershoek Signed-off-by: Simon Glass --- include/blk.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/blk.h b/include/blk.h index 1db203c1bab..871922dcde0 100644 --- a/include/blk.h +++ b/include/blk.h @@ -66,6 +66,7 @@ struct blk_desc { /* device can use 48bit addr (ATA/ATAPI v7) */ unsigned char lba48; #endif + unsigned char atapi; /* Use ATAPI protocol */ lbaint_t lba; /* number of blocks */ unsigned long blksz; /* block size */ int log2blksz; /* for convenience: log2(blksz) */ -- cgit v1.2.3