From 7cf1afce7fa3fe64189020fe14b93f7326dd0758 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 14 Jun 2017 21:28:37 -0600 Subject: dm: ahci: Unwind the confusing init code Two AHCI drivers use SCSI with CONFIG_DM_SCSI. The SCSI uclass calls scsi_low_level_init() which is implemented by ahci.c. If CONFIG_SCSI_AHCI_PLAT is defined it does one thing and if it is not it does something else. We don't need to call through scsi_low_level_init() to get the init completed. Instead, adjust the two drivers to call into AHCI directly. Drop the post-probe init in the SCSI uclass. This means that driver model doesn't need to use scsi_low_level_init(). It is a legacy function and driver model should use a driver's probe() method instead. While we are here, add a comment to the top of the file explaining what ahci.c does. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/ahci.h | 14 ++++++++++++++ include/scsi.h | 4 +--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/ahci.h b/include/ahci.h index 4262ab7..ec5b0c7 100644 --- a/include/ahci.h +++ b/include/ahci.h @@ -179,4 +179,18 @@ struct ahci_uc_priv { int ahci_init(void __iomem *base); int ahci_reset(void __iomem *base); +/** + * achi_init_one_dm() - set up a single AHCI port + * + * @dev: Controller to init + */ +int achi_init_one_dm(struct udevice *dev); + +/** + * achi_start_ports_dm() - start all AHCI ports for a controller + * + * @dev: Controller containing ports to start + */ +int achi_start_ports_dm(struct udevice *dev); + #endif diff --git a/include/scsi.h b/include/scsi.h index bc5be97..cd1b240 100644 --- a/include/scsi.h +++ b/include/scsi.h @@ -171,9 +171,7 @@ struct scsi_platdata { unsigned long max_id; }; -#if defined(CONFIG_DM_SCSI) -void scsi_low_level_init(int busdevfunc, struct udevice *dev); -#else +#ifndef CONFIG_DM_SCSI void scsi_low_level_init(int busdevfunc); void scsi_init(void); #endif -- cgit v1.1