Include latent support for coherent dma though for now it seems that isn't

possible.
This commit is contained in:
matt 2014-02-26 00:19:01 +00:00
parent 7065e56460
commit b33d4dabfe
3 changed files with 35 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: awin_board.c,v 1.8 2014/02/24 16:50:49 matt Exp $ */
/* $NetBSD: awin_board.c,v 1.9 2014/02/26 00:19:01 matt Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.8 2014/02/24 16:50:49 matt Exp $");
__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.9 2014/02/26 00:19:01 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -63,6 +63,23 @@ struct arm32_bus_dma_tag awin_dma_tag = {
_BUS_DMATAG_FUNCS,
};
struct arm32_dma_range awin_coherent_dma_ranges[] = {
[0] = {
.dr_sysbase = AWIN_SDRAM_PBASE,
.dr_busbase = AWIN_SDRAM_PBASE,
.dr_flags = _BUS_DMAMAP_COHERENT,
},
};
struct arm32_bus_dma_tag awin_coherent_dma_tag = {
._ranges = awin_coherent_dma_ranges,
._nranges = __arraycount(awin_coherent_dma_ranges),
_BUS_DMAMAP_FUNCS,
_BUS_DMAMEM_FUNCS,
_BUS_DMATAG_FUNCS,
};
#ifdef AWIN_CONSOLE_EARLY
#include <dev/ic/ns16550reg.h>
#include <dev/ic/comreg.h>
@ -181,6 +198,14 @@ awin_bootstrap(vaddr_t iobase, vaddr_t uartbase)
#endif
}
#if 0
void
awin_dma_bootstrap(psize_t psize)
{
awin_coherent_dma_ranges[0].dr_len = psize;
}
#endif
#ifdef MULTIPROCESSOR
void
awin_cpu_hatch(struct cpu_info *ci)

View File

@ -31,7 +31,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.7 2014/02/25 00:08:29 jmcneill Exp $");
__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.8 2014/02/26 00:19:01 matt Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -56,6 +56,7 @@ static struct awinio_softc {
bus_space_handle_t sc_bsh;
bus_space_handle_t sc_ccm_bsh;
bus_dma_tag_t sc_dmat;
bus_dma_tag_t sc_coherent_dmat;
} awinio_sc;
CFATTACH_DECL_NEW(awin_io, 0,
@ -152,6 +153,7 @@ awinio_attach(device_t parent, device_t self, void *aux)
sc->sc_a4x_bst = &awin_a4x_bs_tag;
sc->sc_bsh = awin_core_bsh;
sc->sc_dmat = &awin_dma_tag;
sc->sc_coherent_dmat = &awin_coherent_dma_tag;
bus_space_subregion(sc->sc_bst, sc->sc_bsh, AWIN_CCM_OFFSET, 0x1000,
&sc->sc_ccm_bsh);
@ -188,6 +190,7 @@ awinio_attach(device_t parent, device_t self, void *aux)
.aio_core_bsh = sc->sc_bsh,
.aio_ccm_bsh = sc->sc_ccm_bsh,
.aio_dmat = sc->sc_dmat,
.aio_coherent_dmat = sc->sc_coherent_dmat,
};
cfdata_t cf = config_search_ia(awinio_find,
sc->sc_dev, "awinio", &aio);

View File

@ -1,4 +1,4 @@
/* $NetBSD: awin_var.h,v 1.8 2014/02/25 00:08:29 jmcneill Exp $ */
/* $NetBSD: awin_var.h,v 1.9 2014/02/26 00:19:01 matt Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
@ -58,6 +58,7 @@ struct awinio_attach_args {
bus_space_handle_t aio_core_bsh;
bus_space_handle_t aio_ccm_bsh;
bus_dma_tag_t aio_dmat;
bus_dma_tag_t aio_coherent_dmat;
};
struct awin_gpio_pinset {
@ -75,9 +76,11 @@ extern struct bus_space awin_bs_tag;
extern struct bus_space awin_a4x_bs_tag;
extern bus_space_handle_t awin_core_bsh;
extern struct arm32_bus_dma_tag awin_dma_tag;
extern struct arm32_bus_dma_tag awin_coherent_dma_tag;
psize_t awin_memprobe(void);
void awin_bootstrap(vaddr_t, vaddr_t);
void awin_dma_bootstrap(psize_t);
void awin_pll6_enable(void);
void awin_cpu_hatch(struct cpu_info *);