All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/7] arm: omap-common: sata: prepare driver for DM conversion
Date: Fri, 24 Mar 2017 13:24:43 +0100	[thread overview]
Message-ID: <1490358287-15304-4-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1490358287-15304-1-git-send-email-jjhiblot@ti.com>

From: Mugunthan V N <mugunthanvnm@ti.com>

Prepare sata driver for DM conversion by abstracting sata phy
init to seperate function.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---
 arch/arm/mach-omap2/sata.c | 13 +++++++++----
 include/sata.h             |  2 ++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/sata.c b/arch/arm/mach-omap2/sata.c
index 217f1c9..dce432b 100644
--- a/arch/arm/mach-omap2/sata.c
+++ b/arch/arm/mach-omap2/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_DM_SCSI
 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 d18cc9a..583b72d 100644
--- a/include/sata.h
+++ b/include/sata.h
@@ -18,4 +18,6 @@ int sata_port_status(int dev, int port);
 extern struct blk_desc sata_dev_desc[];
 #endif
 
+int enable_sata_phy(void);
+
 #endif
-- 
1.9.1

  parent reply	other threads:[~2017-03-24 12:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 12:24 [U-Boot] [PATCH 0/7] OMAP: Move SATA to use block driver model Jean-Jacques Hiblot
2017-03-24 12:24 ` [U-Boot] [PATCH 1/7] arm: omap: sata: move enable sata clocks to enable_basic_clocks() Jean-Jacques Hiblot
2017-04-05 17:43   ` Tom Rini
2017-03-24 12:24 ` [U-Boot] [PATCH 2/7] arm: omap: sata: compile out sata init apis when CONFIG_DM_SCSI is defined Jean-Jacques Hiblot
2017-04-05 17:43   ` Tom Rini
2017-03-24 12:24 ` Jean-Jacques Hiblot [this message]
2017-04-01  4:21   ` [U-Boot] [PATCH 3/7] arm: omap-common: sata: prepare driver for DM conversion Simon Glass
2017-04-04 10:34     ` Jean-Jacques Hiblot
2017-03-24 12:24 ` [U-Boot] [PATCH 4/7] drivers: block: dwc_ahci: Implement a driver for Synopsys DWC sata device Jean-Jacques Hiblot
2017-03-24 12:24 ` [U-Boot] [PATCH 5/7] dm: scsi: ahci: fill max_lun and max_id members of scsi_platdata Jean-Jacques Hiblot
2017-04-01  4:21   ` Simon Glass
2017-03-24 12:24 ` [U-Boot] [PATCH 6/7] dm: scsi: fix scan Jean-Jacques Hiblot
2017-04-01  4:22   ` Simon Glass
2017-04-04 10:43     ` Jean-Jacques Hiblot
2017-03-24 12:24 ` [U-Boot] [PATCH 7/7] defconfig: dra7xx_evm: enable CONFIG_BLK and disk driver model for SCSI Jean-Jacques Hiblot
2017-04-01  4:22   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490358287-15304-4-git-send-email-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.