diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-09-17 23:35:34 +0200 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-09-17 23:35:34 +0200 |
commit | c292adae170fa8c27dca75963bdb0a9afc640e57 (patch) | |
tree | 3c1e6bddf7b2b6c6bb92a6329714db0850d05702 /drivers/block | |
parent | a7f99bf139b3aaa0d5494693fd0395084355e41a (diff) | |
parent | 4c97f16911e229f6d5bbea5bee52449916e5fa92 (diff) | |
download | u-boot-imx-c292adae170fa8c27dca75963bdb0a9afc640e57.zip u-boot-imx-c292adae170fa8c27dca75963bdb0a9afc640e57.tar.gz u-boot-imx-c292adae170fa8c27dca75963bdb0a9afc640e57.tar.bz2 |
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/dwc_ahsata.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c index 15d65d7..29f478b 100644 --- a/drivers/block/dwc_ahsata.c +++ b/drivers/block/dwc_ahsata.c @@ -864,6 +864,23 @@ u32 ata_low_level_rw_lba28(int dev, u32 blknr, lbaint_t blkcnt, return blkcnt; } +int sata_port_status(int dev, int port) +{ + struct sata_port_regs *port_mmio; + struct ahci_probe_ent *probe_ent = NULL; + + if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) + return -EINVAL; + + if (sata_dev_desc[dev].priv == NULL) + return -ENODEV; + + probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv; + port_mmio = (struct sata_port_regs *)probe_ent->port[port].port_mmio; + + return readl(&(port_mmio->ssts)) && SATA_PORT_SSTS_DET_MASK; +} + /* * SATA interface between low level driver and command layer */ |