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 instead of writing 0 to cfg reg, just...
details: https://anonhg.NetBSD.org/src/rev/92617a38573b
branches: trunk
changeset: 332090:92617a38573b
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Sep 06 17:10:17 2014 +0000
description:
instead of writing 0 to cfg reg, just clear the loading bit -- otherwise the dma controller might go crazy when shutting down
diffstat:
sys/arch/arm/allwinner/awin_ac.c | 6 +++---
sys/arch/arm/allwinner/awin_dma.c | 18 ++++++++++++++++--
sys/arch/arm/allwinner/awin_var.h | 3 ++-
3 files changed, 21 insertions(+), 6 deletions(-)
diffs (83 lines):
diff -r 5464972c20f3 -r 92617a38573b sys/arch/arm/allwinner/awin_ac.c
--- a/sys/arch/arm/allwinner/awin_ac.c Sat Sep 06 16:58:16 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_ac.c Sat Sep 06 17:10:17 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_ac.c,v 1.8 2014/09/06 16:54:00 jmcneill Exp $ */
+/* $NetBSD: awin_ac.c,v 1.9 2014/09/06 17:10:17 jmcneill Exp $ */
/*-
* Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.8 2014/09/06 16:54:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.9 2014/09/06 17:10:17 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -565,7 +565,7 @@
struct awinac_softc *sc = priv;
uint32_t val;
- awin_dma_set_config(sc->sc_pdma, 0);
+ awin_dma_halt(sc->sc_pdma);
if (sc->sc_has_pactrl_gpio)
awin_gpio_pindata_write(&sc->sc_pactrl_gpio, 0);
diff -r 5464972c20f3 -r 92617a38573b sys/arch/arm/allwinner/awin_dma.c
--- a/sys/arch/arm/allwinner/awin_dma.c Sat Sep 06 16:58:16 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_dma.c Sat Sep 06 17:10:17 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_dma.c,v 1.3 2014/09/06 12:48:22 jmcneill Exp $ */
+/* $NetBSD: awin_dma.c,v 1.4 2014/09/06 17:10:17 jmcneill Exp $ */
/*-
* Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_dma.c,v 1.3 2014/09/06 12:48:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_dma.c,v 1.4 2014/09/06 17:10:17 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -282,6 +282,20 @@
return 0;
}
+void
+awin_dma_halt(struct awin_dma_channel *ch)
+{
+ uint32_t cfg;
+
+ cfg = awin_dma_get_config(ch);
+ if (ch->ch_type == AWIN_DMA_TYPE_NDMA) {
+ cfg &= ~AWIN_NDMA_CTL_DMA_LOADING;
+ } else {
+ cfg &= ~AWIN_DDMA_CTL_DMA_LOADING;
+ }
+ awin_dma_set_config(ch, cfg);
+}
+
#if defined(DDB)
void
awin_dma_dump_regs(void)
diff -r 5464972c20f3 -r 92617a38573b sys/arch/arm/allwinner/awin_var.h
--- a/sys/arch/arm/allwinner/awin_var.h Sat Sep 06 16:58:16 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_var.h Sat Sep 06 17:10:17 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.12 2014/09/06 00:15:34 jmcneill Exp $ */
+/* $NetBSD: awin_var.h,v 1.13 2014/09/06 17:10:17 jmcneill Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -104,6 +104,7 @@
uint32_t awin_dma_get_config(struct awin_dma_channel *);
void awin_dma_set_config(struct awin_dma_channel *, uint32_t);
int awin_dma_transfer(struct awin_dma_channel *, paddr_t, paddr_t, size_t);
+void awin_dma_halt(struct awin_dma_channel *);
void awin_wdog_reset(void);
void awin_tmr_cpu_init(struct cpu_info *);
Home |
Main Index |
Thread Index |
Old Index