Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Use shared armv7_generic_space



details:   https://anonhg.NetBSD.org/src/rev/ad6fec5be36a
branches:  trunk
changeset: 337005:ad6fec5be36a
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Mar 29 22:27:04 2015 +0000

description:
Use shared armv7_generic_space

diffstat:

 sys/arch/arm/nvidia/files.tegra       |    6 +-
 sys/arch/arm/nvidia/tegra_io.c        |    8 +-
 sys/arch/arm/nvidia/tegra_mc.c        |    6 +-
 sys/arch/arm/nvidia/tegra_pmc.c       |    6 +-
 sys/arch/arm/nvidia/tegra_soc.c       |   15 +-
 sys/arch/arm/nvidia/tegra_space.c     |  416 ----------------------------------
 sys/arch/arm/nvidia/tegra_var.h       |    6 +-
 sys/arch/evbarm/tegra/tegra_machdep.c |    8 +-
 8 files changed, 29 insertions(+), 442 deletions(-)

diffs (truncated from 626 to 300 lines):

diff -r 2b67a0cd2919 -r ad6fec5be36a sys/arch/arm/nvidia/files.tegra
--- a/sys/arch/arm/nvidia/files.tegra   Sun Mar 29 22:26:18 2015 +0000
+++ b/sys/arch/arm/nvidia/files.tegra   Sun Mar 29 22:27:04 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.tegra,v 1.1 2015/03/29 10:41:59 jmcneill Exp $
+#      $NetBSD: files.tegra,v 1.2 2015/03/29 22:27:04 jmcneill Exp $
 #
 # Configuration info for NVIDIA Tegra ARM Peripherals
 #
@@ -10,10 +10,10 @@
 file   arch/arm/arm32/arm32_kvminit.c
 file   arch/arm/arm32/arm32_reboot.c
 file   arch/arm/arm32/irq_dispatch.S
+file   arch/arm/arm32/armv7_generic_space.c
+file   arch/arm/arm/bus_space_a4x.S
 
 file   arch/arm/nvidia/tegra_soc.c
-file   arch/arm/nvidia/tegra_space.c
-file   arch/arm/arm/bus_space_a4x.S
 file   arch/arm/nvidia/soc_tegra124.c          soc_tegra124
 
 # On-board I/O
diff -r 2b67a0cd2919 -r ad6fec5be36a sys/arch/arm/nvidia/tegra_io.c
--- a/sys/arch/arm/nvidia/tegra_io.c    Sun Mar 29 22:26:18 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_io.c    Sun Mar 29 22:27:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_io.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $ */
+/* $NetBSD: tegra_io.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_tegra.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_io.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_io.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -127,8 +127,8 @@
        for (const struct tegra_locators *loc = locators; loc < eloc; loc++) {
                struct tegraio_attach_args tio = {
                        .tio_loc = *loc,
-                       .tio_bst = &tegra_bs_tag,
-                       .tio_a4x_bst = &tegra_a4x_bs_tag,
+                       .tio_bst = &armv7_generic_bs_tag,
+                       .tio_a4x_bst = &armv7_generic_a4x_bs_tag,
                        .tio_bsh = bsh,
                        .tio_dmat = &tegra_dma_tag,
                };
diff -r 2b67a0cd2919 -r ad6fec5be36a sys/arch/arm/nvidia/tegra_mc.c
--- a/sys/arch/arm/nvidia/tegra_mc.c    Sun Mar 29 22:26:18 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_mc.c    Sun Mar 29 22:27:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_mc.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $ */
+/* $NetBSD: tegra_mc.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -91,7 +91,7 @@
                bst = mc_softc->sc_bst;
                bsh = mc_softc->sc_bsh;
        } else {
-               bst = &tegra_bs_tag;
+               bst = &armv7_generic_bs_tag;
                bus_space_subregion(bst, tegra_apb_bsh,
                    TEGRA_MC_OFFSET, TEGRA_MC_SIZE, &bsh);
        }
diff -r 2b67a0cd2919 -r ad6fec5be36a sys/arch/arm/nvidia/tegra_pmc.c
--- a/sys/arch/arm/nvidia/tegra_pmc.c   Sun Mar 29 22:26:18 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_pmc.c   Sun Mar 29 22:27:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pmc.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $ */
+/* $NetBSD: tegra_pmc.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -92,7 +92,7 @@
                bst = pmc_softc->sc_bst;
                bsh = pmc_softc->sc_bsh;
        } else {
-               bst = &tegra_bs_tag;
+               bst = &armv7_generic_bs_tag;
                bus_space_subregion(bst, tegra_apb_bsh,
                    TEGRA_PMC_OFFSET, TEGRA_PMC_SIZE, &bsh);
        }
diff -r 2b67a0cd2919 -r ad6fec5be36a sys/arch/arm/nvidia/tegra_soc.c
--- a/sys/arch/arm/nvidia/tegra_soc.c   Sun Mar 29 22:26:18 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_soc.c   Sun Mar 29 22:27:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_soc.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $ */
+/* $NetBSD: tegra_soc.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_soc.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_soc.c,v 1.2 2015/03/29 22:27:04 jmcneill Exp $");
 
 #define        _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -65,11 +65,14 @@
 void
 tegra_bootstrap(void)
 {
-       bus_space_map(&tegra_bs_tag, TEGRA_HOST1X_BASE, TEGRA_HOST1X_SIZE, 0,
+       bus_space_map(&armv7_generic_bs_tag,
+           TEGRA_HOST1X_BASE, TEGRA_HOST1X_SIZE, 0,
            &tegra_host1x_bsh);
-       bus_space_map(&tegra_bs_tag, TEGRA_APB_BASE, TEGRA_APB_SIZE, 0,
+       bus_space_map(&armv7_generic_bs_tag,
+           TEGRA_APB_BASE, TEGRA_APB_SIZE, 0,
            &tegra_apb_bsh);
-       bus_space_map(&tegra_bs_tag, TEGRA_AHB_A2_BASE, TEGRA_AHB_A2_SIZE, 0,
+       bus_space_map(&armv7_generic_bs_tag,
+           TEGRA_AHB_A2_BASE, TEGRA_AHB_A2_SIZE, 0,
            &tegra_ahb_a2_bsh);
 
        curcpu()->ci_data.cpu_cc_freq = 696000000; /* XXX */
@@ -101,7 +104,7 @@
        static u_int chip_id = 0;
 
        if (!chip_id) {
-               const bus_space_tag_t bst = &tegra_bs_tag;
+               const bus_space_tag_t bst = &armv7_generic_bs_tag;
                const bus_space_handle_t bsh = tegra_apb_bsh;
                const uint32_t v = bus_space_read_4(bst, bsh,
                    APB_MISC_GP_HIDREV_0_REG);
diff -r 2b67a0cd2919 -r ad6fec5be36a sys/arch/arm/nvidia/tegra_space.c
--- a/sys/arch/arm/nvidia/tegra_space.c Sun Mar 29 22:26:18 2015 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,416 +0,0 @@
-/*     $NetBSD: tegra_space.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $ */
-
-/*-
- * Copyright (c) 2012 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Nick Hudson
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_space.c,v 1.1 2015/03/29 10:41:59 jmcneill Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <sys/bus.h>
-
-/* Prototypes for all the bus_space structure functions */
-bs_protos(tegra);
-bs_protos(tegra_a4x);
-bs_protos(a4x);
-bs_protos(bs_notimpl);
-bs_protos(generic);
-bs_protos(generic_armv4);
-
-#if __ARMEB__
-#define NSWAP(n)       n ## _swap
-#else
-#define NSWAP(n)       n
-#endif
-
-struct bus_space tegra_bs_tag = {
-       /* cookie */
-       (void *) 0,
-
-       /* mapping/unmapping */
-       tegra_bs_map,
-       tegra_bs_unmap,
-       tegra_bs_subregion,
-
-       /* allocation/deallocation */
-       tegra_bs_alloc, /* not implemented */
-       tegra_bs_free,  /* not implemented */
-
-       /* get kernel virtual address */
-       tegra_bs_vaddr,
-
-       /* mmap */
-       tegra_bs_mmap,
-
-       /* barrier */
-       tegra_bs_barrier,
-
-       /* read (single) */
-       generic_bs_r_1,
-       NSWAP(generic_armv4_bs_r_2),
-       NSWAP(generic_bs_r_4),
-       bs_notimpl_bs_r_8,
-
-       /* read multiple */
-       generic_bs_rm_1,
-       NSWAP(generic_armv4_bs_rm_2),
-       NSWAP(generic_bs_rm_4),
-       bs_notimpl_bs_rm_8,
-
-       /* read region */
-       generic_bs_rr_1,
-       NSWAP(generic_armv4_bs_rr_2),
-       NSWAP(generic_bs_rr_4),
-       bs_notimpl_bs_rr_8,
-
-       /* write (single) */
-       generic_bs_w_1,
-       NSWAP(generic_armv4_bs_w_2),
-       NSWAP(generic_bs_w_4),
-       bs_notimpl_bs_w_8,
-
-       /* write multiple */
-       generic_bs_wm_1,
-       NSWAP(generic_armv4_bs_wm_2),
-       NSWAP(generic_bs_wm_4),
-       bs_notimpl_bs_wm_8,
-
-       /* write region */
-       generic_bs_wr_1,
-       NSWAP(generic_armv4_bs_wr_2),
-       NSWAP(generic_bs_wr_4),
-       bs_notimpl_bs_wr_8,
-
-       /* set multiple */
-       bs_notimpl_bs_sm_1,
-       bs_notimpl_bs_sm_2,
-       bs_notimpl_bs_sm_4,
-       bs_notimpl_bs_sm_8,
-
-       /* set region */
-       generic_bs_sr_1,
-       NSWAP(generic_armv4_bs_sr_2),
-       bs_notimpl_bs_sr_4,
-       bs_notimpl_bs_sr_8,
-
-       /* copy */
-       bs_notimpl_bs_c_1,
-       generic_armv4_bs_c_2,
-       bs_notimpl_bs_c_4,
-       bs_notimpl_bs_c_8,
-
-#ifdef __BUS_SPACE_HAS_STREAM_METHODS
-       /* read (single) */
-       generic_bs_r_1,
-       NSWAP(generic_armv4_bs_r_2),
-       NSWAP(generic_bs_r_4),
-       bs_notimpl_bs_r_8,
-
-       /* read multiple */
-       generic_bs_rm_1,
-       NSWAP(generic_armv4_bs_rm_2),
-       NSWAP(generic_bs_rm_4),
-       bs_notimpl_bs_rm_8,
-
-       /* read region */



Home | Main Index | Thread Index | Old Index