Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/allwinner Save initial CAP/CAP2/PI config over ...



details:   https://anonhg.NetBSD.org/src/rev/136bd8068ae1
branches:  trunk
changeset: 326973:136bd8068ae1
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Feb 24 12:21:27 2014 +0000

description:
Save initial CAP/CAP2/PI config over reset. Provide channel_start callback
that sets up awin specific DMA regs.

diffstat:

 sys/arch/arm/allwinner/awin_ahcisata.c |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 94670241c5ff -r 136bd8068ae1 sys/arch/arm/allwinner/awin_ahcisata.c
--- a/sys/arch/arm/allwinner/awin_ahcisata.c    Mon Feb 24 12:19:05 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_ahcisata.c    Mon Feb 24 12:21:27 2014 +0000
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_ahcisata.c,v 1.8 2013/09/08 11:47:50 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_ahcisata.c,v 1.9 2014/02/24 12:21:27 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -167,6 +167,17 @@
 }
 
 static void
+awin_ahci_channel_start(struct ahci_softc *sc, struct ata_channel *chp)
+{
+       uint32_t dma;
+
+       dma = AHCI_READ(sc, AWIN_AHCI_DMA_REG);
+       dma &= ~0xff00;
+       dma |= 0x4400;
+       AHCI_WRITE(sc, AWIN_AHCI_DMA_REG, dma);
+}
+
+static void
 awin_ahci_attach(device_t parent, device_t self, void *aux)
 {
        struct awin_ahci_softc * const asc = device_private(self);
@@ -181,6 +192,9 @@
        sc->sc_ahcit = aio->aio_core_bst;
        sc->sc_ahcis = loc->loc_size;
        sc->sc_ahci_ports = 1;
+       sc->sc_ahci_quirks = AHCI_QUIRK_BADPMP;
+       sc->sc_save_init_data = true;
+       sc->sc_channel_start = awin_ahci_channel_start;
 
        bus_space_subregion(aio->aio_core_bst, aio->aio_core_bsh,
            loc->loc_offset, loc->loc_size, &sc->sc_ahcih);



Home | Main Index | Thread Index | Old Index