From: Mugunthan V N Date: Wed, 3 Feb 2016 17:29:37 +0530 Subject: [U-Boot] [PATCH v2 4/7] arm: omap-common: sata: prepare driver for DM conversion In-Reply-To: <1454500780-20751-1-git-send-email-mugunthanvnm@ti.com> References: <1454500780-20751-1-git-send-email-mugunthanvnm@ti.com> Message-ID: <1454500780-20751-5-git-send-email-mugunthanvnm@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Prepare sata driver for DM conversion by abstracting sata phy init to seperate function. Signed-off-by: Mugunthan V N Reviewed-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/sata.c | 13 +++++++++---- include/sata.h | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/armv7/omap-common/sata.c b/arch/arm/cpu/armv7/omap-common/sata.c index df21ca4..dbdfa1e 100644 --- a/arch/arm/cpu/armv7/omap-common/sata.c +++ b/arch/arm/cpu/armv7/omap-common/sata.c @@ -32,16 +32,21 @@ struct omap_pipe3 sata_phy = { .dpll_map = dpll_map_sata, }; +int enable_sata_phy(void) +{ + sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; + + /* Power up the PHY */ + return phy_pipe3_power_on(&sata_phy); +} + #ifndef CONFIG_DISK int init_sata(int dev) { int ret; u32 val; - sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata; - - /* Power up the PHY */ - phy_pipe3_power_on(&sata_phy); + enable_sata_phy(); /* Enable SATA module, No Idle, No Standby */ val = TI_SATA_IDLE_NO | TI_SATA_STANDBY_NO; diff --git a/include/sata.h b/include/sata.h index fa61da8..c2b5360 100644 --- a/include/sata.h +++ b/include/sata.h @@ -16,4 +16,6 @@ int sata_port_status(int dev, int port); extern block_dev_desc_t sata_dev_desc[]; +int enable_sata_phy(void); + #endif -- 2.7.0.75.g3ee1e0f