Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/dev Get the dma registers from the soundbus ...
details: https://anonhg.NetBSD.org/src/rev/42a838989c85
branches: trunk
changeset: 758656:42a838989c85
user: phx <phx%NetBSD.org@localhost>
date: Fri Nov 12 12:26:29 2010 +0000
description:
Get the dma registers from the soundbus property. This should work with all
snapper-compatible hardware.
Tested on PowerBook G4, MacMini and iBook G4. Failed on the PowerBook before.
diffstat:
sys/arch/macppc/dev/snapper.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diffs (56 lines):
diff -r b366c474ec97 -r 42a838989c85 sys/arch/macppc/dev/snapper.c
--- a/sys/arch/macppc/dev/snapper.c Fri Nov 12 12:02:35 2010 +0000
+++ b/sys/arch/macppc/dev/snapper.c Fri Nov 12 12:26:29 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: snapper.c,v 1.35 2010/10/16 18:22:37 phx Exp $ */
+/* $NetBSD: snapper.c,v 1.36 2010/11/12 12:26:29 phx Exp $ */
/* Id: snapper.c,v 1.11 2002/10/31 17:42:13 tsubai Exp */
/* Id: i2s.c,v 1.12 2005/01/15 14:32:35 tsubai Exp */
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: snapper.c,v 1.35 2010/10/16 18:22:37 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snapper.c,v 1.36 2010/11/12 12:26:29 phx Exp $");
#include <sys/param.h>
#include <sys/audioio.h>
@@ -721,8 +721,8 @@
{
struct snapper_softc *sc;
struct confargs *ca;
- int cirq, oirq, iirq, cirq_type, oirq_type, iirq_type;
- int soundbus, intr[6];
+ int cirq, oirq, iirq, cirq_type, oirq_type, iirq_type, soundbus;
+ uint32_t intr[6], reg[6];
char compat[32];
sc = device_private(self);
@@ -757,17 +757,20 @@
sizeof(struct dbdma_command));
sc->sc_baseaddr = ca->ca_baseaddr;
- ca->ca_reg[0] += ca->ca_baseaddr;
- ca->ca_reg[2] += ca->ca_baseaddr;
- ca->ca_reg[4] += ca->ca_baseaddr;
+ OF_getprop(soundbus, "reg", reg, sizeof reg);
+ reg[0] += ca->ca_baseaddr;
+ reg[2] += ca->ca_baseaddr;
+ reg[4] += ca->ca_baseaddr;
sc->sc_node = ca->ca_node;
sc->sc_tag = ca->ca_tag;
- bus_space_map(sc->sc_tag, ca->ca_reg[0], ca->ca_reg[1], 0, &sc->sc_bsh);
- bus_space_map(sc->sc_tag, ca->ca_reg[2], ca->ca_reg[3],
+
+ bus_space_map(sc->sc_tag, reg[0], reg[1], 0, &sc->sc_bsh);
+ bus_space_map(sc->sc_tag, reg[2], reg[3],
BUS_SPACE_MAP_LINEAR, &sc->sc_odmah);
- bus_space_map(sc->sc_tag, ca->ca_reg[4], ca->ca_reg[5],
+ bus_space_map(sc->sc_tag, reg[4], reg[5],
BUS_SPACE_MAP_LINEAR, &sc->sc_idmah);
+
sc->sc_odma = bus_space_vaddr(sc->sc_tag, sc->sc_odmah);
sc->sc_idma = bus_space_vaddr(sc->sc_tag, sc->sc_idmah);
Home |
Main Index |
Thread Index |
Old Index