summaryrefslogtreecommitdiff
path: root/drivers/ata/dwc_ahsata.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-07-29 11:35:03 -0600
committerJaehoon Chung <jh80.chung@samsung.com>2017-08-17 16:44:16 +0900
commitc5273acf5c1da65a6337f6ea8f563e728ab07452 (patch)
tree9e7c0df908511b73897d3d1172eef39963a749cb /drivers/ata/dwc_ahsata.c
parent1dae3b06b770189c4ede3a168f566606aff00f9c (diff)
dm: sata: dw_sata: Move exported functions to the end
With the driver model conversion we will not have any exported functions. Move all exported functions to be together at the end of the file so that we can deal with them in one #ifdef block. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/ata/dwc_ahsata.c')
-rw-r--r--drivers/ata/dwc_ahsata.c124
1 files changed, 62 insertions, 62 deletions
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c
index 49552ca633..8a030a1d11 100644
--- a/drivers/ata/dwc_ahsata.c
+++ b/drivers/ata/dwc_ahsata.c
@@ -556,68 +556,6 @@ static int ahci_port_start(struct ahci_uc_priv *probe_ent,
return 0;
}
-int init_sata(int dev)
-{
- int i;
- u32 linkmap;
- struct ahci_uc_priv *probe_ent = NULL;
-
-#if defined(CONFIG_MX6)
- if (!is_mx6dq() && !is_mx6dqp())
- return 1;
-#endif
- if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) {
- printf("The sata index %d is out of ranges\n\r", dev);
- return -1;
- }
-
- ahci_init_one(dev);
-
- probe_ent = (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
- linkmap = probe_ent->link_port_map;
-
- if (0 == linkmap) {
- printf("No port device detected!\n");
- return 1;
- }
-
- for (i = 0; i < probe_ent->n_ports; i++) {
- if ((linkmap >> i) && ((linkmap >> i) & 0x01)) {
- if (ahci_port_start(probe_ent, (u8)i)) {
- printf("Can not start port %d\n", i);
- return 1;
- }
- probe_ent->hard_port_no = i;
- break;
- }
- }
-
- return 0;
-}
-
-int reset_sata(int dev)
-{
- struct ahci_uc_priv *probe_ent;
- struct sata_host_regs *host_mmio;
-
- if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) {
- printf("The sata index %d is out of ranges\n\r", dev);
- return -1;
- }
-
- probe_ent = (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
- if (NULL == probe_ent)
- /* not initialized, so nothing to reset */
- return 0;
-
- host_mmio = (struct sata_host_regs *)probe_ent->mmio_base;
- setbits_le32(&host_mmio->ghc, SATA_HOST_GHC_HR);
- while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR)
- udelay(100);
-
- return 0;
-}
-
static void dwc_ahsata_print_info(int dev)
{
struct blk_desc *pdev = &(sata_dev_desc[dev]);
@@ -847,6 +785,68 @@ static u32 ata_low_level_rw_lba28(int dev, u32 blknr, lbaint_t blkcnt,
return blkcnt;
}
+int init_sata(int dev)
+{
+ int i;
+ u32 linkmap;
+ struct ahci_uc_priv *probe_ent = NULL;
+
+#if defined(CONFIG_MX6)
+ if (!is_mx6dq() && !is_mx6dqp())
+ return 1;
+#endif
+ if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) {
+ printf("The sata index %d is out of ranges\n\r", dev);
+ return -1;
+ }
+
+ ahci_init_one(dev);
+
+ probe_ent = (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
+ linkmap = probe_ent->link_port_map;
+
+ if (0 == linkmap) {
+ printf("No port device detected!\n");
+ return 1;
+ }
+
+ for (i = 0; i < probe_ent->n_ports; i++) {
+ if ((linkmap >> i) && ((linkmap >> i) & 0x01)) {
+ if (ahci_port_start(probe_ent, (u8)i)) {
+ printf("Can not start port %d\n", i);
+ return 1;
+ }
+ probe_ent->hard_port_no = i;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+int reset_sata(int dev)
+{
+ struct ahci_uc_priv *probe_ent;
+ struct sata_host_regs *host_mmio;
+
+ if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) {
+ printf("The sata index %d is out of ranges\n\r", dev);
+ return -1;
+ }
+
+ probe_ent = (struct ahci_uc_priv *)sata_dev_desc[dev].priv;
+ if (NULL == probe_ent)
+ /* not initialized, so nothing to reset */
+ return 0;
+
+ host_mmio = (struct sata_host_regs *)probe_ent->mmio_base;
+ setbits_le32(&host_mmio->ghc, SATA_HOST_GHC_HR);
+ while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR)
+ udelay(100);
+
+ return 0;
+}
+
int sata_port_status(int dev, int port)
{
struct sata_port_regs *port_mmio;