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 Include latent support for coherent d...



details:   https://anonhg.NetBSD.org/src/rev/9540df48999e
branches:  trunk
changeset: 793765:9540df48999e
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Feb 26 00:19:01 2014 +0000

description:
Include latent support for coherent dma though for now it seems that isn't
possible.

diffstat:

 sys/arch/arm/allwinner/awin_board.c |  29 +++++++++++++++++++++++++++--
 sys/arch/arm/allwinner/awin_io.c    |   5 ++++-
 sys/arch/arm/allwinner/awin_var.h   |   5 ++++-
 3 files changed, 35 insertions(+), 4 deletions(-)

diffs (122 lines):

diff -r dbf98ccbd7a5 -r 9540df48999e sys/arch/arm/allwinner/awin_board.c
--- a/sys/arch/arm/allwinner/awin_board.c       Wed Feb 26 00:12:21 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_board.c       Wed Feb 26 00:19:01 2014 +0000
@@ -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 @@
        _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 @@
 #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)
diff -r dbf98ccbd7a5 -r 9540df48999e sys/arch/arm/allwinner/awin_io.c
--- a/sys/arch/arm/allwinner/awin_io.c  Wed Feb 26 00:12:21 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_io.c  Wed Feb 26 00:19:01 2014 +0000
@@ -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 @@
        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 @@
        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 @@
                        .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);
diff -r dbf98ccbd7a5 -r 9540df48999e sys/arch/arm/allwinner/awin_var.h
--- a/sys/arch/arm/allwinner/awin_var.h Wed Feb 26 00:12:21 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_var.h Wed Feb 26 00:19:01 2014 +0000
@@ -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 @@
        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_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 *);
 



Home | Main Index | Thread Index | Old Index