[PATCH v1 2/2] drivers: scsi: Add 'erase' support
Varadarajan Narayanan
quic_varada at quicinc.com
Tue Apr 1 10:05:03 CEST 2025
On Fri, Mar 28, 2025 at 04:44:48AM -0600, Simon Glass wrote:
[ . . . ]
> > diff --git a/include/scsi.h b/include/scsi.h
> > index b18ae37b861..d6b6e6b665f 100644
> > --- a/include/scsi.h
> > +++ b/include/scsi.h
> > @@ -9,6 +9,7 @@
> > #include <asm/cache.h>
> > #include <bouncebuf.h>
> > #include <linux/dma-direction.h>
> > +#include <part.h>
> >
> > struct udevice;
> >
> > @@ -181,6 +182,7 @@ struct scsi_cmd {
> > #define SCSI_WRT_VERIFY 0x2E /* Write and Verify (O) */
> > #define SCSI_WRITE_LONG 0x3F /* Write Long (O) */
> > #define SCSI_WRITE_SAME 0x41 /* Write Same (O) */
> > +#define SCSI_UNMAP 0x42 /* Write 10-Byte (MANDATORY) */
> >
> > /**
> > * enum scsi_cmd_phase - current phase of the SCSI protocol
> > @@ -349,6 +351,17 @@ int scsi_scan(bool verbose);
> > */
> > int scsi_scan_dev(struct udevice *dev, bool verbose);
> >
> > +/**
> > + * scsi_get_blk() - Provides SCSI partition information.
> > + *
> > + * @partition_name: Partition name for fetching its info
> > + * @blk_desc_ptr: Provides the blk descriptor
> > + * @part_info_ptr: Provides partition info
> > + */
> > +int scsi_get_blk(const char *partition_name,
> > + struct blk_desc **blk_desc_ptr,
> > + struct disk_partition *part_info_ptr);
> > +
> > #define SCSI_IDENTIFY 0xC0 /* not used */
> >
> > /* Hardware errors */
> > --
> > 2.34.1
> >
>
> For testing purposes, could you please implement this method in
> drivers/scsi/sandbox_scsi.c() and then try to erase the block in
> test/dm/scsi.c ?
Sorry, the above hunk should not have been in this patch. The
scsi_get_blk() is implemented in [1]
Will remove and post next version.
1 - https://lore.kernel.org/u-boot/20250401080015.1470999-2-quic_varada@quicinc.com/
Thanks
Varada
More information about the U-Boot
mailing list