1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

dm: ahci: Add a driver for SCSI on AHCI

Some AHCI drivers use SCSI under the hood. Rather than making the AHCI
driver be in the SCSI uclass it makes sense to have the AHCI device create
a SCSI device as a child. That way we can handle any AHCI-specific
operations rather than trying to pretend tha the device is just SCSI.

To handle this we need to provide a way for AHCI drivers to bind a SCSI
device as its child, and probe it. Add functions for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Simon Glass
2017-06-14 21:28:46 -06:00
parent 5c56176318
commit 681357ffd9
2 changed files with 79 additions and 0 deletions

View File

@@ -200,4 +200,26 @@ int achi_start_ports_dm(struct udevice *dev);
*/
int ahci_init_dm(struct udevice *dev, void __iomem *base);
/**
* ahci_bind_scsi() - bind a new SCSI bus as a child
*
* Note that the SCSI bus device will itself bind block devices
*
* @ahci_dev: AHCI parent device
* @devp: Returns new SCSI bus device
* @return 0 if OK, -ve on error
*/
int ahci_bind_scsi(struct udevice *ahci_dev, struct udevice **devp);
/**
* ahci_probe_scsi() - probe and scan the attached SCSI bus
*
* Note that the SCSI device will itself bind block devices for any storage
* devices it finds.
*
* @ahci_dev: AHCI parent device
* @return 0 if OK, -ve on error
*/
int ahci_probe_scsi(struct udevice *ahci_dev);
#endif