Commit 10ee8ecafbb4405ac77f6df081325630617aa7cd
Committed by
Stefano Babic
1 parent
8d29cef588
Exists in
v2017.01-smarct4x
and in
37 other branches
sata: implement reset_sata for dwc_ahsata
Add reset_sata() to the sata driver interface and implement it for dwc_ahsata. This function cleans up after sata_init(), and therefore accepts a device number like sata_init() does. A dummy implementation is provided for the rest of the drivers. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Simon Glass <sjg@chromium.org> Cc: Stefano Babic <sbabic@denx.de>
Showing 9 changed files with 57 additions and 0 deletions Side-by-side Diff
arch/arm/cpu/armv7/omap-common/sata.c
drivers/block/ata_piix.c
drivers/block/dwc_ahsata.c
... | ... | @@ -592,6 +592,27 @@ |
592 | 592 | return 0; |
593 | 593 | } |
594 | 594 | |
595 | +int reset_sata(int dev) | |
596 | +{ | |
597 | + struct ahci_probe_ent *probe_ent = | |
598 | + (struct ahci_probe_ent *)sata_dev_desc[dev].priv; | |
599 | + struct sata_host_regs *host_mmio = | |
600 | + (struct sata_host_regs *)probe_ent->mmio_base; | |
601 | + | |
602 | + if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) { | |
603 | + printf("The sata index %d is out of ranges\n\r", dev); | |
604 | + return -1; | |
605 | + } | |
606 | + | |
607 | + setbits_le32(&host_mmio->ghc, SATA_HOST_GHC_HR); | |
608 | + while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR) | |
609 | + udelay(100); | |
610 | + | |
611 | + disable_sata_clock(); | |
612 | + | |
613 | + return 0; | |
614 | +} | |
615 | + | |
595 | 616 | static void dwc_ahsata_print_info(int dev) |
596 | 617 | { |
597 | 618 | block_dev_desc_t *pdev = &(sata_dev_desc[dev]); |
drivers/block/fsl_sata.c
drivers/block/pata_bfin.c
drivers/block/sata_dwc.c
drivers/block/sata_sil.c
drivers/block/sata_sil3114.c
include/sata.h